hexsha stringlengths 40 40 | size int64 2 1.01M | content stringlengths 2 1.01M | avg_line_length float64 1.5 100 | max_line_length int64 2 1k | alphanum_fraction float64 0.25 1 |
|---|---|---|---|---|---|
6254e9dfee06d75e9bddbb7cce0f4c333aa4f93c | 319 | module Fog
module Compute
class Ninefold
class Real
def update_virtual_machine(options = {})
request('updateVirtualMachine', options, :expects => [200],
:response_prefix => 'updatevirtualmachineresponse', :response_type => Hash)
end
end
end
end
end
| 21.266667 | 93 | 0.611285 |
281f3949914a8f49b0a66721dff1229ca5abe6fd | 663 | module RailsAuthorize
module Matchers
extend RSpec::Matchers::DSL
matcher :forbid_action do |action, *args|
match do |policy|
!policy.public_send("#{action}?", *args)
end
failure_message do |policy|
"#{policy.class} does not forbid #{action} for " +
policy.public_... | 27.625 | 79 | 0.616893 |
332d302374abed30bbadd200df8e92d98224d58e | 4,129 | require 'digest'
require 'open-uri'
require 'resolv-replace'
require 'timeout'
class Voice::File
extend SS::Translation
include SS::Document
include SS::Reference::Site
include Cms::SitePermission
include Voice::Downloadable
include Voice::Lockable
store_in_default_post
set_permission_name "cms_tools"... | 24.288235 | 97 | 0.625575 |
b967a443ea956998fdc4340271a2e1837be83e9b | 547 | class UserMailer < ApplicationMailer
default :from => 'undertow@gmail.com'
def signup_confirmation(user)
@user = user
mail to: user.email, subject: "Welcome to the UnderTow"
end
def question_email(question)
@question = question
@user = @question.user
mail to: @user.email, subject: "#{@ques... | 24.863636 | 73 | 0.680073 |
262c9465b2946bcf9826c2d3c5869ce295128b37 | 3,824 | class Sslyze < Formula
include Language::Python::Virtualenv
desc "SSL scanner"
homepage "https://github.com/nabla-c0d3/sslyze"
license "AGPL-3.0-only"
stable do
url "https://files.pythonhosted.org/packages/7a/c5/92c28ccdd0641c3b5c59b246861f50d738ac0d4a4e0314f9f2700191c464/sslyze-5.0.4.tar.gz"
sha256... | 41.565217 | 147 | 0.770136 |
7aef60d7a59c41559436ad3d9831595b923074d3 | 2,449 | require "test_helper"
module ShopifyCli
module Commands
class WhoamiTest < MiniTest::Test
def test_no_shop_no_org_id
stub_db_setup(shop: nil, organization_id: nil)
ShopifyCli::PartnersAPI::Organizations.expects(:fetch).never
io = capture_io { run_cmd("whoami") }
assert_mess... | 29.154762 | 103 | 0.587178 |
f8541c1c366e5987f1a3aef377d5f1306ba250a9 | 87 | # desc "Explaining what the task does"
# task :rpush_web do
# # Task goes here
# end
| 17.4 | 38 | 0.678161 |
08b161ded70045d61822aac957e031c05436adfd | 848 | Sequel.migration do
up do
alter_table(:mr_bulk_stock_adjustment_items) do
add_column :old_product_code, String, text: true
end
unless ENV['RACK_ENV'] == 'test'
run <<~SQL
UPDATE mr_bulk_stock_adjustment_items
SET old_product_code = (select material_resource_product_variants.ol... | 33.92 | 144 | 0.652123 |
2660943d2d585e8cbd0dfcdb9175fa305cdf9e44 | 741 | class AddCheckTemplates < ActiveRecord::Migration
def up
create_table :check_templates do |t|
t.integer :org_id, :null => true
t.string :name, :limit => 255, :null => false
t.integer :mode, :limit => 2, :null => false
t.string :tags, :limit => 255, :null => true
end
add_foreign_ke... | 27.444444 | 62 | 0.662618 |
e9ae55370218160b4086f9cafd6a7496d2774ffa | 1,078 | class Darkstat < Formula
desc "Network traffic analyzer"
homepage "https://unix4lyfe.org/darkstat/"
url "https://unix4lyfe.org/darkstat/darkstat-3.0.719.tar.bz2"
sha256 "aeaf909585f7f43dc032a75328fdb62114e58405b06a92a13c0d3653236dedd7"
bottle do
cellar :any_skip_relocation
sha256 "8cfff973e95ff4c3124... | 34.774194 | 95 | 0.747681 |
33e1a2ec8870ac5231e7ac9af7561b21595fd243 | 32,604 | # WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::AutoScaling
class Resource
# @param options ({})
# @option options [Client] :client
d... | 40.451613 | 115 | 0.639983 |
d5c1eb7944fb328dc9444d03b11cd6a63301432a | 514 | module Tensorflow
module Keras
module Datasets
module MNIST
def self.load_data(path: "mnist.npz")
file = Utils.get_file(
path,
"https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz",
file_hash: "731c5ac602752760c8e48fbffcf8c3b850d9dc2a2a... | 27.052632 | 89 | 0.599222 |
ffcb499801236031557af84cacb32f3b7aec68ed | 2,475 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | 39.285714 | 127 | 0.75798 |
1a240126dc06358d7dc2f3b81a2bc6406de85464 | 588 | ENV["RAILS_ENV"] ||= "test"
require_relative "../config/environment"
require "rails/test_help"
class ActiveSupport::TestCase
fixtures :all
include ApplicationHelper
def is_logged_in?
session[:user_id].present?
end
def log_in_as user
session[:user_id] = user.id
end
end
class ActionDispatch::Integ... | 23.52 | 66 | 0.637755 |
1d743113e72cc4ae78ea97bf713582bffc24d038 | 376 | class FixProjectsStates < ActiveRecord::Migration
def up
execute "
UPDATE projects SET state = 'waiting_funds' WHERE state IN ('successful', 'online') AND current_timestamp BETWEEN expires_at and expires_at + '4 day'::interval;
UPDATE projects SET state = 'online' WHERE state = 'successful' AND current_ti... | 31.333333 | 164 | 0.728723 |
38eb6e588ddbb243daff64be46e7f359716b620e | 16,258 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 31.507752 | 360 | 0.673884 |
032ad2b77d0fcb4bbc7cc3aad7f226d570cb118e | 639 | # frozen_string_literal: true
module Openpay
class Connection
def initialize(environment, options = {})
@environment = environment
@base_url = "#{@environment.api_url}#{@environment.client_id}"
@options = options
end
def connection
Faraday.new(url: @base_url) do |conn|
co... | 29.045455 | 78 | 0.655712 |
ed183eb8f62ac0ca8a57c4ba1416e2d37142ba91 | 506 | # frozen_string_literal: true
require 'cloud_payments/models/model'
require 'cloud_payments/models/like_subscription'
require 'cloud_payments/models/secure3d'
require 'cloud_payments/models/transaction'
require 'cloud_payments/models/subscription'
require 'cloud_payments/models/order'
require 'cloud_payments/models/app... | 36.142857 | 49 | 0.857708 |
188996d68cd84bd4c4016ff952d3a2c4d8e0d7ed | 5,171 | # frozen_string_literal: true
module Geos
class LineString < Geometry
include Enumerable
def each
if block_given?
num_points.times do |n|
yield point_n(n)
end
self
else
num_points.times.collect { |n|
point_n(n)
}.to_enum
end
e... | 24.276995 | 156 | 0.554438 |
08bf6fc6b2bb37fc4682a5b2d16c438da8f4de55 | 7,814 | require "spec_helper"
describe Teaspoon::Suite do
before do
Teaspoon.configuration.stub(:suites).and_return "default" => proc{}
end
describe ".all" do
it "returns all the suites" do
Teaspoon.configuration.stub(:suites).and_return "default" => proc{}, "foo" => proc{}
results = Teaspoon::Sui... | 31.635628 | 159 | 0.681085 |
4a40ac37fa5488b690d665038ffc9b85126ca278 | 4,859 | require "spec_helper"
require "json"
require "securerandom"
module AttrVault
describe Keyring do
describe ".load" do
let(:key_data) {
{
'1' => SecureRandom.base64(32),
'2' => SecureRandom.base64(32),
}
}
it "loads a valid keyring string" do
keyring ... | 26.994444 | 86 | 0.600535 |
edbf1dadd5d8f11921773ea161c0463efd5eeddd | 1,108 | puts '
== Contributing to zinbei
** Fixed **
The number of files was reduced.
Remind zinbei option
* add -v,version
* add -d,datetime
* add -h,help
* add -s,start
New zinbei option
**How to use**
[zinbei -m notojima.txt]
* add -m
* add -n
* a... | 24.086957 | 47 | 0.49278 |
381b8701ea1a8ad47b1d9bdc15ebd5486a15a174 | 1,263 | module ActiveAdmin
class Resource
module Attributes
def default_attributes
resource_class.columns.each_with_object({}) do |c, attrs|
unless reject_col?(c)
name = c.name.to_sym
attrs[name] = (method_for_column(name) || name)
end
end
end
... | 26.3125 | 129 | 0.611243 |
38b381cf911baee437715f65fd8514f13cb27210 | 3,189 | # frozen_string_literal: true
require 'rails_helper'
describe Maintainer do
it { should be_a(ApplicationRecord) }
context 'Associations' do
it { should have_many(:teams) }
it { should have_many(:gears) }
it { should have_many(:ftbfs) }
end
context 'Validation' do
it { should validate_prese... | 30.961165 | 77 | 0.622766 |
013a146dfdea97773a65563a9f9237af587938a7 | 3,955 | =begin
#Selling Partner API for Fulfillment Inbound
#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network.
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Co... | 31.64 | 164 | 0.732238 |
91ed472b302a5ce27d4c3fb4c556c33eee1750c5 | 701 | require 'simplecov'
if ENV['CI']
require 'coveralls'
SimpleCov.formatter = Coveralls::SimpleCov::Formatter
end
SimpleCov.start do
add_group 'Parsers', 'lib/trackerific/parsers'
add_group 'Builders', 'lib/trackerific/builders'
add_group 'Services', 'lib/trackerific/services'
add_filter 'spec'
end
ENV['RAC... | 23.366667 | 68 | 0.763195 |
d51d35440e922c5f9afd3d5abdf0317245a5cd9f | 174 | class AddStudentCourseIdToPlans < ActiveRecord::Migration
def change
add_column :plans, :student_course_id, :integer
add_index :plans, :student_course_id
end
end
| 24.857143 | 57 | 0.781609 |
b9e3c40fa9015dca2fe36aa5b22f9b50f2186737 | 6,783 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject,... | 40.616766 | 100 | 0.66475 |
116a54a4865b7f54acf7263ca30a0e60f2a4f8a4 | 2,728 | class Libx11 < Formula
desc "X.Org: Core X11 protocol client library"
homepage "https://www.x.org/"
url "https://www.x.org/archive/individual/lib/libX11-1.7.2.tar.bz2"
sha256 "1cfa35e37aaabbe4792e9bb690468efefbfbf6b147d9c69d6f90d13c3092ea6c"
license "MIT"
bottle do
sha256 arm64_big_sur: "07000e94eab919... | 33.268293 | 116 | 0.657625 |
bbf30e7519236aed168703eed1a6c486ec280a6e | 2,772 | gamelog = File.open("games.log", "r").read.split("\n")
#Divide game.log em um array de linhas
def CreateGameReport(start,gamelog)
a = start+1
#contador
total_kills = 0
#conta todos os kills do jogo
players = []
#Lista os players no formato [nome, tag]
kills = []
#Lista os kills individuais no formato [n... | 28 | 105 | 0.579726 |
e94a1b53109cab2516ad5fb876df2966cc328681 | 1,131 | cask 'station' do
version '1.31.2'
sha256 '73626dd8e8c1322206e9fa40ea27e400cc961a477dedff7559b908189a3e3cea'
# github.com/getstation/desktop-app-releases was verified as official when first introduced to the cask
url "https://github.com/getstation/desktop-app-releases/releases/download/#{version}/Station-#{ver... | 37.7 | 110 | 0.648983 |
08b130b3be0aef375fac67ac2d559ce52b83bb64 | 5,136 | module Irwi::Extensions::Controllers::WikiPages
extend ActiveSupport::Concern
module ClassMethods
def page_class
@page_class ||= Irwi.config.page_class
end
def set_page_class(arg)
@page_class = arg
end
end
include Irwi::Extensions::Controllers::WikiPageAttachments
include Irwi::... | 29.348571 | 165 | 0.728972 |
28975c9021d358b8ee3ed2962a9561bb506a6759 | 569 | require 'test_helper'
module Elasticsearch
module Test
class CatShardsTest < UnitTest
context "Cat: Shards" do
subject { FakeClient.new }
should "perform correct request" do
subject.expects(:perform_request).with do |method, url, params, body|
assert_equal 'GET', met... | 21.074074 | 79 | 0.595782 |
21eafdc09ba5d0316510eead449eb337fe34f35a | 119 | class AddImportDate < ActiveRecord::Migration
def change
add_column :uploads, :imported_at, :timestamp
end
end
| 19.833333 | 49 | 0.764706 |
5d35e0cd05ca67dad7915d63f5510211dc937db4 | 4,719 | # Copyright © 2011-2016 MUSC Foundation for Research Development
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list... | 40.681034 | 145 | 0.699301 |
61860f23ca2f0703f4ad6e33acbe8c4fa0a24394 | 175 | require 'test_helper'
class Users::StatusUpdatesControllerTest < ActionController::TestCase
# Replace this with your real tests.
def test_truth
assert true
end
end
| 19.444444 | 69 | 0.777143 |
7a98012b18a5c8a61e29a4ad17f82360c6fca3e9 | 9,179 | require 'spec_helper'
require 'datadog/statsd'
require 'ddtrace'
require 'benchmark/ips'
if !PlatformHelpers.jruby? && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.1.0')
require 'benchmark/memory'
require 'memory_profiler'
end
require 'fileutils'
require 'json'
RSpec.shared_context 'benchmark' do
# W... | 29.325879 | 106 | 0.659658 |
264aba0368d1e9df1b24fa6969b7ab0a13a4a535 | 251 | FactoryGirl.define do
factory :tpl_gooddata_extract_report do
sequence(:name) { |n| "MyGooddataExtractReport-#{n}" }
report_oid '12345'
destination_file_name "somefile.csv"
export_method 'executed'
tpl_gooddata_extract
end
end
| 25.1 | 58 | 0.741036 |
bbb86b64e9bbde56562ec63f3e8eb17ff2e6ccf7 | 2,504 | describe ProblemsHelper do
describe '#truncated_problem_message' do
it 'is html safe' do
problem = double('problem', :message => '#<NoMethodError: ...>')
truncated = helper.truncated_problem_message(problem)
expect(truncated).to be_html_safe
expect(truncated).to_not include('<', '>')
e... | 32.947368 | 112 | 0.633786 |
abf342068f6b2bed5b4251e115e7ffd3e21c5d3f | 31 | include_recipe 'vagrant::rhel'
| 15.5 | 30 | 0.806452 |
f79e97bc3446e8de3f97ef98974a557cf6179816 | 609 | require 'helper'
class TestSoulmate < Test::Unit::TestCase
def test_integration_can_load_values_and_query
items = []
venues = File.open(File.expand_path(File.dirname(__FILE__)) + '/samples/venues.json', "r")
venues.each_line do |venue|
items << JSON.parse(venue)
end
items_loaded = Soul... | 27.681818 | 94 | 0.676519 |
38b21ba6c219e82e5d391347d4983f41f26b371f | 6,866 | require File.expand_path(File.join(File.dirname(__FILE__),'helper.rb'))
class TestExact < Test::Unit::TestCase
def setup
initialize_context
end
def test_exact_no_traps
Decimal.context.exact = true
Decimal.context.traps[Decimal::Inexact] = false
assert_equal Decimal("9"*100+"E-50"), Decimal(... | 46.707483 | 160 | 0.729246 |
ab449d9165da7e1bb8b5f09c806d16212bab3180 | 67 | module Compass
module Slickmap
VERSION = "0.5.1.1"
end
end
| 11.166667 | 23 | 0.656716 |
f8d1e0ae18466ef511b8aa2c0ca9d4b3be34c868 | 2,175 | class Libsass < Formula
homepage "https://github.com/sass/libsass"
url "https://github.com/sass/libsass/archive/3.1.0.tar.gz"
sha1 "858c41405f5ff8b4186c7111e08f29893f4e51a1"
head "https://github.com/sass/libsass.git"
bottle do
cellar :any
sha1 "af2bbeb2d2221df2fece3eaa054a65270768bb92" => :yosemite
... | 36.864407 | 129 | 0.664368 |
110c0b0768a3f4820b116d54b644a25856b7e5af | 1,635 | #
# Be sure to run `pod lib lint ShareModule.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'ShareMo... | 35.543478 | 102 | 0.632416 |
ffda413038fbdd65e40a8c0f1d934b53fa18602c | 2,076 | # frozen_string_literal: true
# Class encapsulating the user action of making a UKHPI query
class QueryCommand
include DataService
MILLISECONDS = 1000.0
attr_reader :user_selections, :results, :query
def initialize(user_selections)
@user_selections = user_selections
@query = build_query
end
# P... | 24.714286 | 79 | 0.73025 |
01f269d2d2de8028993959a44bc4fc9a6987129b | 309 | module Alexa
module Responses
class Delegate
def as_json(options={})
{
"version": "1.0",
"response": {
"directives": [
{
"type": "Dialog.Delegate"
}
]
}
}
end
end
end
end
| 16.263158 | 41 | 0.365696 |
e8c623a0c1f10e86cfa810bcb4989ed5654b5c80 | 291 | module Fog
module Compute
class Ninefold
class Real
def list_zones(options = {})
request('listZones', options, :expects => [200],
:response_prefix => 'listzonesresponse/zone', :response_type => Array)
end
end
end
end
end
| 19.4 | 88 | 0.570447 |
79d6ba27446d19ccd1d7c8baf065b154b0012533 | 2,325 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::NetApp::Mgmt::V2017_08_15_preview
module Models
#
# Microsoft.NetApp REST API operation definition.
#
class Operation
include MsRestAzu... | 28.012048 | 74 | 0.510108 |
39d5d6f944bddcbfe04c8becf81b0a13092e9c46 | 518 | class ApplicationController < ActionController::API
rescue_from ActiveRecord::RecordNotFound, with: Proc.new{|e|
render status: 404, json: { errors: { detail: "#{e.model.titleize.humanize} not found" } }
}
rescue_from ActionController::UnpermittedParameters, with: Proc.new{|e|
render status: 422, json: { ... | 43.166667 | 94 | 0.710425 |
1d6ea7288cf0db7694fc8dfc68cb088aa370d397 | 5,914 | # frozen_string_literal: true
module MediaWiktory::Wikipedia
module Modules
# List all pages in a given category. _Generator module: for fetching pages corresponding to request._
#
# The "submodule" (MediaWiki API term) is included in action after setting some param, providing
# additional tweaking f... | 34.584795 | 310 | 0.594691 |
ab42a75b4c75cab6746832124fca8fa0e8f21b35 | 177 | class AddNextInspectionDate < ActiveRecord::Migration[5.2]
def change
add_column :highway_structures, :next_inspection_date, :date, after: :inspection_frequency
end
end
| 29.5 | 94 | 0.79661 |
0396b7d5e7234f18d27910d06c6a5cd90e425463 | 404 | cask 'font-padauk' do
version :latest
sha256 :no_check
# github.com/google/fonts was verified as official when first introduced to the cask
url 'https://github.com/google/fonts/trunk/ofl/padauk',
using: :svn,
revision: '50',
trust_cert: true
name 'Padauk'
homepage 'https://www.goog... | 25.25 | 86 | 0.685644 |
91327b302763b521b524c47613c6c297dd5c8194 | 202 | require 'test_helper'
class KvstoreTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Kvstore::VERSION
end
def test_it_does_something_useful
assert false
end
end
| 16.833333 | 39 | 0.782178 |
792bb200648ede575584e6981fbb0ebfd0524674 | 9,578 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... | 92.990291 | 470 | 0.770098 |
1cb4d033839df7d9e017fd40de7decd9ce75cfed | 1,145 | ActiveAdmin.register User do
config.filters = false
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
permit_params :organization_id, :email, :name, :phone_number, :role_id, :password, :password_confirmatio... | 22.9 | 122 | 0.679476 |
26f93ccf2a18069f12018bf6e8a01afb2d9b37b8 | 11,601 | # Fix the countries table.
#
class UpdateCountries < ActiveRecord::Migration
# Number of orders array, used to fix the wrong initial values.
NOO_ARRAY = [[[1], 4987],
[[3], 151], [[4], 128], [[2], 121], [[5], 58], [[101], 36], [[85, 91], 21], [[52], 16],
[[191], 14], [[173], 13], [[72, 115, 167], 10], [[... | 57.147783 | 112 | 0.533747 |
f8361abb79c822461b913860f564c990a21cc9d6 | 3,872 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 41.634409 | 157 | 0.761364 |
bb0341acd6d06c996e6ef0917988626ae7ca6559 | 510 | config = YAML.load(ERB.new(IO.read(Rails.root + 'config' + 'redis.yml')).result)[Rails.env].with_indifferent_access
redis_conn = { url: "redis://#{config[:host]}:#{config[:port]}/" }
Sidekiq.configure_server do |s|
s.redis = redis_conn
Sidekiq::Status.configure_server_middleware s, expiration: 30.days
Sidekiq::... | 36.428571 | 115 | 0.754902 |
ff74c9d637a9d364f57c5d2ed3fb7b6ccecd2cf8 | 49 | module MusicBrainz
class Area < Model
end
end | 12.25 | 20 | 0.755102 |
e2aa3239094f61fb800cb89f99c996a0fa822297 | 1,761 | require 'spec_helper'
RSpec.describe 'Client draft 76 handshake' do
let(:handshake) { WebSocket::Handshake::Client.new({ uri: 'ws://example.com/demo', origin: 'http://example.com', version: version }.merge(@request_params || {})) }
let(:version) { 76 }
let(:client_request) { client_handshake_76({ key1: handshak... | 38.282609 | 190 | 0.687677 |
38a4cebb683e5a3330da7696f926f6d566d81395 | 596 | Pod::Spec.new do |spec|
spec.name = "ImageTransition"
spec.version = "0.5.0"
spec.summary = "ImageTransition is a library for smooth animation of images during transitions."
spec.homepage = "https://github.com/shtnkgm/ImageTransition"
spec.license = { :type => "MIT", :file => "LICEN... | 45.846154 | 111 | 0.61745 |
ac6c06d3d1b70c94648ba628647e2ecf0946c85d | 1,371 | require 'rails_helper'
require 'rails/generators'
require 'generators/croesus/croesus_generator'
describe Croesus::Generators::CroesusGenerator, type: :generator do
destination File.expand_path("../../tmp", __FILE__)
before do
prepare_destination
copy_routes
run_generator %w(baklava)
end
desc... | 24.052632 | 82 | 0.681984 |
ed8c216c4cf246782b4f7bbc670c9623c1bd13fb | 2,862 | #require 'redis'
module AuthHelpers
include Rack::Utils
alias_method :h, :escape_html
def cgi_escape(text)
URI.escape(CGI.escape(text.to_s), '.').gsub(' ','+')
end
def query_string(parameters, escape = true)
if escape
parameters.map{|key,val| val ? "#{cgi_escape(key)}=#{cgi_escape(v... | 26.018182 | 119 | 0.625087 |
bf3636de6c61f3b0088f7664b5d3ebb07aeb78d7 | 3,504 | #-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProj... | 31.00885 | 91 | 0.630137 |
627be7e09b73725607c613ecdce19ffcbb901fa8 | 1,005 | class AddCountsToEvents < ActiveRecord::Migration
def change
add_column :events, :bookmarks_count, :integer, :default => 0, null: false
add_column :events, :attended_count, :integer, :default => 0, null: false
add_column :events, :watchers_count, :integer, :default => 0, null: false
add_column :events... | 40.2 | 86 | 0.733333 |
28995f4d18a375921236482d121a085c23c62e64 | 488 | require 'minitest/autorun'
$test = true
require_relative "../breeder"
class TestBreeder < Minitest::Test
def initialize(test_name)
super(test_name)
end
def test_bw_balance
num_games = 200
size = 9
tolerance = 0.15 # 0.10=>10% (+ or -); the more games you play the lower tolerance you can set (... | 21.217391 | 126 | 0.696721 |
5d53e2c1f4539a55caa480bec1ee00d38d128f63 | 1,924 | # Can be used to run different callbacks for each message bus response
class MultiResponseMessageBusRequest
class Error < StandardError; end
def initialize(message_bus, subject)
@message_bus = message_bus
@subject = subject
@responses = []
@response_timeouts = []
end
def on_response(timeout, &... | 26.356164 | 86 | 0.710499 |
1a8b0cf56178de61dc7bf153618139a6479231dc | 569 | require 'rubygems'
require 'xcodeproj'
require 'fileutils'
xcodeproj_filepath = ARGV[0]
file_name = ARGV[1]
group_name = ARGV[2]
# Find group
project = Xcodeproj::Project.open(xcodeproj_filepath)
xcodeproj_group = project.main_group[group_name]
# Remove file from group
if xcodeproj_group != nil
xcodeproj_group.fil... | 21.884615 | 53 | 0.71529 |
0388229712cee531a2b308ea4e9e5b60a748d67b | 367 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ResourceGraph::Mgmt::V2019_04_01
module Models
#
# Defines values for ResultTruncated
#
module ResultTruncated
True = ... | 21.588235 | 70 | 0.694823 |
33674c9b03f6e987bb95fe9e50e7bd6179715064 | 198 | class Genre < ApplicationRecord
has_many :pokemon_types, dependent: :destroy
has_many :pokemons, through: :pokemon_types
validates :name, presence: true
validates :slug, presence: true
end
| 24.75 | 46 | 0.772727 |
d5dc0ef9c8565fc92105c8abfdaf775c2c1cb09d | 154 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "Zlib::GzipFile#os_code" do
it "needs to be reviewed for spec completeness"
end
| 25.666667 | 61 | 0.720779 |
ac72dd00c22def7de9300352b3c984a3bee8e674 | 464 | # # encoding: utf-8
# Inspec test for recipe Wordpress::database
# The Inspec reference, with examples and extensive documentation, can be
# found at http://inspec.io/docs/reference/resources/
unless os.windows?
# This is an example test, replace with your own test.
describe user('root'), :skip do
it { shoul... | 24.421053 | 73 | 0.724138 |
f76b6394ba325c630570f3f3dd9552f1583afb13 | 605 | Pod::Spec.new do |s|
s.name = 'RNGridMenu'
s.version = '0.1.1'
s.license = 'MIT'
s.platform = :ios, '5.0'
s.summary = 'A grid menu with elastic layout, depth of field, and realistic animation.'
s.homepage = 'https://github.com/rnystrom/RNGridMenu'
s.author... | 33.611111 | 97 | 0.568595 |
5d4958f88c507bd6bfc796bda41f44c216c6ff72 | 2,162 | module Solargraph
module LanguageServer
module Message
class Base
# @return [Solargraph::LanguageServer::Host]
attr_reader :host
# @return [Integer]
attr_reader :id
# @return [Hash]
attr_reader :request
# @return [String]
attr_reader :method... | 25.738095 | 77 | 0.528677 |
1cc125d9f0536ffa92f73a8ccdae163c3bf3d277 | 15,069 | require 'rexml/document'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
# In NZ DPS supports ANZ, Westpac, National Bank, ASB and BNZ.
# In Australia DPS supports ANZ, NAB, Westpac, CBA, St George and Bank of South Australia.
# The Maybank in Malaysia is supported and the Citibank for Singapore.
... | 40.291444 | 130 | 0.657841 |
87863da4ed9fe021fc9a8ea2080790fb1e1ab131 | 749 | class Word
@@words = []
attr_reader(:string_form, :definitions)
define_method(:initialize) do |attributes|
@string_form = attributes[:string_form]
@definitions = []
end
define_method(:add_definition) do |definition|
@definitions.push(definition)
end
define_method(:save) do
@@words.push(... | 18.725 | 62 | 0.664887 |
39bd423140bf4f3c107816b224e0060b67d5738e | 958 | cask 'i1profiler' do
version '1.7.2'
sha256 '276aeda81784d074e50fc6b0a6f4b9a7ffca4e15496b58733ae50acb68091b15'
url "https://downloads.xrite.com/downloads/software/i1Profiler/#{version}/Mac/i1Profiler.zip"
name 'i1Profiler'
name 'Eye-One Profiler'
name 'i1Publish'
homepage "http://www.xrite.com/service-su... | 33.034483 | 114 | 0.586639 |
1cccd366c116b574fd93508353a134aeeb8f67b2 | 5,885 | require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../fixtures/classes'
describe "BasicSocket#setsockopt" do
before(:each) do
@sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
end
after :each do
@sock.close unless @sock.closed?
end
it "sets the ... | 37.246835 | 94 | 0.662192 |
4a57431ee254ac06fd9c4bd01ce4c9b0d2091b3f | 14,339 | module Typelib
# Base class for all dynamic containers
#
# See the Typelib module documentation for an overview about how types are
# values are represented.
class ContainerType < IndirectType
include Enumerable
attr_reader :element_t
def typelib_initialize
supe... | 33.424242 | 111 | 0.514053 |
1c307949c672d11825718f509288500f4a21412a | 773 | #
# Cookbook Name:: postgresql
# Resource:: user
#
actions :create, :update, :drop
default_action :create
attribute :name, kind_of: String, name_attribute: true
attribute :superuser, kind_of: [TrueClass, FalseClass], default: false
attribute :createdb, kind_of: [TrueClass, FalseClass... | 36.809524 | 79 | 0.698577 |
4a2053ce31f3e6ccfcdba8d9b8d7100ec7a53bce | 3,257 | #
# Copyright 2017, Noah Kantrowitz
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 23.264286 | 79 | 0.67731 |
ffa5901f1ceed7165ff77ef8ceeb98514096528c | 1,345 | module FaceB
class Session
attr_reader :api_key, :secret_key, :session_key, :user_facebook_uid
def self.create(api_key, secret_key, session_key = nil)
@current_session = self.new(api_key, secret_key, session_key) unless defined?(@current_session) && !!@current_session
@current_session
end... | 25.377358 | 123 | 0.623048 |
399a9a566b2cb786374c1f571e230044a7df2349 | 334 | =begin
#OpenAPI Extension generating aliases to maps and arrays as models
#This specification shows how to generate aliases to maps and arrays as models.
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.3.0-SNAPSHOT
=end
module Petstore
VERSION ... | 20.875 | 79 | 0.775449 |
38dea2222e207c46b556c10596c6ccc38265cfd4 | 1,128 | require 'rails_helper'
describe "Edit author page", type: :feature do
before {
@my_author = FactoryBot.create :author
visit edit_author_path(@my_author)
}
it "should exist at 'edit_author_path' and render withour error" do
end
it "should edit an existing author in the database afte... | 40.285714 | 88 | 0.677305 |
bf16bf5ff88bc7ba8382591f3e4d63c6571d8778 | 9,685 | assert 'File::Stat.new' do
assert_kind_of File::Stat, File::Stat.new('README.md')
assert_raise(RuntimeError){ File::Stat.new('unknown.file') }
end
assert 'File.stat' do
assert_kind_of File::Stat, File.stat('README.md')
end
assert 'File.lstat' do
assert_kind_of File::Stat, File.lstat('README.md')
en... | 28.569322 | 86 | 0.678369 |
ed46843e950ca9465b8bd76eacb32421336f0c2d | 1,909 | class SimCardsController < ApplicationController
load_and_authorize_resource :sim_card_provider
load_and_authorize_resource :sim_card, :through => [:sim_card_provider]
before_filter :set_parent
before_filter :spread_breadcrumbs
def index
end
def show
end
def new
@sim_card = @sim_card_provider.... | 32.913793 | 141 | 0.777894 |
e230d7fa7787d3b0cffd335320d9a3769e7d1d39 | 370 | require "bundler/setup"
require "garden_planner"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_wi... | 24.666667 | 66 | 0.756757 |
f773ac5ab188fc0264ae60e69b5341e59338e8e6 | 1,193 | require 'test_helper'
class CategoriaControllerTest < ActionController::TestCase
setup do
@categorium = categoria(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:categoria)
end
test "should get new" do
get :new
assert_response :succes... | 23.86 | 114 | 0.720034 |
1d8d4daa6ca127f8bace8a8c7732a4ec8dd96b00 | 8,981 | # frozen_string_literal: true
require "rails_helper"
feature "user form password field" do
let(:mission) { get_mission }
before { login(actor) }
shared_examples("edit methods that should work online and offline") do
scenario "leaving password unchanged should work" do
visit(url)
expect(page).t... | 39.047826 | 107 | 0.669747 |
18a41fe889664bb012d7b04f6ec0d051d652274b | 11,174 | require "feidee_utils_test"
require "feidee_utils/transaction"
require "feidee_utils/database"
require 'minitest/autorun'
class FeideeUtils::TransactionTest < MiniTest::Test
def setup
@sqlite_db = FeideeUtils::TestUtils.open_test_sqlite
@all = @sqlite_db.ledger::Transaction.all
@income = @all.find do |t... | 32.201729 | 91 | 0.718185 |
e22ee74af56cddf11dfa1d2144ea7d3cde0f5a8b | 354 | cask :v1 => 'moreamp' do
version '0.1.29'
sha256 '770dad0b69979f51807dee3f873e0ebbb755f9f2f2f60c734ac55094e6a6f707'
url "http://downloads.sourceforge.net/project/moreamp/moreamp/MoreAmp-#{version}/MoreAmp-#{version}-binOSX104intel.dmg"
name 'MoreAmp'
homepage 'http://sourceforge.net/projects/moreamp/'
lice... | 29.5 | 121 | 0.762712 |
62fbae7c181a2b5996bd92ffe939d0508e48c659 | 5,542 | Navigasmic.configure do |config|
# Defining Navigation Structures:
#
# You can define your navigation structures and configure the builders in this initializer.
#
# When defining navigation here, it's important to understand that the scope is not the same as the view scope -- and
# you should use procs wher... | 41.051852 | 120 | 0.679899 |
617c320d1cebde4159e3b4ca84711a210efbb7f5 | 859 | #
# Cookbook:: chef-atom
# Recipe:: windows
#
# Copyright:: (c) 2016 Doug Ireton
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 31.814815 | 74 | 0.738068 |
ed155e6dcc0ef7ee9455a270bd8d9ced14908f9a | 13,790 | require 'test_helper'
class MonerisTest < Test::Unit::TestCase
include CommStub
def setup
Base.mode = :test
@gateway = MonerisGateway.new(
:login => 'store1',
:password => 'yesguy'
)
@amount = 100
@credit_card = credit_card('4242424242424242')
@options = { :order_id => '1', :... | 32.069767 | 225 | 0.717694 |
082645ce22203e91f541cbde9c0e11489eebf918 | 217 | # frozen_string_literal: true
require_relative "gitoc/version"
module Gitoc
class Error < StandardError; end
# Your code goes here...
autoload :Cli, "gitoc/cli"
autoload :Repository, "gitoc/repository"
end
| 18.083333 | 42 | 0.741935 |
33af6cd480d0d5eb9adb6f624cfbc17fdca2c3f7 | 759 | require_relative "boot"
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module Lafamiglia
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rail... | 31.625 | 79 | 0.735178 |
f76fc9d6fe0e6082f6bee1e70e19996f10796ae7 | 1,894 | #
# Cookbook:: jupyterhub-chef
# Spec:: jupyter_ipykernel
#
# The MIT License (MIT)
#
# Copyright:: 2019, Ryan Hansohn
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, i... | 37.88 | 79 | 0.750264 |
b94325c4226f4cd09a27728a28b01f0f3c634cd6 | 144 | class RegistrationsController < Devise::RegistrationsController
protected
def after_sign_up_path_for(_resource)
recipes_path
end
end
| 18 | 63 | 0.819444 |
62bbe1ba3b49575dabe62f705e5477e214ce82f9 | 680 | class MembershipsController < ApplicationController
def index
@user = User.friendly.find params[:user_id]
render layout: 'user'
end
def update
membership = Membership.find(params[:id])
if can?(:update, membership) && membership.update(params.require(:membership).permit(:role))
render json: ... | 26.153846 | 96 | 0.670588 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.