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
e2757dc12670d510f4b896d5b0dbaf6f1db1e0cc
603
class CreateSpreeBulkDiscounts < ActiveRecord::Migration def change create_table :spree_bulk_discounts do |t| t.string :name t.references :calculator t.datetime :deleted_at t.timestamps end add_column :spree_products, :bulk_discount_id, :integer add_column :spree_line_items, ...
35.470588
103
0.731343
acc429622aeeacd6466450f038a53a0e6d79bd3e
2,003
# # Be sure to run `pod lib lint SIPKeyboardManager.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = '...
45.522727
206
0.682976
38ab2f67778c317eed1e0e56775f0494ab5b93dc
5,531
#snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.] #snippet-sourceauthor:[Doug-AWS] #snippet-sourcedescription:[Creates a security group, adds rules to the security group, gets information about security groups, and deletes the security group.] #snippet-keyword:[Amazon Elastic Co...
34.786164
161
0.692822
03a8faa5d0c3dd2e29407b4b6f00017ec0e36131
2,244
module Archie module Model extend ActiveSupport::Concern included do attr_reader :password, :current_password attr_accessor :password_confirmation validates_presence_of :password, :if => :password_required? validates_confirmation_of :password, :if => :password_required? v...
31.605634
121
0.702763
ff45079224058a3818b828daef28686bf20d7b72
495
module Stompede class ErrorFrame attr_reader :headers def initialize(exception, headers = {}) @exception = exception @headers = headers @headers["content-type"] = "text/plain" end def command :error end def body "#{@exception.class}: #{@exception.message}\n\n#{...
19.8
95
0.620202
08b35aa76275f942b22cd93ab4a430e564fdac66
130
class AddTemplateSubject < ActiveRecord::Migration def change add_column :templates, :subject, :string, limit: 200 end end
21.666667
55
0.761538
184659ab564df883cb1bc29cebb00144619f1092
1,078
# frozen_string_literal: true version = File.read(File.expand_path("../VERSION", __dir__)).strip date = File.read(File.expand_path("../RELEASE_DATE", __dir__)).strip Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = "actionfacade" s.version = version s.date = date ...
34.774194
122
0.662338
b9b047ee5448399e94e910f737c97dbbeb847397
2,936
require_relative '../../spec_helper' require_lib 'reek/smell_detectors/too_many_instance_variables' RSpec.describe Reek::SmellDetectors::TooManyInstanceVariables do let(:config) do { Reek::SmellDetectors::TooManyInstanceVariables::MAX_ALLOWED_IVARS_KEY => 2 } end it 'reports the right values' do src = <...
22.075188
82
0.556199
795df5dfda9d808c86a1c52181b8238f8ff2e372
417
FactoryGirl.define do factory :group_member do access_level { GroupMember::OWNER } group user trait(:guest) { access_level GroupMember::GUEST } trait(:reporter) { access_level GroupMember::REPORTER } trait(:developer) { access_level GroupMember::DEVELOPER } trait(:master) { access...
29.785714
61
0.693046
217d96d4c5fef79082221fe8bf0f45613f464fed
939
module Liquid # decrement is used in a place where one needs to insert a counter # into a template, and needs the counter to survive across # multiple instantiations of the template. # NOTE: decrement is a pre-decrement, --i, # while increment is post: i++. # # (To achieve ...
23.475
72
0.620873
28fa4ab9e28ce3648bf921d9c143ea6cc1857c38
145
# frozen_string_literal: true enum1 = 3.times enum2 = %w[zero um dois].each puts enum1.class loop do puts enum1.next puts enum2.next end
11.153846
29
0.724138
7adba65b2563a86c9681414f6f194f3a6ba8d390
2,109
class C10t < Formula desc "Minecraft cartography tool" homepage "https://github.com/udoprog/c10t" url "https://github.com/udoprog/c10t/archive/1.7.tar.gz" sha256 "0e5779d517105bfdd14944c849a395e1a8670bedba5bdab281a0165c3eb077dc" license "BSD-3-Clause" revision 1 bottle do cellar :any sha256 "15eb...
39.055556
140
0.79137
1170e30179423b26bd05c4a4c31c36778470140e
1,203
# -*- encoding: utf-8 -*- # frozen_string_literal: true require File.expand_path('lib/redis/deque', __dir__) Gem::Specification.new do |s| s.name = 'redis-deque' s.version = Redis::Deque::VERSION s.authors = ['Jaakko Rinta-Filppula', 'Francesco Laurita'] s.email = ['jaakko@r-f.fi', 'franc...
37.59375
123
0.659185
3383a3a5c8aaef78f6164f57a083122e9148d94a
3,819
class DialogImportService class ImportNonYamlError < StandardError; end class ParsedNonDialogYamlError < StandardError; end def initialize(dialog_field_importer = DialogFieldImporter.new, dialog_import_validator = DialogImportValidator.new) @dialog_field_importer = dialog_field_importer @dialog_import_va...
29.376923
118
0.749935
62b1186fb2dadfd1b541de99f8b6dbbd0c6d27b7
151
require 'test/unit' class ActsAsParentOfTest < Test::Unit::TestCase # Replace this with your real tests. def test_this_plugin flunk end end
16.777778
47
0.741722
b97eece1e11d091fa0cf0bf03c41e7742979159d
271
# Don't forget! This file needs to be 'required' in its spec file # See README.md for instructions on how to do this def fizzbuzz(int) if int % 3 == 0 "Fizz" elsif int % 5 == 0 "Buzz" elsif int % 5 == 0 && int % 3 == 0 "FizzBuzz" else "nil" end
20.846154
65
0.586716
f7db2007c23a2fe9388879318d7914fe70c3da25
2,259
class ImagemagickAT6 < Formula desc "Tools and libraries to manipulate images in many formats" homepage "https://www.imagemagick.org/" # Please always keep the Homebrew mirror as the primary URL as the # ImageMagick site removes tarballs regularly which means we get issues # unnecessarily and older versions o...
31.816901
93
0.711377
332941387057587d8f3f2a3760a240c916cf8cb2
1,266
require 'hubspot/events_api' module Resque module TrackingJobs module SendSegmentEvent ANONYMOUS_SEGMENT_USER_ID = '00000000-0000-0000-0000-000000000000'.freeze @queue = :tracker def self.perform(user_id, name, properties) return unless segment_api_key = Cartodb.get_config(:segment, '...
30.878049
105
0.623223
5d9af38fa1c0ba94100fc79222e1e99258113035
1,016
class Fonttools < Formula include Language::Python::Virtualenv desc "Library for manipulating fonts" homepage "https://github.com/fonttools/fonttools" url "https://github.com/fonttools/fonttools/releases/download/3.4.0/fonttools-3.4.0.zip" sha256 "12949c451af8db545e8a239f54312eb7b37977a0b946a85bcbbc28f8fcc1a...
32.774194
92
0.781496
1afb8f9c37c4f59153df0473c45fb6604393d9c7
1,015
# frozen_string_literal: true require 'cfn-nag/violation' require 'cfn-nag/util/enforce_reference_parameter' require 'cfn-nag/util/enforce_string_or_dynamic_reference' require_relative 'base' class AlexaASKSkillAuthenticationConfigurationRefreshTokenRule < BaseRule def rule_text 'Alexa ASK Skill AuthenticationC...
27.432432
79
0.752709
ff526c73168a89423edfce879e0c34e36a4e7137
298
class CreateLinkedProductsJoinTable < ActiveRecord::Migration def change create_join_table :products, :linked_products do |t| # t.index [:product_id, :linked_product_id] t.index [:product_id, :linked_product_id], unique: true, name: 'linked_products_by_product' end end end
33.111111
97
0.744966
6aa2ee11efb2a0a5f71b62e4bb038ad3edf9926a
3,047
# 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...
27.7
101
0.698064
7a3be1029fe4a0faa03fe153478c59b7eae43a7d
134
require 'spec_helper' RSpec.describe ShittyQl do it "has a version number" do expect(ShittyQl::VERSION).not_to be nil end end
19.142857
43
0.746269
28bf1b83decb27a4c8cff93de770b36e5e8cbe70
6,447
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'csv' require 'digest' class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::HttpClient include Msf::Exploit::SQLi def initialize(info = {}) supe...
34.848649
123
0.61579
ac041dad2ab80fbca7632ed6c93cb850b13547f5
11,374
=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.180438
219
0.512045
037460612b5df7f7e479bc391c5ea834eb3a34af
13
require 'aws'
13
13
0.769231
f8d30f52672ffd151dba5651c1a0683c41500eab
375
class CreateLecturers < ActiveRecord::Migration[5.2] def change create_table :lecturers do |t| t.references :subject, foreign_key: true, null: false t.string :name, null: false, index: true t.string :note t.string :roles, array: true, null: false, default: [] t.timestamps end ...
26.785714
60
0.656
61a1ec15a38c0f4a92292b1622bf745dbf021a4a
2,291
class Grep < Formula desc "GNU grep, egrep and fgrep" homepage "https://www.gnu.org/software/grep/" url "https://ftp.gnu.org/gnu/grep/grep-3.6.tar.xz" mirror "https://ftpmirror.gnu.org/grep/grep-3.6.tar.xz" sha256 "667e15e8afe189e93f9f21a7cd3a7b3f776202f417330b248c2ad4f997d9373e" license "GPL-3.0-or-later" ...
29.753247
94
0.6866
e2fb918d54468716d62fb515cfaed553caaefaa8
12,941
# frozen_string_literal: true require_relative 'spec_helper' module Aws module S3 describe Presigner do let(:client) do Aws::S3::Client.new( region: 'us-east-1', credentials: Credentials.new( 'ACCESS_KEY_ID', 'SECRET_ACCESS_KEY' ), st...
34.32626
119
0.546557
61ff2eead89800bba947fd493581fa37a7426f22
342
# frozen_string_literal: true module Bi class YearReportHistory < BiLocalTimeRecord self.table_name = 'YEAR_REPORT_HISTORY' def self.year_options Bi::YearReportHistory.order(year: :desc).pluck(:year).uniq end def self.month_names Bi::YearReportHistory.order(month: :desc).pluck(:month).u...
21.375
66
0.719298
eddf31fe31434c72f233e76a045eb5b3d64d1740
3,914
# frozen_string_literal: true # == Schema Information # # Table name: work_records # # id :bigint not null, primary key # aasm_state :string default("published"), not null # body :text not null # deleted_at :datetime # im...
28.569343
122
0.643076
79fca3334cd175adfd9970056c2d02dee2e3c191
680
#!/usr/bin/env ruby require File.dirname(__FILE__) + "/../../config/environment" Signal.trap("TERM") { exit } if Job.included_modules.include?(Job::BonusFeatures) RAILS_DEFAULT_LOGGER.info("BackgroundFu: Starting daemon (bonus features enabled).") else RAILS_DEFAULT_LOGGER.info("BackgroundFu: Starting daemon (bo...
29.565217
132
0.708824
2184606fba5d196934ef547a9110081fbd733f2b
1,422
require 'sass/tree/node' module Sass::Tree # A static node representing an `@extend` directive. # # @see Sass::Tree class ExtendNode < Node # The parsed selector after interpolation has been resolved. # Only set once {Tree::Visitors::Perform} has been run. # # @return [Selector::Comma...
32.318182
93
0.654008
28b48ee8c35d6bc569a1a52bc23b74d4737b81ec
29,091
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Network::Mgmt::V2020_05_01 # # RouteFilterRules # class RouteFilterRules include MsRestAzure # # Creates and initializes a new instance of ...
46.471246
176
0.710838
28fcb7df0597ee6b2302c63523cdf7191bc66899
258
class CreateSkills < ActiveRecord::Migration def change create_table :skills do |t| t.integer :applicant_id t.string :skill t.integer :years_of_experience t.integer :proficiency t.timestamps null: false end end end
19.846154
44
0.678295
87b5ad903a1384f49d3f185346660572d4c6137d
4,336
require "active_support/time_with_zone" require "active_support/core_ext/time/acts_like" require "active_support/core_ext/date_and_time/zones" class Time include DateAndTime::Zones class << self attr_accessor :zone_default # Returns the TimeZone for the current request, if this has been set (via Time.zone...
38.714286
130
0.641605
03facb6430560926e10344b77f57ef63a7ec8141
36,094
# frozen_string_literal: true # -*- ruby -*- #-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. # See LICENSE.txt for permissions. #++ require 'rbconfig' require 'thread' module Gem VERSION = '2.6.7' end # Must be first since it unloads the prelude from 1.9.2 require '...
26.384503
130
0.675043
e849067d7fb892b7471daa66019ed7bc0a200ac0
83
module Foo def bar 666 end def baz 777 end end
6.916667
11
0.433735
bbdfe5b33bae8360bceb4c22aa9accda733399b8
2,480
control 'VCUI-67-000025' do title 'vSphere UI must have the debug option turned off.' desc "Information needed by an attacker to begin looking for possible vulnerabilities in a web server includes any information about the web server and plug-ins or modules being used. When debugging or trace information is enable...
34.929577
91
0.696774
87172bc49bba3128c21742feb3f55192fd15ff87
491
# Get twilio-ruby from twilio.com/docs/ruby/install require 'twilio-ruby' # Get your Account Sid and Auth Token from twilio.com/user/account account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' auth_token = 'your_auth_token' @client = Twilio::REST::Client.new(account_sid, auth_token) call = @client.account.calls ...
35.071429
67
0.682281
2133f4dbf6b4869c23b673ed330f8c1fc15e133a
78
module Docile # The current version of this library VERSION = "1.3.3" end
15.6
39
0.705128
188854b54e2f6fcf0d6d058a378a179e42ceded6
408
# frozen_string_literal: true SeedHelper.instance.populate_df_admins( [ { email: 'jrae@wearefuturegov.com', first_name: 'Jason', last_name: 'Rae' }, { email: 'chris@wearefuturegov.com', first_name: 'Chris', last_name: 'Evans' }, { email: 'giz-solutions@we...
18.545455
48
0.583333
e8e902a5c5c666b4af7354211a3ff5750bb04b91
81
# frozen_string_literal: true require '{{ cookiecutter.project_slug }}/version'
20.25
49
0.777778
ab4744b2b4bf3d9d8d1eaccc470afb29bc31d72f
13,281
require_relative "../../../../support/utils" require_relative "../../../../support/test_controller" require_relative "../support/form_test_controller" require_relative "../support/model_form_test_controller" include Utils describe "Form Component", type: :feature, js: true do describe "Checkbox" do before :all...
37.837607
163
0.621038
1dbd0eff459feed4e3310f74c58bb5b478e79967
2,747
class VampPluginSdk < Formula desc "Audio processing plugin system sdk" homepage "https://www.vamp-plugins.org/" # curl fails to fetch upstream source, using Debian's instead url "https://deb.debian.org/debian/pool/main/v/vamp-plugin-sdk/vamp-plugin-sdk_2.10.0.orig.tar.gz" mirror "https://code.soundsoftware.a...
45.032787
122
0.709137
abe5eb455bb46906a3712952cbf453e230b6e414
344
module Steroids module Errors class UnauthorizedError < Steroids::Base::Error def initialize(options = {}) options[:message] ||= 'You shall not pass! (Unauthorized)' super( { status: :unauthorized, key: :unauthorized }.merge(options) ) ...
21.5
66
0.546512
e81c3c45935b908837f38be8bf4475f4c5f6a9f2
1,503
cask 'slack-beta' do version '3.3.7' sha256 'a4bef0aae5c8f7a195b3c25d85e26f197c39c11f64ca0eb06ab12946d53be80e' # downloads.slack-edge.com was verified as official when first introduced to the cask url "https://downloads.slack-edge.com/mac_releases_beta/Slack-#{version}-macOS.zip" name 'Slack' homepage 'htt...
45.545455
157
0.679973
bfc2b14faf0ef864d4974921b6bd031950b489c8
265
# frozen_string_literal: true class RemoveTrackExternalRightClicks < ActiveRecord::Migration[5.2] def up execute "DELETE FROM site_settings WHERE name = 'track_external_right_clicks'" end def down raise ActiveRecord::IrreversibleMigration end end
22.083333
82
0.784906
e9ea9e2aae7f9c0e94c7101f3eafaf8934af23e3
1,030
class AddConstraintsToTaggings < ActiveRecord::Migration def up # make tag_id NOT NULL & add foreign key constraint # index on tag_id already in place execute <<-SQL WITH taggings_to_delete AS ( SELECT * FROM taggings EXCEPT SELECT taggings.* FROM taggings JOI...
25.121951
77
0.642718
bb3cde6787f3563143c903a0fefe1b40b5fb54f4
928
# Fact: operatingsystemrelease # # Purpose: Returns the release of the operating system. # # Resolution: # Uses the release key of the os structured hash, which itself # operates on the following conditions: # # On RedHat derivatives, returns their `/etc/<variant>-release` file. # On Debian, returns `/etc/debia...
30.933333
79
0.712284
61dcafd5195b34fb224d29c3c85a80340dab4614
418
require 'rails_helper' RSpec.describe WatchingsController, type: :controller do describe "GET 'show' without login" do it 'returns http redirect' do get 'show' expect(response).to redirect_to('/') end end describe "GET 'show' with login" do it 'returns http success' do sign_in Fac...
19
56
0.665072
287c5112cbd75a157409ba099081762767d8269a
355
cask 'font-keania-one' do version :latest sha256 :no_check # github.com/google/fonts was verified as official when first introduced to the cask url 'https://github.com/google/fonts/raw/master/ofl/keaniaone/KeaniaOne-Regular.ttf' name 'Keania One' homepage 'http://www.google.com/fonts/specimen/Keania+One' ...
29.583333
86
0.75493
b9f5163308a4e0a8708cee9d3406f4158efef2b8
160
module Rediska Redis = ::Redis class Configuration attr_accessor :database, :namespace def initialize @database = :memory end end end
13.333333
39
0.66875
21f00783abc6361d00c246627f994c483a544e86
3,183
require 'csv' # This class holds a collection of rules relating to TransferClaims which govern # the fee name, the validity of the data, and the # case allocation type. The rules are read in from a CSV file, instantiated into # TransferDataItem objects and then added to this collection. # # Because reading the CSV fil...
28.419643
112
0.696513
ff30862efa6a3ff1b31ceadee56af535c2cfb727
287
FactoryGirl.define do factory :user do |u| u.email { Faker::Internet.email } u.display_name { Faker::Name.name } u.password { Faker::Internet.password(8) } factory :invalid_user do |u| u.display_name { nil } after(:build) { |u| u.valid? } end end end
23.916667
46
0.620209
260ee700e9d20c63d47b780cb3ffe33d19d4c38e
9,930
# encoding: UTF-8 # $HeadURL$ # $Id$ # # Copyright (c) 2009-2012 by Public Library of Science, a non-profit corporation # http://www.plos.org/ # # 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...
29.909639
146
0.612487
6a8911bc7534612503c82ebd770bedd8deb16561
243
module ApplicationHelper # Returns the full title on a per-page basis. def full_title(page_title = '') base_title = "道具管理サービス" if page_title.empty? base_title else page_title + " | " + base_title end end end
18.692308
47
0.650206
18e792db024638260156c68bc089e98e6912d1f3
9,685
# encoding: utf-8 # author: Christoph Hartmann # author: Dominik Richter require 'thor' require 'inspec/log' require 'inspec/profile_vendor' require 'inspec/ui' # Allow end of options during array type parsing # https://github.com/erikhuda/thor/issues/631 class Thor::Arguments def parse_array(_name) return shif...
34.838129
141
0.635312
b91d6f4e35d011f75ec7fa54af50684caf1871e2
15,145
# frozen_string_literal: true # Assuming you have not yet modified this file, each configuration option below # is set to its default value. Note that some are commented out while others # are not: uncommented lines are intended to protect your configuration from # breaking changes in upgrades (i.e., in the event that...
48.541667
154
0.752328
5d7400a4b1c428d1420ef05ba19ee83914eedba8
1,484
# encoding: utf-8 module DwcaHunter class Downloader attr_reader :url def initialize(source_url, file_path) @source_url = source_url @file_path = file_path @url = Url.new(source_url) @download_length = 0 @filename = nil end # downloads a given file into a specified fil...
24.327869
65
0.584232
4a37410ddef279ec1c74f842be2900fb6b41d206
362
# frozen_string_literal: true module Solargraph::LanguageServer::Message::TextDocument class PrepareRename < Base def process line = params['position']['line'] col = params['position']['character'] set_result host.sources.find(params['textDocument']['uri']).cursor_at(Solargraph::Position.new(li...
30.166667
126
0.712707
916290075e26573723a5d408a9526fec5a5e3f10
530
Pod::Spec.new do |s| s.name = 'PWLoadMoreTableFooter' s.version = '1.0' s.license = 'MIT' s.homepage = 'https://github.com/puttin/PWLoadMoreTableFooter' s.authors = { 'Puttin Wong' => 'yzwang.nj@gmail.com' } s.summary = 'A similar control to load more control.' s.source ...
40.769231
99
0.633962
625aba0b3d7a16ae6da7c4dba7d9fa37cbf7999e
2,934
# frozen_string_literal: true module QA RSpec.describe 'Create', :requires_admin do describe 'Codeowners' do let(:files) do [ { name: 'file.txt', content: 'foo' }, { name: 'README.md', content: 'bar' } ]...
30.5625
136
0.610429
33d21efd4187b60ad6ba8caef8cb958eca7ead29
382
require "rails_helper" FEC_API_KEY = ENV["fec_key"] RSpec.describe Committee, :type => :model do describe ".for" do it "retrieves the appropriate candidate based on an id" do expect(FEC).to receive(:request).with("candidate/45/committees?api_key=#{FEC_API_KEY}&sort_hide_null=true&sort=name&per_page=100&pag...
38.2
158
0.722513
1872aaf6a40ed186051d7cfb53f5172da537aae2
14,684
# Copyright (c) 2016, 2021, 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...
44.362538
245
0.717924
39d88333e810d082bbb4cd771efaa2b26037f29e
1,471
module ActionView module CompiledTemplates #:nodoc: # holds compiled template code end # = Action View Context # # Action View contexts are supplied to Action Controller to render template. # The default Action View context is ActionView::Base. # # In order to work with ActionController, a Context m...
37.717949
81
0.732835
b987eb8d39519305ddb89341d0ed73a4b05a5244
1,598
class ImageUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: # include CarrierWave::RMagick include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: storage :fog # Override the directory where uploaded files will be stored. # This is a sensibl...
29.054545
112
0.701502
d5293966be8ee5de2f6180e7c64bba0954aec276
473
require "bundler/setup" require "puppet_factset" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" config.expect_with :rspec do |c| c.syntax = :expect end end EXTRA_FACT_KEY = "extra_fact" EXTRA_FACT_VALUE...
26.277778
63
0.725159
ff0324340c4ce207188a4c9bbfdbf0e3a3e5c7c3
460
cask :v1 => 'handbrake' do version '0.10.1' sha256 '7c6f231889433d932d3d483df8f4f90fab517386987376542176dd8d2d032bd2' url "http://download.handbrake.fr/releases/#{version}/HandBrake-#{version}-MacOSX.6_GUI_x86_64.dmg" appcast 'http://handbrake.fr/appcast.x86_64.xml', :sha256 => 'f0e700c39b76c16dba12f...
32.857143
101
0.758696
388b9f8a1bb071d9778a1e6c9aaa6276483d902b
3,926
require 'test_helper' class TestPrecedence < Test::Unit::TestCase def test_matching_get_strings_have_precedence_over_matching_get_regexes FakeWeb.register_uri(:get, "http://example.com/test", :body => "string") FakeWeb.register_uri(:get, %r|http://example\.com/test|, :body => "regex") response = Net::HT...
49.075
93
0.701732
33edcdfa12b96d4c8d9dd4ba9bef8cb7e622d1d6
11,373
require_relative 'spec_helper' describe 'Rodauth email auth feature' do it "should support logging in use link sent via email, without a password for the account" do rodauth do enable :login, :email_auth, :logout account_password_hash_column :ph end roda do |r| r.rodauth r.root{vi...
33.157434
137
0.673877
1d87f74347e6d1a7edc302a8cf7754d36ff6528e
8,178
# frozen_string_literal: true require "abstract_unit" require "active_support/cache" require "active_support/cache/redis_cache_store" require_relative "../behaviors" driver_name = %w[ ruby hiredis ].include?(ENV["REDIS_DRIVER"]) ? ENV["REDIS_DRIVER"] : "hiredis" driver = Object.const_get("Redis::Connection::#{driver_...
29.103203
125
0.650893
916d85bfea7303de04337f69cb8db6ae055a87e7
7,358
# Copyright 2019 Google Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
27.871212
100
0.667165
edcd18e80853592422859a6783c75c26cf09c32f
105
class Task::Comments::Volunteered < Comment::AutoComment def message :user_volunteered end end
13.125
56
0.742857
399f8cdbbabc16dda9d2c632d8633086c456e13b
243
require_relative "../command" class StereoOnWithCDCommand < Command def initialize(stereo) @stereo = stereo end def execute @stereo.on @stereo.set_cd @stereo.set_volume(11) end def undo @stereo.off end end
12.789474
37
0.670782
61eb50d28b5c499f2bc019e5a593e33f62c126ce
2,256
module Google # deviates from other bin stuff to accomodate gem class << self def class_for(key) case key when :compute Fog::Compute::Google when :storage Fog::Storage::Google else raise ArgumentError, "Unsupported #{self} service: #{key}" end end def...
29.298701
108
0.591312
d59a8edadbd4f74cf1de5df07c7e8df4d57ecd8a
351
require "spec_helper" module Mastermind RSpec.describe Peg do context "#initialize" do it "raises an error if a colour isn't given" do expect { Peg.new() }.to raise_error(ArgumentError) end end context "#colour" do it "returns the colour" do peg = Peg.new("red") expect(peg.colour).to ...
17.55
54
0.65812
f7940df28d5524b4ab70ec168aa2d16d1f3e85ee
335
# frozen_string_literal: true module Rails # Returns the version of the currently loaded Rails as a <tt>Gem::Version</tt> def self.gem_version Gem::Version.new VERSION::STRING end module VERSION MAJOR = 6 MINOR = 0 TINY = 3 PRE = "3" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(...
18.611111
80
0.644776
bf0894ea2c4891b6f69b1ec3bc87e600bf3db8d1
439
cask 'hab' do version '0.10.2-20160930234832' sha256 '1a819160da57d80d313378b56989b2b101eca00d95e9f8ec7aad2d5b419bab39' # habitat.bintray.com was verified as official when first introduced to the cask url "https://habitat.bintray.com/stable/darwin/x86_64/hab-#{version}-x86_64-darwin.zip" name 'Habitat' hom...
29.266667
89
0.765376
f8a82c927e5d89b8bbe0158acfdf64fb455d74ef
9,057
describe 'grants' do include SpecHelper subject { export_grants } before do apply_roles do <<-RUBY group "engineer" do user "bob" end group "staff" do user "alice" end RUBY end apply_grants do <<-RUBY role "bob" do ...
24.216578
52
0.395495
38c515a90b58b95a8a8e78e724fc51ee9663753b
524
class Hash # Hash#deep_symbolize_keys # based on # https://github.com/svenfuchs/i18n/blob/master/lib/i18n/core_ext/hash.rb def deep_symbolize_keys inject({}) { |result, (key, value)| value = value.deep_symbolize_keys if value.is_a?(self.class) result[(key.to_sym rescue key) || key] = value ...
29.111111
75
0.687023
4a316c68d8e184113a5d6c2411d096feb6c0676b
138
require 'test_helper' class RailsDbInfoTest < ActiveSupport::TestCase test "truth" do assert_kind_of Module, RailsDbInfo end end
17.25
47
0.775362
28af4730418f3634c9bb25030a978b261e9935ed
768
module DomainsScanner module Crawlers class Google < Base def host "https://google.com" end def keyword_field_name "q" end # [{title: "xxx", url: "xxx"}, ...] def parse_results(doc) items = doc.search(".g h3.r a") items.map do |i| tit...
23.272727
140
0.544271
e21d5d157152df2e1438f8876efcf81f7196bc03
1,242
# frozen_string_literal: true # Copyright 2019 OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 require 'test_helper' describe OpenTelemetry::SDK::Trace::Export::ConsoleSpanExporter do export = OpenTelemetry::SDK::Trace::Export let(:captured_stdout) { StringIO.new } let(:spans) { [OpenTelemetr...
24.352941
85
0.716586
035ec947ddd600be57366d5176bea5e97c8cc153
237
# frozen_string_literal: true class AppealStreamSnapshot < ApplicationRecord self.table_name = "hearing_appeal_stream_snapshots" belongs_to :hearing, class_name: "LegacyHearing" belongs_to :appeal, class_name: "LegacyAppeal" end
26.333333
53
0.814346
874083e665b172b3ae7da3cb3d3d6f06e0f66b17
589
require "spec_helper" describe Admin::Fulfillment::AddressesController do describe "routing" do it "recognizes and generates #edit" do expect({ :get => "/admin/fulfillment/shipments/11/addresses/1/edit" }).to route_to(:controller => "admin/fulfillment/addresses", :action => "edit", :id => "1", :shipment_i...
36.8125
187
0.66893
f8147c7f7eed036b65560cf3be5f4094225d4b3f
3,691
class Awscli < Formula homepage "https://aws.amazon.com/cli/" url "https://pypi.python.org/packages/source/a/awscli/awscli-1.6.5.tar.gz" sha1 "e9d225414c1d782f6951ee82e25a7d44f0f4127b" bottle do cellar :any sha1 "1ed935e18c781459271b577f8e00957a8efbe4fc" => :yosemite sha1 "d04e21b63766c5aef2cdfbf34...
30.504132
94
0.712544
4a18c4b43a706713b9f3e3b9da7309d2811d838d
1,405
class SnipsWatch < Formula desc "Snips Watch" homepage "https://snips.ai" url "ssh://git@github.com/snipsco/snips-platform.git", :using => :git, :tag => "0.64.0", :revision => "6df6a46d5ccfb312163c60a0ce2b3b90d8136b54" head "ssh://git@github.com/snipsco/snips-platform.git", :using => :git, :branch => ...
30.543478
93
0.686121
3864a2baa8c6697b951298a512156e8650324f19
824
cask 'fork' do version '1.0.75' sha256 '9abfd84c82fa9dd8b1c541a243978466fc6ed7af7a90924ba3242b86f1b63325' # forkapp.ams3.cdn.digitaloceanspaces.com/mac was verified as official when first introduced to the cask url "https://forkapp.ams3.cdn.digitaloceanspaces.com/mac/Fork-#{version}.dmg" appcast 'https://git...
35.826087
106
0.691748
0198dacbd32655efb64987d9821ef51d18e24149
2,252
# frozen_string_literal: true # rubocop:disable Metrics/MethodLength # rubocop:disable Metrics/AbcSize require 'net/http' require 'json' require 'securerandom' module Cloudify class RunApplicationWorkflow < Cloudify::Service def initialize(computation) super(computation) end def call run_ap...
25.885057
73
0.632771
e9bdf246e43e97ce6228954c83c64eff8860bfb9
970
Pod::Spec.new do |s| s.name = "RxRealm" s.version = "0.7.6" s.summary = "An Rx wrapper of Realm's notifications and write bindings" s.description = <<-DESC This is an Rx extension that provides an easy and straight-forward way to use Realm's natively reactive collect...
31.290323
108
0.612371
bb4ba3ef0f16f606aa4e573f40e5e7c9ac7e9622
423
# frozen_string_literal: true # locals: plan json.title plan.title json.description plan.description start_date = plan.start_date || Time.now json.start start_date.to_formatted_s(:iso8601) end_date = plan.end_date || Time.now + 2.years json.end end_date&.to_formatted_s(:iso8601) if plan.funder.present? || plan.gra...
22.263158
52
0.756501
18a7b35ee700936d4b1272659261936c782a17b7
672
# frozen_string_literal: true class SrpmImportAll attr_reader :branch def initialize(branch) @branch = branch end def execute Dir.glob("#{ branch.srpm_path }/*.src.rpm").each do |file| if file_can_be_imported?(file) puts "#{ Time.now }: import '#{ File.basename(file) }'" SrpmImp...
23.172414
74
0.672619
0106d753a4b2e8d81533e05bfc31f2a711258056
466
cask "emailchemy" do version "14.4.5" sha256 :no_check url "https://s3.amazonaws.com/wksdownload/emailchemy/Emailchemy-Mac.dmg", verified: "s3.amazonaws.com/wksdownload/emailchemy/" name "Emailchemy" desc "Email migration, conversion and archival software" homepage "https://weirdkid.com/emailchemy/" ...
25.888889
75
0.708155
9148f73b42acacdfd6ab1fcedfd8ada2cdab82af
6,011
module RuneRb::Network # An implementation of an ISAAC cipher used to generate random numbers for message interchange. class ISAAC using RuneRb::System::Patches::IntegerRefinements # Called when a new ISAAC Cipher is created. def initialize(seed) @aa = 0 @bb = 0 @cc = 0 @mm = []...
27.447489
97
0.449676
1daf5c86dba3f7016aad3f9543662d6e924dd315
5,752
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2015 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject, which is a fork of ...
35.073171
96
0.605702
ffc61a87f5c8503cea82a057601188ebf1195b42
8,360
Shindo.tests('Fog::Compute[:aws] | network interface requests', ['aws']) do @network_interface_format = { 'networkInterfaceId' => String, 'subnetId' => String, 'vpcId' => String, 'availabilityZone' => String, 'description' => Fog::Nullable::String, 'ownerId' ...
43.316062
133
0.678469
62e7771221efdc450b307bc6f5379d61d90faeb9
59,817
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Web::Mgmt::V2018_02_01 # # WebSite Management Client # class Recommendations include MsRestAzure # # Creates and initiali...
44.907658
216
0.697527
18e913a253b1952f392069937332bf6fa13a9578
2,053
# Password Reset concern for User model. module PasswordResetable extend ActiveSupport::Concern module ClassMethods def pass_reset_expiration Rails.application.config.configurations[:pass_reset_expiration] end def pass_reset_token_str_max_length Rails.application.config.pass_reset_token_st...
30.641791
76
0.628836
0165fa769a80da70228999e010503fe327c3cc14
3,059
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../../../fixtures/rational', __FILE__) describe :kernel_Rational, shared: true do describe "passed Integer" do # Guard against the Mathn library conflicts_with :Prime do it "returns a new Rational number with 1 as the ...
29.413462
95
0.63779