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
018fa78fb44491abd353e8a65f677352f233c8e3
953
FactoryBot.define do factory :products_qhp, :class => 'Products::Qhp' do issuer_id { "1234" } state_postal_code { "DC" } standard_component_id { "12340987" } plan_marketing_name { "gold plan" } hios_product_id { "1234" } network_id { "123" } service_area_id { "12" } formulary_id { "123...
31.766667
58
0.665268
790e19223a1d1dc163e9ea279879dbb8e81f606a
9,958
=begin #Products #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: v3 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 =end require 'date' module Hubspot module Crm module Products ...
32.122581
219
0.542981
0308249c50e3eafb4ce77e8a1a75004708399628
348
windows = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ exclude :test_ascii_incompatible_path, "needs investigation" exclude :test_basename, "needs investigation" exclude :test_dirname, "needs investigation" exclude :test_extname, "needs investigation" exclude :test_join, "needs investigation" exclude :test_path, "need...
38.666667
60
0.804598
11025388762aed985fe6d176e4d468716a34394b
692
require File.dirname(__FILE__) + '/../abstract_unit' class AtomicWriteTest < Test::Unit::TestCase def test_atomic_write_without_errors contents = "Atomic Text" File.atomic_write(file_name, Dir.pwd) do |file| file.write(contents) assert !File.exist?(file_name) end assert File.exist?(fi...
23.066667
54
0.702312
213fb9b9c14082c4cf985dca566b75630657e7a7
974
require 'rails_helper' RSpec.describe PreviousVersionOfClaim do subject(:previous_version) { described_class.new(claim) } let(:claim) { create(:archived_pending_delete_claim, evidence_checklist_ids: [3, 4, 1]) } describe 'call' do subject(:call) { previous_version.call } it { is_expected.to be_a Claim...
31.419355
104
0.668378
ab48af5bb7212ca1ea6222301b9d80028fd06702
212
FactoryBot.define do factory :acts_as_historiable_history, class: 'History' do log { "MyText" } owner { "" } historiable { "" } ip_address { "MyString" } user_agent { "MyString" } end end
21.2
59
0.627358
e86976b4a3894aa5a34b4c30123ceedf25b7ca79
5,017
begin require 'active_record' rescue LoadError require 'rubygems' require 'active_record' end # Authenticates against a plain SQL table. # # This assumes that all of your users are stored in a table that has a 'username' # column and a 'password' column. When the user logs in, CAS conects to the # database and l...
31.553459
151
0.71477
392997e364e8489b7f4d39229ff7237c9ec2bb10
15,614
RSpec.describe "chargebacks API" do let(:field) { FactoryGirl.create(:chargeable_field) } it "can fetch the list of all chargeback rates" do chargeback_rate = FactoryGirl.create(:chargeback_rate) api_basic_authorize collection_action_identifier(:chargebacks, :read, :get) get api_chargebacks_url e...
42.2
138
0.661714
ff7b6cddb74e7f636ab6ee5b33d4321f78e830c9
4,763
# frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake require_relative 'endpoints/admin_analytics' require_relative 'endpoints/admin_apps' require_relative 'endpoints/admin_apps_approved' require_relative 'endpoints/admin_apps_requests' require_relative 'endpoints/admin_apps_restricted' re...
33.542254
63
0.78228
1cb58055431cc93f9e12bd477a5081ba16828b2c
1,580
require_relative '../../../search_test' require_relative '../../../generator/group_metadata' module USCoreTestKit module USCoreV400 class PediatricWeightForHeightPatientCategoryDateSearchTest < Inferno::Test include USCoreTestKit::SearchTest title 'Server returns valid results for Observation search...
32.244898
110
0.702532
019b2184e00f12ba9c542eb03caea1d66959de66
543
current_dir = File.dirname(__FILE__) user = ENV['OPSCODE_USER'] || ENV['USER'] orgname = ENV['ORGNAME'] || "chef" chef_server_url "https://chef-server.local" node_name user client_key "#{user}.pem" validation_client_name "#{orgname}-validator" validation_key "#{orgname...
31.941176
56
0.679558
7aa8c15b4c2572e268b7524fad796a1282877024
442
require 'honeybadger/plugin' require 'honeybadger/ruby' module Honeybadger Plugin.register do requirement { defined?(::Warden::Manager.after_set_user) } execution do ::Warden::Manager.after_set_user do |user, auth, opts| if user.respond_to?(:id) ::Honeybadger.context({ :u...
22.1
62
0.604072
1ab034effa5daf0249a522489e7bafdbf928bb5c
2,563
require "rails_helper" RSpec.describe 'home page', type: :feature, js: true do it 'renders' do visit '/' expect(page).to have_selector('#home_latest_area', visible: true) expect(page).not_to have_selector('.profile_link') track_chunk = find(".asset", match: :first) track_chunk.find(".play_link")...
39.430769
155
0.703472
1d833183ec3df316b0ca9ce467f2ed078f4345d7
2,580
module Gitlab module Diff class Highlight attr_reader :diff_file, :diff_lines, :raw_lines, :repository delegate :old_path, :new_path, :old_sha, :new_sha, to: :diff_file, prefix: :diff def initialize(diff_lines, repository: nil) @repository = repository if diff_lines.is_a?(Gitl...
29.655172
114
0.615116
286cf8dcfac6fbc291d623715c3f335ed676dbbf
1,389
require 'rails_helper' require 'ui/component' describe Ui::Breadcrumbs, type: :cell do controller ApplicationController let(:result) { html } let(:breadcrumbs) { [ Ui::Breadcrumbs::Crumb.new(path: '#', name: 'Breadcrumb 1', current: true), Ui::Breadcrumbs::Crumb.new(path: '#', name: 'Breadcrumb 2...
24.368421
81
0.581713
088270950159070b2f209dcac62377f27389ea27
939
# frozen_string_literal: true require 'appeals/middleware/errors' require 'common/client/configuration/rest' require 'common/client/middleware/response/raise_error' module Appeals class Configuration < Common::Client::Configuration::REST def app_token Settings.appeals.app_token end def base_path ...
24.076923
98
0.7082
e879d916d46019ac3985f3cf3f9fcde3d639a659
1,775
class Thrift < Formula desc "Framework for scalable cross-language services development" homepage "https://thrift.apache.org/" url "https://www.apache.org/dyn/closer.cgi?path=/thrift/0.13.0/thrift-0.13.0.tar.gz" sha256 "7ad348b88033af46ce49148097afe354d513c1fca7c607b59c33ebb6064b5179" bottle do cellar :a...
27.307692
94
0.683944
18f10107f10f1ab40203b5f5a95e13c9650e9014
18,062
require 'spec_helper_acceptance' require 'securerandom' describe "ec2_autoscalinggroup" do before(:all) do @default_region = 'sa-east-1' @aws = AwsHelper.new(@default_region) end def find_autoscaling_group(name) groups = @aws.get_autoscaling_groups(name) expect(groups.count).to eq(1) groups...
34.273245
104
0.592681
9194a69f27c7880ce638018cd8bdc4e7914234a9
203
# frozen_string_literal: true class CreateBlogs < ActiveRecord::Migration[6.0] def change create_table :blogs do |t| t.string :title t.text :body t.timestamps end end end
15.615385
48
0.660099
013a6d8847d0d9468451adcd5e86a93034a49c36
881
cask "deezer" do version "5.30.30" sha256 "1fef7d10834d5206d8137beb0ccf440596d672578fc494d8e27495e3b612d13d" url "https://www.deezer.com/desktop/download/artifact/darwin/x64/#{version}" name "Deezer" desc "Music player" homepage "https://www.deezer.com/download" livecheck do url "https://www.deezer....
29.366667
82
0.725312
1813baf06b4bbd4720c0deb83f1b9071db547d52
112
require "rdcl/link/dock_cmds/dock_cmd.rb" module RDCL class DockCmdGetPassword < DockCmd end end
12.444444
42
0.714286
8763c5f4371a1c9bf1d847da14aa9db719f7e107
78
class Iris::GovernanceParamsDecorator < Common::GovernanceParamsDecorator end
26
73
0.871795
38d629fd21c002f0c3385d90d15cd750796e1495
385
# frozen_string_literal: true Sequel.migration do up do create_table :days do date :date json1 :rates index :date, unique: true end drop_table :currencies end down do create_table :currencies do date :date string :iso_code float :rate index %i[dat...
16.73913
43
0.620779
334ba1f7795dc29e23eaebf096c291c8b51f6c52
1,016
require 'rails_helper' RSpec.describe '/deals', type: :request do login_user describe 'GET /new' do it 'renders a successful response' do get new_deal_url expect(response).to be_successful end end describe 'POST /create' do context 'with valid parameters' do it 'creates a new De...
27.459459
114
0.63189
e2abc5c0902355964eaf27a6a77cab32bc631f91
3,966
module Money #узнать текущую базовую валюту, возвращается экземпляр класса Currency def self.get_base valute = Currency.find_by_is_base(true) valute end #установить новую базовую валюту def self.set_base(sym) currency = Currency.find_by_code(sym) raise "Валюта с указанным ко...
37.415094
120
0.675996
b9b008eec1d6c615c398e04307ff930dce8dafd8
1,074
# frozen_string_literal: true require 'rails_helper' RSpec.describe MidataService do let(:service) { described_class.new } let(:pbs_camp_unit_id) { '1328' } # describe '#pull_camp_unit', vcr: true do # subject(:camp_unit) { service.pull_camp_unit(pbs_camp_unit_id) } # it { is_expected.to have_attribut...
32.545455
92
0.713222
ff03fb146f02b6a3d52720dd485709a2232a658c
271
class DeleteColumnSearches < ActiveRecord::Migration def change remove_column :searches, :point, :string remove_column :searches, :large_area, :string remove_column :searches, :middle_area, :string remove_column :searches, :food_code, :string end end
30.111111
52
0.752768
1a68d7d461a5cf518a125a259dfc0f2685507916
1,538
module Fog module Compute class Telefonica class Real def list_tenants response = @identity_connection.request(:expects => [200, 204], :headers => {'Content-Type' => 'application/json', ...
34.954545
100
0.350455
f76ecc8c2299138aa78ea25d049272d7e05893f4
2,484
module Provider::Admin::DashboardsHelper include ApplicationHelper # @param name [Symbol] # @param params [Hash] def dashboard_widget(name, params = {}) widget = DashboardWidgetPresenter.new(name, params) widget.render end def friendly_service_name(service) if service.name =~ /api$/i se...
32.684211
195
0.744767
6aa76a5236ca63920abdceadefaf6f90d61dfcfd
25,219
# # Author:: John Keiser <jkeiser@chef.io> # Copyright:: Copyright 2015-2016, John Keiser. # License:: Apache License, Version 2.0 # # 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...
34.311565
244
0.648598
4ac7c87a021b44b2a0818547cdb2f8b09e6c17cf
3,438
require "spec_helper" describe Services::WaitlistMoviesCheck do subject{described_class.new(movie)} describe "#perform" do When{subject.perform} context "with an acceptable release after fetching" do Given(:movie){create :movie, waitlist: true} Given(:reloaded_movie){movie.reload} Give...
40.928571
186
0.716696
bbe7138c1c602bd22bbfe94cd7af22bcdec6c3d1
262
class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :name t.string :email t.string :login t.string :password t.timestamps end end def self.down drop_table :users end end
15.411765
43
0.629771
d577d8b51149956d0476bc657638b74f1fea911b
576
cask 'freesmug-chromium' do version '47.0.2526.111' sha256 '71d47d02f868684774b70f4243b1030f7a3efb5557e4684acab246b541bf68ab' # sourceforge.net is the official download host per the vendor homepage url "http://downloads.sourceforge.net/sourceforge/osxportableapps/Chromium_OSX_#{version}.dmg" appcast 'http://...
38.4
96
0.793403
e8d792122d5c874b11d908717eefdae12903c62e
30
module AggregationsHelper end
10
25
0.9
e2089b6486747b97c4eb0e4c15752a5367fabf59
4,946
#!/usr/bin/ruby # # Author:: api.sgomes@gmail.com (Sérgio Gomes) # # Copyright:: Copyright 2010, Google Inc. All Rights Reserved. # # License:: 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 o...
35.582734
80
0.683785
ac4dc654dde6868804a40d3ad12a548d3d6ad192
7,811
module Spree class Variant < Spree::Base acts_as_paranoid acts_as_list include Spree::DefaultPrice belongs_to :product, touch: true, class_name: 'Spree::Product', inverse_of: :variants belongs_to :tax_category, class_name: 'Spree::TaxCategory' delegate_belongs_to :product, :name, :descripti...
29.927203
155
0.665344
213a7dc12b6cc65c72a3e7257fe59afbd048dce2
1,463
# -*- encoding: utf-8 -*- # stub: rails-deprecated_sanitizer 1.0.3 ruby lib Gem::Specification.new do |s| s.name = "rails-deprecated_sanitizer".freeze s.version = "1.0.3" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".fre...
38.5
112
0.667806
61ebe45f48754e92b3c340257ca40bafaf1c812d
1,365
# frozen_string_literal: true require_relative 'lib/space_school/version' Gem::Specification.new do |spec| spec.name = 'space_school' spec.version = SpaceSchool::VERSION spec.authors = ['Carlos Torrealba'] spec.email = ['calrrox@gmail.com'] spec.summary = 'Write a short s...
42.65625
100
0.686447
1de1448ffcc7df8081cd7ebd28c10226754dc54f
4,159
module Fog module AWS class AutoScaling class Real require 'fog/aws/parsers/auto_scaling/describe_auto_scaling_instances' # Returns a description of each Auto Scaling instance in the # instance_ids list. If a list is not provided, the service returns the # full details of ...
43.322917
113
0.57586
e8572c4003a7ac9e808919d6698d27dac63dd0b0
1,934
class Calendar def self.holidays_between(from, to) if same_period_as_last_query?(from, to) @holidays else get_holidays(from, to) end end def self.personal_events(user_access_token, email, from, to) params = { :parameters => { "calendarId" => email, "timeMin" => from.t...
24.794872
83
0.661324
1c1867d5ff6c4175c138852133f98c2c75bb50d1
10,246
require 'spec_helper' require 'ddtrace/contrib/analytics_examples' require 'securerandom' require 'rake' require 'rake/tasklib' require 'ddtrace' require 'ddtrace/contrib/rake/patcher' RSpec.describe Datadog::Contrib::Rake::Instrumentation do let(:tracer) { get_test_tracer } let(:configuration_options) { { tracer...
37.808118
123
0.637322
382486e01a25cc8ccbdb4981ffd4f5c959aa1ddb
174
# frozen_string_literal: true require 'blake/version' require 'blake/main' module Blake def self.digest(input, *args) Blake::Main.new(*args).digest(input) end end
14.5
40
0.724138
2138dc7db2a9319ee9613bd464ee56b11d1d5729
2,354
# frozen_string_literal: true # Copyright The OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'opentelemetry/instrumentation/sinatra/version' Gem::Specification.new do |spec| spec.name = 'ope...
48.040816
201
0.728972
03ac1f27fe70e8f73b70ba26f8d766e8dcd2d3ee
124
require "capybara/spec/spec_helper" require "pry" RSpec.configure do |config| Capybara::SpecHelper.configure(config) end
17.714286
40
0.790323
8791f8e38ed00363a48b2df0326ef3d4802b49f0
1,905
describe Travis::Yml::Schema::Def::Notification::Hipchat, 'structure' do subject { Travis::Yml.schema[:definitions][:notification][:hipchat] } # it { puts JSON.pretty_generate(subject) } it do should include( '$id': :hipchat, title: 'Hipchat', normal: true, see: kind_of(Hash), ...
24.423077
72
0.3979
620b2a34133571a869d83b5cf021d0bef9e0cf78
5,274
require 'rails_helper' describe 'Board with milestone', :feature, :js do let(:user) { create(:user) } let(:project) { create(:empty_project, :public) } let!(:milestone) { create(:milestone, project: project) } let!(:issue) { create(:closed_issue, project: project) } let!(:issue_milestone) { create(:closed_is...
26.502513
100
0.659651
d55e5b07f4aa36de47f86bc9578768f2d808ad8a
11,569
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
43.82197
143
0.716311
39249053ee0329eb547e4cb8bc08d9e24c1b4f22
406
# frozen_string_literal: true class AddCertAndKeyToServerlessDomainCluster < ActiveRecord::Migration[5.2] include Gitlab::Database::MigrationHelpers DOWNTIME = false def change add_column :serverless_domain_cluster, :encrypted_key, :text add_column :serverless_domain_cluster, :encrypted_key_iv, :string...
29
81
0.795567
7a2ba5036e07bd82326e92a2c9c04d25e38e3cc7
3,781
# frozen_string_literal: true require "active_support" require "active_support/callbacks" require "active_support/inflector" require "active_support/core_ext/hash/keys" require "active_support/core_ext/module/delegation" require "active_support/core_ext/string/inflections" require "short_circu_it" require "json_log_...
31.508333
163
0.703518
bb65fe7db85b1e6a2a7fe143e6b6e5d5beba583d
249
module Moneybird::Resource class Webhook include Moneybird::Resource extend Moneybird::Resource::ClassMethods has_attributes %i( id administration_id url last_http_status last_http_body ) end end
14.647059
44
0.670683
1c540779e480727cd315265277662c4a2084facd
1,644
require 'spec_helper' RSpec.describe Elasticband::Filter::Near do describe '#to_h' do subject { described_class.new(options).to_h } context 'with `:latitude` and `:longitude` option' do let(:options) { { latitude: 12.5, longitude: -34.6 } } it 'contains the given latitude and longitude options'...
25.6875
91
0.515815
626b16b0303e466fb0674331c9994a2dcbe32e7d
592
require "grpc" module Lnrpc class MacaroonInterceptor < GRPC::ClientInterceptor def initialize(macaroon_hex) @macaroon = macaroon_hex end def inject_macaroon_metadata(request:, call:, method:, metadata:) if !metadata.has_key?('macaroon') && !metadata.has_key?(:macaroon) metadata[:mac...
25.73913
72
0.728041
3944ef1d5e9111fd8a747de7793c857394b803a7
915
def build # Fetch the code: system "go get github.com/spf13/cobra" system "go get github.com/summerwind/h2spec" # This builds `h2spec` into the current directory system "go build ~/go/src/github.com/summerwind/h2spec/cmd/h2spec/h2spec.go" end def test server do system("./h2spec", "-p", "7272") end end pri...
20.333333
114
0.700546
21cd61dd6a9366f600cebddc809ce1dd73919dfa
346
class Answer < ApplicationRecord belongs_to :question validates :body, presence: true validate :validate_answers_number, on: :create scope :correct, -> { where(correct: true) } private def validate_answers_number errors.add(:base, 'you can\'t have less than 1 and more than 4 answers') if question.an...
23.066667
106
0.728324
d5fcb63b13ba13b11b6f7e0321338f9dcef498e2
1,977
require 'spec_helper' describe 'API Description' do context 'with no additional options' do subject do Class.new(Grape::API) do add_swagger_documentation end end it 'describes the API with defaults' do routes = subject.endpoints.first.routes expect(routes.count).to eq 2 ...
44.931818
137
0.64087
4a20caf7f25bd414ad924ec6673ef48a507705f7
73
require 'rubygems' require 'spec' Spec::Runner.configure do |config| end
14.6
34
0.767123
bf0d93eb219a44cd6d959784c3219a881c352b30
57
module BadgesEngine module ApplicationHelper end end
11.4
26
0.824561
ab12b35db1974fedcae3bcb1591ff22e1bb7bc87
833
Pod::Spec.new do |s| s.name = "ApplicationEventObserver" s.version = "2.0" s.summary = "Application event notification (e.g. UIApplicationDidBecomeActiveNotification) handling in Swift." s.description = <<-DESC Application event notification (e.g. UIApplicationDidBecomeA...
34.708333
118
0.655462
084b9392c8f252bb946c3c29be1cd52cee34dff8
1,464
# frozen_string_literal: true require File.expand_path("../lib/stimulus_reflex/version", __FILE__) Gem::Specification.new do |gem| gem.name = "stimulus_reflex" gem.license = "MIT" gem.version = StimulusReflex::VERSION gem.authors = ["Nathan Hopkins"] gem.email = ["natehop@gmail.com"] gem.homepage = "https...
34.046512
95
0.714481
876fbbc9681490dd03091068cdd152244569a484
3,986
module Cryptopunks class Design ## todo/fix - move to its own file!!! end # class Design ############## ## todo/check: ## find a better way to (auto?) include more designs? class DesignSeries ## find a better name for class (just use Series?) - why? why not? def self.build( dir ) data = {} paths...
32.942149
159
0.576518
265f696507aaab87acaa26b09e66209de509b8bb
5,863
module SamlIdpAuthConcern extend ActiveSupport::Concern extend Forwardable included do # rubocop:disable Rails/LexicallyScopedActionFilter before_action :validate_saml_request, only: :auth before_action :validate_service_provider_and_authn_context, only: :auth before_action :store_saml_request, o...
28.740196
99
0.757291
280cc28ce21a03e69b50ee7eedb87c6f36a80df7
128
# frozen_string_literal: true class ApplicationController < ActionController::Base protect_from_forgery with: :exception end
21.333333
52
0.835938
e28a95099f228c679ba9f09332f762a54c27cfec
642
# frozen_string_literal: true module Users class OmniauthCallbacksController < Devise::OmniauthCallbacksController # You should configure your model like this: # devise :omniauthable, omniauth_providers: [:twitter] # You should also create an action method in this controller like this: # def twitter...
20.709677
75
0.672897
ac93b5aecddb5ed26a2542115cca58b6626a3790
352
require 'test_helper' class EventsControllerTest < ActionDispatch::IntegrationTest test "should get new" do get events_new_url assert_response :success end test "should get show" do get events_show_url assert_response :success end test "should get index" do get events_index_url asse...
17.6
60
0.741477
7992869aa7779b3ad4bef51c2e9f29532d49bfe4
1,949
class Bison < Formula desc "Parser generator" homepage "https://www.gnu.org/software/bison/" # X.Y.9Z are beta releases that sometimes get accidentally uploaded to the release FTP url "https://ftp.gnu.org/gnu/bison/bison-3.7.3.tar.xz" mirror "https://ftpmirror.gnu.org/bison/bison-3.7.3.tar.xz" sha256 "88d9e...
31.435484
94
0.626988
ffc8a8d49ce9ab83254208c2f77ef4b58aea1e3d
857
require 'singleton' module MinimalMatch # Array::Anything. it will always be equal to whatever you compare it to class Anything < MinimalMatchObject include MatchMultiplying # it matches anything OTHER than another minimal matchobject def === who_cares # i think there is a prettier way to do this...
23.162162
74
0.670945
ab7d7b2c64b4f4cc4589dba4d70494326792a726
23,537
require_relative '../utilities/stream_comms' require_relative '../utilities/mob' require_relative 'all' module Paidgeeks module RubyFC module Engine # The game state changer processes all messages that affect the game state. It # is what implements the memoization that allows game playback. As such, ...
41.220665
183
0.541955
0379bfeec333723f74a30939b86ff0b323e3d4f0
137
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_libra_session'
34.25
75
0.80292
334254d0997d616e591140c9a0e62a1476391ed6
22,859
# frozen_string_literal: true require "test_helper" require "database/setup" class ActiveStorage::ManyAttachedTest < ActiveSupport::TestCase include ActiveJob::TestHelper setup do @user = User.create!(name: "Josh") end teardown { ActiveStorage::Blob.all.each(&:delete) } test "attaching existing blobs...
42.253235
127
0.728422
7a75e63fe79937c0b35f1bde9b0b276015e3eedb
2,644
require "rails_helper" class Redis def initialize(config) end end module OkComputer describe RedisCheck do let(:redis_config) do { url: "http://localhost:6379" } end subject { described_class.new(redis_config) } it "is a subclass of Check" do expect(subject).to be_a Check end ...
25.669903
125
0.599092
e2e5287dd7f1e052a6512ef26a86a39e376a5097
92
namespace :samples do task single_id: :environment do Samples.new.single_id end end
15.333333
33
0.75
e894db89188b13d6bf523204fcb405c1033e8226
5,874
class Note < ApplicationRecord class RevertError < Exception ; end attribute :updater_id, :integer attribute :updater_ip_addr, :inet attr_accessor :html_id belongs_to :post belongs_to_creator belongs_to_updater has_many :versions, -> {order("note_versions.id ASC")}, :class_name => "NoteVersion", :depen...
25.876652
171
0.652366
e9dd0b3702293a6b77c6481257bfbe3bc671706d
386
cask 'qgis' do version '3.12.2' sha256 'f7a61f85f4f278eb45d5a84483bea0ca57b344b4ed6f12d3d507927d7ce97234' url 'https://qgis.org/downloads/macos/qgis-macos-pr.dmg' appcast 'https://qgis.org/downloads/macos/qgis-macos-pr.sha256sum', configuration: version.dots_to_underscores name 'QGIS' homepage 'h...
29.692308
75
0.746114
1c792ea6cdab67a7dee1dfcc3161653687630203
92
class ProjectMember < ActiveRecord::Base belongs_to :project belongs_to :teammember end
18.4
40
0.804348
e89e0b9e1bc99b77f5e3af86fae9f1a8cb218d2a
5,337
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
32.150602
91
0.654113
62113f5390d5c38f6c53f381c4c1eca99372b776
1,061
# frozen_string_literal: true module RuboCop module Cop module InSpecStyle # @example EnforcedStyle: InSpecStyle (default) # # linux_kernel_parameter has been deprecated as a resource. Use kernel_parameter instead # class LinuxKernelParameter < Cop MSG = 'Use `kernel_parameter` ...
25.261905
98
0.624882
87706b58586c1fed9ebb07835bd0e2e4944e8915
376
require "bundler/setup" require "omniauth-http-header" 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.exp...
25.066667
66
0.755319
1154f1387adcec15630b2821f5cf8d8e66ee0093
151
class AddRoleIdToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :role_id, :integer add_index :users, :role_id end end
21.571429
53
0.721854
d5772fcbcfc42ec33665687c8a150ac026f56391
6,470
# frozen_string_literal: true module Zoom module Actions module User def user_list(*args) params = Zoom::Params.new(Utils.extract_options!(args)) params.permit(%i[status page_size role_id page_number include_fields next_page_token]) response = self.class.get('/users', query: params,...
48.646617
186
0.689799
7a91c7d60f0d7ca6f5356a02de99c30fc2042cab
44
module MethodSource VERSION = "0.8.2" end
11
19
0.704545
1dfe84d520a73f3b75c2450f041a6328bf9ec716
1,508
require 'rails_helper' RSpec.describe InvoiceValidator do subject { validatable_object } let(:validatable_object) do validatable.new(subtotal: subtotal, invoice_lines: invoice_lines) end let(:validatable) do Class.new do include ActiveModel::Model attr_accessor :invoice_lines, :subtotal ...
22.848485
69
0.62931
f7f05aaf4a409419867e15bec8231cd2f3c4aa5c
585
# frozen_string_literal: true module PriceHubble # The nested PriceHubble property condition object. # # @see https://docs.pricehubble.com/#types-property class PropertyConditions < BaseEntity # Mapped and tracked attributes tracked_attr :bathrooms, :kitchen, :flooring, :windows, :masonry # Define...
27.857143
68
0.71453
0374e9fc93834b270f613c5479e9da29cd897c73
73
require "syncbot/version" module Syncbot # Your code goes here... end
12.166667
26
0.726027
e9410255b421c516649b743bda3ae53674bab45e
5,816
# frozen_string_literal: true require("test_helper") module Bootsnap class KernelTest < Minitest::Test include TmpdirHelper def test_require_symlinked_file_twice setup_symlinked_files if RUBY_VERSION >= "3.1" # Fixed in https://github.com/ruby/ruby/commit/79a4484a072e9769b603e7b4fbdb15b...
27.051163
106
0.622937
1cdf1ee68fdd9a43383841baeccca91b0cb5a24d
4,711
require 'dotenv' Dotenv.load require 'logger' require 'date' require 'timezone' require 'multi_json' require 'restless_router' require 'core_nutrition/client/version' require 'core_nutrition/errors' require 'core_nutrition/logger' require 'core_nutrition/configuration' require 'core_nutrition/connection' require 'cor...
26.615819
98
0.684143
1cbefb80be7894b8e20ce19758822305b52c2d28
2,000
class Suil < Formula desc "Lightweight C library for loading and wrapping LV2 plugin UIs" homepage "https://drobilla.net/software/suil.html" url "https://download.drobilla.net/suil-0.10.10.tar.bz2" sha256 "750f08e6b7dc941a5e694c484aab02f69af5aa90edcc9fb2ffb4fb45f1574bfb" license "ISC" revision 1 head "htt...
35.087719
117
0.7005
798def4deee03814e56ce5c00b3839468a93c3cd
54,952
Vmdb::Application.routes.draw do # grouped routes adv_search_post = %w( adv_search_button adv_search_clear adv_search_load_choice adv_search_name_typed adv_search_toggle ) button_post = %w( button_create button_update ) compare_get = %w( compare_miq compare_to_csv c...
21.516053
164
0.536668
2843da316f38f0e1b7efde3a74947d822ab5c1be
405
class Meth can Track; can Find #=========================properties========================= attr_accessor :type, :name, :url, :documentation #=========================intialize========================== def initialize(type="n/a", name, url) self.type = type self.name = name self.url = url @@...
28.928571
62
0.377778
08e6e4cb728688596b32b52bb2abb0068285428f
1,621
# frozen_string_literal: true require_relative "lib/intercode_client/version" Gem::Specification.new do |spec| spec.name = "intercode_client" spec.version = IntercodeClient::VERSION spec.authors = ["Nat Budin"] spec.email = ["natbudin@gmail.com"] spec.summary = "A Ruby cl...
37.697674
96
0.702036
b900c4bb6be8d20045e488c0bc97436ffd59b150
2,217
### # This Ruby source file was generated by test-to-ruby.xsl # and is a derived work from the source document. # The source document contained the following notice: =begin Copyright (c) 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Auto...
28.792208
113
0.715832
1dd71e6245b147af277344a6896a8720e2879b66
4,179
# Titanic service # # Implements server side of http:#rfc.zeromq.org/spec:9 # # Author: Tom van Leeuwen <tom@vleeuwen.eu> # Based on Python example by Min RK require './mdcliapi2.rb' require './mdwrkapi.rb' require 'pathname' require 'securerandom' require 'json' require 'thread' require 'awesome_print' TITANIC_DIR =...
21.994737
78
0.676717
3964f62ee24beaa5db8a6332fdfc9c57fdadb525
386
module AlertParser module Parser class GrowthTrend < Base def long_term_growth(value, locale) locale.format_percent(value) end def long_term_growth_one_week_ago(value, locale) locale.format_percent(value) end def positive? data[:long_term_growth].to_f > data...
21.444444
80
0.678756
1d4b4bc2f1be7025e5b29cb49164737f0f313baf
213
FactoryGirl.define do factory :index, class: Edgar::Index do data = File.read('spec/support/index.idx') defaults = {} initialize_with { Edgar::Index.new(data, defaults.merge(attributes)) } end end
26.625
74
0.694836
7acee9e78a68387cab221698f6fdbe3f1c2101e2
869
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'cocoapods-ppbuild/gem_version.rb' Gem::Specification.new do |spec| spec.name = 'cocoapods-ppbuild' spec.version = CocoapodsPpbuild::VERSION spec.authors = ['彭懂'] spec...
36.208333
77
0.662831
186cf508c8ff907d3205a86f7186bac6b3984cc4
236
class Sparkbox < Cask version :latest sha256 :no_check url 'http://t.icyblaze.com/sblatest' appcast 'http://matrix.icyblaze.com/index.php/checkupdate/p/8' homepage 'http://www.icyblaze.com/sparkbox' app 'Sparkbox.app' end
21.454545
64
0.724576
91ab2d3ae75cd1005f026b969186c16f50e7ae92
622
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) require File.expand_path('../shared/quo', __FILE__) describe "Numeric#quo" do ruby_version_is ""..."1.9" do it_behaves_like :numeric_quo_18, :quo end ruby_version_is "1.9" do it "returns ...
29.619048
64
0.689711
4a3e21333e8d7f03ad54c7de18f3156a3417e4ce
11,366
# frozen_string_literal: true require "mail_task" RSpec.describe Tasks::ChangeTypeController, :postgres, type: :controller do describe "POST tasks/change_type/:id" do let(:user) { create(:user) } let(:assigner) { create(:user) } let(:root_task) { create(:root_task) } let(:old_instructions) { "Some i...
46.016194
118
0.649305
acf6c1e51e5760baceea6b619b6506cd379cd3b9
1,005
cask "skim" do version "1.6.1,131" sha256 "50139ee146d9bad491bc9de992b9bc1e195810f5119ced08d049037d2c05289e" url "https://downloads.sourceforge.net/skim-app/Skim/Skim-#{version.before_comma}/Skim-#{version.before_comma}.dmg", verified: "downloads.sourceforge.net/skim-app/" name "Skim" desc "PDF reader ...
33.5
118
0.739303
382737b9c13ea6280c8ab44f8efb60242c385119
1,212
require_relative 'boot' 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 "action_cable/engine" # require "sprockets/railti...
32.756757
82
0.766502
625b417e711065d46e58973acac8bd9540a123aa
2,561
# frozen_string_literal: true require 'spec_helper' describe Fondy::Response do before do allow(Fondy::Signature).to receive(:build) .with(params: hash_including, password: 'pass') .and_return('valid_signature') end let(:http_response) do double( status: 200, body: { resp...
23.712963
62
0.615775