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
e99855f46258ff1d4c2128c8c856db662db055d9
1,007
# frozen_string_literal: true require 'rails_helper' RSpec.describe Validations::BenefitYearCreateContract, type: :model, dbclean: :after_each do let(:params) do { expected_contribution: 0.0992, calendar_year: 2020 } end context 'for success case' do before do @result = subject.call(params) e...
23.97619
92
0.677259
f739b19d985b61039a1ccfb49ce14149701254a1
390
class Locust::Keywords::MinLength class Verifier < Locust::Verifier validate :object_length_satisfies_the_limit private def continue? errors.empty? && schema.validate.empty? && object.is_a?(String) end def object_length_satisfies_the_limit return unless continue? return if obj...
21.666667
69
0.7
08fe17d1c072f6b7672865ae220ae3b7af83da7a
47
class PersonRoundColor < ApplicationRecord end
15.666667
42
0.87234
6af9e5f420739f74dc2ee4270d797d57e16e616c
3,782
module Api class ConversionHostsController < BaseController include Subcollections::Tags # Create a conversion host and enable it. This operation will run as an # MiqTask. # # Both the 'resource_type' and 'resource_id' are mandatory arguments, # and the 'resource_type' must be a supported res...
42.022222
175
0.698308
1d7b2cb7360dda3fe8627359a063e331d5093689
6,672
class Ffmpeg < Formula homepage "https://ffmpeg.org/" url "https://www.ffmpeg.org/releases/ffmpeg-2.5.3.tar.bz2" sha1 "160d53a0d6b8df18336fac7f068c390ac2d34cef" head "git://git.videolan.org/ffmpeg.git" bottle do sha1 "08d5a4b48139242805c77ed1e09edba5bc27f5e9" => :yosemite sha1 "87286d9e8da3310e75b01...
37.483146
116
0.655126
f73683b4600483930f2b208381916025d23d83f9
67
module Fog module Google VERSION = "1.15.0".freeze end end
11.166667
29
0.656716
e88750690c3fc2a5de31f88ff45e46fa673ca2b6
1,832
module Comments class Tagging < ActiveRecord::Base DEFAUlT_PER = 20 include Attachable validates :tag, presence: true validates_uniqueness_of :tag_id, scope: [:attachable_id, :attachable_type,:context_id] belongs_to :tag, inverse_of: :taggings after_destroy do tag.destroy if tag.taggings...
33.925926
128
0.639192
7aa2e4b794faedec25490448edd26e14828bfc4d
203
#!/usr/bin/env ruby file = ARGV[0] fail ArgumentError.new 'Please pass a filename' unless file file += '.rb' unless file.match(/.rb$/) `echo "#!/usr/bin/env ruby\n\n" > #{file}` `chmod u+x #{file}`
18.454545
59
0.630542
87855508aa01096159380f426cd53326385c12f8
653
# encoding: utf-8 require 'hocon' require 'hocon/config_error' # # The type of a configuration value (following the <a # href="http://json.org">JSON</a> type schema). # module Hocon::ConfigValueType OBJECT = 0 LIST = 1 NUMBER = 2 BOOLEAN = 3 NULL = 4 STRING = 5 def self.name(config_value_type) case...
21.766667
109
0.675345
265afc1c3eb1ae3081f3c868544c89f2f95ce3d1
180
# frozen_string_literal: true FactoryBot.define do factory :event_notificator_event, class: Turtle::EventNotificator::Event do initialize_with { new(:completed) } end end
22.5
77
0.777778
081147a20046020b4daba92cf4f261c3d1d3bf9b
4,540
# Adds a class to sum up attributes of the class where it's included module Summarizer module Base def self.included(base) # Class enhancements base.extend(ClassMethods) end # the methods in this module will become class methods module ClassMethods # macro: store the option and th...
34.393939
142
0.57511
e89cc35ea273d6dcb51b9602c93d93831a755cc6
3,328
# frozen_string_literal: true require 'view/game/actionable' require 'view/game/part/base' require 'view/game/token' require 'lib/tile_selector' require 'lib/token_selector' module View module Game module Part # a "slot" is a space in a city for a token class CitySlot < Base include Actionab...
30.254545
102
0.545673
38358f6918d1ac3e8a29500e84eaa94fbaae54e2
817
# # Description: This method sets the retirement_state to retiring # $evm.log("info", "Listing Root Object Attributes:") $evm.root.attributes.sort.each { |k, v| $evm.log("info", "\t#{k}: #{v}") } $evm.log("info", "===========================================") vm = $evm.root['vm'] if vm.nil? $evm.log('error', "VM Ob...
26.354839
93
0.648715
2892f494563a942677288b9afd1af5ec433d1c71
569
require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'benchmark-ips' end require_relative '../lib/ngrams_counter' text = File.read('shakespeare-clean-smallest.txt') basic = NGramsCounter.build(:basic) tree = NGramsCounter.build(:tree) sizes = (1..6) Benchmark.ips do |benchmark| benchmark.conf...
18.966667
50
0.681898
6aa439b112744b0053951d3a55689bc94433e729
1,778
# frozen_string_literal: true module Figgy def config @config ||= config_yaml.with_indifferent_access end def messaging_client @messaging_client ||= MessagingClient.new(Figgy.config["events"]["server"]) end def geoblacklight_messaging_client @geoblacklight_messaging_client ||= GeoblacklightMessa...
30.655172
194
0.736783
bba85a537222968346ebab1e3644af171490fb0b
1,487
require 'rails_helper' RSpec.describe RegistrationsController do before do request.env['devise.mapping'] = Devise.mappings[:user] end describe 'POST #create' do let(:list_id) { ENV['MAILCHIMP_LIST_ID'] } let(:email) { 'kevin@bazfiz.com' } let(:user_attributes) do { username: 'kevin...
25.20339
95
0.621385
d502b98193ab91c76f87f4057876ea967db96c4d
6,704
require 'spec_helper' describe 'Parameter Types' do describe 'String' do it 'coerces strings' do get('/coerce/string', arg: '1234') do |response| expect(response.status).to eql 200 expect(JSON.parse(response.body)['arg']).to eq('1234') end end end describe 'Integer' do it...
33.024631
93
0.610829
7a862f497fd64fdaa6fd5196f1597af1141f65e4
945
module Emcee # The `DirectiveProcessor` is responsible for parsing and evaluating # directive comments in a source file. class DirectiveProcessor < Sprockets::DirectiveProcessor # Matches the entire header/directive block. This is everything from the # top of the file, enclosed in html comments. HEADE...
27.794118
76
0.625397
33d9bdcdd7177f2b65bde3596aa0496022b7efb3
1,170
cask 'botframework-emulator' do version '3.5.25' sha256 '78fb6ea5289a6e8fb0d2d54d921bb582af03f733de71efbb1598c5110b8e4fda' url "https://github.com/Microsoft/BotFramework-Emulator/releases/download/v#{version}/botframework-emulator-#{version}-mac.zip" appcast 'https://github.com/Microsoft/BotFramework-Emulator/...
45
129
0.726496
032860fe5203799bc7a4523c6aa99ac20294c630
106
module VCloud Dir[File.expand_path('../user/*.rb', __FILE__)].each do |file| require file end end
17.666667
64
0.669811
01e5c0f82e56fa9b4bdb85b54d9d2f81cad20dd8
4,373
# -------------------------------------------------------------------------- # # Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # no...
31.460432
78
0.405442
080fb2a05c679f45d75d80a26a7fa82cfb2922f4
714
# frozen_string_literal: true FactoryBot.define do factory(:node_param, class: 'Lightning::NodeParams') do node_id { '028d7500dd4c12685d1f568b4c2b5048e8534b873319f3a8daa612b469132ec7f7' } ping_interval { 0 } private_key { '4141414141414141414141414141414141414141414141414141414141414141' } extended_p...
32.454545
86
0.715686
621d7db5f82aceedffdb930ee97d68538971e81c
1,559
module Geometry class PointInPolygon < Struct.new(:point, :polygon) extend Memoist def inside? point_location == :inside end def outside? point_location == :outside end def on_the_boundary? point_location == :on_the_boundary end def point_location return...
23.984615
129
0.652983
b90f5ce430396f9c9f090aae5507d6776590b478
92
module Biostars module API # Biostars::API Gem version. VERSION = "0.1.4" end end
15.333333
31
0.652174
abe49872a3d60001842292b534e386c8f91fb203
3,474
# This formula tracks 1.0.2 branch of OpenSSL, not the 1.1.0 branch. Due to # significant breaking API changes in 1.1.0 other formulae will be migrated # across slowly, so core will ship `openssl` & `openssl@1.1` for foreseeable. class Openssl102p0 < Formula desc "SSL/TLS cryptography library" homepage "https://ope...
30.743363
91
0.681635
18e85c2060a02f792f1018264591f15d23ab0413
90
require "terminal_keynote/version" module TerminalKeynote # Your code goes here... end
15
34
0.777778
7a6664f4d125644e631ba34e5aa8732aa31116e3
9,520
class Subversion16 < Formula desc "Version control system designed to be a better CVS" homepage "https://subversion.apache.org/" url "https://archive.apache.org/dist/subversion/subversion-1.6.23.tar.bz2" sha256 "214abc6b9359ea3a5fda2dee87dad110d1b33dcf888c1f8e361d69fbfa053943" bottle do root_url "https:/...
34.871795
186
0.664811
0891a573210ceb5f7c5669dc6a2c730d6b5289f8
5,912
require 'rails_helper' describe CollectedInk do it 'requires an associated user' do expect(subject).to_not be_valid expect(subject.errors).to include(:user) end it 'requires an ink name' do expect(subject).to_not be_valid expect(subject.errors).to include(:ink_name) end it 'requires a brand...
29.708543
160
0.652402
0399835549f8566ff55487cdbcfc3673434cb704
930
class Sjk < Formula desc "Swiss Java Knife" homepage "https://github.com/aragozin/jvm-tools" url "https://github.com/aragozin/jvm-tools/archive/jvmtool-umbrella-pom-0.5.1.tar.gz" sha256 "d6e34a7e9ce8a094bcf8b5ceab092c04a7307a9a4e7eca0005b7d4f70dd98942" revision 1 bottle do cellar :any_skip_relocation ...
30
92
0.743011
f7a95547ad2d39820e6465d7e48de578fb06fe70
158
class BaseDecorator < SimpleDelegator def decorate(model, decorate_class = nil) ApplicationController.helpers.decorate(model, decorate_class) end end
26.333333
65
0.803797
ac53d62499683163373bb6db150aad0f9c5844ac
1,858
class Softhsm < Formula desc "Cryptographic store accessible through a PKCS#11 interface" homepage "https://www.opendnssec.org/softhsm/" url "https://dist.opendnssec.org/source/softhsm-2.6.1.tar.gz" sha256 "61249473054bcd1811519ef9a989a880a7bdcc36d317c9c25457fc614df475f2" # We check the GitHub repo tags inst...
38.708333
93
0.61141
622d74a2af170a02d22489017554a36ffb7378b5
230
class CreateSubscribers < ActiveRecord::Migration[5.0] def change create_table :subscribers do |t| t.string :phone_number t.boolean :subscribed, :default => false t.timestamps null: false end end end
23
54
0.686957
9153196347795945cd346328ecdfffca81910eab
1,774
require 'spec_helper' # This spec was generated by rspec-rails when you ran the scaffold generator. # It demonstrates how one might use RSpec to specify the controller code that # was generated by Rails when you ran the scaffold generator. # # It assumes that the implementation code is generated by the rails scaffold ...
43.268293
153
0.744645
914cdb1a98b0d65f642095c39d587d4ec90daace
133
child(:prioritized_trackers => :trackers) do extends "api/v1/trackers/partials/base" extends "api/v1/trackers/partials/owner" end
22.166667
44
0.774436
bb1b91a50f65690ca7498725b7b65a532199e4d7
2,152
# frozen_string_literal: true require 'spec_helper' describe 'osquery_spec::osquery_remove' do include_context 'converged recipe' let(:platform) do { platform: 'ubuntu', version: '14.04', step_into: %w[osquery_syslog osquery_install osquery_conf] } end let(:node_attributes) do ...
26.243902
85
0.673792
01ca44254e62651082bd7a609223ecd96d7fc4c1
7,510
=begin #NSX-T Manager API #VMware NSX-T Manager REST API OpenAPI spec version: 2.5.1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.7 =end require 'date' module NSXT class SftpProtocol # Protocol name attr_accessor :name # SSH fingerprint of server...
29.566929
114
0.625699
87cb6bf7ca7c62610c195715db602b67c8fbf095
1,507
# encoding: utf-8 class PictureUploader < 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 :file # storage :fog # Override the directory where uploaded f...
28.980769
112
0.703384
ffaa1720566b66f76d5a5af598d2517d978453c6
858
require 'test_helper' class DishTypesControllerTest < ActionDispatch::IntegrationTest setup do @dish_type = dish_types(:one) end test "should get index" do get dish_types_url, as: :json assert_response :success end test "should create dish_type" do assert_difference('DishType.count') do ...
22
75
0.694639
e2fbf0eae4fca2caba34aefd46c4074aa543306d
2,686
# frozen_string_literal: true RSpec.describe RailsExportRoutes, type: :aruba do it 'prints a help message when executed with no args' do run_command('rails-export-routes') aggregate_failures do expect(last_command_started).to be_successfully_executed expect(last_command_started).to have_output(/...
33.575
117
0.733433
21e477c56a50cbe4abc39dcf5641911e32b562f5
1,968
require "inspec/utils/parser" require "inspec/utils/file_reader" module Inspec::Resources class EtcHosts < Inspec.resource(1) name "etc_hosts" supports platform: "unix" supports platform: "windows" desc 'Use the etc_hosts InSpec audit resource to find an ip_address and its associated hosts' ...
28.941176
125
0.674289
7a9933c7c444488a4d726ea15c7ea2e5516da801
132
class AddCompanyToForms < ActiveRecord::Migration[5.2] def change add_reference :forms, :company, foreign_key: true end end
22
54
0.757576
384c15b0ff0c69997016cbae445f036a51346109
968
module Raz module FileOperations class NotExistingFile < ::StandardError; end class UnknownFileType < ::StandardError; end # Method to copy file and keep same informations (owner, mtime, ...) as original file # # @param src [String] # @param dest [String] # def copy_item(src, dest) ...
24.2
89
0.623967
4a8451a9de71547b77d1ee67fc879918a787fb4d
6,107
require "open3" require "timeout" module EnvUtil def rubybin unless ENV["RUBYOPT"] end if ruby = ENV["RUBY"] return ruby end ruby = "ruby" rubyexe = ruby+".exe" 3.times do if File.exist? ruby and File.executable? ruby and !File.directory? ruby return File.expand_path(...
29.220096
109
0.612576
26282967031bc88147833f62f0f4cad555f6c55f
6,853
require 'mocha/parameter_matchers' require 'mocha/mockery' require 'mocha/sequence' module Mocha # :nodoc: # Methods added to Test::Unit::TestCase or equivalent. module Standalone include ParameterMatchers # :call-seq: mock(name, &block) -> mock object # mock(expected_methods = ...
41.035928
141
0.651248
ed560e478426a51b0c8d2443ac3a90adb11273f5
2,306
require 'fileutils' require 'json' class Config CONFIG_FOLDER_PATH = ENV['HOME'] + '/.pot' CONFIG_FILE_PATH = CONFIG_FOLDER_PATH + '/config' attr_accessor :options def initialize(options:) @options = options end def init if !File.exists?(CONFIG_FOLDER_PATH) Dir.mkdir(CONFIG_FOLDER_PATH) ...
22.38835
96
0.663487
acbc6c3b8f1ce45a3cb6961f031ed44d631604e6
737
# frozen_string_literal: true require_relative 'boot' require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module RecipeApp class Application < Rails::Application # Initialize configuration defaults...
29.48
79
0.740841
5d01209fee7ed6c00f973489df13b269f6ee4db3
4,969
require 'spec_helper' describe Ability do it "restricts actions for non-organizers of events" do user = new_member ability = Ability.new(user) ability.should be_able_to(:create, Event.new) ability.should be_able_to(:read, Event.new) ability.should_not be_able_to(:update, Event.new) ability.sh...
38.51938
119
0.746629
bf41b7962c9ce9e1f44a9087541b36c5e3ef108a
3,996
module Gws::CrudFilter extend ActiveSupport::Concern include SS::CrudFilter included do menu_view "gws/crud/menu" before_action :set_item, only: [:show, :edit, :update, :delete, :destroy, :soft_delete] before_action :set_selected_items, only: [:destroy_all, :soft_delete_all] end private def a...
23.785714
102
0.641141
26e444764db71753910a2c57321ed912d70cabde
3,255
module Ably::Realtime class Channel # Publisher module adds publishing capabilities to the current object module Publisher private # Prepare and queue messages on the connection queue immediately # @return [Ably::Util::SafeDeferrable] def enqueue_messages_on_connection(client, raw_mes...
40.6875
200
0.65192
ffe88099ad472b094679c5af99eb0a4a550da147
2,133
# frozen_string_literal: true class Fisk module Instructions # Instruction VTESTPD forms = [] operands = [] encodings = [] # vtestpd: xmm, xmm operands << OPERAND_TYPES[24] operands << OPERAND_TYPES[24] encodings << Class.new(Fisk::Encoding) { def encode buffer, operands ...
26.012195
47
0.575715
627c0f86d3bc71b25935110c6a712d73a2772f67
2,661
!# ruby ##### # Good example of using the OptionParser class. # https://docs.ruby-lang.org/en/2.1.0/OptionParser.html # http://stackoverflow.com/questions/26434923/parse-command-line-arguments-in-a-ruby-script ##### require 'optparse' require 'ostruct' options = OpenStruct.new OptionParser.new do |opt| opt.on('-i',...
30.94186
100
0.521984
18a921c7dbc419c8ac60395fd1ee81d8bf5d6be0
7,349
module Intrigue module Task class UriSpider < BaseTask include Intrigue::Task::Web include Intrigue::Task::Parse def self.metadata { :name => "uri_spider", :pretty_name => "URI Spider", :authors => ["jcran"], :description => "This task spiders a given URI, creating entities from the ...
38.47644
195
0.594639
1ab985e0036803f775813fdcb75d4d078e757ab8
808
# frozen_string_literal: true module ErrorTracker class InstallGenerator < Rails::Generators::Base # :nodoc: include Rails::Generators::Migration source_root File.expand_path('templates', __dir__) desc 'Add migrations for ErrorTracker gem' def self.next_migration_number(path) next_migration_nu...
36.727273
84
0.766089
389a4d267e9846b6ca11d8d1c31836e535c32872
2,512
require 'rubygems' require 'sinatra' require 'sinatra/reloader' require 'sqlite3' def init_db @db = SQLite3::Database.new 'dof.db' @db.results_as_hash = true end before do #инициализация бд init_db end #configure вызывается каждый раз при конфигураций приложения: #когда изменился код программы и пере...
22.428571
119
0.640924
264f244da57f3b38cf5b416d4b7045ff06fec682
6,706
# -*- coding: utf-8 -*- class EarthDawn < DiceBot setPrefixes(['\d+e.*']) def initialize super @sendMode = 2 @sortType = 1 end def gameName 'アースドーン' end def gameType "EarthDawn" end def getHelpMessage return <<INFO_MESSAGE_TEXT ステップダイス (xEn+k) ステップx、目標値n(省略可能)、カルマダイスk(D2-D20...
30.207207
180
0.536534
33e65d9104d553f2ef0e7fe1fee9dbc916cf0284
1,257
require "./src/common/validators/validator" require "./src/common/validators/size_validator" require "./src/infrastructure/aws/ec2/pem_key_validator" module Infrastructure module Aws module Ec2 class Validator def initialize(context, size_validator = nil, pem_key_validator = nil) ...
30.658537
98
0.630072
ed5ff0d1e0931cf6d13eb86e8dbf333a88265755
735
DIR = {"-" => [1,0], "|" => [0,1], "/" => [1,1]} def cuboid(nx, ny, nz) puts "cuboid %d %d %d:" % [nx, ny, nz] x, y, z = 8*nx, 2*ny, 4*nz area = Array.new(y+z+1){" " * (x+y+1)} line = lambda do |n, sx, sy, c| dx, dy = DIR[c] (n+1).times do |i| xi, yi = sx+i*dx, sy+i*dy area[yi][xi] = (area[...
27.222222
50
0.412245
8718eca2a13714bef7b00f032eff1a4f86538ac0
208
ENV["OPENREDIS_URL"] ||= "redis://127.0.0.1:6379" uri = URI.parse(ENV["OPENREDIS_URL"]) Resque.redis = Redis.new(host: uri.host, port: uri.port, password: uri.password) Rails.logger.info('Connected to Redis')
52
80
0.716346
18eb7d138031c6561e54b81d126611781666ce56
277
# frozen_string_literal: true module Script module Layers module Infrastructure module Languages class WasmProjectCreator < ProjectCreator def self.config_file "script.config.yml" end end end end end end
17.3125
49
0.620939
ab7e83c2b204e7907c544dd86688d6b57f423faf
2,730
require 'azure_generic_resources' class AzurePostgreSQLDatabases < AzureGenericResources name 'azure_postgresql_databases' desc 'Verifies settings for a collection of Azure PostgreSQL Databases on a PostgreSQL Server' example <<-EXAMPLE describe azure_postgresql_databases(resource_group: 'my-rg', server_name...
39.565217
108
0.721245
d5480afccbcafc5b66c245155cda4be41a193128
2,239
class AescryptPacketizer < Formula desc "Encrypt and decrypt using 256-bit AES encryption" homepage "https://www.aescrypt.com" url "https://www.aescrypt.com/download/v3/linux/aescrypt-3.13.tgz" sha256 "87cd6f6e15828a93637aa44f6ee4f01bea372ccd02ecf1702903f655fbd139a8" bottle do cellar :any_skip_relocation...
32.449275
94
0.686467
877c9cdd6f7337c5e7f305c3d3db57ef6c358c92
1,476
# frozen_string_literal: true require 'colmena/error' module RealWorld module Api module Http module Mappers module QueryParam def self.optional(name, type: String) param(name, required: false, type: type) end def self.param(name, required:, type:) ...
28.384615
116
0.511518
7999cd82597b45e82d898e7868548f1f3cbf4ceb
1,066
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
36.758621
62
0.761726
28407f2ec878ba89f6d5ff80f93e8b19c3c72084
1,114
# Plugin's routes # See: http://guides.rubyonrails.org/routing.html get 'openid', to: 'open_id_provider#checkid_setup', constraints: lambda { |request| request.query_parameters["openid.mode"] == "checkid_setup" } post 'openid', to: 'open_id_provider#checkid_setup', constraints: lambda { |request| request...
41.259259
99
0.717235
33ee54d55f273e15199d636734b26a75dee01e0e
287
# frozen_string_literal: true class BookSearchReflex < ApplicationReflex def perform(query = "") return unless query.size > 2 result = HTTP.get("http://openlibrary.org/search.json?#{{q: query}.to_query}") @books = JSON.parse(result.to_s) if result.status == 200 end end
28.7
82
0.703833
1d77a9ec95719af67c17f299807aeb3cc49c934d
436
require 'mongoid' require 'mongoid_search' require_relative '../models/tweet' Mongoid.load! "../config/mongoid.yml" def main batch = [] 10.times do |i| batch << { contents: "test tweet!", date_posted: Time.now, user: {username: "user#{i}", id: i }, mentions: []...
17.44
46
0.568807
6a3f968b6720a6603107bc9502b48bba04b18177
150
# Load the Rails application. require File.expand_path('../application', __FILE__) # Initialize the Rails application. Hurl::Application.initialize!
25
52
0.786667
18b158970d421457ed4f816fa1accc8d0c097081
1,595
# # Be sure to run `pod lib lint RxReachability.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 http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'RxRea...
40.897436
126
0.622571
38da362246e2cba5d65e869850d6d07040d35834
2,185
require 'spec_helper' describe 'import rake task' do before do Rake.application.rake_require 'tasks/import' Rake::Task.define_task(:environment) end describe 'import:locations' do before do Rake::Task['import:locations'].reenable end def run_rake_task(path = nil) Rake.applicatio...
27.658228
92
0.63524
91ba96c7efa2b5794ea9bf2f895ba1a9ee129ad2
3,495
require "spec_helper" describe Blogit::ApplicationHelper do describe :blog_tag do it "should create a tag element and give it a 'blog_post... prefixed class" do helper.blog_tag(:div, "hello", id: "blog_div", class: "other_class").should == %{<div class="other_class blog_post_div" id="blog_div">hello</div>...
36.789474
172
0.680401
0196331d13cb68a7ef81e3608f9feec5aa6d5c70
5,522
# frozen_string_literal: true require_relative "abstract_unit" require "active_support/current_attributes/test_helper" class CurrentAttributesTest < ActiveSupport::TestCase # Automatically included in Rails apps via railtie but that don't run here. include ActiveSupport::CurrentAttributes::TestHelper Person = ...
28.030457
95
0.702463
263cddfd8f75ae6fdcc9cdcb79f0534cc8c874d2
2,379
# frozen_string_literal: true require 'spec_helper' RSpec.describe OneRoster::Connection do let(:connection) { described_class.new(client) } let(:logger) { stub('Logger') } let(:app_id) { 'app_id' } let(:app_secret) { 'app_secret' } let(:api_url) { 'https://bjulez.oneroster.com/' } let(:client) do On...
30.5
100
0.647751
bb02e16b1c9805115a4ff985589d9f20b2b7fc77
1,476
# frozen_string_literal: true class DeviseCreateUsers < ActiveRecord::Migration[5.0] def change create_table :users do |t| ## Database authenticatable t.string :name, null: false, unique: true, index: true t.string :email, null: false, default: "" t.string :encr...
32.086957
104
0.644309
e23ba670dc67f6d434c0129c4d3eae595d37f254
4,038
# frozen_string_literal: true # Asset objects represent digitial assets managed by Pia and stored on one of # the repositories. class Asset include Mongoid::Document include Mongoid::Timestamps # The repository that serves as the primary (main) storage location for the # asset. belongs_to :repository, inver...
35.113043
80
0.703814
1107deb47ac3f98dd4ffce5e5ec9ea6b17185778
378
require 'csv' require 'rubocop' class Export def initialize(products, prices, access, searches) @products = products @prices = prices @access = access @searches = searches export_data end private def export_data CSV.open("search_disney(#{@searches}).csv", 'w') do |csv| @products...
18
61
0.637566
01ee8c6ba98d1808bc0a04ef34e87d3eef4eceaa
6,602
=begin #Hydrogen Nucleus API #The Hydrogen Nucleus API OpenAPI spec version: 1.9.4 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.20 =end require 'spec_helper' require 'json' require 'date' # Unit tests for NucleusApi::Funding # Auto...
29.738739
102
0.707361
87448f9a2d229ddd856186a0211a6738c946c8fc
730
# encoding: ascii-8bit # Collection of methods for creating, reading, and manipulating EBU-STL files. module EbuStl class StlTools public BEHEADED = true # header + n tti_blocks def bytesize 1024 + 128 * @tti.length end def blockcount @tti...
19.72973
78
0.580822
ff5fbe13b3c448aa56e60e7480986458dbc22112
1,308
# A simple disjoint set ADT which uses path compression on finds to speed things up class DisjointSet attr_reader :items def initialize @size = 0 @items = {} end def union(root1, root2) if @items[root2] < @items[root1] @items[root1] = root2 else ...
22.169492
83
0.392966
08b8d6e61cc70fba236bc2dfdabf5463bdf41b31
214
class InfoController < ApplicationController def about @tags = Artifact.tag_counts.order('taggings_count DESC').pluck(:name).first(16) end def contact end def optout end def survey end end
12.588235
83
0.71028
e98eb7298f9be92421c26af289fae7e7842f534e
1,467
# Copyright 2018 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 applicable law or agreed to in writing, ...
34.928571
83
0.622359
08d5aaedb44e3ad5b2e7738c3dfdadf5dd2e6499
948
cask 'kensington-trackball-works' do version '1.3' sha256 '6c2271211f71fc80e237dad2a86f253b408e985d5aea58e574ac89f54e4ce1fc' # accoblobstorageus.blob.core.windows.net was verified as official when first introduced to the cask url 'https://accoblobstorageus.blob.core.windows.net/software/38c915e6-ca92-406e-bd65...
45.142857
112
0.696203
f8f1344ddda4d79b60f589df1328965530be52f5
1,994
require 'test_helper' class UsersControllerTest < ActionController::TestCase include SessionsHelper test "should get new user" do get :new assert_response :success end test "should create user" do StripeMock.start plan = plans(:trial) create_stripe_plan(plan) assert_difference "User....
28.084507
115
0.719659
4a7d0e2033351329cd0160b5846a14a84eb5ec2e
21,495
# Copyright:: Copyright 2022 Trimble Inc. # License:: The MIT License (MIT) # The SketchUp Array class adds additional methods to the standard Ruby Array # class. Specifically, it contains methods allowing an # array to behave just as a {Geom::Vector3d} or {Geom::Point3d} object # (which can be thought of as arrays of...
28.969003
82
0.632519
e9fb658b1f89b32affc093ce780e7c0c5c7ca952
1,742
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/base/sessions/command_shell' require 'msf/base/sessions/command_shell_options' module MetasploitModule CachedSize = :dynamic include Msf::Payload::Single inclu...
27.21875
128
0.584386
61c6ba7d5506af912789935312afd680d6724df9
21,421
require 'spec_helper' describe MergeRequests::RefreshService do include ProjectForksHelper let(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:service) { described_class } describe '#execute' do before do @user = create(:user) group = create(:group) group...
39.89013
130
0.612156
e8ebcbe3a796b35df099da74e37e96eb84a6de8f
2,954
#!/opt/puppetlabs/puppet/bin/ruby require_relative '../lib/puppet/util/task_helper' require 'json' require 'puppet' require 'openssl' # require 'pry-remote'; binding.remote_pry # class PowerstoreVolumeCollectionQueryTask class PowerstoreVolumeCollectionQueryTask < TaskHelper def task(arg_hash) header_params = {...
34.348837
134
0.648951
ab9ca14593051d5469b496b12e1b2cb6af2b0168
3,059
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Transforms module Conversions SideMatch = Struct.new(:before_offset, :key_offset, :after_offset, :captures) do def start key_offset.first end def stop ...
25.923729
86
0.546911
33bed5f19a39085980b186ab623abedbc1f26f8a
508
require 'barr/block' module Barr module Blocks class IP < Block attr_reader :device def initialize(opts = {}) super @device = opts[:device] || 'lo' @version = opts[:ipv6] ? 'inet6' : 'inet' end def update! ip = sys_cmd.split('/').first @output =...
16.933333
81
0.5
5d0cd9f7430e8920f401ca1897a7d2688b385b8e
105
module CmsEngine class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end end
17.5
46
0.771429
11296480e214ae6809ce8323b8d113e0f5c2ee99
10,021
# typed: false # frozen_string_literal: true class Keg PREFIX_PLACEHOLDER = "@@HOMEBREW_PREFIX@@" CELLAR_PLACEHOLDER = "@@HOMEBREW_CELLAR@@" REPOSITORY_PLACEHOLDER = "@@HOMEBREW_REPOSITORY@@" LIBRARY_PLACEHOLDER = "@@HOMEBREW_LIBRARY@@" PERL_PLACEHOLDER = "@@HOMEBREW_PERL@@" JAVA_PLACEHOLDER = "@@HOMEBREW_...
31.812698
112
0.678276
383a4bd451c34ad6e8e7cb757de1ce3e31df6d43
1,947
cask 'little-snitch' do version '3.7.1' sha256 'e6332ee70385f459d9803b0a582d5344bb9dab28bcd56e247ae69866cc321802' url "https://www.obdev.at/downloads/littlesnitch/LittleSnitch-#{version}.dmg" appcast 'https://www.obdev.at/products/littlesnitch/releasenotes.html', checkpoint: '1f2ffae32b8f4cab5618c32d...
49.923077
134
0.672316
1d41d928ec7330a016f806b1ae92259579c68cda
1,936
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 have to restart the web serv...
33.964912
87
0.757748
b9b5119346b423cc1543e6e5e07594a011cac58d
1,079
# shows the effect of using .all_hashes instead of looping on each hash # run it by substiting in a 'long' [many row] query for the query variable and toggling use_all_hashes here at the top # note that we load all the rows first, then run .all_hashes on the result [to see more easily the effect of all hashes] # on my...
25.093023
120
0.692308
5d65e5c882c1f9c554ec2bd825e846af878839b4
4,486
require 'spec_helper' shared_examples 'a working module' do it { is_expected.to compile.with_all_deps } it { is_expected.to create_class('openscap::schedule') } it { is_expected.to create_class('openscap') } it { is_expected.to create_file('/var/log/openscap') } end describe 'openscap::schedule' do on_supp...
36.770492
474
0.583593
8787e16dc64fd06ef409864cf8c7fe4fbdb392c0
5,848
require 'pry/terminal' # A pager is an `IO`-like object that accepts text and either prints it # immediately, prints it one page at a time, or streams it to an external # program to print one page at a time. class Pry::Pager class StopPaging < StandardError end attr_reader :_pry_ def initialize(_pry_) @_...
24.065844
90
0.608584
187a6712ad25925209b9eefeb027b07998995f2c
4,189
module Bunto class StaticFile attr_reader :relative_path, :extname, :name class << self # The cache of last modification times [path] -> mtime. def mtimes @mtimes ||= {} end def reset_cache @mtimes = nil end end # Initialize a new StaticFile. # ...
25.542683
79
0.601576
8716317336b651ba2e624f346a070683277b480f
57
FactoryGirl.define do factory :post do end end
8.142857
21
0.666667
393040b34b43138e5c380efa02ae1198a6dbaba3
918
Pod::Spec.new do |s| s.name = 'TensorFlowLiteSelectTfOps' s.version = '2.3.0' s.authors = 'Google Inc.' s.license = { :type => 'Apache' } s.homepage = 'https://github.com/tensorflow/tensorflow' s.source = { :http => "https://dl.google.com/dl/cpdc/4f62...
39.913043
130
0.647059
01ba9263795bd7989b6b4bc31e857580f6bb7b11
3,850
require "erb" require "fpm/namespace" require "fpm/package" require "fpm/errors" require "fpm/util" class FPM::Package::P5P < FPM::Package option "--user", "USER", "Set the user to USER in the prototype files.", :default => 'root' option "--group", "GROUP", "Set the group to GROUP in the prototype fi...
30.8
100
0.653506
033fe0c2cdbe2f07eaf21fb78f897b39f3afcc14
5,358
## # 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::BrowserExploitServer def initialize(info={}) super(update_info(info, ...
36.951724
183
0.575588