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
286340a3c7770782c834a8f07f3b51f9d623a62f
1,619
module Guard class RSpec class Inspector attr_accessor :excluded, :spec_paths def initialize(options = {}) self.excluded = options.fetch(:exclude, []) self.spec_paths = options.fetch(:spec_paths, []) end def excluded=(pattern) @excluded = Dir[pattern.to_s] ...
24.164179
112
0.567634
26c31f50926962b8e73a98a91df24d5cb77e5f80
2,392
require 'aaws/version' AUTHOR = 'John Nunemaker' # can also be an array of Authors EMAIL = "nunemaker@gmail.com" DESCRIPTION = "API wrapper for Amazon Associates Web Service" GEM_NAME = 'aaws' # what ppl will type to install your gem RUBYFORGE_PROJECT = 'aaws' # The unix name for your project HOMEPATH = "http://#{RUB...
35.176471
126
0.672659
38289a14f766b07e29c22709d20a87864644abbc
157
module Spree module PermittedAttributes @@user_attributes = [:email, :password, :first_name, :last_name, :birthday, :avatar_url, :signup_type] end end
31.4
105
0.751592
7a2b81de69a0f45138df9e5e80fcd70eac18f440
1,968
# encoding: utf-8 # frozen_string_literal: true require 'spec_helper' describe "ContentTransferEncodingParser" do it "should work" do text = "quoted-printable" a = Mail::Parsers::ContentTransferEncodingParser expect(a.parse(text).error).to be_nil expect(a.parse(text).encoding).to eq 'quoted-printabl...
30.75
61
0.676829
21ffdef0babadc63b588aef4d99e29229059ce17
950
require_relative "../canvas_base_mutation" module LMSGraphQL module Mutations module Canvas class PostReplyGroup < BaseMutation argument :group_id, ID, required: true argument :topic_id, ID, required: true argument :entry_id, ID, required: true argument :message, String, req...
28.787879
83
0.561053
e8f84063a3b26a622fcb1f51a953fe5b529f207e
1,806
require "codnar" require "test/spec" # Test highlighting syntax using GVim. class TestGraphVizDiagrams < Test::Unit::TestCase MINIMAL_DIAGRAM_SVG = <<-EOF.unindent #! ((( svg <svg width="62pt" height="116pt" viewBox="0.00 0.00 62.00 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/...
33.444444
116
0.587486
b956601dd75375781485ada6de3bfe66664013ed
2,344
require "active_support/core_ext/integer/time" # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data the...
38.42623
85
0.780717
79356b11781ea8580a7f15ecd8ed770cad08409b
966
require "formula" class SwitchaudioOsx < Formula homepage "https://github.com/deweller/switchaudio-osx/" url "https://github.com/deweller/switchaudio-osx/archive/1.0.0.tar.gz" sha1 "4b7bae425f4b9ec71b67dc2c4c6f26fd195d623a" head "https://github.com/deweller/switchaudio-osx.git" bottle do cellar :any ...
29.272727
72
0.698758
4a593e94321d8998568cf2d6c07283bd92617ebf
346
module Buildable def perform(payload_data) payload = Payload.new(payload_data) build_runner = BuildRunner.new(payload) build_runner.run rescue Resque::TermException retry_job rescue => exception Rails.logger.warn "Exception #{exception}" Raven.capture_exception(exception, payload: { data: ...
26.615385
71
0.739884
bb7924d78e663b364ed5ba406c0ccbb6c2ba7f24
67
class PagesController < ApplicationController def show end end
13.4
45
0.80597
ed63b05c539fb02efe8323ea828218f2a2f7faf3
1,803
# frozen_string_literal: true # Brainfuck Language Specifications https://en.wikipedia.org/wiki/Brainfuck # >: p_increment prt++; # <: p_decrement prt-; # +: increment (*ptr)++; # -: decrement (*ptr)--; # .: put putchar(*ptr); # ,: get *ptr=getchar(); # [: open while(*ptr) # ]: close }...
20.033333
78
0.506378
ab1087a9a15934e1b49becc53853abc9db2334e4
939
class Comment include Mongoid::Document include Mongoid::Timestamps field :name, :type => String field :content, :type => String field :email, :type=>String belongs_to :post validates :name, presence: true validates :email, presence: true, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i...
29.34375
116
0.676251
1a158c2464df91f1f5c22d2e985a10664f7f8856
95
require 'spec_helper_acceptance' # Ensure NIS CLient is not installed - Section 2.3.1 describe
23.75
52
0.8
5d86e4de7095e0fe368faee04242d5bde9b2cf34
3,587
require 'fileutils' require 'chef/cookbook/metadata' module DroneChef # # Class for uploading stuff to a Chef Server # class ChefServer def initialize(config) @config = config @options = config.plugin_args fail 'Chef organization required' unless @options.key? 'org' end def recur...
25.083916
77
0.629217
bfc15e640f505be9e56f0897dba35698793ccae7
38
module Grocer VERSION = '0.4.1' end
9.5
19
0.657895
d5d8a09aaf1cf8e4e478d96c67808f6c80c868fc
6,199
class Patient < ApplicationRecord include PgSearch include CommonContent attr_reader :object_pronoun, :subject_pronoun, :possessive_pronoun, :vitals_show_header, :vitals_by_date, :age, :full_name scope :sorted, (-> { order(id:...
28.56682
188
0.598968
0333eb85fb6307cd049f7bdfbf7208c1dbbe2379
15,209
# frozen_string_literal: true require 'spec_helper' describe SearchService do let_it_be(:user) { create(:user) } let_it_be(:accessible_group) { create(:group, :private) } let_it_be(:inaccessible_group) { create(:group, :private) } let_it_be(:group_member) { create(:group_member, group: accessible_group, user...
30.418
115
0.637978
033398187b6952b27578dac88f3b45ec3d5be2cf
1,075
require File.expand_path("../../Abstract/abstract-php-extension", __FILE__) class Php70Mcrypt < AbstractPhp70Extension init desc "An interface to the mcrypt library" homepage "http://php.net/manual/en/book.mcrypt.php" bottle do revision 9 sha256 "0582320a1560683fd2a353cc3d1f7ad3fad157200fe7ec49e4b1812f...
29.861111
92
0.701395
28f7ccf9757879fdbce9daba136fbdf6c726ed5c
120
# frozen_string_literal: true class VhaProgramOffice < Organization def can_receive_task?(_task) false end end
15
37
0.775
87d752f2854689221e90960467e5f7908c11a399
1,407
# -*- encoding: utf-8 -*- # stub: public_suffix 4.0.6 ruby lib Gem::Specification.new do |s| s.name = "public_suffix".freeze s.version = "4.0.6" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "bug_tracker_uri" => "https://github.co...
56.28
434
0.721393
336c53dec948af92a66f31d52c13e013416d07e4
4,646
require File.join(File.dirname(__FILE__), 'test_helper') module Resque::Durable class DurableTest < Minitest::Test describe 'Durable queue' do before do QueueAudit.delete_all GUID.stubs(:generate).returns('abc/1/12345') Resque.expects(:enqueue).with(Resque::Durable::MailQueueJob, :...
29.782051
116
0.618166
bfc9bbaa08405be49f5af00c594eba457bf9160b
304
module Keras::Wrappers extend self pyfrom 'keras.layers', import: 'TimeDistributed' pyfrom 'keras.layers', import: 'Bidirectional' def time_distributed(layer, **args) TimeDistributed.new(layer, **args) end def bidirectional(layer, **args) Bidirectional.new(layer, **args) end end
21.714286
50
0.713816
115120e00d3fd8546e23464f0de576da0b5a3ba8
324
module Catherine module Admin class ResourceController < Catherine::Admin::BaseController include ResourceHelper before_action :require_user before_action :require_site_admin before_action :configure_resource_controller def resource_url(obj) url_for([:admin, obj]) end end end ...
18
62
0.743827
21f97431aa31bb66456d7a09e2ac11eb32ef8168
78
require 'unidom/promotion/engine' module Unidom module Promotion end end
11.142857
33
0.782051
5dbe2c4c0a592a18e2feec04eab541683a86f6be
1,228
require 'spec_helper' # Anodator::Validator::BlankValidator require 'anodator/validator/blank_validator' RSpec.describe Anodator::Validator::BlankValidator, '.new' do context 'with no parameters' do it 'should raise ArgumentError' do expect do Anodator::Validator::BlankValidator.new end.to r...
24.078431
66
0.665309
035ee8508b5eb70334a5c56fe166c7d9387026ad
415
class TmuxinatorFzfStart < Formula desc "A macOS tool for starting then waiting for Docker.app to be ready" homepage "https://github.com/camspiers/tmuxinator-fzf-start" url "https://github.com/camspiers/tmuxinator-fzf-start/archive/1.0.2.tar.gz" sha256 "f214277ba5b0cfdfa1101f2dbe21a1cf8b1c7b41ef3ac5ee2ada002789...
31.923077
78
0.783133
1c5bf31e9137cdbf71656531e9de63e779254479
875
# # Cookbook:: vm # Test:: mysql_test # # Author: Tom Price # Date: Dec 2018 # # Inspec tests for recipe vm::mysql # # The Inspec reference, with examples and extensive documentation, can be # found at http://inspec.io/docs/reference/resources/ # describe package('mysql-server') do it { should be_installed } end des...
25
78
0.685714
01ffe3f4da93d2648cb1fde465d5be44f3984be3
179
# frozen_string_literal: true class AddCommencementStatusToTrainee < ActiveRecord::Migration[6.1] def change add_column :trainees, :commencement_status, :integer end end
22.375
67
0.793296
91103e1101cffc872380fc872e425ee78da5e9d9
1,072
# frozen_string_literal: true require 'syslog/logger' require 'edools/version' require 'edools/utils' require 'edools/api_request' require 'edools/pagination_proxy' require 'edools/school' require 'edools/course' require 'edools/school_product' require 'edools/invitation' require 'edools/user' require 'edools/session'...
18.482759
54
0.751866
11756c6fc3c53a6cd5c8293ff0f47af648a6ae66
547
# frozen_string_literal: true class ApplicationController < ActionController::Base # helper_method allows you to call the method on the views # helper_method :check_and_see_if_someone_is_logged_in? # before_action :authorized_to_see_page # def set_current_student # @current_user = User.find_by(id: session...
27.35
74
0.780622
1dde2f7f1352e95c83c23eed18da5d0602230c54
1,057
# # Cookbook Name:: serverdensity # Provider:: plugin def whyrun_supported? true end # actions action :enable do config.run_action :create plugin.run_action :create new_resource.updated_by_last_action( config.updated_by_last_action? || plugin.updated_by_last_action? ) end action :disable do config.r...
20.72549
68
0.701987
e894c00eaf8cb3c74bc694ce70416901e50d4d0b
1,878
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
28.892308
74
0.687966
612e70ebaab197c3b4e26394887dcbaba4eea73d
1,730
class MyLinkedList =begin Initialize your data structure here. =end def initialize() @array = [] end =begin Get the value of the index-th node in the linked list. If the index is invalid, return -1. :type index: Integer :rtype: Integer =end def get(index)...
24.366197
241
0.621965
1114a1b1406b6696f413725a392511b1d8c01b6b
1,319
require 'minitest_helper' module SlideHero describe GroupedSlides do describe "nesting slides" do it "groups sections" do grouped_slides = GroupedSlides.new do slide "banana" do point "High in potassium" end slide "apple" do point "Good if you h...
27.479167
69
0.567096
617e1cecbd59cdfc91d2d19c4071215ba162a30e
108
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'spider_pig' require 'minitest/autorun'
21.6
58
0.75
6a1819ec0e6f156adf6c29dad5cb090586fe97b1
6,982
require 'oauth' module Withings module Api module OAuth include ::OAuth end # Methods to ease the OAuth setup steps for using the Withings API. # # Specifically, this class provides methods for OAuth access token creation. The steps are: # # 1. Request request tokens - via {#creat...
37.537634
130
0.689487
3326c3258139c10f6bb731573b4a68f4fd1b9c8b
38
require 'hyrarchy' Hyrarchy.activate!
12.666667
18
0.815789
e8d365304eeab4cf0a687dc852c8234ab5fab227
8,529
=begin #NSX-T Data Center Policy API #VMware NSX-T Data Center Policy REST API OpenAPI spec version: 3.1.0.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.17 =end require 'date' module NSXTPolicy # This condition is used to match the HTTP protocol version of the...
32.184906
433
0.642045
33ff3c3a54c3b02a1037ba399905ef50fa9e304c
115
FactoryBot.define do factory :address do address_line_1 { "Street" } association :organisation end end
16.428571
31
0.721739
039dfca1616fa1486628c297e4a7ea843daee0c1
4,820
require 'spec_helper' describe ISO8601::Time do it "should raise an error for any unknown pattern" do expect { ISO8601::Time.new('') }.to raise_error(ISO8601::Errors::UnknownPattern) expect { ISO8601::Time.new('T') }.to raise_error(ISO8601::Errors::UnknownPattern) expect { ISO8601::Time.new('T10:3012+040...
43.423423
98
0.651867
39a9792e0193cc6639c91fe1d351b7e9a3774cf9
4,545
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::DataFactory::Mgmt::V2018_06_01 module Models # # Square Service dataset. # class SquareObjectDataset < Dataset include MsRestAzure ...
29.705882
75
0.413201
08f5eb178ca453ed6e877eee0e537b14e70918fe
816
require('rspec') require('prime_shifting') require('pry') describe('#prime_shifting') do it('return 2 if number user enter is 2') do prime_finder = PrimeNumber.new() expect(prime_finder.find_prime(2)).to(eq("2")) end it('return 3 if number user enter is 2,3') do prime_finder = PrimeNumber.new() ...
30.222222
121
0.671569
2100e3c262dcdbcebc716f58af03b014ea8cdf92
1,893
# frozen_string_literal: true RSpec.shared_examples 'inserted middleware' do |modification| context ".#{modification}" do let(:processed_collection) { double('processed_collection') } let(:collection) { double('collection') } let(:params) { {} } def env @env ||= [] end subject(:inspect...
29.123077
94
0.628104
d55651de6be1e82af2bb861f05d697c008c1e5a2
4,362
require 'spec_helper' require 'action_controller' RSpec.describe OpenApiAnnotator::PathsBuilder do describe "#build" do subject { builder.build } let(:builder) { described_class.new } let(:routes) do [ OpenApiAnnotator::Route.new( http_verb: "GET", path: "/api/v1/books"...
30.503497
100
0.530261
f7f99dfac14555daae5ca269e3589e6fa7e0707f
750
# frozen_string_literal: true require 'spec_helper' RSpec.describe SidekiqUniqueJobs::OnConflict::Strategy, redis: :redis do let(:strategy) { described_class.new(item) } let(:unique_digest) { 'uniquejobs:56c68cab5038eb57959538866377560d' } let(:item) do { 'unique_digest' => unique_digest, 'queue' => :c...
23.4375
99
0.678667
915e4d1c3fc5068059d1e0fd729acf94ee1cb772
1,757
class Muparser < Formula desc "C++ math expression parser library" homepage "http://beltoforion.de/article.php?a=muparser" url "https://github.com/beltoforion/muparser/archive/v2.2.6.1.tar.gz" sha256 "d2562853d972b6ddb07af47ce8a1cdeeb8bb3fa9e8da308746de391db67897b3" head "https://github.com/beltoforion/mupars...
28.803279
93
0.582242
d5827e61c86a9a90702a103ec36b6b35739c8ae1
5,101
require 'rails_helper' module RemarkGenerators RSpec.describe FrequencyChecker do before { create :bank_holiday } context 'state benefit payments' do let(:amount) { 123.45 } let(:dates) { [Date.current, 1.month.ago, 2.months.ago] } let(:state_benefit) { create :state_benefit } let(:a...
44.745614
143
0.67575
91b0fb5280403fb90aa6ca9c8951638fd3037345
393
connection = ActiveRecord::Base.connection connection.create_table :taxable_records do |t| t.string :currency_code t.decimal :amount t.decimal :gross_amount t.decimal :tax_factor end class TaxableRecord < ActiveRecord::Base end TaxableRecord.create!(currency_code: "GBP", amount: 123.45, gross_amount: 141.09...
23.117647
81
0.778626
0807c5ff2722997c48ac4f0a9d86ac75d7835d80
964
YARD::Config.load_plugin("sinatra") YARD::Tags::Library.define_tag("API Doc", :apidoc) YARD::Tags::Library.define_tag("Description", :description) YARD::Tags::Library.define_tag("Note", :note) YARD::Tags::Library.define_tag("Endpoint path", :path) YARD::Tags::Library.define_tag("Category", :category) YARD::Tags::Libra...
37.076923
81
0.698133
38df709eb5e67b0fd8b983da1e62cf9908fc8635
2,133
require "interaction/version" require "interaction/params" require "interaction/validation_helpers" module Interaction # Override Ruby's module inclusion hook to prepend base with #perform, # extend base with a .perform method, and include Params for Virtus. # # @api private def self.included(base) base....
18.876106
77
0.630567
1c8b59eb65c1a7d318c509def0f7d40cff63cb3a
1,890
class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.string :username, limit: 100 t.string :realname t.string :email t.string :hashed_password t.string :location t.string :gamertag t.string :stylesheet_url t.text :description t.b...
31.5
62
0.650265
184cde2c3d23db29736105a4fafbcbff9563baef
2,879
require 'bundler' ENV['RACK_ENV'] = 'test' Bundler.require(:default, 'test') Bundler.require(:default, 'development') require 'rack/test' require 'rspec' require "capybara/rspec" require 'capybara/webkit' Sinatra::Application.environment = :test Capybara.app = Autochthon::Web Capybara.javascript_drive...
25.936937
87
0.686002
7a82f2187372a69d695a6ddbd6f82b75608ae9aa
1,820
require "rails_helper" RSpec.describe "managing responses" do it "lets pcmos track responses" do pcmo = FactoryGirl.create :pcmo e1, e2, e3, e4 = 4.times.map { FactoryGirl.create(:response, country: pcmo.country).user.email } login_as pcmo visit responses_path find("tr", text: e1).click_on "Rec...
27.575758
100
0.701648
3325f757fad464dc90dafcfdf3959b71935cb2c7
1,691
require 'money' require 'sugar-high/delegate' require 'money/mongoid/core_ext' require 'money/orm/generic' require 'money/mongoid/macros' require 'money/mongoid/monetizable' require 'money/mongoid/monetize' require 'money/orm/generic' if ::Mongoid::VERSION > '3' require "money/mongoid/3x/money" else require "mon...
21.679487
76
0.641041
03942e468fe09b9c10b75ea14e6627cf1fb5e9ce
1,061
require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require(*Rails.groups) require "shipit" begin require "pry" rescue LoadError end module Shipit class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application con...
33.15625
99
0.731385
33bada8c5434cd0dd346ca2defed1eceb8cc89b7
506
require "meuh" require "cinch" module Meuh # Plugin for Cinch class CinchPlugin include Cinch::Plugin listen_to :channel, method: :on_channel def on_channel(msg) @brain ||= Brain.new options = { nickname: msg.user.nick, message: msg.message, nicknames: msg.chann...
18.071429
55
0.596838
1d197dc47e159528e0a056002d96e4862134c8eb
655
require 'rails_helper' RSpec.describe GlobalDirectMessageReceivedFlag, type: :model do let(:instance) { described_class.new } describe '#key' do subject { instance.key } it { is_expected.to eq("#{Rails.env}:GlobalDirectMessageReceivedFlag:86400:any_ids") } end describe '#cleanup' do subject { ins...
24.259259
90
0.691603
e9647583a8b5363c7f2bd34711af58eec1001c1c
1,862
Dir.glob(File.expand_path(File.join(__FILE__, "..", "data_migrations", "*.rb"))).sort.each do | path | require path end # Data migrations run *every* time the broker starts up, after the schema migrations. # Their purpose is to ensure that data integrity is maintained during rolling migrations # in architectures wit...
53.2
102
0.794307
ff249fa939c3c32fe13fac5368a160cdded537ba
13,158
require_relative './spec_helper' class GeoEngineer::RemoteResources < GeoEngineer::Resource def self._fetch_remote_resources(provider) [{ _geo_id: "geo_id1" }, { _geo_id: "geo_id2" }, { _geo_id: "geo_id2" }] end end describe GeoEngineer::Resource do let(:env) { GeoEngineer::Environment.new("testing") } d...
30.178899
106
0.592719
6109ee2425148521798ffe6cdd351a0e9968abd3
896
$:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "third_rail/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "third_rail" s.version = ThirdRail::VERSION s.authors = ["TODO: Your name"] s.email = ["TODO: Y...
30.896552
85
0.671875
b9c962fac27f104cffcdc5f353fa422a8a310b1f
1,120
cask 'unity-webgl-support-for-editor@2017.4.12f1' do version '2017.4.12f1,b582b87345b1' sha256 :no_check url "https://download.unity3d.com/download_unity/b582b87345b1/MacEditorTargetInstaller/UnitySetup-WebGL-Support-for-Editor-2017.4.12f1.pkg" name 'WebGL Build Support' homepage 'https://unity3d.com/unity/'...
31.111111
141
0.716964
e9d8afe6684243545b48a4d1f7a57f9f171a35b0
827
# encoding: utf-8 class SimpleTemplater module ArgvParsingMixin def parse! self.inject(Hash.new) do |options, argument| case argument when /^--no-([^=]+)$/ # --no-git-repository options[$1.gsub("-", "_").to_sym] = false when /^--([^=]+)$/ # --git-repository op...
29.535714
65
0.500605
e87bd9c2a89baaad74fe7e8670d713f1a07dd314
1,212
require 'spec_helper' describe Taxem::BoundaryReaderZipFour do before(:all) do #TODO: This is wayyyy slow. Find a way to spped this up. # we probably don't need to eat the whole file for this. path_to_csv = boundary_data @boundary_reader = Taxem::BoundaryReaderZipFour.new(path_to_csv) end subje...
24.734694
68
0.669142
1c107c0a131f7d1fe34a55aa16c9da2af9afc43b
4,175
# encoding: utf-8 # copyright: 2018, eNFence GmbH title 'java_advisory_20180220' control 'CVE-2018-2599' do impact 0.48 title 'An unspecified vulnerability related to the Java SE JNDI component could allow an unauthenticated attacker to cause no confidentiality impact, low integrity impact, and low availability i...
40.144231
203
0.633054
33acdfc91cc55b2626cb9360cd3e0af7946b6052
1,234
lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'twitter/version' Gem::Specification.new do |spec| spec.add_dependency 'addressable', '~> 2.3' spec.add_dependency 'buftok', '~> 0.2.0' spec.add_dependency 'equalizer', '~> 0.0.11' spec.add_dependency 'http',...
42.551724
115
0.688817
6a439f60bef408793125dd344e620bff33e9649e
48
#SimpleNavigationAcl::Base.contexts += %w(admin)
48
48
0.770833
ab004c3a0365658f6b32b305cd846e7679ea2dd5
869
module Fabric module Webhooks class InvoiceCreated include Fabric::Webhook def call(event) check_idempotence(event) or return if Fabric.config.store_events stripe_invoice = retrieve_resource( 'invoice', event['data']['object']['id'] ) return if stripe_invoice...
28.966667
73
0.657077
6a8ee613131ec5897ba6c0101dd5ce750935ade7
76
class Award < ApplicationRecord belongs_to :goal belongs_to :runner end
15.2
31
0.789474
abd7a1d091489d3dbf136a3d4723d92f91445816
464
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :recoverable, :registerable, :rememberable, :timeoutable, :trackable, :validatable # Setup accessible (or protect...
38.666667
75
0.74569
392180b0d56ced960c26134c8745d81ded865e3c
5,924
# frozen_string_literal: true require 'rails_helper' RSpec.describe Service do subject { build(:service) } it { should validate_presence_of(:uri) } it { should validate_uniqueness_of(:uri) } it 'auto-validate built service' do build(:service).valid? end # NOTE: default uniqueness test seams to not ...
31.015707
99
0.691087
6a748a092d65545692c0deb040d7f3e1b7453f47
2,328
# frozen_string_literal: true RSpec.describe RuboCop::Cop::Rails::ORMAbstraction do subject(:cop) { described_class.new(config) } let(:config) { RuboCop::Config.new } it 'registers an offense when breaking ORM abstraction in a where clause' do expect_offense(<<-RUBY.strip_indent) users.where(baz: 'co...
34.235294
92
0.585481
2899bd1033983812ca3f9ff9773dd54587fb4ffa
355
module Xiki class Sass def self.menu *args txt = ENV['txt'] File.open("/tmp/tmp.sass", "w") { |f| f << txt } css = `sass /tmp/tmp.sass` css.gsub!("\n", '\n') css.gsub!('"', '\"') code = "$('head').append(\"<style>#{css}</style>\")" Firefox.exec code "@flash/- Loa...
19.722222
58
0.48169
2679e0ec17c8612e8561ee2c808a4cc5fb0ee9d6
116
json.extract! @near_place, :id, :kiosk, :disco, :beach, :national_park, :other, :place_id, :created_at, :updated_at
58
115
0.724138
b91185eab29c13c26e4e1bd6827fa3445d1f611d
1,026
module ArJdbc module QuotedPrimaryKeyExtension def self.extended(base) # Rails 3 method Rails 2 method meth = [:arel_attributes_values, :attributes_with_quotes].detect do |m| base.private_instance_methods.include?(m.to_s) end pk_hash_key = "self.class.primary_key" ...
35.37931
101
0.601365
3914da48c7712112663956e22b09fc6ff8e3d731
265
define_upgrade do if Partybus.config.bootstrap_server must_be_data_master # 1. cookbook artifacts # 2. adds last update tracking to keys table. run_sqitch('@2.9.0', 'oc_erchef') end end define_check do check_sqitch('@2.9.0', 'oc_erchef') end
20.384615
49
0.709434
e8e8bea66d634e5f20928373b8fced453aac660f
251
module Tunefind class Show < Base def self.search(offset: nil, updated: nil) build_collection(get("show?offset=#{offset}&updated=#{updated}")['shows']) end def self.find(id) build_object(get("show/#{id}")) end end end
20.916667
80
0.633466
6ae1a09c0af2fbc85ffe63482c3e83fc25dea983
3,507
name "tile" description "Role applied to all tile servers" default_attributes( :accounts => { :users => { :tile => { :members => [:jburgess, :tomh] } } }, :apache => { :mpm => "event", :timeout => 60, :event => { :server_limit => 60, :max_request_workers => 120...
29.225
144
0.569718
083df8c92cd795d1b816417491948bc31ee6d5f7
178
class ChangeVisitMonthToDate < ActiveRecord::Migration def up change_column :visits, :month, :date end def down change_column :visits, :month, :datetime end end
17.8
54
0.724719
083967ca3bf99be56b87c71b2977c87e137141c5
661
require 'rails' module Tolk class Engine < Rails::Engine isolate_namespace Tolk initializer :assets do |app| app.config.assets.precompile += ['tolk/libraries.js'] end # We need one of the two pagination engines loaded by this point. # We don't care which one, just one of them will do. ...
25.423077
90
0.67171
629eeac1d6ba6160b3377b1b498b04e67d6fc4e5
247
module BrokerModelConcerns class Engine < ::Rails::Engine isolate_namespace BrokerModelConcerns config.generators do |g| g.test_framework :rspec g.fixture_replacement :factory_girl, :dir => 'spec/factories' end end end
24.7
67
0.724696
b9e8fbadda8e8e8dd8880eb948fd663464c157fc
377
module UsersHelper # 引数で与えられたユーザーのGravatar画像を返す # 渡されたユーザーのGravatar画像を返す def gravatar_for(user, options = { size: 80 }) size = options[:size] gravatar_id = Digest::MD5::hexdigest(user.email.downcase) gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?s=#{size}" image_tag(gr...
34.272727
80
0.702918
390c66017f4cbc15c478c3c569a07173aa902c78
2,712
class Xxh < Formula include Language::Python::Virtualenv desc "Bring your favorite shell wherever you go through the ssh" homepage "https://github.com/xxh/xxh" url "https://files.pythonhosted.org/packages/ad/7f/effcf114577d392f270831ab36e5833d071ebf1f494dd5acb7cf3953f5fd/xxh-xxh-0.8.4.tar.gz" sha256 "cf6cd0a...
33.481481
140
0.716814
bb328e5fbc45397930f3b9c05e57dadf8eccd223
4,268
# == Schema Information # # Table name: listing_images # # id :integer not null, primary key # listing_id :integer # created_at :datetime # updated_at :datetime # image_file_name :string(255) # image_content_type :string(255) # image_file_size :integer # im...
36.793103
176
0.67104
18d87a9b0483b1f85f3ba62285c8ddb046fbba0a
1,756
require File.expand_path('../boot', __FILE__) require "rails" # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "sprockets/railtie" # requi...
35.836735
99
0.730638
bf16fa1242dc03c970b2fd2030abea9ce3e38059
2,059
# Copyright 2017 Google Inc. # 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 applicable law or agreed to in writing, so...
22.139785
74
0.625061
87fe85bffffc8042929fed7a3cd3820c458598ce
792
require 'rails_helper' RSpec.describe "bio" do before(:each) do FactoryGirl.create(:image) visit "/" find("li > a#bio_link").click end it "populates the content section with bio content", :js => true do expect(page).to have_content("BIO") expect(page).to have_content("IF ONE CAN LIKEN TH...
56.571429
515
0.741162
4a8cde859cfa1880635eb2cc59a4c2fb9106a5d9
908
lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "method_pattern/version" Gem::Specification.new do |spec| spec.name = "method_pattern" spec.version = MethodPattern::VERSION spec.authors = ["Jamie Gaskins"] spec.email = ["j...
33.62963
74
0.643172
f7cbf522a32a27c928922f53f03814b817f74988
374
class TodayService def self.matches_today(query) url = "https://api.football-data.org/v2/matches?#{query}" resp = Faraday.get url do |req| req.headers['X-Auth-Token'] = ENV['AUTH_TOKEN'] end body = JSON.parse(resp.body) if resp.success? @response = body["matches"] else @...
17.809524
61
0.609626
086d5fe87a7e888c4db97fad4a0014e6ff4381d8
129
module Podling class ApplicationMailer < ActionMailer::Base default from: 'from@example.com' layout 'mailer' end end
18.428571
46
0.728682
389bd818162d43f71c3cb2eaa365ac1ae5aedbdc
1,096
#!/usr/bin/env ruby require 'rex/post/meterpreter/extensions/espia/tlv' module Rex module Post module Meterpreter module Extensions module Espia ### # # This meterpreter extensions interface that is capable # grab webcam frame and recor mic audio # ### class Espia < Extension def initialize(cli...
19.571429
67
0.706204
b99a7d9ba932363de2cf5d3e8c83357f248f1d1a
1,510
module RetinaTag module TagHelper def self.included(base) base.module_eval do alias_method :image_tag_without_retina, :image_tag alias_method :image_tag, :image_tag_with_retina end end def image_tag_with_retina(source, options={}) hidpi_asset_path = nil src = optio...
26.964286
110
0.65298
879c5ab59bb4e8178823a67a62f2a911db055426
940
require 'karel_testcase' class TestControlFlow < KarelTestCase def test_define WORLD <<END K W END DEFINE('TURNRIGHT') { ITERATE(3.TIMES) { TURNLEFT() } } TURNRIGHT() MOVE() assert [0,1],THE_WORLD.karel end def test_good_names DEFINE('A9A') {} DEF...
14.6875
39
0.582979
620bd0a56bd29a8fd2b52280f7ac2a5cf8266788
3,788
require 'spec_helper' require 'rack/test' require 'split/dashboard' describe Split::Dashboard do include Rack::Test::Methods def app @app ||= Split::Dashboard end def link(color) Split::Alternative.new(color, experiment.name) end let(:experiment) { Split::Experiment.find_or_create("link_colo...
23.675
91
0.661563
b9d50ecdc4919716edba7eed63d44ebb84db4648
727
cask 'toggldesktop-dev' do version '7.4.28' sha256 '5f6a41982790b81bc6266dd6a3758c3d828aeab9ab64599ac6c645ed09792c0f' # github.com/toggl/toggldesktop was verified as official when first introduced to the cask url "https://github.com/toggl/toggldesktop/releases/download/v#{version}/TogglDesktop-#{version.dots_t...
38.263158
123
0.707015
1148e5e1ade4f533846c3627b7c1f7db2ebc8a5e
1,303
# mundi_api # # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). module MundiApi # Object used for returning lists of objects with pagination class PagingResponse < BaseModel # Total number of pages # @return [Integer] attr_accessor :total # Previous pa...
24.12963
65
0.561013
21e2e21e9b3c168602f1a535e92b465bb384e85d
9,382
# frozen_string_literal: true class CommitStatus < Ci::ApplicationRecord include Ci::HasStatus include Importable include AfterCommitQueue include Presentable include EnumWithNil include BulkInsertableAssociations include TaggableQueries self.table_name = 'ci_builds' belongs_to :user belongs_to :...
28.95679
129
0.694948
38ee6893d267a6e851d8a7df0ad3e938f860cfb8
2,132
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'extension_lister/version' Gem::Specification.new do |spec| spec.name = 'extension_lister' spec.version = ExtensionLister::VERSION spec.authors = ['Burin Choomnuan'] sp...
53.3
94
0.575516
91ec90673b3a16bdbd20d1102f56a0aa1c9ed68b
64
require_relative 'load_path' require 'shopping_cart_component'
16
33
0.859375
b99fb2df39dab54b2559e94541a5f64270f27593
2,094
RSpec.describe Inquisition::Fasterer::Runner do include_examples 'enablable', :fasterer describe '#call' do subject(:runner_result) { described_class.new.call } let(:test_file) { 'app/controllers/application_controller.rb' } let(:instance_file_traverser) { instance_double(Inquisition::Fasterer::FileTr...
37.392857
113
0.692932
1ca251d5e94e376496a16334d998e3a7f51f75dc
115
# frozen_string_literal: true require 'chefspec' require 'chefspec/berkshelf' require 'coveralls' Coveralls.wear!
16.428571
29
0.808696