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
183a540476fcf055259a4475997f59dfca5dd780
2,268
# frozen_string_literal: true require 'spec_helper' describe AdventOfCode2020::Day14::Decoder::Version2 do let(:program) do described_class.new( [ 'mask = 000000000000000000000000000000X1001X', 'mem[42] = 100', 'mask = 00000000000000000000000000000000X0XX', 'mem[26] = 1' ...
28
100
0.638889
5dcbd7b099eb54bac570c3a96f85ff9f726c4f5a
186
class AddLocalFileToLogFile < ActiveRecord::Migration[4.2] def up add_column :log_files, :local_file, :string end def down remove_column :log_files, :local_file end end
18.6
58
0.736559
1c7676b831657037d6fa10dfa575944d4f70f69d
8,691
module FlatMap # == Mapper # # FlatMap mappers are designed to provide complex set of data, distributed over # associated AR models, in the simple form of a plain hash. They accept a plain # hash of the same format and distribute its values over deeply nested AR models. # # To achieve this goal, Mapper us...
44.341837
131
0.659763
33df4b20df51e6d09e7df7177e2e099b9eca5a34
585
cask "freeplane" do version "1.8.11" sha256 "5f558640e8811c0d4b515dfc67c4d9ef5d877dfb3b7c88a3578d97001f6b337a" url "https://downloads.sourceforge.net/freeplane/freeplane%20stable/Freeplane-#{version}.dmg", verified: "downloads.sourceforge.net/freeplane/" appcast "https://sourceforge.net/projects/freeplan...
36.5625
96
0.779487
7a9ec9c9ac9d92e6c54528fc9f4090e4f3f56e8a
1,355
module Fog module Compute class Cloudstack class Real def revoke_security_group_ingress(options={}) options.merge!( 'command' => 'revokeSecurityGroupIngress' ) request(options) end end # Real class Mock def revoke_security_group...
30.795455
134
0.540221
18665885fcf1f6a428ffc4f2740bea0656e014ce
65,270
# coding: utf-8 # frozen_string_literal: true # external dependencies require 'rack' require 'tilt' require 'rack/protection' require 'mustermann' require 'mustermann/sinatra' require 'mustermann/regular' # stdlib dependencies require 'thread' require 'time' require 'uri' # other files we need require 'sinatra/indif...
32.327885
171
0.611491
622749434972f0630d9f7c63285d8c7788b4caa3
468
require "rails_helper" RSpec.describe Integrated::ReviewTaxRelationshipsController do describe "#skip?" do context "when applicant is not filing taxes next year" do it "returns true" do application = create(:common_application, members: [create(:household_member, filing_taxes_next_year: "no")]) ...
31.2
117
0.726496
1af9833d46f5543b1133b34e8ae6dbfe9d7be105
15,433
# frozen_string_literal: true require "active_support/inflections" module ActiveSupport # The Inflector transforms words from singular to plural, class names to table # names, modularized class names to ones without, and class names to foreign # keys. The default inflections for pluralization, singularization, ...
38.874055
104
0.593987
1a7cfad3944d17b3a3d642dd6d7c9bccedcbf8b9
327
class Keka < Cask version '1.0.4' sha256 '0075741ed52e2c86d7749dfe2baf54c8b6dad75a780b4b51ca5fb14337124701' url 'http://www.kekaosx.com/release/Keka-1.0.4-intel.dmg' appcast 'http://update.kekaosx.com' homepage 'http://kekaosx.com/' app 'Keka.app' zap :delete => '~/Library/Preferences/com.aone.keka.plis...
27.25
75
0.733945
79b3c3d91926d75a16df141aa71334fbe6260345
56
module SequelSchemaDotGenerator VERSION = '0.0.4' end
14
31
0.767857
acb9ba55c462de2284284e9609110cc36e874270
7,238
# 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...
37.502591
245
0.679608
d58f2d3d0a376bea2236ce1a9ebd136470f00a42
1,844
# frozen_string_literal: true module Spree module OrderDecorator def self.prepended(base) base.has_many :bookkeeping_documents, as: :printable, dependent: :destroy base.has_one :invoice, -> { where(template: 'invoice') }, class_name: 'Spree::BookkeepingDocument', ...
34.148148
127
0.694685
bb6bbd639fb56942b2782e4af3019e705f14e12d
2,105
# 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::Appconfiguration::Mgmt::V2019_02_01_preview module Models # # The result of a request to check the availability of a resource name. ...
28.445946
76
0.529216
6183fe0d3bece5a9e94acc116e3a53d69adaf91e
1,368
cask 'font-source-serif-pro' do version '2.007R-ro,1.007R-it' sha256 '46d9b5114e3e86b24769729e2fe09288b6a94c2d4f28a7e39ef572fbe2bec2da' # github.com/adobe-fonts/source-serif-pro was verified as official when first introduced to the cask url "https://github.com/adobe-fonts/source-serif-pro/archive/#{version.bef...
59.478261
114
0.769737
abb988896754cf694442c5cc9d5e457e9e672f16
192
require 'erb' module Booty class ERBTemplate def initialize(content) @content = content end def expand(binding) ERB.new(@content).result(binding) end end end
13.714286
39
0.651042
61bc6527819426ad6f9873f42bf6fa5083c63e07
1,521
class PasswordResetsController < ApplicationController before_action :get_user, only: [:edit, :update] before_action :valid_user, only: [:edit, :update] before_action :check_expiration, only: [:edit, :update] def new end def create @user = User.find_by(email: params[:password_reset][:em...
23.765625
73
0.646285
5d5b2137c4a266277c4ea9f74508c8fa976cdf5e
892
module Validations class StatisticInfo include ActiveModel::Validations validate :query_key_format_must_be_correct def initialize(params = {}) @query_key = params[:id] end def error_object api_errors = [] if invalid? api_errors << Api::V1::Exceptions::StatisticInfoNam...
23.473684
107
0.681614
215798d33f3c408e604881f3a9c6c0b71c9ec095
1,282
require 'trundle' require 'digest' require 'active_support' require 'active_support/core_ext/string/inflections' module TextbundleTo class TextbundleExtend attr_accessor :title attr_accessor :tags attr_accessor :body attr_accessor :assets BEAR_CREATOR_IDENTIFIER = 'net.shinyfrog.bear' d...
25.64
125
0.613105
0146af79fdf9aa041fbff542dc319ad37c558691
4,246
#-- encoding: UTF-8 #-- 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,...
39.682243
110
0.674753
1cd6e20e8b09f784ffa074555cfadcd6958d6d7b
3,321
require_relative '../../spec_helper' module Aws module Plugins describe EndpointPattern do let(:metadata) {{ 'apiVersion' => '2018-11-07', 'protocol' => 'rest-xml', 'endpointPrefix' => 'svc', 'signatureVersion' => 'v4' }} let(:operations) {{ 'Foo' => { ...
30.190909
119
0.509485
266bb32c26a0eb8ea2f4ee334649a7c2d84c3bc6
4,805
# frozen_string_literal: true # Copyright 2022 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...
42.522124
89
0.614984
4afba39f4143c79dea0c646ca2ca795810e81696
5,289
require 'request_helper' RSpec.describe '/test_runs' do let(:router) { Inferno::Web::Router } let(:response_fields) { ['id', 'inputs', 'results', 'status', 'test_group_id'] } let(:test_suite) { BasicTestSuite::Suite } let(:test_group_id) { test_suite.groups.first.id } let(:test_session) { test_run.test_sessi...
32.447853
113
0.665721
f8786b2c6024471b7653eec46be96dd5f173f5e8
1,362
# frozen_string_literal: true module Facter class ExternalFactLoader def custom_facts @custom_facts = load_custom_facts end def external_facts @external_facts ||= load_external_facts end def all_facts @all_facts ||= Utils.deep_copy(custom_facts + external_facts) end p...
24.763636
81
0.711454
08c8c41706a234bdd29b2769f1c5dfb7c5c553ab
1,201
require 'rack' module ApiHammer # Rack middleware which adds a trailing newline to any responses which do not include one. # # one effect of this is to make curl more readable, as without this, the prompt that follows the # request will be on the same line. # # does not add a newline to blank responses....
30.025
104
0.610325
03c305e35a0e92820a3370f0a902e0fc6a0d0b64
965
require 'pp' # bundler require 'rubygems' require 'bundler/setup' # json # make sure you have an entry like:w # # gem 'yajl-ruby', :require => 'yajl' # # or # gem 'json', :require => 'yajl' # # in your Gemfile require 'rufus-json/automatic' # ruote-kit $:.unshift 'lib' require 'ruote-kit' # ruote requi...
13.985507
78
0.650777
91230c1e3f8f3eece4e21d2fa76e1a735671000b
18,261
# -*- encoding: utf-8 -*- require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes.rb', __FILE__) # TODO: Add missing String#[]= specs: # String#[re, idx] = obj ruby_version_is ""..."1.9" do describe "String#[]= with Fixnum index" do it "sets the code of the cha...
26.933628
94
0.602596
bf26ec538aad74c50c5ae25e1b74d65cf89633e8
5,996
# frozen_string_literal: true def whyrun_supported? true end use_inline_resources # ~FC113 action :create do Chef::Application.fatal!("CategoryGroup specified '#{@current_resource.category_group}' doesn't exist!") unless @current_resource.catgroup_exists if @current_resource.changed Chef::Log.info "#{@new_r...
42.225352
189
0.735324
d525e1775bdc800fd01cc66c0916eb50d82fc33f
3,006
class SysWatchdog DEFAULT_CONF_FILE = '/etc/sys_watchdog.yml' DEFAULT_LOG_FILE = '/var/log/sys_watchdog.log' WORKING_DIR = '/var/local/sys_watchdog' CRONJOB_PATH = '/etc/cron.d/sys_watchdog' INSTALL_TYPE_PATH = "#{WORKING_DIR}/install_type" def initialize conf_file: nil, log_file: nil ...
28.093458
114
0.585163
f82921b6f54acf3f90f6dec2d4f6dae354604ece
97
module ApplicationHelper def display_error @errors = @item.errors.full_messages end end
13.857143
40
0.762887
1af9a27050f913ef570632339306bebad3a64ad5
5,256
require "cloudfront-signer" require "cloud_controller/blobstore/blobstore" module VCAP::CloudController class StagingsController < RestController::Base include VCAP::Errors STAGING_PATH = "/staging" DROPLET_PATH = "#{STAGING_PATH}/droplets" BUILDPACK_CACHE_PATH = "#{STAGING_PATH}/buildpack_cache" ...
33.477707
110
0.676941
1a90f09a35c600a33b860be211b004a687aca6e1
1,411
require 'active_record' require 'mongoid' module ModelSupport def self.included(base) base.extend ClassMethods end module ClassMethods def fake_active_record(name, &block) let(name) { Class.new(ActiveRecord::Base) do self.table_name = 'dummies' instance_eval &block ...
22.396825
73
0.583983
0317ca045b4c648c1ef744d1f8480d81397ceba0
2,090
# Some tests require the more flexible driver methods for 'get', 'post' # etc. than available in RSpec controller tests. # # See also spec/controllers/scimitar/application_controller_spec.rb. # require 'spec_helper' RSpec.describe Scimitar::ApplicationController do before :each do allow_any_instance_of(Scimitar:...
41.8
118
0.7
edf216cf2d7ce103f09f36ad3e83f0d80d8c6ce0
5,205
# 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, # software distributed # under the Lice...
65.0625
185
0.624207
7a0995aaab2421aab0427f2f7f21b7c48ec55b79
247
cask :v1 => 'kibako' do version :latest sha256 :no_check url 'https://updates.kibakoapp.com/download/latest' homepage 'https://www.kibakoapp.com/' license :unknown # todo: improve this machine-generated value app 'Kibako.app' end
22.454545
66
0.708502
ffbaef8ed90783d6d3e71749156089d1d0ca468c
2,806
namespace :regions do desc 'Import regions from YAML without deleting old data' task import: :environment do file_path = "#{Rails.root}/tmp/import/regions.yml" media_dir = "#{Rails.root}/tmp/import/regions" ignored = %w(image header_image) if File.exists? file_path File.open file_path, 'r' d...
41.264706
100
0.604063
62e03e68aeeb21bcccff35d80a7c8b75255a2cce
584
# frozen_string_literal: true require 'spec_helper' describe 'User activates Pushover' do include_context 'project service activation' before do stub_request(:post, /.*api.pushover.net.*/) end it 'activates service', :js do visit_project_integration('Pushover') fill_in('Api key', with: 'verySecr...
23.36
55
0.696918
e9cc357970338f4a61a1fc4a7084f1307e275795
441
# frozen_string_literal: true require_dependency "#{Rails.root}/lib/training_module" # Controller for data on which trainings a user has completed class TrainingStatusController < ApplicationController def show @course = Course.find(params[:course_id]) @assigned_training_modules = @course.training_modules ...
25.941176
61
0.755102
110ce65d4c1e4e58179a08f919a95fd7572da95e
3,969
require File.expand_path('../helper', __FILE__) class TestRakeTaskManager < Rake::TestCase def setup super @tm = Rake::TestCase::TaskManager.new end def test_create_task_manager refute_nil @tm assert_equal [], @tm.tasks end def test_define_task t = @tm.define_task(Rake::Task, :t) ...
25.120253
64
0.613757
4ac7e593dd043080d47cf894c7b69d44b4d46631
10,348
# -*- coding: utf-8 -*- #-- # Copyright (C) 2004 Mauricio Julio Fernández Pradier # See LICENSE.txt for additional licensing information. #++ require 'zlib' require 'gems/security' class Gems::Package class Error < Gems::Error; end class FormatError < Error attr_reader :path def initialize(message, pat...
22.995556
81
0.645149
bf1dcdf61aa09f474cc83882f67921cc1d86dd18
111
class PlanBilling < ActiveRecord::Base belongs_to :data_plan belongs_to :music_plan belongs_to :user end
18.5
38
0.792793
accbbcf3f12be0f5200ffb573743f27d2debfd59
1,751
require 'test_helper' class UsersEditTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) end test "unsuccessful edit" do log_in_as(@user) get edit_user_path(@user) patch user_path(@user), params: { user: { name: "", email: "foo...
33.037736
78
0.499714
bb792b2b1c4afaf578ae8649deabc483a76f7f11
1,033
require 'spec_helper' describe Puppet::Type.type(:package).provider(:pip3) do it { is_expected.to be_installable } it { is_expected.to be_uninstallable } it { is_expected.to be_upgradeable } it { is_expected.to be_versionable } it { is_expected.to be_install_options } it { is_expected.to be_targetable } ...
26.487179
72
0.698935
878d63e275a4d52575ab1a91e2009d0458653c31
1,327
Given(/^I am on the cabinet page$/) do @cabinet_page.visit_home_page end When(/^I start typing a medication name$/) do @cabinet_page.type_search_characters(@medication) end Then(/^I should see the medication in the list$/) do expect(@medication).to eq(@cabinet_page.autocomplete_text) end When(/^I select that m...
29.488889
93
0.762622
91b7f307488dd6c38959cb77afdfeabd642c58f0
690
# frozen_string_literal: true module ActiveRecord module Embedded class Aggregation # Driver for JSON/JSONB query support in PostgreSQL. Uses a +@>+ # query to look for partial JSON in the +data+ Array. class Postgresql < Aggregation delegate :any?, :empty?, to: :results def re...
25.555556
70
0.592754
1da30dd65885ccba8d22c082616e179a9c688a84
829
Pod::Spec.new do |s| s.name = "Device" s.version = "2.0.0" s.summary = "Light weight tool for detecting the current device and screen size written in swift." s.description = "Swift library for detecting the running device's model and screen size. With the newer  devices, developers have mor...
51.8125
284
0.6538
79d637e5e13e3fcbb096015ef9bbc6855f35fc61
3,049
# frozen_string_literal: true require 'test_helper' class ActsAsEditable::ActsAsEditableTest < ActiveSupport::TestCase it 'edits get created on new project' do project = create(:project, name: 'Foo', description: 'Best of projects!', created_at: Time.current) _(CreateEdit.where(target: project).count).must_...
45.507463
109
0.718268
ab790a8c537a81b9f7b364beb34aca7e5ff9f724
5,741
class Checkov < Formula include Language::Python::Virtualenv desc "Shiny new formula" homepage "https://github.com/bridgecrewio/checkov" url "https://files.pythonhosted.org/packages/d1/8d/fb9815b10cc6af4e8eacfcfed6312bec8b5a1aca9a00d76b8eb9b27fd761/checkov-1.0.303.tar.gz" sha256 "0aa2c9f63d63146d33a02f33b0ff...
45.928
145
0.826859
08abb9cdb8369a35779e88a7ccb87bfd639dd2d7
2,820
require 'spec_helper' require 'mail' require 'mandrails/message_builder' describe Mandrails::MessageBuilder do include Factories::Emails subject { described_class.new(text_mail).as_json } context 'subject' do it 'sets :subject' do subject[:subject].should == 'Hi' end end context 'recipients'...
24.310345
131
0.613475
7a268b1cd721687f4905e0cb83c07ea737043ef4
6,691
# encoding: utf-8 require 'tabula' require 'date' module Evacuees class PDFExtractor attr_reader :path, :title, :date, :header, :body def initialize(path, range = nil) @path = path @range = range || 3..5 end def extract caption, raw_body = TabulaWrapper.new(@path, @range).extract...
31.413146
113
0.56703
088570bd5aed56dde548b6e3c2bef91b07c35fbd
419
require "delegated_presenter/version" require 'delegate' require "active_support/concern" require "active_support/dependencies/autoload" require "active_support/core_ext/module/delegation" require "active_support/inflector" module DelegatedPresenter extend ActiveSupport::Autoload autoload :Base autoload :Error ...
23.277778
56
0.832936
1895f4a2bc2c4060fb7dda94bf0cbeba9c3c8513
4,359
require "language/haskell" class Agda < Formula include Language::Haskell::Cabal desc "Dependently typed functional programming language" homepage "https://wiki.portal.chalmers.se/agda/" stable do url "https://hackage.haskell.org/package/Agda-2.6.0/Agda-2.6.0.tar.gz" sha256 "bf71bc634a9fe40d717aae76b...
27.24375
93
0.61872
1ab41c8cffdf4202669d72dd75e7eef235dcde07
1,581
require_relative 'lib/CLI_Data_Gem_pp/version' Gem::Specification.new do |spec| spec.name = "CLI_Data_Gem_pp" spec.version = CLIDataGemPp::VERSION spec.authors = ["Uchoosecode"] spec.email = ["awittyl44@gmail.com"] spec.summary = %q{Write a short summary, because RubyGems ...
42.72973
89
0.677419
389f862d6a95398694371eb5488e7d561e4e5b38
7,003
module ActiveMerchant #:nodoc: module Billing #:nodoc: class UsaEpayGateway < Gateway class_inheritable_accessor :test_url, :live_url self.live_url = 'https://www.usaepay.com/gate.php' self.test_url = 'https://sandbox.usaepay.com/gate.php' self.supported_cardtypes = [:visa,...
33.033019
116
0.571755
d513d0502937e1db474081e4bd67983dc5b202f2
2,043
# frozen_string_literal: true require 'spec_helper' require 'ttfunk/table/vorg' RSpec.describe TTFunk::Table::Vorg do let(:font_path) { test_font('NotoSansCJKsc-Thin', :otf) } let(:font) { TTFunk::File.open(font_path) } let(:cmap) { font.cmap.unicode.first } let(:vorg_table) { font.vertical_origins } let(:o...
30.044118
79
0.68184
d5b974b2d31ba69d376fac3b5d421d34f1618a53
6,099
class Environment < ActiveRecord::Base # Used to generate random suffixes for the slug LETTERS = 'a'..'z' NUMBERS = '0'..'9' SUFFIX_CHARS = LETTERS.to_a + NUMBERS.to_a belongs_to :project, required: true, validate: true has_many :deployments, dependent: :destroy has_one :last_deployment, -> { order('dep...
26.986726
89
0.684374
4ad73d150bd4df9f9f3683348597da19689a5f1e
939
module Hits class << self #hit = 0b0000000000000000 #16 bits CAP_MASK = 0b1000000000000000 #1st bit only IMP_MASK = 0b0110000000000000 #2nd and 3rd bit POS_MASK = 0b0001111111111111 #4th to 16th #Anchor hits dont need...
32.37931
82
0.582535
abc396462a94a7b560b836eb346eca8b98c243da
831
require 'test_helper' class UserMailerTest < ActionMailer::TestCase test 'account_activation_and_password_reset_emails' do user = users(:test_user) [{ type: 'activation', method: 'account_activation', subject: 'Account activation' }, { type: 'reset', method: 'password_reset', subject: 'Password reset' }...
46.166667
98
0.703971
1835ec1d180148a41555a3fcfffcba16a1c528cf
4,391
class CorpusEmitter PIPE = "\n | " class CSArg TRANSLATIONS = {"integer" => "number", "string" => "string", "float" => "number", "boolean" => "boolean" } attr_reader :name, :allowed_values def initialize(name:, allowed_values:) ...
28.888158
91
0.630608
abe5c9517a25c3fe2a9941aa8e6fdadc3db6d035
1,854
# # Be sure to run `pod lib lint TaggerKit.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 = 'TaggerKit...
40.304348
169
0.659115
79fbc01d2ebe102e0dbc67d939f30df706b2c1be
711
Pod::Spec.new do |s| s.name = 'AWSKinesis' s.version = '2.6.29' s.summary = 'Amazon Web Services SDK for iOS.' s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.' s.homepage = 'http:...
39.5
157
0.611814
1c8ca1fabdb3cfb5b08bed0cf8f23249fc75af3f
949
# frozen_string_literal: true require 'rails_helper' require_relative '../shared/descriptive_field_sets/field_set_base' RSpec.describe Curator::DescriptiveFieldSets::Publication, type: :model do subject { create(:curator_descriptives_publication) } it_behaves_like 'field_set_base' describe 'attributes' do ...
33.892857
109
0.726027
39c690ce89d5f5a6be89bf0fe3cca3b18e81e5c4
4,961
#!/opt/puppetlabs/puppet/bin/ruby require 'json' require 'puppet' def log_files_list_by_server(*args) header_params = {} argstring = args[0].delete('\\') arg_hash = JSON.parse(argstring) # Remove task name from arguments - should contain all necessary parameters for URI arg_hash.delete('_task') operation...
32.006452
194
0.667204
bb2b39141e9a9e39d7aa6298b96a755cd0c8ee14
610
cask 'unity-ios-support-for-editor' do version '2019.2.11f1,5f859a4cfee5' sha256 '6191bd3323909ec4615ce5b835b63f22819508d6d172ba8ac8815797cfe69646' url "https://netstorage.unity3d.com/unity/#{version.after_comma}/MacEditorTargetInstaller/UnitySetup-iOS-Support-for-Editor-#{version.before_comma}.pkg" appcast 'h...
38.125
154
0.785246
f71a21764f26783cb403883d33f9d6e0a062736f
5,709
# frozen_string_literal: true # Copyright 2015-2017, the Linux Foundation, IDA, and the # CII Best Practices badge contributors # SPDX-License-Identifier: MIT require 'test_helper' # rubocop:disable Metrics/ClassLength class UserTest < ActiveSupport::TestCase setup do @user = User.new( name: 'Example Use...
31.027174
80
0.678052
269b3356c6a2e42f92f1b38b4c78f1f69ac6de79
414
require 'bbk/app/matchers/base' module BBK module App module Matchers class Headers < Base def initialize(rule) @rule = rule.with_indifferent_access end def match(headers, _payload = nil, _delivery_info = nil, *_args) match_impl(@rule, headers.with_indifferent_...
17.25
72
0.611111
e975e058582dab04ee1ad9b32319b426fcbbbe97
23,286
#!/usr/bin/env ruby # coding: utf-8 # = nessus_rest.rb: communicate with Nessus(6+) over JSON REST interface # # Author:: Vlatko Kosturjak # # (C) Vlatko Kosturjak, Kost. Distributed under MIT license. # # == What is this library? # # This library is used for communication with Nessus over JSON REST interface. # Yo...
27.987981
146
0.606072
39640422e787540804d47ffa1562f5e53b06374e
5,972
# frozen_string_literal: true require 'spec_helper' describe Simulation::Contagion::Population::Builder do let(:simulation) { create(:simulation) } let(:contagion) { simulation.contagion } let(:behavior) { contagion.behaviors.last } let(:group) do create( :contagion_group, contagion: contag...
22.367041
69
0.562626
1df296074475c17fd3ac341ce0dadde84f5c624d
2,864
# Copyright (c) Universidade Federal Fluminense (UFF). # This file is part of SAPOS. Please, consult the license terms in the LICENSE file. class Student < ApplicationRecord mount_uploader :photo, ProfileUploader has_many :student_majors, :dependent => :destroy has_many :majors, :through => :student_ma...
28.078431
149
0.683659
6ae2773dd5981eb2d68cd97df45e1a597945cafe
316
class CreateInfoNodes < ActiveRecord::Migration def change create_table :info_nodes do |t| t.string :title t.string :key t.string :node_type t.integer :collection_id t.integer :document_id t.integer :passage_id t.integer :node_id t.timestamps end end end
19.75
47
0.651899
4aba27db0ec3f72b7a6dd33c35d3463ea7ec5caa
1,747
require 'spec_helper' describe "datadog_agent::integration" do context 'supported agents' do ALL_SUPPORTED_AGENTS.each do |agent_major_version| let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" } if agent_major_version == 5 let(:conf_file) { '/et...
34.254902
119
0.559817
878de53e6e27ed833cd1f9df858a2d8acb949bae
281
require 'minitest/autorun' require_relative '../lib/i2c/drivers/lcd' class MiniTest::Test def initialize(name = nil) @test_name = name super(name) unless name.nil? end def fixture(name = @test_name) File.join(File.dirname(__FILE__), 'fixtures', name) end end
20.071429
55
0.701068
ab167936044beb8ac9edb0c85abf03293f10ca63
2,583
require 'spec_helper' describe BatchEditsController do before do controller.stub(:has_access?).and_return(true) @user = FactoryGirl.find_or_create(:jill) sign_in @user User.any_instance.stub(:groups).and_return([]) controller.stub(:clear_session_user) ## Don't clear out the authenticated session ...
39.738462
111
0.667054
f78b8276e5c940bfbeb0b81a11d610fd3cefe87f
8,444
module Fog module Vcloud class Compute class Server < Fog::Vcloud::Model identity :href, :aliases => :Href ignore_attributes :xmlns, :xmlns_i, :xmlns_xsi, :xmlns_xsd attribute :type attribute :name attribute :status attribute :network_connections, :aliases ...
28.917808
136
0.528896
26f0c87e1fd29f1ab96791a9ebc2280d68844cbe
2,126
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...
35.433333
88
0.764817
62194ad5b417993b0d057709ae6add8f921c2cd9
1,794
# encoding: utf-8 # This file is autogenerated. Do not edit it manually. # If you want change the content of this file, edit # # /spec/fixtures/responses/whois.eenet.ee/ee/status_registered.expected # # and regenerate the tests with the following rake task # # $ rake spec:generate # require 'spec_helper' require ...
26.776119
80
0.686734
7a3d1f90e6447f2e3c94b9f8669b7b7a09401d7f
1,034
class Cvsync < Formula homepage "http://www.cvsync.org/" url "http://www.cvsync.org/dist/cvsync-0.24.19.tar.gz" sha256 "75d99fc387612cb47141de4d59cb3ba1d2965157230f10015fbaa3a1c3b27560" depends_on "openssl" def install ENV["PREFIX"] = prefix ENV["MANDIR"] = man ENV["CVSYNC_DEFAULT_CONFIG"] = etc...
28.722222
78
0.665377
912e565b8e4d978a7e437a19ce0898f90401e28e
1,146
# -*- encoding : utf-8 -*- module SlncFileColumnHelper def fc_thumbnail(im_path, mode, dim, link_original=true, title='') if im_path.to_s.strip != '' then im_path = '/' << im_path unless im_path =~ /^\// # TODO añadir parsing de dim si mode == f if mode == 'f' then style = 'style="width:...
29.384615
107
0.521815
035392a07638c13c6038bc5878c1c573e254e64d
1,281
# # Be sure to run `pod lib lint SchibstedAccount.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 = 'SchibstedAccoun...
29.113636
83
0.656518
bb6e4427a8e267a21f2f7f83ce548b9be813b060
2,935
#!/usr/bin/env ruby # Fetch all entries from a datbase, change entries as wanted and save them back again. # Use if you want to change the schema of an existing database. # # Author: srldl # ###################################################### require './server' require './config' require 'net/http' require 'net/ssh...
24.872881
157
0.591482
2182f6aa8b5eece2bf789b73b4b3394bce2d0774
304
# frozen_string_literal: true class Array #:nodoc: def deep_symbolize_keys map(&:deep_symbolize_keys) end def deep_stringify_keys! map(&:deep_stringify_keys!) end def deep_stringify_keys map(&:deep_stringify_keys) end def except(*value) self - [value].flatten end end
15.2
31
0.713816
218590ad5ce82c93a3da92daa7019d1764b23d62
756
class SubjectSetSubjectCounterWorker include Sidekiq::Worker sidekiq_options queue: :data_high, congestion: Panoptes::CongestionControlConfig. counter_worker.congestion_opts.merge({ reject_with: :reschedule, key: ->(subject_set_id) { "subject_set_#{ subject_set_id }_counter_work...
29.076923
80
0.723545
ff8aeb17c0eb2c482ad4531702b37a6e9034dabd
3,079
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads/v8/services/smart_campaign_setting_service.proto require 'google/ads/googleads/v8/enums/response_content_type_pb' require 'google/ads/googleads/v8/resources/smart_campaign_setting_pb' require 'google/api/annotations_pb' require '...
54.982143
185
0.786619
e8efc9158a5858caff28373a204ffc0455e345a4
157
include InitialTestData::Utilities include FactoryGirl::Syntax::Methods store create(:user), :test1 store create(:user), :test2 store create(:user), :test3
22.428571
36
0.77707
622fe37cc7186e65deeebbc4dba032fe94c580b1
454
Then(/^tuist graph$/) do system("swift", "run", "tuist", "graph", "--path", @dir, "--output-path", @dir) end Then(/^tuist graph of ([a-zA-Z]+)$/) do |target_name| system("swift", "run", "tuist", "graph", "--path", @dir, "--output-path", @dir, target_name) end Then(/^I should be able to open a graph file$/) do b...
32.428571
94
0.625551
335227be614809957102452ef3925c01795f280a
192
class AddIndices < ActiveRecord::Migration def self.up change_table :user_activities do |t| t.index :activity_id t.index :created_at end end def self.down end end
16
42
0.682292
0805056ccfe5ee72085ae744b583810149296503
3,716
# Jekyll plugin for generating an rss 2.0 feed for posts # # Usage: place this file in the _plugins directory and set the required configuration # attributes in the _config.yml file # # Uses the following attributes in _config.yml: # name - the name of the site # url - the url of the sit...
31.491525
127
0.663886
f839fcae86bbd3e4c67440964d97c970345a5027
543
require 'test_helper' class RelationshipTest < ActiveSupport::TestCase def setup @relationship = Relationship.new(follower_id: users(:tester).id, followed_id: users(:seconder).id) end test "should be valid" do assert @relationship.valid? end test "should requi...
22.625
70
0.6814
1cbef802aeadf1d4d9584458e409c68714418e61
296
require './init' use Rack::Static, :urls => ["/favicon.ico", "/classify.html", "/symbols.html", "/stylesheets", "/images", "/flash", "/javascripts", "/fonts"], :root => "public" map '/api' do run Detexify::LatexApp end run Class.new(Sinatra::Base) { get('/') { redirect '/classify.html' } }
29.6
160
0.621622
abd8479f3c97a1baac9166e6c5bae61e66f2a7ac
341
require 'rails' require 'jaya_mega_lotto/helper' module JayaMegaLotto class Railtie < Rails::Railtie initializer "mega_lotto.action_view" do ActiveSupport.on_load(:action_view) do include JayaMegaLotto::Helper end end rake_tasks do load 'jaya_mega_lotto/tasks/jaya_mega_lotto.rak...
21.3125
55
0.721408
ed02b41dccacc176821e6de7f5c28b0b99611c01
676
module Mutations class UpdateReviewChecklist < GraphQL::Schema::Mutation argument :target_id, ID, required: true argument :review_checklist, GraphQL::Types::JSON, required: true description "Mettre à jour la liste de contrôle d'examen" field :success, Boolean, null: false def resolve(params) ...
28.166667
104
0.680473
5de1e9e9a4fb9af87e298f730b2021ad86f6011f
4,608
# frozen_string_literal: true require 'openssl/better_defaults/version' require 'openssl' # = Changes made by openssl/better_defaults # # == Miscellaneous resources # # 1. https://www.ruby-lang.org/en/news/2014/10/27/changing-default-settings-of-ext-openssl # 2. https://en.wikipedia.org/wiki/Transport_Layer_Security ...
34.909091
126
0.603082
01739961c7cb6233925377a5032afb94c3404799
86
class ManageIQ::Providers::OracleCloud::NetworkManager::FloatingIp < ::FloatingIp end
28.666667
81
0.813953
1d81f53ee20b717d22827709fbf8eea5bb355ea8
2,678
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
36.189189
86
0.725915
01d4e9a5d1c6723b9792992bc7f2118328077dd9
8,331
# File based CMS require "sinatra" require "sinatra/reloader" if development? require "tilt/erubis" require "redcarpet" require "yaml" require "bcrypt" configure do enable :sessions set :session_secret, "secret" set :erb, escape_html: true if ENV["RACK_ENV"] == "test" set :public_folder, File.expand_path(...
24.647929
79
0.690913
286d4285e5227e895f5552f78d5c7e8994293bc9
12,753
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmat...
49.05
154
0.750333
26055773346fec928a5de3df4112f1fb3c1f1e1b
2,021
class StoryDataController < ApplicationController include MyUtility before_action :set_story_datum, only: [:show, :edit, :update, :destroy] # GET /story_data def index param_set @count = StoryDatum.search(params[:q]).result.count() @search = StoryDatum.page(params[:page]).search(params[:q]) @se...
25.910256
82
0.687778
7a2d559edf1d982719d3b659dc79abc3b6d0d804
3,143
#!/usr/bin/env ruby # Encoding: utf-8 # # Copyright:: Copyright 2014, Google Inc. All Rights Reserved. # # License:: 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 # # ...
33.084211
79
0.714286
d5b5e5410ee5cc21cb2592f552bccc93cd4f315e
318
module GitHubClassroom def self.github_client(options = {}) client_options = { client_id: Rails.application.secrets.github_client_id, client_secret: Rails.application.secrets.github_client_secret, auto_paginate: true }.merge!(options) Octokit::Client.new(client_options) end end
26.5
68
0.726415
abfd5e42b071955ec8d2c32ce30441d0e506fdc8
234
require "rails_helper" RSpec.describe App::CategoryViewer, type: :helper do it_should_behave_like "a viewer" do let(:model_name) { :category } let(:field_name) { :name } let(:input_field_tag) { "input" } end end
15.6
52
0.675214
339d341c5b89e193247cbc62d4c4b5fcf6fd0855
96
# frozen_string_literal: true class ContactInformationController < StandardStepsController end
19.2
60
0.875