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
acfd9dab51a7c02cffd95f3b2cbee44739c12495
747
cask "bandage" do version "0.8.1" sha256 "13e90e5824b61bd4abe62afa8785a28627714bf7a3d4dad3edb4b8f9854d3b6d" url "https://github.com/rrwick/Bandage/releases/download/v#{version}/Bandage_Mac_v#{version.dots_to_underscores}.zip", verified: "github.com/rrwick/Bandage/" name "Bandage" desc "Bioinformatics A...
32.478261
120
0.729585
5d4a8ffe0a78b86d7818ded73301369372f0489f
8,972
#! /usr/bin/env ruby # Copyright 2014 Frank Breedijk, Zate Berg, Trelor, Alex Smirnoff # # 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 # # Unles...
27.606154
115
0.604882
281de5bdc28360d3e637d1c30eb46a2f24330c4b
2,221
class Caddy < Formula desc "Powerful, enterprise-ready, open source web server with automatic HTTPS" homepage "https://caddyserver.com/" url "https://github.com/caddyserver/caddy/archive/v2.4.4.tar.gz" sha256 "0ea7b65406c77b2ce88cdf496e82b70838c78305659fa5c891ef004dfabcc17a" license "Apache-2.0" head "https...
34.169231
122
0.70824
5d11646c85f98539921a513e72b6fd81bbb27768
7,492
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. require 'date' # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength module OCI # A base request type containing common criteria for searching for resources. # This class has direct subclasses. If you are using this cl...
38.420513
255
0.696343
abaf5ec0af46027c57bb7ed9a10f15901f3f3b24
39
# typed: strong module UsersHelper end
9.75
18
0.794872
03f01d2e5c0c0595c72691743a7b664f527245dc
107
Fabricator :link do name { Faker::Company.name } url { "http://#{Faker::Internet.domain_name}" } end
26.75
51
0.654206
212bbf564912da5d53a86c5ec59b430782561e1a
5,285
require 'spec_helper' module ROF::Translators describe "translate CSV" do it "requires rows to have an owner and type" do s = %q{type,owner Work, } expect{CsvToRof.call(s)}.to raise_error(ROF::Translators::CsvToRof::MissingOwnerOrType) end it "deocdes the access field into rights...
33.238994
128
0.508231
1c01d9bf7f6cf2aec04a0483fbfd42ac96335e9a
1,433
module PageObjects module Pages module Admin module Cases class NewFOIPage < PageObjects::Pages::Base set_url '/admin/cases/new/foi' sections :notices, '.notice-summary' do element :heading, '.notice-summary-heading' end section :page_heading, ...
34.119048
76
0.636427
79c475bbc898f371482144480158bcc10478907d
111
require 'resque/tasks' ENV["QUEUE"] = "*" task "resque:setup" => :environment task "jobs:work" => "resque:work"
27.75
35
0.666667
1cb13a362d95b51b0ae4eb88a2675a054e318ced
928
# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "jekyll-minimagick/version" Gem::Specification.new do |s| s.name = "jekyll-minimagick" s.version = Jekyll::Minimagick::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Roger López"] s.email = ["roger@...
37.12
86
0.639009
6a5e2c3978815d111b1e889c14e5a1e859def844
1,556
lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "link_to/version" Gem::Specification.new do |spec| spec.name = "link_to" spec.version = LinkTo::VERSION spec.authors = ["yamitake"] spec.email = ["take.yapr@gmail.com"] sp...
40.947368
202
0.67545
61ca5206ff721e5553ecb2c70cad059bd72fcb23
120
class Current < ActiveSupport::CurrentAttributes # makes Current.user accessible in view files. attribute :user end
24
48
0.791667
e834f73d845f409d02670281c129865cc26391b7
525
require "test_helpers" class TestTags < RSpecQTest def test_inclusion_filter queue = exec_build("tagged_suite", "--tag=slow") assert_processed_jobs [ "./spec/tagged_spec.rb", ], queue assert_equal 1, queue.example_count end def test_exclusion_filter queue = exec_build("tagged_suite",...
20.192308
65
0.699048
338c856588e3b6a0977d9a34db63fb0ab056a975
377
class SessionsController < ApplicationController def new; end def create user = User.find_by_username(params[:username]) if user session[:user_id] = user.id redirect_to root_path else render 'new' end end def destroy session[:user_id] = nil redirect_to root_path flash...
19.842105
77
0.681698
082be1f7e1165915d411f86d6c57e6d9d78fc523
5,183
# frozen_string_literal: true module API class Wikis < ::API::Base helpers ::API::Helpers::WikisHelpers feature_category :wiki helpers do attr_reader :container params :common_wiki_page_params do optional :format, type: String, values: Wiki::VALID_USER_MARKUPS.k...
32.597484
150
0.60274
5d43f8dc98052e172aa8c89badbe4ed535d3f193
124
RSpec.describe Threadfix::Cli do it "has a version number" do expect(Threadfix::Cli::VERSION).not_to be nil end end
20.666667
49
0.725806
910c4c0bd394d598e89aed91e0d961bd4e425887
250
module Admin module V1 module Types class BaseObject < GraphQL::Schema::Object edge_type_class(Types::BaseEdge) connection_type_class(Types::BaseConnection) field_class Types::BaseField end end end end
20.833333
52
0.676
38b636e4e5a36c9bf5272f2f30f8246bd4b03ec8
3,071
# frozen_string_literal: true module Gitlab module Diff module FileCollection class Base include Gitlab::Utils::StrongMemoize attr_reader :project, :diff_options, :diff_refs, :fallback_diff_refs, :diffable delegate :count, :size, :real_size, to: :raw_diff_files def self.d...
28.700935
112
0.590361
79c7251f01af27cb4d9d12b722a96e84148e3236
51
describe :string_unpack_taint, shared: true do end
17
46
0.823529
f737f3665f87e20c9a79120adc4cfe5c2dfa5130
855
ActiveAdmin.register BadgeClaim do menu priority: 99 permit_params :badge_id, :user_id filter :badge action_item :create_many, only: :index do link_to 'Create Many', admin_utilities_path end form do |f| f.semantic_errors(*f.object.errors.keys) f.inputs do f.input :badge f.input :u...
17.44898
47
0.616374
3397b657c88f5fa0a62e5ed6950cc47357cb110b
1,401
class ApplicationMailbox < ActionMailbox::Base # Last part is the regex for the UUID # Eg: email should be something like : reply+6bdc3f4d-0bec-4515-a284-5d916fdde489@domain.com REPLY_EMAIL_USERNAME_PATTERN = /^reply\+([0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12})$/i def self.reply_mail? ...
29.808511
123
0.66167
28f12288b8fa1e3b323b44b1397b4ce27803da7f
4,711
# frozen_string_literal: true module Blackjack class Console def self.print_logo logo = <<~LOGO =========================================================================== 888888b. 888 888 d8b 888 888 "88b 888 888 ...
32.489655
98
0.560603
e9276a60e201a9b85e09bc0af339a823a5e74237
2,008
class WorkItemStatesController < ApplicationController respond_to :html, :json before_action :authenticate_user! before_action :set_item_and_state, only: [:show, :update] before_action :init_from_params, only: :create after_action :verify_authorized def create authorize @state_item respond_to do |f...
26.773333
106
0.679283
e95be460b2e33f758ba500b270398d51518bcc4f
10,132
# frozen_string_literal: true require_relative '../test_helper' # rubocop:disable Metrics/ClassLength class GenericSortFilterTest < ActiveSupport::TestCase subject { GenericSortFilter } let(:query) { Offer.where('1 = 1') } let(:invalid_query) { OpenStruct.new } describe '#snake_case_contents' do it 'shoul...
37.25
80
0.639262
26ecb26970d943bd42012d43b875823659409f28
2,154
# -*- encoding: utf-8 -*- # stub: websocket-driver 0.6.5 ruby lib # stub: ext/websocket-driver/extconf.rb Gem::Specification.new do |s| s.name = "websocket-driver".freeze s.version = "0.6.5" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.requir...
43.959184
112
0.668059
5d887dd8dd81c473630c115d3fbb67358dd3dc42
8,323
=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-ap...
19.400932
177
0.515199
08857831b4b8fa7a61d11d19bd1bc1b38ab3323d
2,936
module Jekyll module Paginate class Pagination < Generator # This generator is safe from arbitrary code execution. safe true # This generator should be passive with regard to its execution priority :lowest # Generate paginated pages if necessary. # # site - The Site. ...
32.622222
93
0.553815
0136deaccac61ac6d26c0da85410f2c28529d636
675
require 'spec_helper' describe "FriendlyForwardings", :type => :request do describe "GET /friendly_forwardings", :type => :request do it "should forward to the requested page after signin" do user = FactoryBot.create(:user) visit edit_user_path(user) fill_in :email, :with => user.email ...
29.347826
61
0.671111
ab13830922f5383e53bd67820bc738a6c15e97ba
2,504
require 'socket' require 'syslog_protocol' module RemoteSyslogSender class Sender # To suppress initialize warning class Packet < SyslogProtocol::Packet def initialize(*) super @time = nil end end attr_reader :socket attr_accessor :packet def initialize(remote_ho...
30.536585
119
0.59385
61b422f72e67279afff9cd8bc49e35cea7d07312
1,715
class AddInfoAboutLastTransferRequestOnBalance < ActiveRecord::Migration def up execute %Q{ CREATE OR REPLACE VIEW "1".balances as select id as user_id, balance.amount as amount, last_transfer.amount as last_transfer_amount, last_transfer.created_at as last_transfer_created_at...
33.627451
97
0.568513
182a3c4b56ecde4f58f10258caeea922035153f0
944
# == Schema Information # Schema version: 16 # # Table name: items # # id :integer not null, primary key # type :string(255) not null # title :string(255) not null # project_id :integer # role_id :integer not null #...
32.551724
61
0.48411
1d7399f58eff5e168c65bfe41d0a5c12c93b965a
338
# frozen_string_literal: true module Fourier module Services module Test module Tuist class Unit < Base def call Utilities::System.system( "swift", "test", "--package-path", Constants::ROOT_DIRECTORY ) end end end ...
18.777778
57
0.517751
11328edbda46ca15905a685c480a786d266ba551
3,843
# == Schema Information # # Table name: papers # # id :integer not null, primary key # uid :text not null # submitter :text # title :text not null # abstract :text not null # author_comments :text # msc_class :text...
31.760331
84
0.617486
388bf2ca5a653ae3af4a729a6e3b4372dbab5367
412
# current_CriticalBugs = 14 # moreInfo = "Critical status" # differenceRate = -10 # # SCHEDULER.every '1s' do # last_CriticalBugs = current_CriticalBugs # send_event('CriticalBugs', { current: current_CriticalBugs, last: last_CriticalBugs, moreinfo: moreInfo, difference:differenceRate }) # end SCHEDULER.every ...
29.428571
137
0.735437
030d5bb2bd8111fd68b90473484930472c02a989
596
# frozen_string_literal: true class MakeExpressionsLessGeneric < ActiveRecord::Migration[4.2] def up rename_column :expressions, :parent_id, :post_id rename_column :expressions, :expression_type_id, :expression_index remove_column :expressions, :parent_type add_index :expressions, [:post_id, :expres...
31.368421
105
0.763423
e27c314e51a3fa4e4491ef40ad6fb740c5edeb03
195
class InvoicePolicy < ApplicationPolicy def index? user.is_admin? end def download? user.is_admin? or (record.user_id == user.id) end def create? user.is_admin? end end
13.928571
49
0.676923
91aa59aada1e4a6718d9ac66a38ed8f50844180e
21,309
## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Preview < Domain class HostedNumbers < Version ## # PLEASE NOTE that this class contains preview products that are subj...
45.532051
201
0.608147
878fd7986b68d41d6c12408a0eefc7db9f27f510
4,113
class TestTrack::Visitor include TestTrack::RequiredOptions attr_reader :id def initialize(opts = {}) opts = opts.dup @id = opts.delete(:id) @loaded = true if opts[:assignments] @assignments = opts.delete(:assignments) unless id @id = SecureRandom.uuid @assignments ||= [] # If we...
27.059211
136
0.705811
1d1b3f648d3a044336dfeb71ebcb086c39d1c110
623
# -*- encoding : utf-8 -*- difficulty 3 description "A bug was introduced somewhere along the way. You know that running `ruby prog.rb 5` should output 15. You can also run `make test`. What are the first 7 chars of the hash of the commit that introduced the bug." setup do init_from_level repo.init end solutio...
36.647059
227
0.727127
ed54865411afcae9c6c393d72a7ff84c8193240b
528
Headcount.configure do |config| # config.path = 'db/headcounts.json' # where to write headcount to config.timestamp = '%' now = DateTime.now count User do a = now - 7.days b = now - 30.days c = now - 90.days count User.where("last_request_at >= ?", a), :as =...
33
95
0.549242
187e96be2322babf543f229eaf7170bef2f3610d
343
class TreemapGenerator < BaseGenerator # generate horizontal bar chart # element - div id or class for chart # data_url - json file with data def generate( element, data_url ) add_assets( "#{element[1..-1]}"+'.js', js_code( element, data_url ) ) add_assets( "#{element[1..-1]}"+'.scss', css_code( el...
31.181818
73
0.653061
2625ccb70342a3725ef387b67aa3a75f66f463a3
139
class Invitation < ActiveRecord::Base belongs_to(:person) # people can invite other people ... belongs_to(:team) # ... into teams end
19.857143
57
0.71223
d52e8cfcfe989c00ab277cf1d3fab7b51b740c61
3,148
# This extension Gzips assets and pages when building. # Gzipped assets and pages can be served directly by Apache or # Nginx with the proper configuration, and pre-zipping means that we # can use a more agressive compression level at no CPU cost per request. # # Use Nginx's gzip_static directive, or AddEncoding and mo...
32.453608
131
0.690915
d536e1d4d7491a9a29b868b0a526f113a736733f
260
class CreateCoffees < ActiveRecord::Migration[6.0] def change create_table :coffees do |t| t.string :name t.string :notes t.string :roast t.belongs_to :roaster, null: false, foreign_key: true t.timestamps end end end
20
59
0.65
21fb98fdde3d8e8e7bc7dd739d4640630482ad1d
935
# # This class was auto-generated from the API references found at # https://epayments-api.developer-ingenico.com/s2sapi/v1/ # require 'ingenico/connect/sdk/factory' require 'ingenico/connect/sdk/domain/payment/capture_payment_request' Payment = Ingenico::Connect::SDK::Domain::Payment def example get_client do |cli...
33.392857
125
0.765775
389cc86a35bf6ee4a3f298d378b73fdad3b95bf5
137
FactoryGirl.define do factory :page do title 'Test page' name 'test-page' path '/test-page' root_folder_id 1 end end
15.222222
21
0.656934
6ac8bd8282b84fb2f01d282c95948ca326683c69
131
class AddFluidPreferenceToUser < ActiveRecord::Migration def change add_column :users, :fluid_preference, :boolean end end
21.833333
56
0.78626
1165f91707e97ca7a41a1d280738c317f78a96e7
19
test_variable = 42
19
19
0.789474
b924affa50f22c5281e4a27ac814aa613a913b6f
3,817
require 'spec_helper' describe Spree::Admin::FavoriteProductsController do let(:role) { Spree::Role.create!(name: 'user') } let(:roles) { [role] } let(:product) { mock_model( Spree::Product) } let(:proxy_object) { Object.new } before(:each) do @user = mock_model(Spree::User, generate_spree_api_key!: fal...
33.482456
103
0.690333
ff3b7d2004348cb2dcdeeb21c78f48e20ce6b265
333
module PagSeguro class Document include Extensions::Assignment # Set the type. attr_accessor :type # Set the value. attr_accessor :value def ==(other) [type, value] == [other.type, other.value] end def cpf? type == 'CPF' end def cnpj? type == 'CNPJ' e...
13.875
48
0.570571
7a3d5214c7c68506d0b88354dd6c5a8ac7c9ba16
5,987
# frozen_string_literal: true module Committee module SchemaValidator class OpenAPI3 class OperationWrapper # # @param request_operation [OpenAPIParser::RequestOperation] def initialize(request_operation) @request_operation = request_operation end def path_params ...
45.015038
123
0.663604
619fc8e7d38846ea73a8d2ff2d51991d50895992
1,764
# frozen_string_literal: true require 'spec_helper' describe TrendingProject do let(:user) { create(:user) } let(:public_project1) { create(:project, :public) } let(:public_project2) { create(:project, :public) } let(:public_project3) { create(:project, :public) } let(:private_project) { create(:project, :p...
29.898305
105
0.706916
6affda77b595a122f904d1d67a75219e1d623cf9
1,215
require 'spec_helper' # mesos master service describe 'mesos master service' do it 'should be running' do case RSpec.configuration.os when 'Debian' expect(service('mesos-master')).to be_running end end end describe port(5050) do it { should be_listening } end describe command('curl -sD - http...
31.973684
94
0.678189
1d07b69b00b09d4672c1dde3b83c6d226d4f19d2
694
# frozen_string_literal: true require "test_helper" module ActsAsAuthenticTest class MagicColumnsTest < ActiveSupport::TestCase def test_validates_numericality_of_login_count u = User.new u.login_count = -1 refute u.valid? refute u.errors[:login_count].empty? u.login_count = 0 ...
23.133333
57
0.690202
e2edb5a42eaae4ae14c82942a7230447077724d5
1,402
# encoding: UTF-8 # 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. # # Note that this schema.rb definition is the authoritative sou...
41.235294
86
0.692582
18c0c37d1e563fe756d67139faeb7efecd11cca0
203
Phccontactor::Engine.routes.draw do # Message Routes resources :messages, only: [:create] get 'contact_us', to: 'messages#new' # PHCAccounts Routes mount Phcaccounts::Engine, :at => '/' end
18.454545
39
0.689655
ed5be8d8e3024fe018a0d755e5b29d70078a1cbb
1,015
module Arcade # Error handling class Error < RuntimeError end class ArgumentError < ArgumentError end class SymbolError < ArgumentError end class LoadError < LoadError end class ImmutableError < RuntimeError end class RollbackError < RuntimeError end end # module Arcade # Patching Ob...
21.595745
82
0.748768
6a64215ade8d291ba01d82283ed03d34e4a122bc
1,922
class Makefile2graph < Formula desc "Create a graph of dependencies from GNU-Make" homepage "https://github.com/lindenb/makefile2graph" url "https://github.com/lindenb/makefile2graph/archive/v1.5.0.tar.gz" sha256 "9464c6c1291609c211284a9889faedbab22ef504ce967b903630d57a27643b40" license "MIT" head "https://...
40.041667
94
0.759625
01fc5c3c65ceb7c1748b759a79892abef0a604da
259
require 'rails_helper' RSpec.describe ReputationJob, type: :job do let(:question) { create(:question) } it 'calls ReputationJob' do expect(Services::Reputation).to receive(:calculate).with(question) ReputationJob.perform_now(question) end end
23.545455
70
0.745174
b9bc1abfbe228c7c63cc633cfdb68719539b6e89
4,962
require "rails_helper" RSpec.describe ResponsiblePersonAddressLog, type: :model do describe "validations" do subject(:address_log) { build_stubbed(:responsible_person_address_log) } it "fails if a street address is not specified" do address_log.line_1 = nil expect(address_log.valid?).to be fals...
38.169231
101
0.631802
6abf73dfe6fc55e048b8bd47dbf41d106dc06e08
241
# frozen_string_literal: true organization_name = 'IKIA' puts "Running seeds for organization #{organization_name}" organization = Organization.find_by(name: organization_name) organization ||= Organization.create!(name: organization_name)
34.428571
62
0.817427
08c9b563da652f7e5687d5ae64edda361213e8db
347
require 'raven' require 'raven/integrations/rack' require 'sinatra/base' module Travis module Api module Build class Sentry < Sinatra::Base configure do Raven.configure do |config| config.tags = { environment: environment } end use Raven::Rack end ...
18.263158
54
0.596542
91fb637525414c505eddc6794bc81fcc754843cd
473
module ConsoleUtils #:nodoc: module ActiveRecordUtils extend ActiveSupport::Autoload autoload :RandomRecord def self.extended(mod) ActiveSupport.on_load(:active_record) do ActiveRecord::Relation.send(:prepend, RandomRecord::FinderMethods) ActiveRecord::Base.send(:extend, RandomReco...
24.894737
74
0.699789
337e953200abb49adf515d3a65d9f258d99dd1b5
451
Puppet::Type.newtype(:swift_ring_build_helper) do @doc = "Base resource definition for building swift rings" ensurable newparam(:name) do desc "A unique name for the resource" end newproperty(:swift_storage_ips, :array_matching => :all) do desc "an array of the ip addresses of the swift storage nod...
23.736842
70
0.720621
1d56f1b059a9ace139c09240b8547106d0e2dc20
431
cask 'thedesk' do version '18.7.1' sha256 '0e92ed2ab9b61fe9b113ae3c90af9e90281f83f1c76af2aca53a8ccda3016252' # github.com/cutls/TheDesk was verified as official when first introduced to the cask url "https://github.com/cutls/TheDesk/releases/download/v#{version}/TheDesk-#{version}.dmg" appcast 'https://githu...
33.153846
93
0.763341
ed3286180299a63d1bba5508a52c173c19be56f6
3,271
require 'tempfile' require 'fileutils' require 'galaxy/filter' require 'galaxy/temp' require 'galaxy/transport' require 'galaxy/version' require 'galaxy/versioning' module Helper def Helper.mk_tmpdir Galaxy::Temp.mk_auto_dir "testing" end class Mock def initialize listeners={} @listeners = list...
23.035211
135
0.631611
38747e0aadf44158e476883d1fb8166437a2f980
15,377
# typed: false # frozen_string_literal: true require "cmd/shared_examples/args_parse" require "dev-cmd/bottle" describe "Homebrew.bottle_args" do it_behaves_like "parseable arguments" end describe "brew bottle", :integration_test do it "builds a bottle for the given Formula" do # create stub patchelf if ...
33.574236
113
0.577876
211d3d847f2cac162306cb58b38db39d0ed2ba5b
23,435
require 'spec_helper' describe GitPushService, services: true do include RepoHelpers let(:user) { create(:user) } let(:project) { create(:project, :repository) } before do project.team << [user, :master] @blankrev = Gitlab::Git::BLANK_SHA @oldrev = sample_commit.parent_id @newrev = sample_...
35.346908
190
0.66422
1cf5f9404cb10af8dc3ba655a33fc4f661279a43
4,516
require 'spec_helper' # Suppose the following class exists: # # class User < ActiveRecord::Base # include Friendable::UserMethods # end describe Friendable::UserMethods do def redis; Friendable.redis; end before(:each) { redis.flushdb } let(:current_user) { User.first } let(:target_user) { User.last }...
29.324675
98
0.64814
ff9ff58f814b1a2eea8f5f34bd4a498aa5e95fad
2,645
RSpec.shared_context "nucleon_codes" do #***************************************************************************** # Code initialization let(:codes_registry_clean) do { :success => 0, :help_wanted => 1, :unknown_status => 2, :action_unprocessed => 3, :bat...
26.989796
85
0.507372
1df46a3fd2f83abdd5483ec111e4d6fac9795a24
1,384
# Wraps up logic for querying the IAL level of an authorization request class IalContext attr_reader :ial, :service_provider # @param ial [String, Integer] IAL level as either an integer (see ::Idp::Constants::IAL2, etc) # or a string see Saml::Idp::Constants contexts # @param service_provider [ServiceProvid...
26.113208
97
0.726879
0184ddfbeffaece936f1c158adab4d80f93c86f2
9,109
require 'test_helper' class MetricsGlobalTest < Test::Unit::TestCase include CommStub def setup @gateway = ActiveMerchant::Billing::MetricsGlobalGateway.new( :login => 'X', :password => 'Y' ) @amount = 100 @credit_card = credit_card('4111111111111111', :verification_value => '999') ...
38.597458
363
0.661324
399f5f3c362e80ba56baaafd9df2b57b8035f1d9
952
class ENV_BANG module Classes class << self attr_writer :default_class def default_class @default_class ||= :StringUnlessFalsey end def cast(value, options = {}) public_send(:"#{options.fetch(:class, default_class)}", value, options) end def boolean(value, op...
25.052632
85
0.609244
e9a29e75358ec058ca30fcbfb8e2e1b3f1c3f061
728
class AssignmentFilesController < ApplicationController before_action :set_current_course before_action :authenticated_as_user # GET /6.006/assignment_files/1/download def download @file = AssignmentFile.find params[:id] return bounce_user unless @file.can_read? current_user db_file = @file.db_file...
38.315789
78
0.740385
e986ffa00ce63e4540ac1bad0bbd5ed28ff29ca4
2,325
module ActiveNotifier class Base attr_accessor :recipient, :channels def initialize(attributes={}) attributes.each do |(key, value)| self.public_send("#{key}=", value) end end delegate :deliver_now, to: :deliverable def deliver_now delivered = false locale = self...
23.019802
78
0.577204
6aaf25e072563b7bfe88fb877d09ab56ab1fd2d6
2,677
Pod::Spec.new do |s| s.name = "Nimble" s.version = "7.1.2" s.summary = "A Matcher Framework for Swift and Objective-C" s.description = <<-DESC Use Nimble to express the expected outcomes of Swift or Objective-C expressions. Inspired by Cedar. DESC s.hom...
50.509434
118
0.731789
b9467748793d6ff28960fbfc9971cde0982ffc13
239
module ScorchedBlog class BaseController < Scorched::Controller render_defaults[:layout] = File.expand_path('../templates/layout.erb', __FILE__).to_sym render_defaults[:dir] = File.expand_path('../templates', __FILE__) end end
34.142857
91
0.748954
ab094426054377a1c825441b0793d8b4f22fc85a
8,488
require "spec_helper" module Berkshelf describe Downloader do let(:berksfile) do double(Berksfile, lockfile: lockfile, dependencies: []) end let(:lockfile) do double(Lockfile, graph: graph) end let(:graph) { double(Lockfile::Graph, locks: {}) } let(:self_...
42.228856
164
0.606032
ed4205a477eb5df54f345873853a2d70a34910b5
104
class HomeController < ApplicationController def index end def contact_us end end
9.454545
44
0.673077
1ae7cba70393d7c5574397e381d06de5f1a61482
302
package "git-daemon-sysvinit" directory "/srv/repos" do recursive true end template '/etc/default/git-daemon' do source 'git-daemon.erb' owner 'root' mode '0644' variables :git_root => '/srv/repos' end service "git-daemon" do provider Chef::Provider::Service::Init action [:start] end
16.777778
40
0.708609
624d0200f7817d44ea1537254e49d46ef7bb7d99
2,610
require 'spec_helper' RSpec.describe DeserializationRetry do context 'when a Delayed::Job fails to load because the class is missing' do it 'prevents DelayedJob from marking it as failed' do handler = VCAP::CloudController::Jobs::Runtime::EventsCleanup.new(10_000) VCAP::CloudController::Jobs::Enqueue...
32.222222
128
0.681992
7ad3a48b0eaa7f034d3f7d558db60510a1b9d733
137
class OrderedPost include Mongoid::Document field :title, :type => String field :rating, :type => Integer belongs_to :person end
19.571429
33
0.722628
5d5a335acb3df5145683cda329c8e6979efe00d1
19,168
# frozen_string_literal: true # Copyright 2021 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...
39.359343
203
0.722767
086e1394bf86ba33b78e9a2b2fafc7276356e3bd
340
module ReviewsHelper def display_heading(object) if object content_tag(:h1, "Reviews for #{object.title}") else content_tag(:h1, "All Reviews") end end def go_back(recipe) if recipe link_to "Back", recipe_path(recipe), class: "btn btn-dark" else link_to "Back", recipes_path, class: "btn btn-d...
17.894737
61
0.694118
1d052fb22cc205099fb67a82885460148a1d60a2
771
# frozen_string_literal: true module CaseMixHelper CASE_MIX_TIERS = %i[a b c d na].freeze def case_mix_key render partial: 'poms/case-mix/key', locals: { tiers: CASE_MIX_TIERS } end def case_mix_bar(pom) tiers = { a: pom.tier_a, b: pom.tier_b, c: pom.tier_c, d: pom.tier_d, ...
22.028571
91
0.616083
1dd05b8373d513db26856bbed67a04620bfdd92a
640
$: << File.join(File.dirname(__FILE__), '..', 'lib') require 'rubygems' require '../lib/rturk' require 'yaml' aws = YAML.load(File.open(File.join(File.dirname(__FILE__), 'mturk.yml'))) RTurk::setup(aws['AWSAccessKeyId'], aws['AWSAccessKey']) file = File.open(File.join(File.dirname(__FILE__), 'answers.yml'), 'w') hits...
27.826087
74
0.698438
ede3a4409037ac16a7f3a697f822561f234ec42d
83,164
require "cases/helper" require "models/developer" require "models/computer" require "models/project" require "models/company" require "models/contract" require "models/topic" require "models/reply" require "models/category" require "models/image" require "models/post" require "models/author" require "models/essay" requ...
32.975416
180
0.744661
87a8fac852c82d0244c309a2421211c62e4308c0
1,443
class FacebookPublisher < Facebooker::Rails::Publisher helper PostsHelper, LocationsHelper, PicturesHelper, GeneralUtilities # Defines the template for the feed item that is posted on a user's wall # when they create a new post. def post_feed_template one_line_story_template "{*actor*} made a new {*title...
42.441176
158
0.704782
62d73c3cb31498935c0c91bd3f1d3a42de7025cb
1,046
# -*- encoding : utf-8 -*- module Pacto class ContractFactory include Singleton include Logger def initialize @factories = {} end def add_factory(format, factory) @factories[format.to_sym] = factory end def remove_factory(format) @factories.delete format end d...
24.904762
79
0.691205
5d83561758fc2d07c89e7576ccb5e30cd66867fa
3,486
Given(/^I have previously created the "(.*?)" service$/) do |name| params = { name: name, slug: name.parameterize, csv_path: csv_path_for_data(name) } @service = create_service(params) end Given(/^I have previously created a service with the following attributes:$/) do |table| params = table.rows_hash.symbolize...
27.448819
100
0.687894
213c02f8acedcba9cec0d2cbcc074227a26218d1
1,958
require 'test_helper' class UserTest < ActiveSupport::TestCase def setup @user = User.new(name: "Kevin Suh", email: "ksuh@dinnerlab.com", password: "kevinsuh1", password_confirmation: "kevinsuh1") end test "should be valid" do assert @user.valid? end test "name cannot be too long" do name = 'a' * 51 ...
24.78481
125
0.723698
62eb7352ba892b7923401484bd849c145196fe44
3,533
# encoding: UTF-8 # # Copyright (c) 2010-2017 GoodData Corporation. All rights reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. require_relative 'base_action' module GoodData module LCM2 class CollectSegmentClients < Base...
31.265487
170
0.590716
87d277af199035df15a56ec2e92aa24d0e6541fc
8,498
=begin Copyright (c) 2019 Aspose Pty Ltd Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribu...
31.474074
175
0.631796
bb1f100adc03dabf3d0cf34621a59b0a06136a9e
297
#-- # # # # Copyright (c) 1999-2006 Minero Aoki # # This program is free software. # You can distribute/modify this program under the same terms of ruby. # see the file "COPYING". # #++ module Racc VERSION = '1.6.0' Version = VERSION Copyright = 'Copyright (c) 1999-2006 Minero Aoki' end
16.5
70
0.673401
f8875de0a2a9f016ac4297855ff38a1ed4c70db3
288
$LOAD_PATH.unshift File.expand_path("../lib", __dir__) require 'simplecov' require 'oneshot_coverage/simplecov_reporter' OneshotCoverage::SimplecovReporter.new( project_path: Dir.pwd, log_path: 'coverage.json', file_filter: OneshotCoverage::SimplecovReporter::DefaultFilter ).run
26.181818
64
0.798611
268a08bff1471c5ec932eb4037fa2cd51e06404c
5,335
require "active_support/core_ext/integer/time" Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your applica...
44.090909
114
0.765323
21178e24999dca9045e32181f0065ceee7e1649b
231
module MiqAeMethodService class MiqAeServiceSwitch < MiqAeServiceModelBase expose :hosts, :association => true expose :guest_devices, :association => true expose :lans, :association => true end end
28.875
50
0.688312
e91ac11d9d7260f38822128e992941057ddf4141
1,279
# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't...
32.794872
84
0.778733
03130cc3b745dff964776b005cc362fff875964f
1,682
require File.expand_path('../../spec_helper', __FILE__) describe JobQueue do before do @q = JobQueue.new 2 $job_queue_results = Set.new $job_queue_runs = 0 $job_queue_data_mutex = Mutex.new end class TestWorker def perform(item, delay) sleep delay $job_queue_data_mutex.synchroniz...
28.508475
56
0.669441
331145218374d37d24b560c6c4bf4eb80b347b1f
16,010
## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / module Twilio module REST class Api < Domain class V2010 < Version class AccountContext < InstanceContext class SipList < ListResource class IpAccessControlListList < Lis...
40.634518
120
0.524422