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
ffda3fa5e8f80b9aa0cb5336ca03165d8d39f9e9
157
module TheRole module ActiveRecord def has_roles include TheRoleUserModel end def acts_as_role include RoleModel end end end
14.272727
30
0.694268
6a6bc005e6c0f64bf0812905ab150bf203dd8ddc
1,823
# frozen_string_literal: true module GraphQL module Analysis module_function # Visit `query`'s internal representation, calling `analyzers` along the way. # # - First, query analyzers are initialized by calling `.initial_value(query)`, if they respond to that method. # - Then, they receive `.call(...
32.553571
114
0.685683
5d2ad77a25e30ca0dc982384b918ba163447e0f5
568
require 'pod/command/package' require 'cocoapods-packager/user_interface/build_failed_report' require 'cocoapods-packager/builder' require 'cocoapods-packager/framework' require 'cocoapods-packager/mangle' require 'cocoapods-packager/pod_utils' require 'cocoapods-packager/spec_builder' require 'cocoapods-packager/symbo...
35.5
81
0.802817
e88e8c1dac9bff55d032a46e01e44f8a74b24048
163
class User < ActiveRecord::Base devise :cosign_authenticatable, :rememberable, :timeoutable def active_for_authentication? super && !deactivated end end
23.285714
61
0.773006
187e4b2bf4d5d701830a792780753b30474fd702
943
# frozen_string_literal: true RSpec.describe ROM::Relation::Combined do subject(:relation) do ROM::Relation::Combined.new(users, []) end let(:users) do Class.new(ROM::Relation) do def by_name(_name) self end end.new([]) end describe '#method_missing' do it 'responds to t...
24.815789
81
0.679745
4af54ae7bd5e0b5fb35c3d99fba000fd59f67fbd
33
Wupee::Engine.routes.draw do end
11
28
0.787879
6a4980bb1174cf28af00851db4a42493a19750a0
1,740
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes.rb', __FILE__) describe "String#*" do it "returns a new string containing count copies of self" do ("cool" * 0).should == "" ("cool" * 1).should == "cool" ("cool" * 3).should == "coolcoolcool" end ...
32.222222
92
0.657471
26ec3b52e303734b94b72c1fc7c80e662f00e566
695
require File.join(File.dirname(__FILE__), "/../spec_helper") describe TicTacToe::Cursor do describe "#<=>" do before(:each) do @cursor = TicTacToe::Cursor.new @cursor.set(1,1) end it "should be < a row above" do @cursor.should be < [2,0] end it "should be > a row below" do...
23.166667
64
0.561151
11078ebb628b72341e2651dd015faafe01008670
529
# frozen_string_literal: true class Anonymize def self.name(name) return if name.blank? names = name.split(' ') names.map do |n| initial = n.first n = '*' * n.length initial + n[1..-1] end.join(' ') end def self.email(email) return if email.blank? at_index = email.ind...
19.592593
47
0.597353
e2369c6117c7f0f6148fcbbd7177550b0fc8ce1d
1,740
require 'test_helper' class OnDemandTest < MiniTest::Test def setup stub_on_demand_wsdl end def test_get_customer_key_success stub_get_customer_by_key_success service = Netforum::OnDemand.new('123') customer = service.get_customer_by_key('key') assert_kind_of Netforum::User, customer end...
24.507042
67
0.778736
0139ac268165f3475e58aa7ed03cad0f7ff9a634
1,428
# frozen_string_literal: true require 'spec_helper' describe 'User searches for merge requests', :js do let(:user) { create(:user) } let(:project) { create(:project, namespace: user.namespace) } let!(:merge_request1) { create(:merge_request, title: 'Foo', source_project: project, target_project: project) } le...
28.56
123
0.695378
186729cf4fb8941dc6f641ec2c9e4cba554c4bea
315
require "net/http" require "open-uri" require "json" require "pry" require "colorize" require "tty-prompt" require_relative "../lib/modules/covidtracker" require_relative "../lib/cli" require_relative "../lib/coviddata" require_relative "../lib/api" require_relative "../lib/metadata" require_relative "../lib/gif"
24.230769
46
0.75873
e93a3bc3355760a1d815d0fa3e3d15ecd7bb7a85
5,960
module SimpleFormExtension module Inputs class SelectizeInput < SimpleForm::Inputs::Base include SimpleFormExtension::Translations include SimpleFormExtension::ResourceNameHelper # This field only allows local select options (serialized into JSON) # Searching for remote ones will be imple...
28.113208
115
0.567617
390d1bd0cdc9e6c858b2e7879464568fdb58ffc5
2,473
# encoding: utf-8 # copyright: 2016, you # license: All rights reserved # date: 2015-08-28 # description: All directives specified in this STIG must be specifically set (i.e. the server is not allowed to revert to programmed defaults for these directives). Included files should be reviewed if they are used. Procedure...
72.735294
607
0.773959
edbfead1502370d5e55766e2d4970ad598aa7a1f
1,645
# -*- encoding: utf-8 -*- # stub: activemodel 6.1.3 ruby lib Gem::Specification.new do |s| s.name = "activemodel".freeze s.version = "6.1.3" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "bug_tracker_uri" => "https://github.com/ra...
49.848485
414
0.721581
3949a5ca9c1a67ba64e7b3321358e9a438838b80
1,702
RSpec.configure do |c| c.mock_with :rspec end require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb')) include RspecPuppetFacts default_facts = { puppetversion: Puppet.version, facterve...
28.366667
104
0.747356
d53c2783c006d82695d6b9a948f1526e3cdc5a2d
1,025
require "psych" module Psych module Inherit module File class Handler < Psych::TreeBuilder TAG_NAME = '!file' NODE_NAME = 'inherit' attr_reader :reader def initialize(reader) @reader = reader super() end def document root.chil...
19.711538
61
0.526829
87ab5f1a2aaca4cb72d765c762d026818e6cfe71
1,468
module Authentication mattr_accessor :login_regex, :bad_login_message, :name_regex, :bad_name_message, :email_name_regex, :domain_head_regex, :domain_tld_regex, :email_regex, :bad_email_message self.login_regex = /\A\w[\w\.\-_@]+\z/ # ASCII, strict # self.login_regex = /\...
35.804878
108
0.637602
26d70c72391f9e0debc9e9f5ac2eb00e9f1fd29a
152
class AddIndexToFollow < ActiveRecord::Migration[6.1] def change add_index :follows, :follower_id add_index :follows, :following_id end end
21.714286
53
0.75
6a84e7020a20767afe8a029c1a88ad46d5bca4f3
1,945
#!/usr/bin/ruby -w # The MIT License (MIT) # Copyright (c) 2016 Alexander J Probst # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights t...
41.382979
462
0.752699
ac00615dd53e38567db384be21341cfabffa7abe
2,855
require 'formula' class Opam < Formula homepage 'https://opam.ocaml.org' url 'https://github.com/ocaml/opam/archive/1.1.2.tar.gz' sha1 '15ade90a1965fa712967e807a717f79db8d9032f' head 'https://github.com/ocaml/opam.git' depends_on "objective-caml" depends_on "aspcud" => :recommended if build.with? "asp...
29.739583
85
0.699475
87dcaed1147bea03c80b641b21697e7ff19bbf9e
1,589
require File.expand_path(File.dirname(__FILE__) + '/../../../test_helper') module Graticule # Generic tests for all geocoders (theoretically) module GeocodersTestCase def test_success return unless prepare_response(:success) location = Location.new( :street => "1600 Amphithe...
27.877193
93
0.662681
ed857b2ff0d5064cce6d934e8f93369b1ca84331
325
# frozen_string_literal: true module Metanorma; module Document; module BasicDocument # A digital signature of the contribution, consisting of a `hash` value and a `signature`, with an # associated `publicKey`. class IntegrityValue < Core::Node include Core::Node::Custom register_element end end; end;...
27.083333
100
0.747692
1a87ef4432c63b579347ebe8d05ca9a0763404eb
3,235
require 'json' require 'seek/license' module LicenseHelper def license_select(name, selected = nil, opts = {}) select_tag(name, options_for_select(license_options(opts), selected), opts) end def grouped_license_select(name, selected = nil, opts = {}) select_tag(name, grouped_options_for_select(grouped_l...
28.130435
124
0.677589
261fb66ff4876be0b6cd269bf26f83c14dd40e24
2,834
# 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::V2017_09_01 module Models # # Response for the ListVirtualNetworks API service call. # class VirtualNetworkLi...
28.34
80
0.531757
4a3f6fe932bd6059006d8348ff9c7bc5a187873c
921
$:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "filestack_rails/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "filestack-rails" s.version = FilestackRails::VERSION s.authors = ["filestack"] s.email = ...
34.111111
115
0.693811
f7c9a758956fb71b9b0420049616731de55643a2
54
require 'ecrire' run Ecrire::Application.initialize!
13.5
35
0.796296
1d01c0a66acf6b0ddab6d37f04e0401a8a3be3fc
121
require 'test_helper' class LibraryTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
15.125
43
0.702479
6292cf547db049bb7a59619e697217fae98fcbf1
51
module TestDevcampViewTool VERSION = "0.1.0" end
12.75
26
0.745098
5dd58ad66a768ba16d3c34c83b6fa43a3549150b
464
require 'spec_helper' feature 'Merge Requests List' do let(:user) { create(:user) } let(:project) { create(:project) } background do project.team << [user, :developer] login_as(user) end scenario 'user does not see create new list button' do create(:merge_request, source_project: project) ...
22.095238
75
0.715517
1ae8ffb8f9f97c641acd5d4f82fa6f9e91b92d62
225
class CreateUsers < ActiveRecord::Migration[6.0] def change if !table_exists?(:users) create_table :users do |t| t.string :name t.string :email t.timestamps end end end end
18.75
48
0.591111
38784c22fac837067574c691ae1cb7dec61f44e4
2,346
#-- # Author:: Tim Hinderliter (<tim@opscode.com>) # Author:: Christopher Walters (<cw@opscode.com>) # Copyright:: Copyright (c) 2010-2015 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...
39.762712
115
0.731032
08029d1b13c8de7fba83ad6c1ca1d5221e9060cb
1,980
gem "multi_json", "~> 1.10" gem "faraday", ">= 0.9.0", "< 1.1.0.pre" gem "netrc", ">= 0.10.0", "< 0.12.0.pre" require 'time' require 'cgi' require 'uri' require 'netrc' require 'multi_json' require 'faraday' require 'faraday/adapter/fury_http' require 'faraday/request/multipart_with_fil...
23.855422
80
0.668687
62bedf9282be29012e5980c34ad928fdabed161d
7,595
require "spec_helper" module Switchman describe DatabaseServer do describe "shareable?" do it "should be true for mysql" do db = DatabaseServer.new(nil, adapter: 'mysql') expect(db.shareable?).to eq true db = DatabaseServer.new(nil, adapter: 'mysql2') expect(db.shareable?)....
34.680365
138
0.623831
085970d96036f2a398f12eedb2774112d24800dd
199
RSpec.describe Serverless::Local do it "has a version number" do expect(Serverless::Local::VERSION).not_to be nil end it "does something useful" do expect(false).to eq(true) end end
19.9
52
0.708543
abadbc9d1fbd90d6736eff0d5173a1f3721e232f
508
module MarkdownHelper def markdown(text) options = { filter_html: true, hard_wrap: true, link_attributes: { rel: "nofollow", target: "_blank" }, fenced_code_blocks: true } extensions = { autolink: true, superscript: true, disable_indented_code_blocks: true, ...
22.086957
61
0.653543
6a836e8d758c6f30c47c4303efb6efa22a78671a
96
require_relative 'hmac_authentication/signature' require_relative 'hmac_authentication/version'
32
48
0.895833
4a8b12a31519be5c23657a915b0e3023a94dc18a
2,785
# frozen_string_literal: true module Ryo class CLI < Thor desc "cert URL", "Discover an SSL certificate belongs to a given URL" def cert(url) hash = run_discovery(url, cert: true) puts hash.to_json end desc "dir URL", "Discover directories and files belong to a given URL" def dir(url...
29.010417
74
0.648474
79b7e9d4c5b12e72ff3f54131d2dca0c1ccd8538
108,177
# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'seahorse/client/plugins/content_length.rb' require 'aws-sdk-core/plugins/credentials_configuration.rb' ...
46.229487
284
0.681698
3994a0536c432cc5a247209da0959cafb4f3b0d0
2,607
# (The MIT License) # # Copyright (c) 2008 Jamis Buck <jamis@37signals.com>, # with modifications by Bruce Williams <bruce@codefluency.com> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # 'Software'), to deal in ...
33.857143
76
0.695052
bbd4420ac2c35b0de2efbd830d1bb598072ce102
1,329
name "resolver" maintainer "Opscode, Inc." maintainer_email "cookbooks@opscode.com" license "Apache 2.0" description "Configures /etc/resolv.conf via attributes" long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version "1.1.5" recipe "resolver", "...
30.906977
96
0.691497
871edc01d7041f7803c7164d578bec433036e06b
1,231
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'cucoo/version' Gem::Specification.new do |spec| spec.name = 'cucoo' spec.version = Cucoo::VERSION spec.authors = ['RC'] spec.email = ['rc.chandru@gmail.com'] spec.summary = %q{Cucumber ...
37.30303
125
0.721365
1c5a7956dc71e11795f1b55ea557ec355f36d01f
2,522
module ComplexField module SourceIndexer def generate_solr_document super.tap do |solr_doc| index_source(solr_doc) end end def index_source(solr_doc) solr_doc[Solrizer.solr_name('complex_source', :displayable)] = object.complex_source.to_json solr_doc[Solrizer.solr_name('c...
43.482759
165
0.6705
181e6774d9f67e21e646855cb2395c5ec958a9a9
366
class AddDefaultToIsDeleted < ActiveRecord::Migration def up change_column :answers, :is_deleted, :boolean, :default => false change_column :comments, :is_deleted, :boolean, :default => false end def down change_column :answers, :is_deleted, :boolean, :default => nil change_column :comments, :is_d...
33.272727
69
0.715847
e2dd516ad9a2e94c9be766a45feb15345b064dc9
263
module Given class FileCache def initialize @lines = {} end def get(file_name) @lines[file_name] ||= read_lines(file_name) end private def read_lines(file_name) open(file_name) { |f| f.readlines } end end end
13.842105
49
0.604563
ffcb65d276393f43e878f60b6aa6878ceebadd76
986
# Module: Files (Aura) # Files stuff. # # ## Description # This is accessible via {Aura.files}. # # These functions checks for files in: # # * Aura's default app stuff (`(aura gem)/app/`) # * Each of the active extensions's folders (`(extension)/`) # * Your applications (`(application)/app/`) # class Aura module F...
25.282051
68
0.574037
ff505fdbdddd64f641a153e4b957c15030bcc797
3,425
# frozen_string_literal: true module QA module Support module Page module Logging def refresh log("refreshing #{current_url}") super end def wait(max: 60, interval: 0.1, reload: true) log("next wait uses reload: #{reload}") # Logging of wait...
21.40625
80
0.506569
03f6ef58acdd716f3c0f90ef498ae2a97a3839d7
1,155
module Depthcharge module Formatters MAIN_INDENT = " | " SUB_INDENT = " " NEWLINE = "\n" def format_body(headers, body, level = 1) content_type = headers["Content-Type"] body = body.join if body.respond_to?(:join) body = body.body if body.respond_to?(:body) if !content_typ...
21.792453
73
0.587879
ab457e4271ca115007b37db6198f4a5b5ca2133a
440
# FrenchRails require 'french_rails/version' module FrenchRails class Railtie < Rails::Railtie initializer :load_french_rails => :load_application_initializers do require 'french_rails/backend/simple' require 'french_rails/action_support/inflections' require 'french_rails/action_view/text_helpe...
27.5
71
0.772727
e9a21f50f1a2c8d87d034c528af36f7aeed36009
273
module Phccontactor class MessageMailer < ApplicationMailer # Message Address default :to => ENV["PHC_CONTACTOR_SENDER"] # Put Togther Messange def message_me(msg) @msg = msg mail from: @msg.email, subject: @msg.subject, body: @msg.content end end end
18.2
67
0.714286
79bee63f31e09f113f211fdb5d25324f640d5908
2,945
require "rspec/core/formatters/base_text_formatter" module RSpec module Longrun class Formatter < RSpec::Core::Formatters::BaseTextFormatter RSpec::Core::Formatters.register self, :start, :example_group_started, :example_group_finished, :example_started, :example_passed, :...
21.34058
102
0.570798
264ca0fd881e54cc2b07352b20cf185ccf3f7ba4
2,413
# typed: false # frozen_string_literal: true # This file was generated by GoReleaser. DO NOT EDIT. require_relative "./lib/private_strategy.rb" class Awscreds < Formula desc "AWS Tools for managing credentials" homepage "https://github.com/jacobfg/awscreds" version "0.4.10" license "Apache-2.0" depends_on :m...
35.485294
166
0.664733
18a8f9724eeceb0e6add3138866a27e1d374967a
391
class FakeAccessResultGenerator def initialize(student) @dates = (2010..2015).to_a.shuffle @student = student end def next { assessment_id: Assessment.access.id, date_taken: DateTime.new(@dates.pop, 5, 15), scale_score: rand(300..400), performance_level: rand(10), growt...
20.578947
50
0.649616
39f910f2cd081e4b6506f27bfd2ae65168206d84
1,217
class Admin::UsersController < AdminController layout "application_admin" before_action :logged_in_manager def index @users = User.all end def new @user = User.new end def create @user = User.new(user_params) if @user.save flash[:success] = "Create User Success!" redirect_t...
21.350877
144
0.663106
2838898c13a5acbec7cc9f816c80ef35aeb87cd3
70
# frozen_string_literal: true module Awesome VERSION = "0.1.0" end
11.666667
29
0.728571
339a089f34b9f8598bdb6a77900ea201bfd02c4c
111
require "jquery-popover/version" module Jquery module Popover require 'jquery-popover/engine' end end
13.875
35
0.756757
03f239e447a6d1d336c930594d1d525f923e4274
747
# frozen_string_literal: true require "spec_helper" describe Mongoid::Errors::NoClientConfig do describe "#message" do let(:error) do described_class.new(:secondary) end it "contains the problem in the message" do expect(error.message).to include( "No configuration could be found ...
23.34375
83
0.668005
abc04558f6dbefb2b31539e4e60e6b3721c3f287
1,359
module Momm class Storage # The presenter model to rule the behavior of storage. # Lazy load Client # # == Returns # Client # def client raise NotImplementedError end # Insert the currency rate to client # # == Parameters # currency:: # Currency passed i...
20.907692
78
0.565857
b93c7af81b137735d39c693a324a68290a69e4b0
3,346
## # $Id$ ## require 'msf/base' module Msf module Simple ### # # Simple payload wrapper class for performing generation. # ### module Payload include Module # # Generate a payload with the mad skillz. The payload can be generated in # a number of ways. # # opts can have: # # Encoder => A encoder mod...
24.423358
106
0.621937
5d89d0e44d39912c3167ffc51e30ad41b4f51123
1,948
require "isolation/abstract_unit" require "console_helpers" module ApplicationTests class DBConsoleTest < ActiveSupport::TestCase include ActiveSupport::Testing::Isolation include ConsoleHelpers def setup skip "PTY unavailable" unless available_pty? build_app end def teardown ...
25.298701
93
0.606263
28c6ca9b1b191c6c3e1c5f5c2b1b75699221e88d
5,186
=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-ap...
25.297561
177
0.601041
f730a0e055192e1db37b2ddc1ce7a5f65385b46e
643
cask "nvidia-geforce-now" do version "2.0.30.99" sha256 :no_check url "https://download.nvidia.com/gfnpc/GeForceNOW-release.dmg" name "NVIDIA GeForce NOW" desc "Cloud gaming platform" homepage "https://www.nvidia.com/en-us/geforce-now/download/" livecheck do skip "No version information available" ...
26.791667
80
0.715397
f7edfdee8ce073152a9909dbe52710aee8c1cfcd
3,084
require 'spec_helper' require 'puppet/util/puppetdb/config' require 'puppet/util/puppetdb/command_names' # Create a local copy of these constants so that we don't have to refer to them # by their full namespaced name CommandReplaceCatalog = Puppet::Util::Puppetdb::CommandNames::CommandReplaceCatalog CommandReplaceFa...
25.487603
85
0.65013
4a9b3bd51057f99b975ccf07914138d0a2b37c25
987
# frozen_string_literal: true # # Cookbook:: aws-parallelcluster-config # Recipe:: update_computefleet_status # # Copyright:: 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the # Licen...
41.125
125
0.767984
4ab26d12997f4306c4102ca714fbe11155e21434
179
class CreateGames < ActiveRecord::Migration[6.0] def change create_table :games do |t| t.integer :score t.integer :user_id t.timestamps end end end
16.272727
48
0.648045
911a3bdfcc7dff0639bbba34f1a76829d4bdf276
2,510
# encoding: UTF-8 require 'test_helper' describe Vines::Stream::Http::Auth do before do @stream = MiniTest::Mock.new @state = Vines::Stream::Http::Auth.new(@stream, nil) end def test_missing_body_raises_error node = node('<presence type="unavailable"/>') @stream.expect(:valid_session?, true, [n...
35.352113
114
0.68247
2146cb36721618109ffe9cdee56351fbe84c47b7
352
require 'spec_helper' describe service('etcd2') do it { should be_enabled } it { should be_running } end describe file('/etc/systemd/system/etcd2.service.d/20-proxy.conf') do it { should exist } it { should be_file } its(:md5sum) { should eq 'fa1ca1aade71d4599964bbc211e382dd' } end describe port(2379) do ...
20.705882
69
0.721591
7a124448779fccf5078a199e3621d38a85c1694a
1,013
require 'spec_helper' describe 'windows_power::global::hibernation', type: :define do describe 'updating with invalid status' do let(:title) { 'hibernate on' } let(:params) do { status: 'xxx' } end it do expect do is_expected.to contain_exec('update hibernate status') end.t...
23.55814
91
0.624877
28a63c25f3bd5ddc2d72a39efda3be1dab92b933
635
class AvroTools < Formula desc "Avro command-line tools and utilities" homepage "https://avro.apache.org/" url "https://www.apache.org/dyn/closer.lua?path=avro/avro-1.10.0/java/avro-tools-1.10.0.jar" mirror "https://archive.apache.org/dist/avro/avro-1.10.0/java/avro-tools-1.10.0.jar" sha256 "74c037354ba1bb43e...
33.421053
94
0.729134
f8683c22c1b15b3435299501798383f9ebcf30ad
1,109
# coding: utf-8 module Recot module Tasks class BaseTask def initialize @user_root = Dir.pwd end def run(args = nil) end protected # Get Current test no. # # == Returns: # Number of test. # If not cached test no return empty string. def get...
19.803571
55
0.555455
28481b664dd592d415c29f01d6107f1db546cd2d
358
# == Schema Information # # Table name: shop_photos # # id :integer not null, primary key # shop_id :integer # data :string(255) # position :integer default(1) # created_at :datetime # updated_at :datetime # require 'spec_helper' describe ShopPhoto do pending "add some exa...
19.888889
56
0.639665
b9ed4cdb41dc75e82962a4f3a6ce6f865c9511b6
16
require 'woulda'
16
16
0.8125
e974d356fcbb91b665f22740933bca0f51bcd335
730
require 'spec_helper' require 'factory_girl/syntax/make' describe "a factory using make syntax" do before do Factory.define :user do |factory| factory.first_name 'Bill' factory.last_name 'Nye' factory.email 'science@guys.net' end end after do Factory.factories.clear end ...
20.277778
50
0.660274
b9d2d073e5b7fd7ab222cda40a37b37070434398
2,463
class ManageIQ::Providers::IbmPowerHmc::InfraManager::MetricsCapture < ManageIQ::Providers::BaseManager::MetricsCapture VIM_STYLE_COUNTERS = { "cpu_usage_rate_average" => { :counter_key => "cpu_usage_rate_average", :instance => "", :capture_interval => "20", ...
37.892308
119
0.555014
3873958ca927871db4ffaf293c2158016c1af021
8,095
class Gnuradio < Formula include Language::Python::Virtualenv desc "SDK for signal processing blocks to implement software radios" homepage "https://gnuradio.org/" url "https://github.com/gnuradio/gnuradio/archive/refs/tags/v3.9.3.0.tar.gz" sha256 "4073ac72524f95fed4bda7dd553cb946f66d2e00bd07c4ae7758f1b787d5...
35.349345
143
0.689685
3361390b3f4f28d4d26ce2687241fc90f63c2bfc
3,524
module Locomotive::Steam module Middlewares class Cache < ThreadSafe include Concerns::Helpers CACHEABLE_RESPONSE_CODES = [200, 301, 404, 410].freeze CACHEABLE_REQUEST_METHODS = %w(GET HEAD).freeze DEFAULT_CACHE_CONTROL = 'max-age=0, s-maxage=3600, public, must-revalidate'.freeze...
29.864407
114
0.596198
e89d90b655e3fb8f5f8a176641b6f768fdb5f06e
1,667
$:.unshift(File.join(File.dirname(__FILE__),'..','lib')).uniq! require 'ldaptic/filter' require 'test/unit' class LdapticFilterTest < Test::Unit::TestCase def assert_ldap_filter(string, filter) assert_equal string.downcase, Ldaptic::Filter(filter).process.downcase end def test_filter_from_hash assert_e...
30.87037
76
0.595681
ab093eddc577dfba59311f50bcfa59582ed4d9ce
920
require 'formula' class Libusrsctp < Formula desc "User-land SCTP stack" homepage 'http://sctp.fh-muenster.de/sctp-user-land-stack.html' url 'http://sctp.fh-muenster.de/download/libusrsctp-0.9.1.tar.gz' sha1 'b719ddd754fd21b2bda634db20640bb9477c2a1b' bottle do cellar :any revision 1 sha1 "5b540e...
27.058824
69
0.693478
5dd07d98d90f44090a8f5f09276e43ce4920c87c
4,914
# frozen_string_literal: true require 'rails_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 ...
38.093023
107
0.694546
33886c1875014d6d9e040ed9fdf712b57ddaf6aa
504
class CdsImporter class EntityMapper class MeasureActionMapper < BaseMapper self.entity_class = 'MeasureAction'.freeze self.mapping_root = 'MeasureAction'.freeze self.exclude_mapping = ['metainfo.origin'].freeze self.entity_mapping = base_mapping.merge( 'actionCode' => :action_c...
25.2
73
0.730159
263498815edf2a5ba3d6266be18aee158936397b
488
require 'spec_helper' describe 'cfssl' do on_supported_os.each do |os, facts| context "on #{os}" do let(:facts) do facts end it { is_expected.to compile.with_all_deps } describe 'ensure wget is managed' do let(:params) do { wget_manage: true, ...
17.428571
54
0.508197
e88d4b891266305cbd1bdcd9bf9e0ff66954a5d6
1,649
# # Be sure to run `pod lib lint netfox-Droar.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 = 'netfox-...
37.477273
109
0.646452
ff2452e7f73df5103184c77de69eff473f234b88
10,046
# TODO deprecate in favor of the gem directlink # TODO maybe activate raise_on_failure optional FastImage param require "pp" # require "json" # require "nethttputils" require "imgur2array" require "fastimage" module GetDimensions class Error404 < RuntimeError def initialize url # Module.nesting[1].logge...
47.164319
488
0.647422
d5fd1e1c73e1fc6390137dfd935cdfef2548f68f
12,115
# frozen_string_literal: true require "cases/migration/helper" module ActiveRecord class Migration class TableTest < ActiveRecord::TestCase def setup @connection = Minitest::Mock.new end teardown do assert @connection.verify end def with_change_table yield...
34.51567
110
0.601651
39fdb0fd57de54aaf91bd743768a6ed477cc8344
6,600
# 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...
32.673267
117
0.656061
ff2eac77dbeb0da24a9d04e4425fffc0bd9405c2
10,446
# frozen_string_literal: true require 'faraday' require 'json' require 'yaml' require 'browserstack/automate/api' require 'browserstack/automate/builds' module Browserstack module Automate # This class encapsulates the JSON returned from the browserstack Session API such as class Sessions # rubocop:di...
62.550898
492
0.6973
2111b7d4c15a097428edcfdcde53cb911fa6e971
1,729
require 'test_helper' class RecipeTest < ActiveSupport::TestCase def setup @chef = Chef.create(chefname: "bob", email: "bob@email.com") @recipe = @chef.recipes.build(name: "chicken farm", summary: "This is the best chicken farm recipe ever", description: "Heat oil, add onio...
23.364865
121
0.64893
913e3a9523585d3b4e142ef86ac1d7ddc2cdf1ed
667
class Calabash < Formula desc "XProc (XML Pipeline Language) implementation" homepage "https://xmlcalabash.com/" url "https://github.com/ndw/xmlcalabash1/releases/download/1.1.24-98/xmlcalabash-1.1.24-98.zip" sha256 "e80bca50cf7e32bf4fd3ae4c2e426b781224fc726ecdb55f9251c2be0ee53a64" bottle :unneeded depend...
30.318182
97
0.728636
180c550c5b1e5a114a28f2386f268813e14741d5
282
class PillsBuilder attr_reader :pill def initialize @pill = Pill.new end def set_color(color) @pill.color = color end def set_location(location) @pill.location = location end def set_passphrase(passphrase) @pill.passphrase = passphrase end end
14.1
33
0.695035
f7f933bc5b671c0eb10790bbf6796d54c15faf34
3,919
{ :address=>{ :city=>"Atlanta", :email=>"brett@voteharrell.com", :fax=>nil, :phone=>"4046560254", :state=>"GA", :street=>"601-D Coverdell Legislative Office Building", :zip=>"30334 " }, :birthday=>"July 1", :education=>nil, :name=>{ :first=>"Brett", :last=>"Harrell", :middle=>nil, :nickna...
48.382716
753
0.611125
bbfdd192266ba9e5758341f3563c875526a46cd7
360
require 'test_helper' require 'parser/parser' class ParserTest < Test::Unit::TestCase def test_method_with_param code = <<-CODE def method(a, b): true CODE nodes = Nodes.new([ DefNode.new( 'method', ['a', 'b'], Nodes.new([TrueNode.new]) ) ]) assert_equal n...
15
46
0.586111
f82ebedc2949da5ce4a7322a44914e986a24d96e
20,746
require 'rest_client' require 'json' require 'cgi' require 'securerandom' require 'active_support/core_ext/hash/conversions' module NewWxPay module Service GATEWAY_URL = 'https://api.mch.weixin.qq.com'.freeze SANDBOX_GATEWAY_URL = 'https://api.mch.weixin.qq.com/sandboxnew'.freeze FRAUD_GATEWAY_URL = 'htt...
34.634391
176
0.655403
186290f9be3bcf02781ca1dcd757e5e122bddebd
1,070
require 'fog/core/collection' require 'fog/glesys/models/compute/server' module Fog module Compute class Glesys class Servers < Fog::Collection model Fog::Compute::Glesys::Server def all data = service.list_servers.body['response']['servers'] load(data) end ...
24.883721
80
0.536449
79caeaceb5f10da730b3d820a0c851fde989572b
1,476
#-- copyright # OpenProject is an open source project management software. # Copyright (C) 2012-2020 the OpenProject GmbH # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject, which is a fork ...
35.142857
91
0.73916
6293b8597299a2b9e7d8c7c3d605f9f69e4f494c
10,388
module Helpers module UserHelpers def profile_body(admin: false) body = { 'uid' => 'testuser', 'first_name' => 'Test', 'last_name' => 'User', 'email_address' => 'testuser@example.com', 'country' => 'United States', 'study_area' => 'Ot...
42.4
141
0.679438
112ca10f273209b0e1a38c96f59698ce8556265e
965
require File.dirname(__FILE__) + "/../spec_helper" EM.describe Pusher::Transport::Sse do before do @request = mock("request") @transport = Pusher::Transport::Sse.new(@request) end it "should render" do @transport.render.should == [200, {'Content-Type' => 'application/x-dom-event-stream'}, @transpo...
22.97619
112
0.620725
bbcb3570f5b68d00953788c4760b354eb4278f9b
560
class Grade < ActiveRecord::Base belongs_to :standard belongs_to :student belongs_to :section belongs_to :term validates :standard_id, :section_id, :student_id, :grade, :semester, :term_id, presence: true def self.grades_per_standard(standard) standard.grades end def number_grade case self.grade when "E...
15.135135
94
0.692857
79a9bcf587c8cd63a08d4ac4776552b6158d3fed
22,487
# # 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...
31.987198
103
0.66683
0351175408b72f40c2457355de54b22f5c376f71
2,304
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.446154
86
0.761285
0361bfe0cf518d6272c841708e809bc5ff681be1
5,344
COVERAGE_MIN = 90 CURRENT_PATH = File.expand_path(File.dirname(__FILE__)) SERVER_DISCOVERY_TESTS = Dir.glob("#{CURRENT_PATH}/spec_tests/data/sdam/**/*.yml").sort SDAM_MONITORING_TESTS = Dir.glob("#{CURRENT_PATH}/spec_tests/data/sdam_monitoring/*.yml").sort SERVER_SELECTION_RTT_TESTS = Dir.glob("#{CURRENT_PATH}/spec_te...
34.038217
108
0.766093