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
1aa192bfe3723d1fb06499931bb9d3aa8f00a0bd
8,455
=begin #Telegram bot API #This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api). OpenAPI spec version: 3.6 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complianc...
28.758503
131
0.615967
284c7e2a962c40fe6c300b5e08a9b5493fe15f35
341
class CreateComics < ActiveRecord::Migration[6.1] def change create_table :comics do |t| t.string :full_path, null: false t.integer :size t.integer :issue_number t.integer :pub_year t.integer :pub_month t.string :extension t.integer :title_id t.timestamps null: fal...
21.3125
49
0.648094
b93967a8b3727cd12660a84d5cb4029b330b8c75
1,301
describe TodoBot::Tasks::FinishTaskService do let(:service) { described_class.new(args) } let(:args) { {user: user, chat: chat, number: number} } let(:user) { create(:user) } let(:number) { 1 } describe '#execute' do subject { service.execute } context 'when chat doesn`t contain list' do let(:...
28.911111
99
0.601845
3300414479c1bc360684690fff2bbb1cc6f6b46f
361
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::SQL::Mgmt::V2014_04_01 module Models # # Defines values for GeoBackupPolicyState # module GeoBackupPolicyState Disabled = "Disabled" ...
22.5625
70
0.706371
1c336d99267150f9e7beb6934abd60522d74648a
2,704
class SlotsStep include MemoryModel attribute :processor, :steps_processor attribute :review_slot, :string attribute :currently_filling, :string attribute :skip_remaining_slots, :boolean attribute :option_0, :string attribute :option_1, :string attribute :option_2, :string before_validation :reorde...
24.36036
76
0.698964
912cf4ef0f9d0ecdaf546f1bcd10327978e7250b
732
Pod::Spec.new do |spec| spec.name = "ValidationNEL" spec.version = "0.2.0" spec.summary = "A Swift implementation of ValidationNEL: accumulating more than one failure." spec.homepage = "https://github.com/Hxucaa/ValidationNEL" spec.license = { type: 'MIT', file: 'LICENSE' } spec.authors = { "Lance Zhu" => '...
36.6
113
0.684426
acf83c3a5a767abfbc10d671d20d56dfc2929be7
191
# frozen_string_literal: true require "zeitwerk" module DevOrbit loader = Zeitwerk::Loader.new loader.tag = File.basename(__FILE__, ".rb") loader.push_dir(__dir__) loader.setup end
17.363636
45
0.748691
bb70a609d197a02f21d802c8a97e0f6680626fae
3,370
# -*- coding: utf-8 -*- # # frozen_string_literal: true module Rouge module Themes # A port of the pastie style from Pygments. # See https://bitbucket.org/birkenfeld/pygments-main/src/default/pygments/styles/pastie.py class Pastie < CSSTheme name 'pastie' style Comment, ...
47.464789
95
0.465282
4aede30fc45acdd3ab13684e63963a21bb388ee0
1,437
require 'jackal-stacks' module Jackal module Stacks module Formatter # Format result for slack notification class Slack < Jackal::Formatter # Source service SOURCE = 'stacks' # Destination service DESTINATION = 'slack' NOTIFY_ON = %w(created updated destroyed...
32.659091
137
0.512178
d545496b5e919c6d6a44096744f480430a2af7e0
418
class SessionsController < ApplicationController def new end def create user = User.find_by(email: params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) log_in user redirect_to user else flash.now[:danger] = 'Invalid email/password combination'...
19.904762
65
0.674641
037e1a4412ae4d487f9df598256a4e41b933d9b8
125
class RemoveOwnedShowsFromUsers < ActiveRecord::Migration[5.0] def change remove_column :users, :owned_shows end end
20.833333
62
0.776
d5afa91b1619b06435572b5c71489a0fc6b03afc
119
class AddToContainerType < ActiveRecord::Migration def change add_column :container_types, :label, :string end end
19.833333
50
0.798319
ab3ce9258ac33188b64aa8812cd8d2fc77c2a968
1,708
# Class represents a lono option that is possibly callable. Examples: # # config.allow.envs # config.allow.regions # config.deny.envs # config.deny.regions # # Abstraction is definitely obtuse. Using it to get rid of duplication. # class Lono::App class CallableOption include Lono::Utils::Logging ...
29.964912
106
0.618267
ac3ae07f3a0ea0c8077e06acd145bd3a378f691b
51
require "mkmf" create_makefile("rubyraw/rubyraw")
12.75
34
0.784314
6136903a8d2e39c671aa5cee44a7f80d78c56261
1,386
# encoding: utf-8 # frozen_string_literal: true require_relative 'keys' module TTY class Reader # Responsible for meta-data information about key pressed # # @api private class Key < Struct.new(:name, :ctrl, :meta, :shift) def initialize(*) super(nil, false, false, false) end ...
23.1
61
0.520202
91e86aa00515de1f5ada51ab6d03bace99283e10
442
require 'simplecov' SimpleCov.start do add_filter '/spec/' add_group 'Codeception', 'lib/guard' end require 'rspec' require 'guard/codeception' require 'coveralls' Coveralls.wear! RSpec.configure do |config| config.treat_symbols_as_metadata_keys_with_true_values = true config.run_all_when_everything_filtered...
22.1
66
0.68552
87759055abe6335f0cec565733e03cf4fe6880cb
4,254
#-- # Copyright 2011-2013 Splunk, 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...
32.976744
80
0.682652
ff468ca7b783ccfbc77c4045514c97d5685499dc
184
class CreateItems < ActiveRecord::Migration[5.2] def change create_table :items do |t| t.string :name t.string :description t.integer :box_id end end end
18.4
48
0.652174
187d95913a3f42da3fde317772f1ebc3f91173ef
1,417
require 'test_helper' class GitTest < Minitest::Test def test_get_tags_sort_by_date_asc output = <<-EOF refs/tags/0.0.1 Thu Aug 4 12:34:56 2011 +0200 refs/tags/1.0.0 Fri Aug 5 11:11:11 2011 +0200 refs/tags/1.0.1 Thu Sep 12 21:10:00 2013 +0200 refs/tags/1.1.0 Thu Dec 10 10:10:10 2015 +0200 refs/tags/2.0.0 Fri Dec...
37.289474
145
0.695131
61a8fa9c1bbd4c61e598561fd6400564a3407a0e
447
# Be sure to restart your server when you modify this file. HackerspaceLibrary::Application.config.session_store :cookie_store, key: '_hackerspace-library_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the sess...
49.666667
103
0.823266
38cdf3065631172a2139a5a09163bde6764db53f
2,960
require "rails_helper" describe "Rate limiting" do include_context "stub types api" include_context "stub candidate create access token api" let(:ip) { "1.2.3.4" } it_behaves_like "an IP-based rate limited endpoint", "POST /csp_reports", 5, 1.minute do def perform_request post csp_reports_path, par...
41.111111
121
0.710473
bb199ce1343f3e7c9437181a5b709d7bb63793d5
590
$:<< 'lib' require 'benchmark' require 'bloomfilter-rb' n = 10000 Benchmark.bm do |x| r = BloomFilter::Redis.new x.report("insert") do n.times do r.insert("a") end end x.report("lookup present") do n.times do r.include?("a") end end x.report("lookup missing") do n.times...
17.352941
61
0.583051
e82c93843c78ea5c8deb8a5fa829654d17055896
367
class InvoicesMailer < ActionMailer::Base default from: Rails.configuration.sender def send_invoice(invoice_id, to, subject, message, attach_pdf) @invoice = Invoice.find(invoice_id) @message = message attachments["invoice-#{@invoice.code}.pdf"] = File.read(@invoice.invoice_location) if attach_pdf ...
30.583333
100
0.724796
2825dbffe21f370911fd56e0515ba89a2f5ac1a4
2,596
class Hdf4 < Formula homepage "http://www.hdfgroup.org" url "http://www.hdfgroup.org/ftp/HDF/releases/HDF4.2.10/src/hdf-4.2.10.tar.bz2" sha1 "5163543895728dabb536a0659b3d965d55bccf74" bottle do root_url "https://homebrew.bintray.com/bottles-versions" sha1 "c2c52d5a07559d08d3eb5af108ed8b839721ed88" => :...
31.658537
89
0.67604
7948995ba6170f212af650499b890b9a2f420589
4,086
# This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause # this file to always be loaded, without a need to explicitly require ...
44.413043
92
0.755262
5daeb2f445d8cc2e3e57c6691123e517973bad55
3,020
# frozen_string_literal: true module TwelvedataRuby class Error < StandardError DEFAULT_MSGS = { "EndpointError" => "Endpoint is not valid. %{invalid}", "EndpointNameError" => "`%{invalid}` is not a correct endpoint. Valid values are: `%{valid_names}`", "EndpointParametersKeysError" => "Invalid...
33.186813
135
0.657285
33e6c4dbf2c96b1650e572146b887c13b7279124
153
# frozen_string_literal: true RSpec.describe EtdaUtilities do it "has a version number" do expect(EtdaUtilities::VERSION).not_to be nil end end
19.125
48
0.764706
bbba61557acdfbc4d398c50b4d5f00a3386bf724
320
# frozen_string_literal: true require "active_support" require "active_support/core_ext" require "active_model" require "dfe_wizard/version" require "dfe_wizard/store" require "dfe_wizard/step" require "dfe_wizard/base" require "dfe_wizard/controller" require "dfe_wizard/issue_verification_code" module DFEWizard end
21.333333
44
0.834375
4af2a2ac4896fa84d364be9bde93d12e8b170830
6,366
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::NetApp::Mgmt::V2019_10_01 # # Microsoft NetApp Azure Resource Provider specification # class MountTargets include MsRestAzure # # Creates a...
46.808824
206
0.707823
ac8953c3251ebf5039dae07505a7504bb9a70e9c
1,534
# -*- encoding: utf-8 -*- # stub: crass 1.0.6 ruby lib Gem::Specification.new do |s| s.name = "crass".freeze s.version = "1.0.6" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "bug_tracker_uri" => "https://github.com/rgrove/crass/i...
43.828571
321
0.687093
873731cae5e98db78e039cbe186ddfa226e670f0
3,133
# 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...
55.946429
184
0.789658
4ac1ea8c0565cfdbe5e7defcb3a1021d88881f7a
1,501
class UserTeeTimesController < ApplicationController def create @user_tee_time = UserTeeTime.new authorize @user_tee_time @tee_time = TeeTime.find_by_id(params[:user_tee_time][:tee_time_id]) @user = User.find_by_id(params[:user_tee_time][:user_id]) if @tee_time.add_user(@user) render json: ...
29.431373
87
0.711526
1ccf3fc58503851d6b6af400589496c3219ea483
13,653
require 'spec_helper' describe 'automysqlbackup::backup' do let :default_params do { :cron_script => false, :backup_dir => '/backup', :etc_dir => '/usr/local/etc' } end context 'on supported operating systems' do ['Debian', 'RedHat'].each do |osfamily| ...
34.652284
96
0.493591
38efe5b8fd55818cb6f72c30faf962d57e29bc48
341
module Bankscrap class Investment include Utils::Inspectable attr_accessor :bank, :id, :name, :balance, :currency, :investment def initialize(params = {}) params.each { |key, value| send "#{key}=", value } end private def inspect_attributes %i[id name balance currency investmen...
18.944444
69
0.651026
7afe83dca293f96dba9a245abc9e2ccbef7b72d0
614
require 'beaker/hypervisor/vagrant' class Beaker::VagrantParallels < Beaker::Vagrant def provision(provider = 'parallels') super end def self.provider_vfile_section(host, options) provider_section = "" provider_section << " v.vm.provider :parallels do |prl|\n" provider_section << " prl....
32.315789
113
0.688925
e9110e6e72bbf6166bca2ce89d6717226a876e39
895
# encoding: UTF-8 module Mutant class Mutator class Node # Mutator for resbody nodes class Resbody < self handle(:resbody) children :captures, :assignment, :block private # Emit mutations # # @return [undefined] # # @api private ...
19.456522
65
0.52514
f7f907b04a3f1869d3d1066432810ed8ebe6dda2
977
# frozen_string_literal: true # rubocop:disable Metrics/LineLength # == Schema Information # # Table name: taggings # # id :uuid not null, primary key # created_at :datetime not null # updated_at ...
30.53125
103
0.559877
28ee92235357d13d5101e4e26ba47a38ce492d13
139
class AddHideDefaultFieldsToSpaces < ActiveRecord::Migration def change add_column :spaces, :hide_default_fields, :boolean end end
23.166667
60
0.798561
eddd42ffcbac72546d98f22eaee5a6ed6fcff51b
308
cask 'font-nanummyeongjo-eco' do version :latest sha256 :no_check url "http://appdown.naver.com/naver/font/NanumFont/setupmac/NanumFontSetup_MJECO_OTF_Ver1.0.app.zip" name 'Nanummyeonjo Eco' homepage 'https://hangeul.naver.com/2017/nanum' app "NanumFontSetup_MJECO_OTF_Ver1.0.app" end
38.5
104
0.753247
d5aead7826ae80cad4635f42569eb39a97ff3495
16,042
module Resque # A Resque Worker processes jobs. On platforms that support fork(2), # the worker will fork off a child to process each job. This ensures # a clean slate when beginning the next job and cuts down on gradual # memory growth as well as low level failures. # # It also ensures workers are always l...
29.167273
97
0.618751
1d60e68c3073c4db6179fcd4cccf9abb65ad162c
1,333
{ matrix_id: '1832', name: 'scrs8-2b', group: 'Meszaros', description: 'LP sequence: scrs8-2b-4, 16, 64', author: '', editor: 'C. Meszaros', date: '2004', kind: 'linear programming problem sequence', problem_2D_or_3D: '0', num_rows: '1820', num_cols: '3499', nonzeros: '73...
29.622222
89
0.63916
085e98c76e424b58730facc480ba23e09da643c9
57
require "spec_helper" describe 'test template' do end
8.142857
27
0.754386
5d51a65a297925fee3d4614dbf05613c95316d84
6,452
require 'spec_helper' describe Mongo::Retryable do let(:klass) do Class.new do include Mongo::Retryable attr_reader :cluster attr_reader :operation def initialize(operation, cluster) @operation = operation @cluster = cluster end def max_read_retries ...
28.052174
115
0.628642
331c160b3fa49bd93a98f1382db140f32508b76f
8,043
require 'senedsa' module Elesai; module Action class Check DEFAULT_SENEDSA_CONFIG_FILE = File.join(ENV['HOME'],"/.senedsa/config") include Senedsa def initialize(arguments,options) @options = options.merge!({ :monitor => :nagios, :mode => :active, :diskcachepolicy => nil }) @arguments = [...
44.192308
166
0.585105
4af58e7211d2d33b4622e8032434ee6030de6140
343
require 'xml/libxml' require 'test/unit' class TestDeprecatedRequire < Test::Unit::TestCase def test_basic xp = XML::Parser.string('<ruby_array uga="booga" foo="bar"><fixnum>one</fixnum><fixnum>two</fixnum></ruby_array>') assert_instance_of(XML::Parser, xp) @doc = xp.parse assert_instance_of(XML::Doc...
28.583333
118
0.71137
d57beef1353a6a377978be852552667f7ccb6410
214
class CreateEnglishQuizQuestions < ActiveRecord::Migration[5.1] def change create_table :english_quiz_questions do |t| t.string :question t.text :explanation t.timestamps end end end
19.454545
63
0.705607
1106a20b9104349dad7d73d461a1b2779c5f8a83
1,888
class Bazelisk < Formula desc "User-friendly launcher for Bazel" homepage "https://github.com/bazelbuild/bazelisk/" url "https://github.com/bazelbuild/bazelisk.git", tag: "v1.7.5", revision: "089a39a3f896a43e759e0b494e4acfe2982aca7e" license "Apache-2.0" head "https://github.com/bazelbuild/ba...
40.170213
121
0.74947
1dfbf179927c92b34b2946c69603530b88f30750
780
# 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.896552
74
0.730769
acc79c8a9d7d76dab110da628b0d748ff699898f
957
# frozen_string_literal: true class API::Products::SelfAssignedController < API::BaseController before_action :require_staff_login_for_api def index @target = params[:target] @target = 'self_assigned_no_replied' unless target_allowlist.include?(@target) @products = case @target when 'se...
31.9
82
0.560084
1d112e80e86ebdf688d4e1dee8b58b8247e6d4c3
418
class CreateCustomers < ActiveRecord::Migration def change create_table :customers do |t| t.integer :company_id t.string :first_name t.string :last_name t.string :email_address t.string :phone_number t.string :address t.string :city t.string :state t.strin...
22
47
0.619617
03d9109602ff875146a0e4329048eb8b9e2c74be
297
k1 = "Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong"; k2 = "Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping Pong Ping"; h = {k1 => 0, k2 => 0}; 3000000.times{|i| k = i % 2 ? k2 : k1; h [k] = h[k] + 1}
59.4
107
0.659933
018618dd634c88f084b87368eb1f3bd0a9c6c08c
1,003
# -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'log_runes/version' Gem::Specification.new do |gem| gem.name = "log_runes" gem.version = LogRunes::VERSION gem.authors = ["wlipa"] gem.email = ["dojo...
45.590909
239
0.671984
f8903d94cec13965648f1f9b1c8c1d4095e27be9
1,286
# frozen_string_literal: true module AutoCompleteUsername extend ActiveSupport::Concern module ClassMethods def attr_autocomplete_username_as(user_attr) attribute_name = :"#{user_attr}_username" # def second_author_username # @second_author_username || second_author.try(:username) # ...
35.722222
118
0.679627
ed470530d7645a362248851c7da6a8402a836f9f
2,508
# frozen_string_literal: true module Crafty module ToolStateMachine class Tool # @return [Proc] a block that returns the initial [Mode] for the tool. attr_accessor :activator # @return [Geom::BoundingBox] the bounding box containing the points of interest to the tool attr_accessor :bound...
31.746835
110
0.602472
114d1e7a379cb5fc3f0278af6c1b4aeab161aaa6
479
xml.instruct! xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://search.yahoo.com/mrss/" do xml.title "#{@user.name} activity" xml.link href: user_url(@user, :atom), rel: "self", type: "application/atom+xml" xml.link href: user_url(@user), rel: "alternate", type: "text/html" xml...
36.846154
102
0.665971
2871afff3786819f31484e9615b75fc0c8039e5f
468
module Locomotive module Steam class EditableElementService include Locomotive::Steam::Services::Concerns::Decorator attr_accessor_initialize :repository, :locale def find(page, block, slug) decorate(Decorators::I18nDecorator) do repository.editable_element_for(page, block,...
21.272727
77
0.668803
ff28039bafb8df5b241349e50574be56eccca676
391
# frozen_string_literal: true module Jekyll module Drops class CollectionDrop < Drop extend Forwardable mutable false def_delegator :@obj, :write?, :output def_delegators :@obj, :label, :docs, :files, :directory, :relative_directory private def_delegator :@obj, :metadata, :fallb...
18.619048
82
0.654731
87557d67bbdc308b5146f00c5828f9f540c434dd
11,591
require 'aws-sdk' require 'timeout' class OpsworksInteractor begin require 'redis-semaphore' rescue LoadError # suppress, this is handled at runtime in with_deploy_lock end DeployLockError = Class.new(StandardError) # All opsworks endpoints are in the us-east-1 region, see: # http://docs.aws.amazo...
32.742938
108
0.686912
e99625add9d790cc1db80e51782f9ad068385882
982
module Lita # Constructs a Lita plugin from a block. # @since 4.0.0 # @api private class PluginBuilder # @param namespace [String, Symbol] The Redis namespace to use for the plugin. # @yield The class body of the plugin. def initialize(namespace, &block) @namespace = namespace.to_s @bloc...
25.179487
82
0.660896
e905b7da556e76adce4f9ae378680a012475810e
4,844
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # web site for more information on licensing and terms of use. # http://metasploit.com/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank ...
30.465409
165
0.638315
ff3e0f44921c95dcd6fe97addc21ba800a00d1c4
10,361
=begin #SendinBlue API #SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/or...
32.581761
839
0.620693
e9dfdee642b07823f908688888654ef36824c2e2
576
require 'forwardable' module Cucumber module Formatter # Adapter to make #puts/#print/#flush work with win32console class ColorIO #:nodoc: extend Forwardable def_delegators :@kernel, :puts, :print # win32console colours only work when sent to Kernel def_delegators :@stdout, :flush, :tty?, :...
24
97
0.637153
bfc2c6d02b731a053433dda8548a741cd129818c
2,994
# frozen_string_literal: true module CIT module Actions # Provides functions to access actions on records of mad scientists module MadScientists require_relative 'mad_scientists/create' # Creates new record of a mad scientist and returns associative array # with information about the recor...
36.512195
75
0.655311
3989b9c90cf5b0979b14525b6a37156b4b4dca98
172
require 'guard' require 'guard/guard' module Guard class Autorefresh < Guard def run_on_change(paths) system('autorefresh my_awesome_app') end end end
13.230769
42
0.709302
08924e54182b9472581a3489ae970bd725587393
660
# frozen_string_literal: true module RuboCop module Cop module Minitest # This cop enforces the test to use `assert_in_delta` # instead of using `assert_equal` to compare floats. # # @example # # bad # assert_equal(0.2, actual) # assert_equal(0.2, actual, 'message'...
23.571429
59
0.578788
ab716b124fbe58958b2faadc97748609af6108a5
932
RSpec::Matchers.define :schedule_rake do |task| match do |whenever| jobs = whenever.instance_variable_get("@jobs") key = @duration.is_a?(ActiveSupport::Duration) ? @duration.to_i : @duration if jobs.has_key?(key) jobs[key].any? do |job| options = job.instance_variable_get("@options") ...
25.189189
79
0.666309
4aab371ea1367608f25bbca24c854f9f1d0ef2a7
861
# Initialiazing vars cars = 100 space_in_a_car = 4.0 drivers = 30 passengers = 90 cars_not_driven = cars - drivers # calculates the number of cars not driven, assuming one car per driver cars_driven = drivers # calculates the number of cars driven, assumin one car per driver carpool_capacity = cars_driven * space_in_a...
37.434783
77
0.785134
7988cc9edc7cf8e922a3962e00e09149f1aa431b
1,198
=begin =end require 'spec_helper' require 'json' require 'date' # Unit tests for AuthressSdk::Body6 # Please update as you see appropriate describe 'Body6' do before do # run before each test @instance = AuthressSdk::Body6.new end after do # run after each test end describe 'test an instance...
23.038462
102
0.696995
21cabeadd74e0d2f3d80f27861318e0263434875
764
# frozen_string_literal: true require 'fog/core/collection' require 'fog/aliyun/models/compute/eip_address' module Fog module Compute class Aliyun class EipAddresses < Fog::Collection model Fog::Compute::Aliyun::EipAddress def all(filters_arg = {}) data = Fog::JSON.decode(servic...
26.344828
109
0.624346
01147a9e5956a786a456cfce5c673d65d3aff60e
934
require 'test_helper' describe Enumerize::Base do let(:klass) do Class.new do extend Enumerize end end let(:subklass) do Class.new(klass) end let(:object) { klass.new } it 'returns [] when not set' do klass.enumerize :foos, in: %w(a b), multiple: true object.foos.must_equal [] ...
21.72093
71
0.656317
1db24f35cb45c34bfaeb0dd1a784415972b514f8
4,617
#!/usr/bin/env ruby # encoding: utf-8 require 'optparse' require 'httparty' require 'merkle-hash-tree' require 'digest' require 'base64' config_raw = ARGV.pop config = JSON.parse(config_raw) def defaultHeaders(token) { 'Accept' => '*/*', 'Content-Type' => 'application/json', 'Authorization' => 'Bearer...
31.841379
124
0.604722
330af35c00515767191e81e3e15111e48cd3b3f3
1,121
BackboneDemo2::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 have to restart the...
37.366667
85
0.773417
f8bbb2eef0fbe6bc84031cd73a93bed0df0e30c7
88
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) require "tracker_deliveries"
29.333333
58
0.761364
e9560eff75b76085d682d64c239695730053b162
1,030
module VersionedDatabaseFunctions module Adapters class Postgres # Decorates an ActiveRecord connection with methods that help determine # the connections capabilities. # # Every attempt is made to use the versions of these methods defined by # Rails where they are available and publ...
28.611111
80
0.640777
21cd2260e30540216afa032038e9b53a4858ec20
123
require 'sinatra/base' class SinatraStem < Sinatra::Base get '/' do "Hellllllo! i am Lindsey Lohan!!" end end
12.3
37
0.650407
ffdc863ce006ddc037af17d9fb246077676873ba
2,663
class Admin::UsersController < Admin::AdminController before_action :set_admin_user, only: [:show, :edit, :update, :destroy] def initialize(*params) super(*params) @category = t(:menu_user,scope:[:admin_menu]) @controller_name = t('activerecord.models.user') end # GET /admin_users # GET /admin_...
26.63
118
0.674427
08b93a38f2743682144e80518a9a3e41944595ac
1,712
require 'rails_helper' require 'shared_context_for_bucket_generators' module Physiqual module BucketGenerators describe EquidistantBucketGenerator do let(:interval) { 6 } let(:measurements_per_day) { 3 } let(:hours_before_first_measurement) { 6 } let(:subject) { described_class.new(measur...
33.568627
115
0.628505
616d7d90500058214aa162993b95f23183085d53
322
require 'rails_helper' RSpec.describe "albums/show", type: :view do before(:each) do @album = assign(:album, Album.create!( :gallery => nil, :title => "Title" )) end it "renders attributes in <p>" do render expect(rendered).to match(//) expect(rendered).to match(/Title/) end en...
18.941176
44
0.611801
b947c94e23cc0a948c15e79b91e3e7504e1d4eef
5,504
# frozen_string_literal: true class Test extend MSIDP::Endpoint end RSpec.shared_context 'tenant' do let(:tenant) { 'tenant.example.com' } end RSpec.describe MSIDP::Endpoint, '#authorize_uri' do include_context 'tenant' subject { Test.authorize_uri(tenant) } it { is_expected.to eq URI.parse( "htt...
27.247525
76
0.697856
ff5cbb9262a8ea5c8972f4dae2236bdd9e469333
378
module Spree module Inventory module UploadFileActionDecorator def upload_options @upload_options ||= { vendor_id: upload_meta.delete(:vendor_id) } end def queue_name slug = Spree::Vendor.find(upload_options[:vendor_id]).slug "#{slug}-uploads" end end Uplo...
22.235294
73
0.677249
339d62766a963f20c10281babbea6a388b7112f9
232
module Gitlab module Git class Railtie < Rails::Railtie initializer 'gitlab_git.add_middleware' do |app| app.config.middleware.insert_before "Rack::Runtime", "Gitlab::Git::Middleware" end end end end
23.2
86
0.685345
0861e54e8e41308a4b6f20e0b3e38fbb75a0ab95
279
require './config/environment' if ActiveRecord::Base.connection.migration_context.needs_migration? raise 'Migrations are pending. Run `rake db:migrate` to resolve the issue.' end use Rack::MethodOverride use UsersController use PupdatesController run ApplicationController
21.461538
77
0.820789
110314c12c9744edecf9f97c8bec72b4817deae8
115
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) require "ruby_wifi_scanner" require "minitest/autorun"
23
58
0.765217
26dee9ca4f6b6992a2567fac63019e6dc43d572a
1,340
class DockerFileBuilder def write_persistent_files unless @blueprint_reader.persistent_files.nil? write_comment("#Persistant Files #{@blueprint_reader.persistent_files}") log_build_output('set setup_env') paths = '' src_paths = @blueprint_reader.persistent_files unless src_paths.nil?...
35.263158
91
0.622388
6ad51a745704c68803d0e24bf5fa469a6601e446
1,062
# -*- encoding : utf-8 -*- require 'spec_helper' describe 'apt::force', :type => :define do let :title do 'my_package' end let :default_params do { :release => 'testing', :version => false } end [{}, { :release => 'stable', :version => '1' } ]...
24.136364
99
0.539548
4a4d5adad2ede3565b763e3ab7fad0d606885b4e
1,020
class Rem < Formula desc "Command-line tool to access OSX Reminders.app database" homepage "https://github.com/kykim/rem" url "https://github.com/kykim/rem/archive/20150618.tar.gz" sha256 "e57173a26d2071692d72f3374e36444ad0b294c1284e3b28706ff3dbe38ce8af" bottle do cellar :any_skip_relocation sha256 "...
35.172414
95
0.786275
1ae94ac54f8cc050c98b52bcbd268858eab54ba6
1,561
Pod::Spec.new do |s| s.name = "NBUCore" s.version = "1.9.1" s.summary = "Convenience extensions and utilities for iOS projects." s.homepage = "http://cyberagent.github.io/iOS-NBUCore/" s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' } s....
38.073171
108
0.568866
ff924732a6bc719520b0763a26de120b42e41911
119
module SavedSearchTestHelper def mock_saved_search_service! SavedSearch.stubs(:enabled?).returns(true) end end
19.833333
46
0.798319
ab2f199c6c0aba99cc5009a54882aa96121a3f9c
2,724
# # Cookbook Name:: prometheus # Recipe:: alertmanager # # Author: Paul Magrath <paul@paulmagrath.com> # # 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/L...
28.978723
104
0.716593
e26d582805c3600f36bb72c4c6b5276a87626907
2,793
# frozen_string_literal: true require "spec_helper" describe GraphQL::Relay::ConnectionInstrumentation do it "replaces the previous field definition" do test_type = GraphQL::ObjectType.define do name "Test" connection :tests, test_type.connection_type end assert_equal ["tests"], test_type.fi...
33.25
133
0.717508
1db4a66b780d0a17f5fb02a2521f46615a670589
2,045
require File.expand_path(File.join(File.dirname(__FILE__), '..', "helper")) module SWF class TestButton < Kedama::TestCase def test_new_yields called = false Button.new { |button| assert button called = true } assert called end def test_button Movie.new { |m...
26.907895
84
0.494866
ed637e7b04d6b74d0c7a0f7eb73be58dca067473
276
require 'ipconverter/version' require 'ipconverter/ipconverter' # Contains the methods for doing IP Address conversions # # Example: # IpConverter.str_to_int('192.168.2.1') # 3232236033 # module IpConverter module_function :str_to_int module_function :int_to_str end
21.230769
56
0.782609
e20ea336cb447ee6f6479c67192f2707a65df800
298
class RoyalTsx < Cask url 'http://app.royaltsx.com/updates/royaltsx_1.3.0.0.dmg' appcast 'http://app.royaltsx.com/updates_stable.php' homepage 'http://www.royaltsx.com' version '1.3.0.0' sha256 '2306ae0579b097ccf4796f9cc08012819d3e55d5025a1424c8eca5330cdaedf5' link 'Royal TSX.app' end
33.111111
75
0.765101
333558d69d11a33a76ff5bb7ea596adf111e1902
2,731
### # Do not use this file to override the ruby cookbook's default # attributes. Instead, please use the customize.rb attributes file, # which will keep your adjustments separate from the AWS OpsWorks # codebase and make it easier to upgrade. # # However, you should not edit customize.rb directly. Instead, create # "r...
39.57971
108
0.691688
7a988b7828d20471d3e62400768ff31c3036b025
4,410
# Copyright (c) 2018 Yegor Bugayenko # # 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, dis...
40.090909
101
0.663492
180233a51ffbd748f9871b9d9a307284e4ea2aea
3,731
# frozen_string_literal: true json.course do user_role = current_user&.role(@course) || CoursesUsers::Roles::VISITOR_ROLE json.call(@course, :id, :title, :description, :start, :end, :school, :subject, :slug, :url, :submitted, :expected_students, :timeline_start, :timeline_end, :day_excepti...
47.227848
99
0.76521
1a29c54e3d8ee439621aa360b5575853c8fc8fe5
518
require File.dirname(__FILE__) + '/spec_helper.rb' FEED = 'http://twitter.com/statuses/user_timeline/3922901.rss' describe MiniTwitter do before(:each) do @twitter = MiniTwitter::Feed.new(FEED) end it "should exists" do @twitter.class.should == MiniTwitter::Feed end it "should have items" d...
22.521739
62
0.650579
91e817afb7b7fd98653f20a1db9d1aa5b87ef51d
2,821
# encoding: utf-8 module Nanoc3::CLI::Commands class Update < Cri::Command def name 'update' end def aliases [] end def short_desc 'update the data stored by the data source to a newer version' end def long_desc 'Update the data stored by the data source to a ...
29.385417
78
0.542361
1ddcf35017881bf8b8a1436ed0537c8097c17e6e
2,170
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = GreatRanking include Msf::Exploit::Remote::Gdb def initialize(info = {}) super(update_info(info, 'Name' ...
27.820513
154
0.612903
ac30c6d5366e568dabfb6313851ab78603f29601
179
require 'artoo' connection :beaglebone, :adaptor => :beaglebone device :led, :driver => :led, :pin => :P9_12 work do every 1.second do led.on? ? led.off : led.on end end
17.9
47
0.653631