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
e8fd2e6e32da5e142253db20b130ce3fc26ffe71
229
require 'dcell/registries/zk_adapter' RSpec.describe DCell::Registry::ZkAdapter, skip: TEST_ADEPTER != 'zk' && "no zookeeper" do subject { DCell::Registry::ZkAdapter.new TEST_DB[:zk] } it_behaves_like "a DCell registry" end
32.714286
90
0.746725
618e2f54d4df4ee36beb1489d5d35446362b649f
132
FactoryGirl.define do factory :carrier do name 'Super Awesome Carrier' sequence(:hbx_carrier_id) { |n| "#{n}" } end end
18.857143
44
0.666667
5d5e94b488128308eb5c64c1023df2c2ac75fe0d
6,602
require 'json' require 'bio' require 'open-uri/cached' require 'nokogiri' require 'awesome_print' require 'securerandom' require 'tty-command' require 'tty-file' require_relative 'org' require_relative 'seqdb' require_relative 'bowtie' module ASO class Seq attr_accessor :id, :seq, :source, :entry_id, :gene_...
23.748201
104
0.595123
4a6238139967a027e14aba90b878d4fcc19495b6
2,117
# frozen_string_literal: true require 'rails_helper' describe 'Donations endpoint' do describe 'GET#totals' do it 'returns a json api compatible response' do get '/api/donations/total', params: { start: Date.today.beginning_of_month.to_s, end: Date.today.to_s } expect(json_hash...
33.603175
106
0.654228
1cbd4c1d06379b4392057746a6e398698ce7b64e
899
Pod::Spec.new do |s| s.name = "SECoreTextView" s.version = "0.6.1" s.summary = "Multi-line rich text view library with clickable links, selectable text, embeding images and editing." s.homepage = "https://github.com/kishikawakatsumi/SECoreTextView" s.l...
44.95
131
0.581758
ed0dd00dc7d974f24280a2b57641e1edc56bbca9
16,689
module Unix::Exec include Beaker::CommandFactory # Reboots the host, comparing uptime values to verify success # @param [Integer] wait_time How long to wait after sending the reboot # command before attempting to check in on the host # @param [Integer] max_connection_tries How many...
39.925837
148
0.659057
ab12637e87dec7144a99cb38bdbd1ee5051f0c4f
1,419
# encoding: utf-8 require 'spec_helper' describe Github::Client::Repos::Keys, '#list' do let(:user) { 'peter-murach' } let(:repo) { 'github' } let(:request_path) { "/repos/#{user}/#{repo}/keys" } before { stub_get(request_path).to_return(:body => body, :status => status, :headers => {:content_type ...
26.277778
71
0.650458
21fc9ce5dc0f334385300f064234336dbfd41ad7
3,776
module Options def self.help puts "HELP. Use rft.rb with following commands: " puts " " puts "### Options Commands with 1 parameter ###" puts "$ ruby RFT/rft.rb -help # displays this info" puts "$ ruby RFT/rft.rb -folder # displays current working path" puts " " puts "### Options Commands...
53.183099
134
0.673729
3394686e751fd55980850d63e9f9f127a06e87e5
1,793
# == Schema Information # # Table name: tags # # created_at :datetime not null # href_translations :hstore default({}), not null # id :integer not null, primary key # name_translations :hstore default({}), not null # priority :integer def...
24.902778
116
0.634133
d5d708b43f2b1485813b8242c8a04bad77ab371e
1,481
# config valid for current version and patch releases of Capistrano lock "~> 3.15.0" set :application, "RicardoMontenegro_portfolio" set :repo_url, "git@github.com:ricardomonte/RicardoMontenegro_portfolio.git" # Default branch is :master # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp # Default deploy_to dire...
34.44186
129
0.733964
1acd8080bfbcd787fa224b266053f7782f9b0f42
1,511
require 'spec_helper' require 'tempfile' require 'tender_spec/coverage_storage' describe TenderSpec::CoverageStorage do subject(:storage) { described_class.new } describe 'descriptions' do context 'when line exist' do it 'returns descriptions' do expect(logger.descriptions(in_line: 'foo.rb:1'))....
27.472727
83
0.614163
1def5c2feac668d982ec8d78f58817663c9eb614
402
# frozen_string_literal: true require "English" module IDidMean def self.call(error) processor = Processor.new(error) processor.call end end at_exit do IDidMean.call($ERROR_INFO) if $ERROR_INFO end require "i_did_mean/error" require "i_did_mean/processor" require "i_did_mean/formatter" if defined?(::...
16.75
43
0.763682
e9e8c417334f5bd79342208e0e440800b20c815c
1,456
class Micropost < ApplicationRecord belongs_to :user default_scope -> { order(created_at: :desc) } validates :user_id, presence: true validates :content, presence: true, length: { maximum: 500 } def init_emotions # IBM Watson NLU Declaration authenticator = IBMWatson::Authenticators::IamAuthenticat...
32.355556
181
0.673077
87ce6d84bb28eaa6dec377bdc72822d9a4776fa1
713
require "bundler/setup" Bundler.require(:default) require "minitest/autorun" require "minitest/pride" require "active_record" logger = ActiveSupport::Logger.new(ENV["VERBOSE"] ? STDOUT : nil) ActiveRecord::Schema.verbose = false unless ENV["VERBOSE"] ActiveRecord::Base.logger = logger ActiveRecord::Base.establish_con...
23
88
0.755961
4a8717dfcc6591c9fba77f4e2fba39c0c3104ae0
79
class Order < ApplicationRecord belongs_to :route has_many :order_item end
15.8
31
0.797468
33be9a55d0c0769f51ac92f8592301ff86facc8d
1,788
# # Copyright:: Copyright (c) 2012-2014 Chef Software, Inc. # 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://www.apache.org/licenses/LICE...
31.368421
90
0.696868
18d64d2c41bb9f6c59a66c5c50bcb1eb1d1d994b
81
# frozen_string_literal: true class DemosController < ApplicationController end
16.2
45
0.851852
d516308900d3dcf95495e0efc3f634f04e0d9910
66
module Journal class ApplicationJob < ActiveJob::Base end end
13.2
40
0.772727
ac701c858f8c0cc52b1e1bdd2450c243854fba9c
1,738
require 'yt/collections/resources' module Yt module Collections class PlaylistItems < Resources def insert(attributes = {}, options = {}) super attributes.merge(playlist_id: @parent.id), options rescue Yt::Error => error ignorable_errors = error.reasons & ['videoNotFound', 'forbidden...
32.792453
85
0.627733
21bf6bdbb09181038931f97440b0b64b1eda5622
820
# frozen_string_literal: true # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
26.451613
74
0.718293
d5cf79b4ad0ebdf8a27f6d143c045588c26b891d
928
module Geo class BaseNotify include HTTParty # HTTParty timeout default_timeout Gitlab.config.gitlab.webhook_timeout def notify(notify_url, content) response = self.class.post(notify_url, body: content, headers: { ...
32
110
0.577586
03393cd7283c457c588c97e65259494b75cd6968
1,211
# 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 require 'aws-sdk-core' require 'aws-sigv4' require_relative 'aws-sdk-qldbsession/types' require_relative 'aws-s...
25.229167
87
0.750619
ac71932830bd55b8c83305c2caff87e36d5d83b5
25
# typed: true %{#@@1}
6.25
13
0.4
333d3a3bdec85f3387bed59d822294e9bd74e588
2,535
# -*- encoding: utf-8 -*- # stub: msgpack 1.3.3 ruby lib # stub: ext/msgpack/extconf.rb Gem::Specification.new do |s| s.name = "msgpack".freeze s.version = "1.3.3" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] ...
46.944444
216
0.658777
aca7579d306a5309f38db5d0a686e1a8091ee978
522
class FollowsController < ApplicationController def import_from_facebook facebook = Authorization::Assertion::Facebook.new(params[:assertion]) render json: serialize_follows(facebook.auto_follows) end def serialize_follows(follows) serializer.serialize_to_hash(wrap_in_resources(follows)) end def...
27.473684
74
0.777778
625a1465bd9ba933670c299b75fdddb1cde7dd8b
3,586
# XXX eval not supported #require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' #require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/classes' # #describe "Kernel#instance_eval" do # it "expects a block with no arguments" do # lambda { "hola".instance_eval }....
31.45614
92
0.648076
d5f5a0a49c9422f2d1e015948ec29d44154054fa
480
cask 'font-sanfrancisco-pro' do version :latest sha256 :no_check url 'https://developer.apple.com/fonts/downloads/SFPro.zip' name 'San Francisco Pro Fonts' homepage 'https://developer.apple.com/fonts/' pkg 'SFPro/San Francisco Pro.pkg' caveats <<~EOS The Apple San Francisco font is to be used solel...
28.235294
68
0.73125
015889d856b6ee2af0abac57f42bd41e33a17097
1,509
# Copyright 2015 Sergey Bahchissaraitsev # 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 ...
35.093023
84
0.723658
395a8adec5d21d56932b026f0afd5170e2539501
723
FactoryBot.define do factory :borrow_policy do sequence(:code, "b") name { "Policy ##{code.upcase}" } duration { 7 } fine_cents { 100 } fine_currency { "USD" } fine_period { 1 } renewal_limit { 2 } description { "What this policy is used for" } uniquely_numbered { true } member...
21.909091
50
0.59751
877225a574adc3eb71c13bbafa22e7918a954d1c
377
# frozen_string_literal: true require 'json' require_relative 'base' require_relative 'mergable' module GDK module ConfigType class Hash < Base include Mergable def parse value.is_a?(::Hash) end private def mergable_merge(fetched, default) Hash(fetched).merge(def...
15.708333
59
0.657825
edf5b441dd6e5fe424ae0155922fcfaee2133840
219
# This model is here for the generators' specs class Octopussy < PARENT_MODEL_CLASS include Mongoid::Document if DEVISE_ORM == :mongoid devise :database_authenticatable, :validatable, :confirmable, :encryptable end
36.5
76
0.799087
629f59ea3736bdf3c25fe285c31c1d02e8d655d9
437
# 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...
43.7
111
0.716247
03df9d976e3fd0fb771158141a3dc7a739df979a
451
require 'rails_admin/config/fields/base' module RailsAdmin module Config module Fields module Types class Integer < RailsAdmin::Config::Fields::Base # Register field type for the type loader RailsAdmin::Config::Fields::Types::register(self) @view_helper = :number_fiel...
21.47619
59
0.620843
396e18ef1d270ad52b68165c90e2ef7e6839ae98
1,136
require "spec_helper" describe Filters::TextFilter do subject(:text_filter) { Filters::TextFilter.new(facet, params) } let(:facet) { double } let(:params) { nil } describe "#active?" do context "when params is nil" do it "should be false" do expect(text_filter).not_to be_active ...
20.654545
66
0.588028
ed93e4d0ddbc64b1acbbc679abdd32991c5077e5
72
module ActiveStorage module Openstack VERSION = '1.5.2' end end
12
21
0.694444
7aa18c42ea8ad5456bc4b103d7ed7fce877f827c
7,549
## # This module requires Metasploit: http//metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpClient def initialize(info = {}) super(update_info(i...
37.371287
108
0.581666
917ce42cb364952746272ef35528fdaf5a803532
3,865
require "google/apis/analytics_v3" require "googleauth" describe GoogleAnalytics::AnalyticsExportService do let(:service) { Google::Apis::AnalyticsV3::AnalyticsService.new } let(:authorizer) { Google::Auth::ServiceAccountCredentials.new } let(:data) { "ga:dimension36,ga:dimension37\n'www.google.com','OK'\n" } ...
30.674603
107
0.667788
4adad527c2f9946bed3024e0f47a42557848e1b0
1,036
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this f...
29.6
63
0.722008
184ac945e48e839a2835665e527e7ccc99446222
3,844
class Pocketknife # == Error # # Superclass of all Pocketknife errors. class Error < StandardError # == InvalidTransferMechanism # # Exception raised when given an invalid transfer mechanism, e.g. not :tar or :rsync. class InvalidTransferMechanism < Error # @return [Symbol] Transfer mechan...
30.507937
118
0.647763
629610c02e33b3d4813730da517a60ab15c0ef29
1,551
class GitAnnex < Formula desc "Manage files with git without checking in file contents" homepage "https://git-annex.branchable.com/" # Check [hackage] page for new versions # # [hackage]: https://hackage.haskell.org/package/git-annex # # Use `strings git-annex.linux/shimmed/git-annex/git-annex` to find t...
31.02
101
0.691812
2125dbf7100eb34dbe968fd82e315e12ad13d10c
3,282
require 'spec_helper' describe "Settings page" do before do @user = FactoryGirl.create(:user) sign_in @user visit settings_path end it "has the right settings fields" do expect(page).to have_link('change', href: 'http://gravatar.com/emails') expect(page).to have_field "Name", with: @user.ful...
25.053435
75
0.688909
619cbce29785639ec9227bd92a91437ac134cb72
413
cask "terraform-0.15.0-alpha20210107" do version "0.15.0-alpha20210107" name "Terraform" homepage "https://www.terraform.io/" case Hardware::CPU.arch when :x86_64 url "https://releases.hashicorp.com/terraform/0.15.0-alpha20210107/terraform_0.15.0-alpha20210107_darwin_amd64.zip" sha256 "91d1c9424968c...
27.533333
119
0.769976
ed1b36223e2cade830dcbd7c1d98c5c9776f1e82
3,769
# 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. require 'uri' require 'cgi' require 'date' require 'json' require 'base64' require 'erb' require 'securerandom' require 'time' require 'timeliness' require ...
76.918367
165
0.66649
4af92959e39271bb34cae158d742b36cdaf87ecb
848
require 'test_helper' class RelativeTest < Minitest::Test def test_it_takes_nil_safely refute FasterPath.relative? nil end def test_it_knows_its_relativeness refute FasterPath.relative? '/' refute FasterPath.relative? '/a' refute FasterPath.relative? '/..' assert FasterPath.relative? 'a' ...
27.354839
62
0.700472
e8ad9ebea58a44e41065ded860e0430bb6acfbe5
591
module Scorm2004 module Manifest class Map include VisitorPattern include Attributes # @attribute [r] target_id # @return [String] The +targetID+ attribute of <map> attribute :any_uri, 'targetID' # @attribute [r] read_shared_data # @return [Boolean] The +readShare...
28.142857
66
0.658206
5d9e0a11cb67cd628424f89fed5d3dba345a1426
1,786
# # 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 ...
30.793103
100
0.701568
086a36af333fafa27d0ff540daaf6cb033ffaa41
374
describe :queue_num_waiting, shared: true do it "reports the number of threads waiting on the queue" do q = @object threads = [] 5.times do |i| q.num_waiting.should == i t = Thread.new { q.deq } Thread.pass until q.num_waiting == i+1 threads << t end threads.each { q.enq ...
22
60
0.604278
037f28c5c59b7a278f547a4c8806b9e5a8bddecd
776
require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) Pod::Spec.new do |s| s.name = 'ABI33_0_0UMReactNativeAdapter' s.version = package['version'] s.summary = package['description'] s.description = package['description'] s.license = package['lic...
31.04
67
0.641753
1a295408e71fefc3c536b57743aa832bc98914cc
19,287
#-- 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 ChiliProje...
34.318505
121
0.712397
337a76de42eb5ec9185f07d88847d43615c8e614
5,746
#-- 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...
33.602339
123
0.687609
38013fe8d846496376581f609b15db24f9ef97f4
6,750
require 'spec_helper' describe Travis::Yml::Web::App do include Rack::Test::Methods let(:app) { described_class } let(:status) { last_response.status } let(:headers) { last_response.headers } let(:body) { Oj.load(last_response.body) } let(:params) { {} } describe 'GET /' do it 'is ok' do ...
24.816176
129
0.463111
26a7b66a6f5fc68042ffc9d4b4d01f3a44964f49
1,796
# frozen_string_literal: true RSpec.describe RuboCop::Cop::Rails::Exit, :config do subject(:cop) { described_class.new } it 'registers an offense for an exit call with no receiver' do expect_offense(<<-RUBY.strip_indent) exit ^^^^ Do not use `exit` in Rails applications. RUBY end it 'regi...
28.0625
80
0.654232
878a001f5b6d0dd7e56a96a7b47a685ad45b0967
186
#Kata: Triangular Treasure #URL: https://www.codewars.com/kata/525e5a1cb735154b320002c8 # Return the nth triangular number def triangular( n ) n < 0 ? 0 : (0..n).reduce(&:+) end
26.571429
61
0.688172
872a05fe2a9425a1a833a0edeb52164da2b441b7
892
require 'radmin/fields/types/text' module Radmin module Fields module Types class Wysihtml5 < Radmin::Fields::Types::Text Radmin::Fields::Types.register(self) register_property :partial do :form_wysihtml5 end # # If you want to have a different toolbar configurat...
28.774194
86
0.632287
18bc0dd1cea9a59e110049cf7c5fdecc5a142424
5,522
# frozen_string_literal: true require "spec_helper" RSpec.describe Git::Cop::Commits::Unsaved, :git_repo do let(:path) { "#{Bundler.root}/spec/support/fixtures/commit-valid.txt" } subject { described_class.new path: path } describe "#initialize" do it "raises base error for invalid path" do result = ...
27.888889
88
0.604129
1cc4855aace460798cadd7253fedfab2a64181d8
2,292
# frozen_string_literal: true # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
32.28169
96
0.58377
acf986d598bd4ad274ee6cf8ad8cb801be016901
1,284
require 'spec_helper' require 'ddtrace' RSpec.describe Datadog::Context do subject(:context) { described_class.new(options) } let(:options) { {} } let(:tracer) { ::Datadog::Tracer.new(writer: FauxWriter.new) } describe '#current_root_span' do subject(:current_root_span) { context.current_root_span } ...
27.319149
82
0.59891
f8150b492eb31a4bd8560e24ac02e912c99d29ac
557
cask "eclipse-testing" do version "4.17.0,2020-09:R" sha256 "e16ecbea12c3a71f64aa5f1bc16076563f1e1e62e84bd96b930e051fdd22b4b2" url "https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/#{version.after_comma.before_colon}/#{version.after_colon}/eclipse-testing-#{version.after_comm...
46.416667
255
0.780969
387703ecf75be7a5836eceb13b04da437bf64fb3
654
Spree::Api::TaxonsController.class_eval do def products taxon = Spree::Taxon.find(params[:id]) @products = taxon.products.ransack(params[:q]).result @products = @products.reorder(available_on: :asc) if params[:sort_by] == 'date_asc' if params[:filter_by_seller].present? property = Spree::Propert...
43.6
120
0.70948
38abba4be55ff304a4f9f17611f90c4f63c9d3be
2,911
# frozen_string_literal: true require 'rails_helper' RSpec.describe PriceEntity, type: :entity do subject(:serializable_hash) { described_class.new(resource).serializable_hash } let(:resource) { build(:price) } it 'exposes base_price' do money_hash = MoneyEntity.represent(resource.base_price).serializable...
29.11
96
0.739265
6263f54753e5e2e3e422611f1fc247c2cf47ab9f
53
class Brand < ApplicationRecord has_many :model end
13.25
31
0.811321
331b4c4876b2f3f0042314ded1b947393d3a8683
56,801
require "rails_helper" describe Reports::RegionSummarySchema, type: :model do using StringToPeriod let(:organization) { create(:organization, name: "org-1") } let(:user) { create(:admin, :manager, :with_access, resource: organization, organization: organization) } let(:range) { (july_2018..june_2020) } let...
77.596995
196
0.744159
7a0682132d6f3c848cfc12eed8f46d9f70d55a9f
716
Pod::Spec.new do |s| s.name = "lucie_labs_gloves06" s.version = "0.01" s.summary = "iOS SDK for Lucie Labs XRAY platform interaction" s.homepage = "https://lucielabs.com" s.authors = "Lucie Labs" s.platform = :ios, "9.0" s.source = { :http => "https://specs.lucielabs.com/#{s.name}/#{s.version}/#{s.name}.z...
44.75
126
0.677374
f81627ea9fc40a9bd41b3b5193b8065b24331b63
10,075
require 'spec_helper' require 'flapjack/gateways/jsonapi' describe 'Flapjack::Gateways::JSONAPI::Methods::Tags', :sinatra => true, :logger => true, :pact_fixture => true do include_context "jsonapi" let(:tag) { double(Flapjack::Data::Tag, :id => tag_data[:id]) } let(:tag_2) { double(Flapjack::Data::Tag, :id ...
33.250825
114
0.629181
3825277bec5dd5e782c0390725cbb4c05022ac1b
1,399
# -*- encoding: utf-8 -*- # stub: net-dns 0.8.0 ruby lib Gem::Specification.new do |s| s.name = "net-dns".freeze s.version = "0.8.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Marco Ceresa".fre...
37.810811
112
0.66619
f75d15b117e46cb1811a20b33fc5d89e1c6ffa9a
5,130
require 'rubygems/test_case' require 'rubygems' require 'rubygems/rdoc' class TestGemRDoc < Gem::TestCase def setup super @a = quick_spec 'a' @rdoc = Gem::RDoc.new @a begin Gem::RDoc.load_rdoc rescue Gem::DocumentError => e skip e.message end Gem.configuration[:rdoc] = ni...
20.853659
73
0.689279
264b565685c65f8c6d4242d8f48a873ce807ba60
274
class AddIsShowListAndIsShowDetailToErpProductsProperties < ActiveRecord::Migration[5.0] def change add_column :erp_products_properties, :is_show_list, :boolean, detail: false add_column :erp_products_properties, :is_show_detail, :boolean, detail: false end end
39.142857
88
0.810219
6294d6a56d4187a01b3220ef63a2f862eac13b70
1,444
require_relative '../../sequence_base_extension' module Inferno module Sequence class ConfirmQuestionnaireSequence < SequenceBaseExtension title 'Confirm Questionnaire Sequence' description "Verify that the server's Questionnaires conform to HL7 standards" test_id_prefix 'cqs' requires ...
28.88
156
0.642659
f8aa0fac081bd6ec496f429ad667c14c5040233a
7,933
class Person < ApplicationRecord has_many :users has_many :nicknames, as: :nicknameable has_many :addresses, as: :addressable has_many :phones, as: :phoneable has_many :emails, as: :emailable accepts_nested_attributes_for :nicknames accepts_nested_attributes_for :addresses accepts_nested_attributes_for...
28.638989
107
0.655616
acc430b803f5e2b8d415d5160657deb22e68b37c
6,716
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic...
36.699454
245
0.674806
6ade55e4a8a22472cc8274b698df0577370a6b63
246
# frozen_string_literal: true class ProgramAcceptanceDrop < Liquid::Drop delegate :enrollment_agreement_url, to: :@program_acceptance, allow_nil: true def initialize(program_acceptance) @program_acceptance = program_acceptance end end
27.333333
79
0.808943
0840b9bca1534afaadf2662b6f58a0a80926fff0
3,627
# # Author:: Adam Edwards (<adamed@chef.io>) # # Copyright:: Copyright 2014-2016, Chef Software 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 # # http://www.apache.org/licenses/LIC...
26.866667
138
0.589744
abc0d0727d779633ae937f98c94f2b3a3152a24a
539
Pod::Spec.new do |s| s.name = "FaveButton" s.version = "2.0.3" s.summary = "Twitter's heart like animated button written in Swift" s.license = 'MIT' s.homepage = 'https://github.com/xhamr/fave-button' s.author = { 'Jansel Valentin' => 'jvra16@gmail.com' } s.ios.depl...
33.6875
98
0.586271
086ec686f7ed53d636a7a18835b7478ed8e07f52
376
ActiveAdmin.register Sensor do permit_params :device_id, :description, :external_id form do |f| f.input :device, as: :select, collection: Device.all.map { |u| [u.name, u.id] }, include_blank: false f.input :descri...
26.857143
69
0.518617
28fff85cf9e557c9acabd6558347043ca839fae5
1,337
Pod::Spec.new do |s| s.name = 'mosquitto_ios' s.version = '2.0.11.1' s.summary = 'Publish to CocoaPods.' s.description = <<-DESC Eclipse Mosquitto - An open source MQTT broker DESC s.homepage = 'https://github.com/RengeRenge/mosquitto_ios.git...
29.711111
129
0.60359
38d40a47432f7017c17d1353deda556bc28d3a9e
2,031
# frozen_string_literal: true require 'spec_helper' describe Bosh::AzureCloud::InstanceTypeMapper do subject { described_class.new } context 'when no possible VM sizes are found' do let(:desired_instance_size) do { 'cpu' => 3200, 'ram' => 102_400 } end let(:available_vm_si...
21.83871
103
0.557361
7af43962755ddea39dca3319463e0ae27e115ec0
12,257
module ActiveMerchant #:nodoc: module Billing #:nodoc: # The Mercury gateway integration by default requires that the Mercury # account being used has tokenization turned. This enables the use of # capture/refund/void without having to pass the credit card back in each # time. Only the "OneTime" token...
35.630814
142
0.597455
e2b8611b5d756b9ca0f260bff99bb6da1909a14d
425
# frozen_string_literal: true module Overcommit::Hook::PreCommit # Runs LicenseFinder if any of your package manager declaration files have changed # See more about LicenseFinder at https://github.com/pivotal/LicenseFinder class LicenseFinder < Base def run result = execute(command) return :pass ...
26.5625
84
0.72
878aa018da34eeaf5f7bc5a9df6dac98c03db4cc
2,758
# typed: true module KubeDSL class ResourceMeta include StringHelpers attr_reader :ref ,:inflector, :fields def initialize(ref, inflector) @ref = ref @inflector = inflector @fields = {} end def external? false end def empty? fields.size.zero? end ...
23.57265
134
0.494199
6a0cbde0e99bedeb8eebe3fe7503502b78114674
1,490
require "formula" class Cardpeek < Formula homepage "http://pannetrat.com/Cardpeek/" stable do url "http://downloads.pannetrat.com/get/302b8a00996e9f4180ad/cardpeek-0.8.3.tar.gz" mirror "https://raw.githubusercontent.com/DomT4/LibreMirror/master/Cardpeek/cardpeek-0.8.3.tar.gz" sha1 "8cc9c0652f0214ec06...
32.391304
162
0.722819
6aa7169ba65ccebdc8fa541bc46b0e28068a51db
388
# frozen_string_literal: true class WeeklyMailer < ApplicationMailer def notify user = params[:user] @weekly_selection = params[:weekly_selection] if params[:preview] || email_notifications?(user) locale = user.english? ? :en : :'zh-CN' I18n.with_locale(locale) do mail(to: user.email,...
25.866667
67
0.680412
79eec88d2722a8adbee36e306dfceb0e65fcd728
5,467
# frozen_string_literal: true Given(/^the user is on FAA Household Info: Family Members page$/) do login_as consumer, scope: :user hbx_profile = FactoryBot.create(:hbx_profile, :open_enrollment_coverage_period) hbx_profile.benefit_sponsorship.benefit_coverage_periods.each do |bcp| ivl_product = FactoryBot.cr...
44.08871
155
0.730199
111931c61e12141021911c0ae889888da59117ab
138
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr VERSION = '6.7.0' end
15.333333
44
0.710145
5db7556f843ce2e8ec02158e59842220e4bc88aa
2,045
module Clarifai module Rails class Error < StandardError def initialize(code, text) @error_code = code @error_text = text end def code @error_code end def message @error_text end def self.detector(status_code) error = case stat...
33.52459
143
0.557457
91bb951e547e59e1ddb7056ec82521e6fa53be57
10,573
=begin #Kubernetes #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.13.4 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.2.3 =end require 'date' module Kubernetes # A StatefulSetSpec is the...
38.169675
537
0.672846
28d3936487f784c3982c373dc66e6351a896c7f1
6,754
module RSpec module Expectations # @private class FailureAggregator attr_reader :block_label, :metadata def aggregate RSpec::Support.with_failure_notifier(self) do begin yield rescue ExpectationNotMetError => e # Normally, expectation failures w...
34.635897
102
0.650874
03ca605eb1819fd8b4328e69432554f49a328dff
2,771
# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/ads/googleads/v9/services/campaign_label_service.proto for package 'Google.Ads.GoogleAds.V9.Services' # Original file comments: # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use th...
37.445946
178
0.607723
2150ab2e6b4a76fe930cc26c798e4a388d642197
888
module Admin class AccountsController < BaseController load_and_authorize_resource def index @q = Account.includes(:registrar).ransack(params[:q]) @accounts = @q.result.page(params[:page]) @accounts = @accounts.per(params[:results_per_page]) if paginate? render_by_format('admin/accou...
28.645161
81
0.55518
5dc3d44a3b9e1222f0adf9e88035bc9db18abc08
160
# Test hook plugin # Jekyll::Hooks.register :pages, :pre_render do |page, payload| puts "Firing :pages, :pre_render from : " + File.basename(__FILE__) end
17.777778
69
0.70625
0335e7d685732c4d39315075927ded5cfe428e35
436
# frozen_string_literal: true require_relative 'lib/bar/version' Gem::Specification.new do |s| s.name = 'bar' s.version = Bar::VERSION s.platform = Gem::Platform::RUBY s.authors = ['Nicolas Rodriguez'] s.email = ['nicoladmin@free.fr'] s.homepage = 'https://github.com/n-rodriguez...
24.222222
54
0.616972
333f87a6afb7bee27b544cc96f35898b0b595224
544
require 'awestruct/handler_chain' require 'awestruct/handler_chains' describe Awestruct::HandlerChains do it "should perform matching in-order" do chains = Awestruct::HandlerChains.new(false) chain1 = Awestruct::HandlerChain.new( /foot/ ) chain2 = Awestruct::HandlerChain.new( /foo/ ) chain3 = Awe...
20.923077
50
0.667279
f8a027d837660c5b80c2bf52339f898ba4673126
3,117
require 'test_helper' module C32 class ProviderImporterTest < MiniTest::Unit::TestCase def setup Provider.all.each(&:destroy) @doc = Nokogiri::XML(File.new("test/fixtures/provider_importer_sample.xml")) @doc.root.add_namespace_definition('cda', 'urn:hl7-org:v3') @nist_doc = Nokogiri::XM...
35.420455
82
0.708053
1dcc3d6fe261c7bef16e058d4ce6be1cd8298059
955
require_relative 'words_base_test' require_relative '../../../../lib/tyrano_dsl/export_tyrano/words/set_character_stance' class ExportTyranoWords::SetCharacterStanceTest < ExportTyranoWords::WordsBaseTest def setup super @set_character_stance = TyranoDsl::ExportTyrano::Words::SetCharacterStance.new end ...
38.2
114
0.722513
bbc57d2ba6e4daa14c97230fb455c2341365925d
1,319
# frozen_string_literal: true module Onebox module Engine class VimeoOnebox include Engine include StandardEmbed matches_regexp(/^https?:\/\/(www\.)?vimeo\.com\/\d+/) requires_iframe_origins "https://player.vimeo.com" always_https WIDTH ||= 640 HEIGHT ||= 360 d...
24.425926
97
0.547384
e935b723c85de4dc937c259ab7f0858435dd0738
664
require 'test/helper' class ValidateAttachmentPresenceMatcherTest < Test::Unit::TestCase context "validate_attachment_presence" do setup do reset_table("dummies") do |d| d.string :avatar_file_name end @dummy_class = reset_class "Dummy" @dummy_class.has_attached_file :avatar ...
27.666667
69
0.712349
7afc06bce6234a90f2cef00efd21c475cd8ba382
4,348
# typed: strict # frozen_string_literal: true require "constant_resolver" module Packwerk # Holds the context of a Packwerk run across multiple files. class RunContext extend T::Sig DEFAULT_CHECKERS = T.let([ ::Packwerk::ReferenceChecking::Checkers::DependencyChecker.new, ::Packwerk::Referenc...
31.507246
116
0.684683
4a2eb1df839840bfb87bf760c27e892e6eddfbc3
3,232
# frozen_string_literal: true module RuboCop module Cop module Performance # This cop is used to identify usages of `count` on an `Enumerable` that # follow calls to `select` or `reject`. Querying logic can instead be # passed to the `count` call. # # @example # # bad ...
32.32
87
0.506807
1a051809af6a0c23346636d684208ad9fc634c19
75
class ChangeDatatype < ActiveRecord::Migration def change end end
12.5
46
0.733333
6253d207d1d29e3a3f890e87ad7c0bd2331f7d7c
15,002
require "rails_helper" require "generators/administrate/dashboard/dashboard_generator" describe Administrate::Generators::DashboardGenerator, :generator do around do |example| ActiveRecord::Migration.suppress_messages do example.run end end describe "dashboard definition file" do it "has valid...
29.765873
80
0.60112
1cd850b30133da96c7321560554af653694c7c7e
734
require 'gce_metadata' module GCEMetadata module HttpClient def self.extended(obj) obj.open_timeout_sec ||= DEFAULT_OPEN_TIMEOUT obj.read_timeout_sec ||= DEFAULT_READ_TIMEOUT end DEFAULT_OPEN_TIMEOUT = 5 DEFAULT_READ_TIMEOUT = 10 attr_accessor :open_timeout_sec attr_accessor :re...
24.466667
61
0.658038