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
1d6e5ec4faf9048c178e19ba6ab6cb33b824db6a
27,904
require 'log4r' require "vagrant/util/platform" require File.expand_path("../base", __FILE__) module VagrantPlugins module ProviderVirtualBox module Driver # Driver for VirtualBox 5.0.x class Version_5_0 < Base def initialize(uuid) super() @logger = Log4r::Logger.new("v...
35.321519
153
0.508744
f7a113d58d52139fda113f4945d0b18d55f4e753
1,244
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) assert_template 'users/edit' patch user_path(@user), params: { user: { name: "", ...
31.1
78
0.518489
26b880b4d9eff30448d92afcd405acfb445f659b
398
require './config/environment' class ApplicationController < Sinatra::Base configure do set :public_folder, 'public' set :views, 'app/views' enable :sessions set :session_secret, "starfish" end get '/' do erb :welcome end helpers do def logged_in? !!session[:user_id] end...
13.724138
43
0.638191
2145a54561ca4fb3ac8e93169c071668ca092907
3,292
module CamaleonCms::FrontendConcern extend ActiveSupport::Concern # visiting sitemap.xml # With hook "on_render_sitemap" you can skip post_types, categories, tags or posts # you can change render file and layout # you can add custom sitemap elements in the attr "custom", like: https://github.com/owen2345/ca...
49.878788
199
0.690158
39695cf2a5ac27cfde6a232b911d9505ca7788f9
76
class PagesController < ApplicationController def dashboard end end
10.857143
45
0.776316
87fe9e8e36c3fa976a817518d57f7f14c6f8cd3b
2,055
# frozen_string_literal: true module Gql module QueryInterface::Base def self.included(base) base.instance_eval <<-RUBY, __FILE__, __LINE__ + 1 attr_reader :input_key attr_accessor :input_value, :update_type RUBY end # def input_value # @input_value # end # def...
26.688312
113
0.634063
e991dc9754f9014f6de8ecc7d646e589fd274d12
1,122
class Gfan < Formula desc "Computes Gröbner fans and tropical varieties" homepage "http://home.imf.au.dk/jensen/software/gfan/gfan.html" url "http://home.imf.au.dk/jensen/software/gfan/gfan0.5.tar.gz" sha256 "aaeabcf03aad9e426f1ace1f633ffa3200349600314063a7717c20a3e24db329" revision 1 bottle :disable, "Tes...
24.933333
75
0.672906
7a773f47ca55ec05f063441fd1145bd143ba305e
1,878
# frozen_string_literal: true require 'spec_helper' RSpec.describe BitbucketServer::Representation::Repo do let(:sample_data) do <<~DATA { "slug": "rouge", "id": 1, "name": "rouge", "scmId": "git", "state": "AVAILABLE", "statusMessage": "Available", "forkable": true...
22.626506
101
0.521299
7932075a8d7d61a211cf0017b2526271d482f113
129
class RemoveTitleFromComments < ActiveRecord::Migration[6.1] def change remove_column :comments, :title, :string end end
21.5
60
0.75969
5dd0ab156688a66cba4801034109c69a771c786f
279
gem 'minitest' require 'minitest/autorun' # using a global variable because this is only a test $base_path = File.expand_path("#{File.dirname(__FILE__)}/../../") unless $base_path ENV['SNEAQL_DISABLE_SQL_INJECTION_CHECK']="TEST" unless ENV['SNEAQL_DISABLE_SQL_INJECTION_CHECK']
39.857143
97
0.777778
ab7961616b9be06ef4cd8fcd6ef967c2f36ceed0
497
# # Cookbook Name:: newrelic # Attributes:: ruby-agent # # Copyright 2012-2014, Escape Studios # default['newrelic']['ruby-agent']['install_dir'] = '' default['newrelic']['ruby-agent']['app_user'] = 'newrelic' default['newrelic']['ruby-agent']['app_group'] = 'newrelic' default['newrelic']['ruby-agent']['audit_mode'] =...
35.5
60
0.692153
28a87f83451610c7bbabf3669b72d78a11606395
4,386
# frozen_string_literal: true require 'addressable/uri' class Projects::CompareController < Projects::ApplicationController include DiffForPath include DiffHelper include RendersCommits include CompareHelper # Authorize before_action :require_non_empty_project before_action :authorize_download_code! ...
28.480519
135
0.727086
6aabb92333621a7f84e1675f8b09dea6001ecece
382
class J < Cask version '803' sha256 'a595ab134a72dd8948ba3930678be41d27796f257f67ceb2ee4df58cdf1a82fa' url "http://www.jsoftware.com/download/j#{version}/install/j#{version}_mac64.zip" homepage 'http://www.jsoftware.com' %w<jbrk jcon jhs jqt>.each do |a| app "j64-#{version}/#{a}.app" end %w<jconsol...
23.875
83
0.688482
ff17f62db042ab3f8c62c4f8033dcac1a6b4a360
217
class CreateActions < ActiveRecord::Migration def change create_table :actions do |t| t.string :action_name t.string :status t.integer :user_id t.timestamps null: false end end end
19.727273
45
0.668203
1cbed343f3aa4db2471fc6da13436f665c214707
2,496
module Workbaskets class EditCertificateController < Workbaskets::BaseController skip_around_action :configure_time_machine, only: [:submitted_for_cross_check] expose(:sub_klass) { "EditCertificate" } expose(:settings_type) { :edit_certificate } expose(:initial_step_url) do edit_edit_certifica...
24.712871
82
0.651843
626275df33358287001bcd29b56ca7c9447d1c04
913
class Daylite::Base < ActiveRecord::Base self.abstract_class = true self.pluralize_table_names = false self.primary_key = "_rowid" self.table_name do self.name.sub("Daylite::", "") end # don't allow to save Daylite::Base objects to DB def readonly? # false true end def method_missing...
21.232558
66
0.653888
d54da68cb0f1ebd4080a6318e26219b24e0e3737
7,686
# frozen_string_literal: false # # shell/process-controller.rb - # $Release Version: 0.7 $ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # # # require "forwardable" require "sync" class Shell class ProcessController @ProcessControllers = {} @ProcessControllersMonitor = Th...
24.793548
102
0.574941
bb1fc021e6680e0b3d4ac09079c1f16cac345a16
1,192
# frozen_string_literal: true require 'spec_helper' RSpec.describe Clusters::Agent do subject { create(:cluster_agent) } it { is_expected.to belong_to(:project).class_name('::Project') } it { is_expected.to have_many(:agent_tokens).class_name('Clusters::AgentToken') } it { is_expected.to validate_presence_o...
33.111111
134
0.677013
3838e40d72f8bbc196868b6ddb4b67b8419d0ecf
1,501
class Envchain < Formula desc "Secure your credentials in environment variables" homepage "https://github.com/sorah/envchain" url "https://github.com/sorah/envchain/archive/v1.0.1.tar.gz" sha256 "09af1fe1cfba3719418f90d59c29c081e1f22b38249f0110305b657bd306e9ae" license "MIT" head "https://github.com/sorah/e...
41.694444
95
0.796136
1ce644608206560ae6090d4f3b65324d2b350fa3
928
# this plugin prints major events like builds starting / passing / failing to console # # it is useful in debugging # # (this plugin is built in and needs no customization) # class MinimalConsoleLogger < BuilderPlugin def build_started(build) puts "Build #{build.label} started" end def build_finished(build...
26.514286
91
0.709052
62a374406647ccc02e204f12cba40a3d014eb339
1,701
# frozen_string_literal: true # Copyright The OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 module OpenTelemetry module SDK module Trace # {Tracer} is the SDK implementation of {OpenTelemetry::Trace::Tracer}. class Tracer < OpenTelemetry::Trace::Tracer # @api private ...
37.8
160
0.678424
611916dcde0104fcdd3ccbb2e8aab527649c3e37
5,058
require 'crichton/lint/base_validator' module Crichton module Lint # class to lint validate the protocols section of a resource descriptor document class ProtocolValidator < BaseValidator # @private list of valid protocol attributes PROTOCOL_PROPERTIES = %w(uri entry_point method headers slt) ...
41.121951
126
0.704033
ed2da92c41423b073b4f08894af51cc735b3ad75
3,349
require './config/environment' require 'sinatra/base' require 'rack-flash' class ApplicationController < Sinatra::Base enable :sessions use Rack::Flash configure do set :session_secret, "secret" set :public_folder, 'public' set :views, 'app/views' end get '/' do erb :index end get '/si...
22.47651
115
0.623171
9163f2b0c8661226d78a57aa439e27c23c1130cf
131
class AddNameToOrthologGroup < ActiveRecord::Migration[6.1] def change add_column :ortholog_groups, :name, :string end end
21.833333
59
0.763359
ff8a79a9eeb469ebb2b320d0fb22470a8b9a6d70
510
# frozen_string_literal: true module Jasmine class Server def initialize(port = 8888, application = nil, rack_options = nil, env = ENV) @port = port @application = application @rack_options = rack_options || {} @env = env end def start @env['PORT'] = @port.to_s Rack::...
24.285714
81
0.515686
abd93d2435479e0ac647cd207edf5e4988e34ec5
88,595
# -*- coding: binary -*- # # Rex # require 'rex/ui/text/output/buffer/stdout' # # Project # require 'msf/ui/console/command_dispatcher/encoder' require 'msf/ui/console/command_dispatcher/exploit' require 'msf/ui/console/command_dispatcher/nop' require 'msf/ui/console/command_dispatcher/payload' require 'msf/ui/cons...
27.394867
149
0.662396
e2db40403c4343ab9378b038f233974061a197e9
1,397
class Glfw < Formula desc "Multi-platform library for OpenGL applications" homepage "https://www.glfw.org/" url "https://github.com/glfw/glfw/archive/3.3.3.tar.gz" sha256 "aa9922b55a464d5bab58fcbe5a619f517d54e3dc122361c116de573670006a7a" license "Zlib" head "https://github.com/glfw/glfw.git" bottle do ...
29.104167
106
0.666428
f87f92c05227749ca6aa05f4d713b6bf5b6d3e95
38,166
# frozen_string_literal: true # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
49.890196
111
0.618404
edc9a1b6bbcfd0459ee8c15c042d1fc17f77e792
233
# frozen_string_literal: true require 'spec_helper' describe 'ufw::params' do on_supported_os.each do |os, os_facts| context "on #{os}" do let(:facts) { os_facts } it { is_expected.to compile } end end end
16.642857
40
0.656652
d56e86208e687443cd2f6954cf6b115f6ea423c2
3,811
=begin #Xero Payroll AU #This is the Xero Payroll API for orgs in Australia region. The version of the OpenAPI document: 2.3.7 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 =end require 'spec_helper' require 'json' require 'date' # Unit tests for XeroRuby::Payr...
28.871212
102
0.71005
bfdfd0ee8340d891e45f2e9f3d093519f77e15e3
8,036
FactoryBot.define do sequence :email do |n| "test#{n}@example.com" end sequence :public_name do |n| "name#{n}" end sequence :conference_acronym do |n| "frabcon#{n}" end sequence :room_names do |n| "Room #{n}" end sequence :event_title do |n| "Introducing frap part #{n}" end ...
26.876254
146
0.629791
6a0f3cbbc2bf6d35a41883bab62b2b6e09b46a03
816
Pod::Spec.new do |s| s.name = "Sora" s.version = "2021.2" s.summary = "Sora iOS SDK" s.description = <<-DESC A library to develop Sora client applications. DESC s.homepage = "https://github.com/shiguredo/sora-ios-sdk" s.license = { :type => "...
32.64
66
0.547794
9188c4fd7813a2d48e5b3de2678dc12b854c85df
188
class CreateQuestions < ActiveRecord::Migration[6.0] def change create_table :questions do |t| t.text :content t.string :difficulty t.timestamps end end end
17.090909
52
0.664894
e874818c5c2399b773eacf5570547a4515ad6cb1
133
# frozen_string_literal: true class AddMetaCategory < ActiveRecord::Migration[4.2] def change # replaced by fixture end end
16.625
52
0.75188
08f7bfd140cc11f3f30a6583d81dd34b79f6433d
732
# Settings specified here will take precedence over those in config/environment.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 webserver when you make code changes. config.ca...
43.058824
82
0.777322
d5f45cc58c292d2e30453eea873f2270a2bc1342
768
Pod::Spec.new do |s| s.name = "STGTISensorTag" s.version = "1.0.3" s.ios.deployment_target = '9.0' s.tvos.deployment_target = '9.0' s.summary = "iOS framework to interface with the TI Sensor Tag" s.description = "By adding the STGTISensorTag framework to your iOS app you wil...
51.2
175
0.619792
1a24871b157ba675e5635014732fdf1fdee75936
40
module JekyllCsvy VERSION = "0.4" end
10
17
0.7
1cfe98f1774cb9416a229bacb797bd3f6f708cbc
476
class Feature < ActiveRecord::Base include PgSearch multisearchable :against => [:title] belongs_to :page belongs_to :primary_asset, :class_name => 'Asset' belongs_to :secondary_asset, :class_name => 'Asset' positioned :page_id track_user_edits validations_from_schema # Returns the options requi...
21.636364
76
0.731092
267436e2d2c7e1fc4370d1e0cc50f39d37ab7469
487
# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= KIT_APP_PATHS['GEMFILE'] require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) if KIT_APP_PATHS['GEM_LIB'] $LOAD_PATH.unshift KIT_APP_PATHS['GEM_LIB'] end if KIT_APP_PATHS['GEM_APP'] $LOAD_PATH.unshift KIT_APP_PATHS['GEM_APP'] end if KIT_APP...
23.190476
61
0.770021
91306ad3437a7ce2e2f0b0f07fcd0f0428c79476
797
# sbJson 1 writer tests - browse categories # History: # Stan Smith 2017-05-31 original script require 'minitest/autorun' require 'json' require 'adiwg-mdtranslator' require_relative 'sbjson_test_parent' class TestWriterSbJsonBrowseCategory < TestWriterSbJsonParent # get input JSON for test @@jsonIn = TestWr...
23.441176
96
0.706399
e9614db1d638287408e20ce7427152702f72658e
197
class CreateGames < ActiveRecord::Migration[5.0] def change create_table :games do |t| t.string :state t.references :user, foreign_key: true t.timestamps end end end
17.909091
48
0.659898
e980e6d43a0a584c535d62a0e19f1c9e895ba8ae
398
FactoryBot.define do factory :user, class: "Platforms::User" do name { "Joe Bloggs" } platform_id { "10" } thumbnail_url { "http://mypic" } web_url { "http://myprofile" } email { "joe@bloggs.com" } admin { false } association :platforms_network, factory: :...
23.411765
53
0.562814
331740f740ef15e04777ed0653000a48c7215136
1,309
module Courses class ValidateCustomAgeRangeService def execute(age_range_in_years, course) error_message = "#{age_range_in_years} is invalid. You must enter a valid age range." valid_age_range_regex = Regexp.new(/^(?<from>\d{1,2})_to_(?<to>\d{1,2})$/) if valid_age_range_regex.match(age_range_in...
35.378378
129
0.695951
f84115528e09b2560be3ea479870b10367ced470
1,601
class User < ApplicationRecord attr_accessor :remember_token, :activation_token before_save :downcase_email before_create :create_activation_digest validates :name, presence: true, length: { maximum: 50 } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+\.*[a-z\d]+\.[a-z]+\z/i validates :email, presence: true, ...
26.245902
78
0.689569
7a0dac54ac1f06e5926540e36b8ff8f80186cf36
4,775
# encoding: utf-8 require "logstash/codecs/base" class LogStash::Codecs::Ansi < LogStash::Codecs::Base config_name "ansi" config :columns, :validate => :number, :default => 0 config :indent, :validate => :number, :default => 4 config :fields, :validate => :array, :default => ["message"] config :highlighters...
23.522167
98
0.573194
62f74bc611a2f618b0736dc16349426f61bc9783
4,659
require 'rails_helper' require 'sorbet-runtime' require 'sorbet-rails/sorbet_utils' module SorbetUtilsExampleModule end class SorbetUtilsExampleClass extend T::Sig sig { void } def no_param_method; end sig { params(p1: String, p2: T.class_of(String)).void } def method_req_args(p1, p2); end sig { params...
36.97619
91
0.707233
bb57e52b207ecfdd97ae15ed70547130a04a8b50
10,014
class Admin::CustomFieldsController < Admin::AdminBaseController before_action :field_type_is_valid, :only => [:new, :create] CHECKBOX_TO_BOOLEAN = ->(v) { if v == false || v == true v elsif v == "1" true else false end } HASH_VALUES = ->(v) { if v.is_a?(Array) v ...
32.407767
187
0.72828
bb7be5f7f100f1403af55e53ef28ad7f8b59f8f6
1,827
require 'rack' require 'kramdown' require 'erb' require 'pathname' module GrantFront class Engine attr_accessor :request, :tree def call(env) @request = Rack::Request.new(env) status = 200 headers = {'Content-Type' => 'text/html'} body = ERB.new(application_template).result(binding)...
24.689189
107
0.56705
1a6f2447be8002f0cb68132565ea4ce0e6c55c26
891
# frozen_string_literal: true require_relative 'test_helper' class TestHeLocale < Test::Unit::TestCase def setup Faker::Config.locale = 'he' end def teardown Faker::Config.locale = nil end def test_he_address_methods assert Faker::Address.city_prefix.is_a? String assert Faker::Address.city...
27.84375
57
0.750842
87b1f95a6bea8ee60d7aa4370826c5fabe744f8b
949
# The Book of Ruby - http://www.sapphiresteel.com puts( "Main thread: #{Thread.main.inspect}" ) puts( Thread.new{ }.inspect ) puts( Thread.new{ sleep }.kill.inspect ) puts( Thread.new{ sleep }.inspect ) puts( Thread.new{ Thread.stop }.inspect ) puts( Thread.new{ for i in (1..100) do i += 1 ...
35.148148
87
0.680717
7a60524c9095a272bb4834bdc34f6dc53a261819
1,766
# 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. # # This file is the source Rails uses to define your schema when running `rails #...
40.136364
89
0.735561
d536a9439be46de88eab13fd352a6f13e324b99b
3,065
############################################################################### # Copyright (c) 2017 Cisco and/or its affiliates. # # 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:...
28.37963
80
0.579772
e22ae07a77401ce7edede5aca955012a8fc8af72
1,533
require 'spec_helper' describe Saml::Elements::Conditions do let(:conditions) { build(:conditions) } describe "Optional fields" do [:not_before, :not_on_or_after, :audience_restriction].each do |field| it "should have the #{field} field" do conditions.should respond_to(field) end i...
29.480769
92
0.682975
1c1b064a0a03322433d237e5192a6b028bfafe5e
104
class Status < ActiveRecord::Base has_many :tickets attr_accessible :name acts_as_paranoid end
17.333333
33
0.769231
edac88af498c461e0f05b55e1246455afb0ea8c5
190
# frozen_string_literal: true class WelcomeMailer < CustomMailer def welcome_email(user) @user = user mail(to: @user.email, subject: 'Babywearing Account Registration') end end
21.111111
70
0.742105
ff8c0bdae2e289a58f3f5e7d9687c47e472f455a
496
require 'spec_helper' require 'tempfile' describe Kommando do it 'has a version number' do expect(Kommando::VERSION).not_to be nil end describe 'initialization' do it 'requires cmd as an argument' do k = Kommando.new "uptime" expect(k).to be_an_instance_of(Kommando) end it 'accepts ...
20.666667
61
0.667339
082bbe0d9d11f04ba7cd17ad4b3f199cbbebf963
924
################################## ##### SET THESE VARIABLES ######## ################################## server "epsilon.jumpstart.ge", :web, :app, :db, primary: true # server where app is located # server "parlvote.jumpstart.ge", :web, :app, :db, primary: true # server where app is located set :application, "Voting-Re...
57.75
94
0.656926
5dc0f55db880bb12f4ec1f155ab1a8fbe002dcfa
1,241
# frozen_string_literal: true require 'spec_helper' RSpec.describe 'query Jira service' do include GraphqlHelpers let_it_be(:current_user) { create(:user) } let_it_be(:project) { create(:project) } let_it_be(:jira_integration) { create(:jira_integration, project: project) } let_it_be(:bugzilla_integration)...
25.854167
90
0.660757
bbd1c5c4d6b8e098349365525f7ef5d34b3c58ba
4,170
#!/usr/bin/env ruby require "sinatra" require "open3" if ARGV[0] == "onboot" File.open("/etc/init/dokku-installer.conf", "w") do |f| f.puts "start on runlevel [2345]" f.puts "exec #{File.absolute_path(__FILE__)} selfdestruct" end File.open("/etc/nginx/conf.d/dokku-installer.conf", "w") do |f| f.puts "upstream...
34.46281
204
0.628777
5d9947a7a4900576709440ba71d654701f226e52
159
class RenameEnterredOnToEnteredOn < ActiveRecord::Migration[4.2] def change rename_column :transplant_registrations, :enterred_on, :entered_on end end
26.5
70
0.805031
611be2b866f6d50fc5da744fc5350eb0e3e133ac
1,071
# 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::Network::Mgmt::V2019_11_01 module Models # # Reference to another subresource. # class SubResource include MsRestAzur...
22.787234
70
0.528478
03085a62c56b5425adee94d565adcd8b3765439a
3,351
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
41.8875
117
0.763951
bf17325bb17a8b4365216a079f7ba2020c96a7b4
3,409
# use SSHKit directly instead of Capistrano require 'sshkit' require 'sshkit/dsl' include SSHKit::DSL deploy_tag = ENV['DEPLOY_TAG'] hostname = ENV['SERVER_HOST'] user = ENV['SERVER_USER'] dockerhub_user = ENV['DOCKERHUB_USER'] dockerhub_pass = ENV['DOCKERHUB_PASS'] dockerhub_org = ENV['DOCK...
26.84252
119
0.652391
035de363ed155311377d4497384f4f70a0795db4
907
require 'telesign' require 'telesignenterprise' customer_id = 'FFFFFFFF-EEEE-DDDD-1234-AB1234567890' api_key = 'EXAMPLE----TE8sTgg45yusumoN6BYsBVkh+yRJ5czgsnCehZaOYldPJdmFh6NeX8kunZ2zU1YWaUw/0wV6xfw==' phone_number = 'phone_number' verify_code = Telesign::Util.random_with_n_digits(5) verify_client = TelesignEnterpri...
29.258065
100
0.791621
d5816d3767c528353760b424847232900e317507
779
Pod::Spec.new do |s| s.name = 'WolfGraph' s.version = '0.2.2' s.summary = 'A Swift-based general graph structure with value semantics.' s.homepage = 'https://github.com/wolfmcnally/WolfGraph' s.license = { :type => 'MIT', :file => 'LICENSE' } s.aut...
32.458333
107
0.577664
912156fbc29907e3ae24b765f678051277ca4fbf
204
# frozen_string_literal: true module QA module Scenario module Test module Integration class OAuth < Test::Instance::All tags :oauth end end end end end
14.571429
41
0.602941
8752cb59689e36c929cc34a9fbc88d310e0d9749
144
require 'test_helper' class AdvertSelectorTest < ActiveSupport::TestCase test "truth" do assert_kind_of Module, AdvertSelector end end
18
50
0.784722
083183c8c684f9a27cf711b8d6480fae52436188
1,005
require 'spec_helper' describe SimpleDeploy::Stack::Execute do include_context 'stubbed config' include_context 'double stubbed stack', :name => 'my_stack', :environment => 'my_env' before do @ssh_mock = mock 'ssh' options = { :instances => @instances, ...
32.419355
69
0.533333
1a81289dc8e50271e6b24f54fa40e6e59fd83134
659
class RemoveChpSeriesFromESourceCharts < ActiveRecord::Migration[5.2] def up ActiveRecord::Base.transaction do # Remove old series OutputElementSerie.find_by(gquery: 'collective_chps_in_source_of_electricity_in_households').destroy! OutputElementSerie.find_by(gquery: 'chps_in_source_of_electric...
41.1875
117
0.811836
61f4658779035a410bd64690cb526849e0601ea1
4,120
# frozen_string_literal: true require "ripper" module ActionviewPrecompiler module RipperASTParser class Node < ::Array attr_reader :type def initialize(type, arr, opts = {}) @type = type super(arr) end def children to_a end def inspect type...
23.542857
94
0.517476
87c8ced4d485ceb8184d3aa204c433d11e550704
2,491
require 'pathname' module Precious module Views class Overview < Layout attr_reader :results, :ref, :allow_editing, :newable HIDDEN_PATHS = ['.gitkeep'] def title "Overview of #{@ref}" end # def editable # false # end def current_path @path ? @...
30.378049
162
0.541148
bfbc8200b33a8890f8b94a4937f48f43f7f0f177
225
require 'spec_helper' describe Admin::HomeController do before { activate_authlogic } describe 'includes the correct concerns' do it { expect(controller.class.ancestors.include?(Accountable)).to eq(true) } end end
25
79
0.76
4a7d02211cfc72c9b7b0e42675c9b05aaf4290a3
2,814
# frozen-string-literal: true module Leftovers module ProcessorBuilders module Transform def self.build(transform, arguments, then_processor) # rubocop:disable Metrics case transform when :original, nil then_processor when :downcase ::Leftovers::Processors::Downc...
42
93
0.641791
fff3fd1a751a3dbc758b88b67ab34c7401dfc31f
18,376
# frozen_string_literal: true # rubocop:disable Style/AsciiComments require 'capybara/selector/filter_set' require 'capybara/selector/css' module Capybara # # ## Built-in Selectors # # * **:xpath** - Select elements by XPath expression # * Locator: An XPath expression # # * **:css** - Select el...
41.10962
202
0.618361
f7394b3c0e58a83e2b7d9474eceabb55a6bdf30b
576
require 'minitest_helper' describe Marshal do class Klass def initialize(str) @str = str end def say_hello @str end end it 'Dump and encode base 64' do obj = Klass.new 'hello world' Marshal.encode64(obj).must_match %r(^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[...
21.333333
117
0.635417
62fd8ccf1b908c2e64ffd0e80c9eb99ce19d7a9d
5,192
module Carnival class Field attr_accessor :size, :column, :line, :name, :params def initialize(name, params={}) @params = params @name = name set_position_by_params validate end #def name # @name.to_s #end def specified_association? not get_association_and...
25.326829
123
0.622496
91160fc5d87b1eafb14dc91d20a92ac17a194096
3,230
require "language/go" class Terraform < Formula desc "Tool to build, change, and version infrastructure" homepage "https://www.terraform.io/" url "https://github.com/hashicorp/terraform/archive/v0.6.15.tar.gz" sha256 "5dc7cb1d29dee3de9ed9efacab7e72aa447052c96ae8269d932f6a979871a852" head "https://github.com/...
30.471698
104
0.654799
e2815d8aae9da18889ae54c5f66c1405874c804a
1,210
# encoding: UTF-8 require 'rails_helper' describe 'my/show.html.erb', type: :view do let(:src_sets) { [] } before do assign(:gend_images, Kaminari.paginate_array([]).page(1)) assign(:src_images, Kaminari.paginate_array([]).page(1)) assign(:src_sets, Kaminari.paginate_array(src_sets).page(1)) assi...
26.304348
66
0.657851
e2f2fa4db2f102c1ee03055f549cf94e8edf234e
441
class CompanySize < ActiveHash::Base include ExposableViaApi self.data = [ { id: ID_FOR_ALL, name: "All Company sizes" }, { id: "0-9", name: "0-9" }, { id: "10-249", name: "10-249" }, { id: "250-500", name: "250-500" }, { id: "501-1000", name: "501-1000" }, { id: "more_than_1000", name: "10...
17.64
50
0.544218
116233ca4cc49996e91c0058c5951fad11935f1c
111
module Skeletor class RequiredBothPlatformsError < LoadError end require "Skeletor/version" end
9.25
46
0.738739
0132cfc010c2f4aa85eacb1601ff98779252e48d
870
# frozen_string_literal: true RSpec.describe Zen::Search::Updater do let(:subject) { Zen::Search::Updater } context ".run" do let(:users) { ZenSearchTestHelper::Mock.new.users } let(:tickets) { ZenSearchTestHelper::Mock.new.tickets } let(:user_collection) { Zen::Search::Users.new(users) } let(:tic...
28.064516
72
0.664368
bf48252d32f6a7ed0d0171e499961c04e0576e0d
1,208
load File.expand_path("../set_rails_env.rake", __FILE__) namespace :deploy do desc 'Runs rake db:migrate if migrations are set' task :migrate => [:set_rails_env] do on fetch(:migration_servers) do conditionally_migrate = fetch(:conditionally_migrate) info '[deploy:migrate] Checking changes in /db/...
30.2
103
0.686258
114276df875a7b652f6c0b3dafc9edc54a631946
4,723
# frozen_string_literal: true class RemoveDuplicateLabelsFromGroup < ActiveRecord::Migration[6.0] DOWNTIME = false CREATE = 1 RENAME = 2 disable_ddl_transaction! class BackupLabel < ApplicationRecord include EachBatch self.table_name = 'backup_labels' end class Label < ApplicationRecord ...
34.727941
162
0.729198
2641b9b4db6bae4b907abdcb48b8376c3b8e91a1
6,832
#!/usr/bin/env rspec @agent_file = File.join('mcollective', 'agent', 'rpcutil') require 'spec_helper' require @agent_file module MCollective module Agent describe Rpcutil do module Facts def self.[](fact) {'fact1' => 'value1', 'fact2' => 'value2', 'fact3' => 'value3'}[fact] end ...
38.59887
119
0.559426
010b89c4f48a23ef61c83e4e45cd91dd6e44e23a
1,596
# # Author:: Daniel DeLeo (<dan@chef.io>) # Copyright:: Copyright 2010-2016, Chef Software Inc. # License:: Apache License, Version 2.0 # # 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 # # ...
28.5
74
0.680451
6a8ad7c5f0028ba911d9e1b06ba3f34bd4f685f8
601
require 'logger' require 'semantic_logger' log_level = begin Kernel.const_get('Logger').const_get(ENV['PACT_BROKER_LOG_LEVEL'] || 'WARN') rescue NameError $stderr.puts "Ignoring PACT_BROKER_LOG_LEVEL '#{ENV['PACT_BROKER_LOG_LEVEL']}' as it is invalid. Valid values are: DEBUG INFO WARN ERROR FATAL. Using WARN." L...
33.388889
158
0.740433
62ead1cf76614978c2ed1b4a10ea436b030dc875
958
# encoding: utf-8 # copyright: 2015, Vulcano Security GmbH # license: All rights reserved # author: Dominik Richter # author: Christoph Hartmann module FindFiles TYPES = { block: 'b', character: 'c', directory: 'd', pipe: 'p', file: 'f', link: 'l', socket: 's', door: 'D', }.freeze ...
21.288889
60
0.585595
3353735c95a553c524753ffc127f557dbfe12d17
5,127
# Patches for Qt must be at the very least submitted to Qt's Gerrit codereview # rather than their bug-report Jira. The latter is rarely reviewed by Qt. class Qt < Formula desc "Cross-platform application and UI framework" homepage "https://www.qt.io/" url "https://download.qt.io/official_releases/qt/5.15/5.15.2/...
32.449367
109
0.672128
1ca222a12c85701d57cafe94dddd588241612de7
59
module Sass module Rails VERSION = "5.0.4" end end
9.833333
21
0.627119
33b810588147adab605bf15aa83602b536bb075c
1,491
class ProjectUserInvitation < ActiveRecord::Base belongs_to :user, :inverse_of => :project_user_invitations belongs_to :invited_user, :class_name => "User", :inverse_of => :project_user_invitations_received belongs_to :project, :inverse_of => :project_user_invitations validates_presence_of :user_id, :invited_us...
31.0625
105
0.746479
79185c39800dda02061c7c8cf4add50d9fabab1f
5,174
# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative sou...
43.116667
135
0.633166
18a2ae2ff6738bcf1c0954f389161ee08baf81ae
1,119
require 'digest/md5' require 'digest/sha1' require 'digest/sha2' require 'rickshaw/version' require 'core_ext/string/to_md5' require 'core_ext/string/to_sha1' require 'core_ext/string/to_sha256' require 'core_ext/string/to_sha512' require 'core_ext/string/to_base64' require 'core_ext/string/byte_packing' module Ricksh...
20.722222
49
0.67471
f84965233d2f39a81a51c3b8e144cdd1946301ab
147
require 'test/unit' class TabsHelperTest < Test::Unit::TestCase # Replace this with your real tests. def test_this_plugin flunk end end
16.333333
43
0.734694
08b1ccc7c1a0b3b4eda0c5a31f52b6c6f6bff825
1,980
require "test_helper" class DashboardTest < ActionDispatch::IntegrationTest setup do @user = create(:user, remember_token_expires_at: Gemcutter::REMEMBER_FOR.from_now) cookies[:remember_token] = @user.remember_token create(:rubygem, name: "arrakis", number: "1.0.0") end test "request with array of ...
30.461538
86
0.698485
3958f8845ddc8a1db5966eb5f5f0249fb4ce5f89
416
class Setting < ActiveRecord::Base def self.data_attributes [:hostname, :site_name, :juvia_site_key, :juvia_server_url, :juvia_include_css, :juvia_comment_order, :api_throttle_per_minute, :mail_sender, :mail_address, :mail_port, :mail_domain, :mail_authentication, :mail_user_name, :mail_password, :excep...
46.222222
131
0.790865
08a5a597d6f9226b2e0a1d961c31c73df010e23f
897
require 'spec_helper' describe 'mysql_client_test::default on omnios-151014' do cached(:omnios_client_55) do ChefSpec::SoloRunner.new( platform: 'omnios', version: '151014', step_into: 'mysql_client' ) do |node| node.set['mysql']['version'] = '5.5' end.converge('mysql_client_test:...
30.931034
94
0.714604
6244f2c9f6ea0f6473d0773099060f14b9266a15
1,961
require 'linked_list_functions/challenges' RSpec.describe 'linked list functions' do describe 'list_min' do it 'returns nil for the empty list' do list = LinkedList.new assert_equal nil, list_min(list) end it 'returns the first item when there is only one' do list = LinkedList.new(Node...
33.237288
106
0.569607
ed60a16140a50e49f60473655c2dd2b4a41b00e0
441
module CarrerasHelper def link_to_editar_carrera(carrera) render partial: 'link_to_editar_carrera', locals: { carrera: carrera } end def link_to_carrera_detalle(carrera_id) render partial: 'link_to_carrera_detalle', locals: { carrera_id: carrera_id } end def link_to_puntaje_carr...
20.045455
83
0.714286
26fe10bdfb52b73667b08bf1a1800657b5c54004
3,892
require "test_helper" # users interests class InterestControllerTest < FunctionalTestCase # Test list feature from left-hand column. def test_list_interests login("rolf") Interest.create(target: observations(:minimal_unknown_obs), user: rolf, state: true) Interest.create(target: nam...
33.843478
78
0.716341
285ebeafdecad93380353177cb2389ba45b2eb0d
7,711
require 'spec_helper' describe RailsExceptionHandler::Storage do render_views before(:each) do @handler = RailsExceptionHandler::Handler.new(create_env, create_exception) end it "should be able to use multiple storage strategies" do clear_test_log read_test_log.should == '' RailsExceptionHand...
48.19375
144
0.700817