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
283df6ba06970559bda57c14b8ec415fa2850f4b
169
require 'test_helper' class SessionsControllerTest < ActionDispatch::IntegrationTest test "should get new" do get login_path assert_response :success end end
13
62
0.786982
2133c86567410fb969b54d490e44e5c0bb61d635
580
# This class represents a Marathon Deployment step. class Marathon::DeploymentStep < Marathon::Base attr_reader :actions # Create a new deployment step object. # ++hash++: Hash returned by API, including 'actions' def initialize(hash) super(hash) if hash.is_a?(Array) @actions = info.map { |e| Ma...
26.363636
93
0.653448
ab739bec5c5449905956f3893f6082dbeb9f0d89
6,156
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
32.230366
132
0.597953
f76a229d0ee08a59e529d10530959b047f0aec13
314
require File.dirname(__FILE__) + '/../../spec_helper' require File.dirname(__FILE__) + '/fixtures/classes' describe "Kernel#getc" do it "is a private method" do Kernel.private_instance_methods.should include("getc") end end describe "Kernel.getc" do it "needs to be reviewed for spec completeness" end
24.153846
58
0.738854
1c1637a53816c174d4367272cd65ad53ae87a0e3
2,354
require "spec_helper" describe Volunteer do describe '#name' do it 'returns the name of the volunteer' do test_volunteer = Volunteer.new({:name => 'Jane', :project_id => 1, :id => nil}) expect(test_volunteer.name).to eq 'Jane' end end describe '#project_id' do it 'returns the project_id ...
30.973684
85
0.613424
79704730a43c2190a7be509dbe0e9c5b625195eb
3,754
class Logstash < Formula desc "Tool for managing events and logs" homepage "https://www.elastic.co/products/logstash" url "https://github.com/elastic/logstash/archive/v7.13.1.tar.gz" sha256 "b88a5d571833c7e72474246acff8f773dee2093acf4f2efafc20ea2f693e23c0" license "Apache-2.0" version_scheme 1 head "https...
31.283333
112
0.617208
01c80432f134f28cf40935d11b6c5eac5b7824e5
2,883
# frozen_string_literal: true require "rails_helper" describe Eve::CorporationImporter do let(:corporation_id) { double } subject { described_class.new(corporation_id) } it { should be_a(Eve::BaseImporter) } describe "#import" do before { expect(subject).to receive(:configure_middlewares) } before...
31.681319
139
0.659036
ab8da2ff36daa572b4fbeb70d3651d3962272a2e
127
require 'test_helper' class FavoritesListTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
15.875
49
0.716535
2627c3afa98d3a6f0e3f18c26b480a79d78d667e
6,921
require "rails_helper" require "controller_spec_helper" RSpec.describe FacilityAccountUsersController, if: SettingsHelper.feature_on?(:edit_accounts) do render_views before(:all) { create_users } before(:each) do @authable = FactoryBot.create(:facility) @account = create_nufs_account_with_owner end ...
32.957143
133
0.636613
08e0190f1470bd3c4e0efa2251554ec154bdbd20
1,741
# # Author:: Seth Chisamore (<schisamo@chef.io>) # Copyright:: Copyright (c) 2013-2018 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...
34.82
74
0.700172
87e1fc7efa739b11c08cf5fb98e50cd7be1bd001
1,924
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this f...
37.72549
97
0.68815
2839a622afb349d249e89793b61fd90fb286245a
4,960
require 'spec_helper' describe 'taxa/overview/show' do before(:all) do Language.create_english UriType.create_enumerated Vetted.create_enumerated Visibility.create_enumerated License.create_enumerated ContentPartnerStatus.create_enumerated end before(:each) do # TODO - generalize th...
35.942029
123
0.665726
ab56f38f0c1272ccb078f83f863fe60d38ae901e
744
# frozen_string_literal: true require 'spec_helper' RSpec.describe Gitlab::Metrics::RackMiddleware do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } let(:env) { { 'REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/foo' } } describe '#call' do it 'tracks a transaction' do expe...
25.655172
70
0.673387
62165bc43a70f715d385d37bf11d2a4366e90cea
49
require 'creature' class Troll < Creature end
7
22
0.734694
b98efc732ca0ef17d716ecef5568c4016c44ce14
42,897
require 'spec_helper' describe GenericFile, :type => :model do let(:user) { FactoryGirl.find_or_create(:jill) } before(:each) do @file = GenericFile.new @file.apply_depositor_metadata(user.user_key) end describe "created for someone (proxy)" do before do @transfer_to = FactoryGirl.find_or_c...
39.391185
220
0.641001
9143e75f9a9603461119fbb03f3768e701d01722
611
# See https://docs.chef.io/config_rb_knife.html for more information on knife configuration options current_dir = File.dirname(__FILE__) log_level :info log_location STDOUT node_name "webops" client_key "#{current_dir}/webops.pem" validation_client_name "awo-va...
43.642857
99
0.654664
3951356978434100f902beecf6c0311964955afb
437
# frozen_string_literal: true module TimesheetReader # Converter class class Converter attr_accessor :minute_multiplier def initialize @minute_multiplier = 60 end def hour_to_minutes(hours) hours.to_i * minute_multiplier end def minutes_to_time(minutes) hours = (minutes...
19
49
0.693364
0168f3460f752011047417cd18190f642832ded8
1,783
# Copyright 2007-2014 Greg Hurrell. All rights reserved. # Licensed under the terms of the BSD 2-clause license. require 'spec_helper' describe Walrat::ParsletOmission do it 'raises if "parseable" argument is nil' do expect do Walrat::ParsletOmission.new nil end.to raise_error(ArgumentError, /nil pars...
31.839286
116
0.716209
ffe7f141e1f04171745cd42a32c4d7eedbfdac33
1,613
module RetirementsHelper def time_difference_from_now(end_time, format = :sentence) start_time = Time.current.to_time end_time = end_time.to_time if end_time.respond_to?(:to_time) distance_in_seconds = ((end_time - start_time).abs).round format = :sentence unless %i[sentence header score].include? fo...
36.659091
105
0.701178
f7b22d6d6d206e42dba1eb7e17fe7ea80cea097f
3,996
require "rails_helper" RSpec.describe Reports::QuarterlyFacilityState, {type: :model, reporting_spec: true} do describe "Associations" do it { should belong_to(:facility) } end around do |example| freeze_time_for_reporting_specs(example) end it "has a row for every facility, every quarter" do f...
45.931034
138
0.738989
62a3df86052dbd1c1c4641756581be9cf8da9710
2,243
require 'tests/test_helper.rb' def test_game_turn_is_advanced_after_action(_args, assert) $game.game_map = build_game_map_with_entities(Entities.player, build_actor) $game.scene = Scenes::Gameplay.new(player: Entities.player) scene_before = $game.scene assert.will_advance_turn! do $game.handle_input_event...
29.906667
88
0.753009
211d01741cccfb92625304e78980916577a8131b
920
# frozen_string_literal: true workers Integer(ENV.fetch('WEB_CONCURRENCY', 2)) threads_count = Integer(ENV.fetch('MAX_THREADS', 5)) threads threads_count, threads_count tag 'sinatra-skeleton' rackup DefaultRackup environment ENV.fetch('RACK_ENV', 'development') preload_app! if ENV['RACK_ENV'] == 'produ...
35.384615
115
0.644565
1ddc755239be0a0db5a7c6bcbfc7e1d8a3a96b7f
764
cask "font-iosevka-curly" do version "8.0.2" sha256 "b151a755b038e208db36f4be67b8554f0b35526e639bc45461edfd02b6708787" url "https://github.com/be5invis/Iosevka/releases/download/v#{version}/ttc-iosevka-curly-#{version}.zip" name "Iosevka Curly" desc "Sans-serif, slab-serif, monospace and quasi‑proportional t...
30.56
106
0.751309
1d871daf1270f2e35854e36168db71d8af45b6e1
3,372
FactoryGirl.define do factory :orchestration_stack do ems_ref "1" end factory :orchestration_stack_cloud, :parent => :orchestration_stack, :class => "ManageIQ::Providers::CloudManager::OrchestrationStack" do end factory :orchestration_stack_cloud_with_template, :parent => :orchestration_stack, :class =>...
41.62963
176
0.765421
386007a03121dac17d7ec23d93eff0ef94fa34c7
1,215
module Pupa # A real person, alive or dead. class Person include Model self.schema = 'popolo/person' include Concerns::Timestamps include Concerns::Sourceable include Concerns::Nameable include Concerns::Identifiable include Concerns::Contactable include Concerns::Linkable att...
28.255814
117
0.633745
396771a57bed667006ee4c3633e6bee118ce9677
738
module AnalyticsHelper def can_use_analytics? ENV["ANALYTICS"].present? && !masquerading? end def identify_hash(user = current_user) { created: user.created_at, email: user.email, first_name: user.first_name, name: user.name, unsubscribed_from_emails: user.unsubscribed_from_...
19.421053
62
0.597561
39cd7f62dee8f80ea0dcf248a4772095f5ecb3d1
2,123
# A mapping element connects source with targed field. It further does # a conversion if needed # # == Conversions: # - join: merges multiple incoming fields into a target # - enum: maps source strings to enum target values # # - split: split source field into multiple target fields # class MappingElement < ActiveRecor...
29.082192
124
0.695243
5d3f487bc658f0b6f37c5fa91bb9b9eb983ce569
45,605
require File.dirname(__FILE__) + '/../spec_helper' describe "Standard Tags" do dataset :users_and_pages, :file_not_found, :snippets it '<r:page> should allow access to the current page' do page(:home) page.should render('<r:page:title />').as('Home') page.should render(%{<r:find url="/radius"><r:title...
45.972782
270
0.647517
62fd08b3d425a6a11c7a32ccad60a4c973d3469c
7,301
require 'rails_helper' RSpec.describe Api::V1::Admin::RacesController, type: :request do let(:random_name) { generate_random_string(16) } let(:login_user) { create(:user, :admin) } let(:race) { create(:race, name: random_name) } before(:each) do @headers = { 'ACCEPT': 'application/json', 'CONTEN...
34.601896
89
0.661279
1dc2205644f935a41d869619a3e2556c453f14aa
1,972
describe ManageIQ::Providers::Nuage::NetworkManager::EventParser do let(:ems) { FactoryBot.create(:ems_nuage_network) } context ".event_to_hash" do [ { :name => 'with requestID', :fixture => '/event_catcher/events/subnet_create.json', :expected => { :event_type => '...
37.923077
126
0.5857
115d9fcbefa0f7d4fd0aecdb5b30504b75c843d8
1,829
require "logstash/outputs/base" require "logstash/namespace" class LogStash::Outputs::Stomp < LogStash::Outputs::Base config_name "stomp" milestone 2 # The address of the STOMP server. config :host, :validate => :string, :required => true # The port to connect to on your STOMP server. config :port, :vali...
27.298507
109
0.649535
0350f17ec92cc34645b16d003994b0ddcdc730a9
2,058
require 'bosh/dev/command_helper' module Bosh::Dev class GitBranchMerger include CommandHelper def initialize(logger) @logger = logger end def merge(source_sha, target_branch, commit_message) stdout, stderr, status = exec_cmd("git fetch origin #{target_branch}") raise "Failed fetc...
45.733333
133
0.673955
386258614286a46e99e5bd4be589bf258b71454f
1,787
class UsersController < ApplicationController before_action :set_user, only: [:show, :edit, :update, :destroy] # GET /users # GET /users.json def index @users = User.all end # GET /users/1 # GET /users/1.json def show end # GET /users/new def new @user = User.new end # GET /users/1...
23.826667
88
0.6385
6220008de2451656f7829877b4cd197760027bb0
2,987
# -*- coding: utf-8 -*- require 'helper' class TestRegressionAutofilter03 < Minitest::Test def setup setup_dir_var end def teardown @tempfile.close(true) end def test_autofilter03 @xlsx = 'autofilter03.xlsx' workbook = WriteXLSX.new(@io) worksheet = workbook.add_worksheet data = [...
28.447619
61
0.556746
1a76cab173d4298a6f2d9ac3f5a3981adde86a7e
444
require 'rails_helper' describe "MeasureComponent XML generation" do let(:db_record) do create(:measure_component) end let(:data_namespace) do "oub:measure.component" end let(:fields_to_check) do %i[ measure_sid duty_expression_id duty_amount monetary_unit_code mea...
17.76
49
0.720721
e26c1b0bc0393cf5d4e19b9897d5c9c0ad1cb1fa
317
module Gradebooks class HistogramsController < BaseController def show authorize(:generic, :manage_results?) @histogram = GradebookClient::Histogram.find_by_gradebook_assignment_id( params[:gradebook_assignment_id], number_of_bins: params[:number_of_bins], ) end end end
26.416667
78
0.719243
f73b4c3716823bb0ce070b892cbf5b779753f1fd
852
module Trasto module Translates def translates(*columns) extend Trasto::ClassMethods include Trasto::InstanceMethods # Don't overwrite values if running multiple times in the same class # or in different classes of an inheritance chain. unless respond_to?(:translatable_columns) ...
25.058824
74
0.691315
d5813ad22e74405b1dcbf69429f17505f8b314ed
45
include_recipe 'daddy::wkhtmltopdf::install'
22.5
44
0.822222
1db52af59b608beb5b5fc022727a7d54dd85ec79
31,513
require "cases/helper" require 'models/minimalistic' require 'models/developer' require 'models/auto_id' require 'models/boolean' require 'models/computer' require 'models/topic' require 'models/company' require 'models/category' require 'models/reply' require 'models/contact' require 'models/keyboard' class Attribute...
31.799193
135
0.713134
21436f5beb345187afd461d2ec47bcffccccb424
32
module FavouriteListsHelper end
10.666667
27
0.90625
281ad32aac416822f11691631f20c9359745a3d9
831
class Grails < Formula version "20" desc "Web application framework for the Groovy language" homepage "http://grails.org" url "http://dist.springframework.org.s3.amazonaws.com/release/GRAILS/grails-2.0.4.zip" sha256 "51a273b8d51c08a21111bba774745db70370fbe7df906dba5551da2376f4f41b" bottle :unneeded # Gr...
27.7
88
0.677497
4a5492e9d7668ed0faeb9a83855b6c0d5bb6846b
1,416
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: "", email: "foo@invalid",...
28.32
91
0.641243
879cf56045eb0a9ffc27afe960e6b58b4ac46321
6,994
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Security::Mgmt::V2019_08_01 # # A service client - single point of access to the REST API. # class SecurityCenter < MsRestAzure::AzureServiceClient ...
42.646341
154
0.734487
91da08fd6663ce7740da01850964bf3875925f57
1,079
json.total @total json.rows @participants do |participant| json.cache! participant, expires_in: 5.minutes do json.id participant.id json.first_middle truncated_formatter(participant.first_middle) json.first_name truncated_formatter(participant.first_name) json.middle_initial participant.middle_initial...
46.913043
79
0.81835
e2f16f59351498080337fb2a5e873d1c0da3e33e
3,287
class Filebeat < Formula desc "File harvester to ship log files to Elasticsearch or Logstash" homepage "https://www.elastic.co/products/beats/filebeat" url "https://github.com/elastic/beats.git", tag: "v7.16.3", revision: "d420ccdaf201e32a524632b5da729522e50257ae" # Outside of the "x-pack" fold...
33.886598
123
0.657134
1cd05a54aae018c200a279c49a9c2e9ec23d33e9
4,688
#! /usr/bin/ruby ## -*- Mode: Ruby -*- require "uconv" ; require "rexml/document" ; include REXML ; $LOAD_PATH.push("~/lib/ruby") ; require "sexp.rb" ; #====================================================================== # Syntax =begin <head> body1 body2 </head> <==> (head body1 body2) <head ...
18.241245
72
0.489334
1c7af3bfa6c0b4aa855f00c1d5370d1ad9bb3bf2
1,241
Pod::Spec.new do |s| s.name = 'ZLPhotoBrowser' s.version = '4.1.2' s.summary = 'A lightweight and pure Swift implemented library for select photos from album' s.description = <<-DESC ZLPhotoBrowser 是一款纯swift实现的框架 ...
36.5
107
0.495568
1da3bff4429a4cfc41160b1b8039f845a68f332e
6,647
# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
44.610738
224
0.665413
e8b4e920bae48f9dd15a7228dd22542d44268d34
1,399
require File.expand_path('../boot', __FILE__) require "rails" # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "sprockets/railtie" # requi...
38.861111
99
0.751966
3800a54de668f157899c1b83e0889f2269453398
278
# frozen_string_literal: true module Stall module KuroneKoyamato module Utils protected def price_with_currency(price) [ price.format(symbol: '', separator: '.', delimiter: ''), currency ].join end end end end
16.352941
66
0.582734
bfd0ff035bd833819ff63e3f59718af452410663
279
#!/usr/bin/env ruby # vim: set sw=2 sts=2 et tw=80 : Puppet::Parser::Functions.newfunction(:mco_array_to_string, :type => :rvalue) do |args| unless args[0].is_a? Array fail ArgumentError, "Expected an array, but got a #{args[0].class}" end args[0].collect(&:to_s) end
27.9
87
0.681004
e8204c40032e6a09c1706b25ea60cac152b94b0b
143
class ApplicationController < ActionController::Base protect_from_forgery with: :exception def hello render html: "hello, world!" end end
23.833333
53
0.79021
6a1af05474802d1eed52c6d5b4e3abf11e3afd49
240
class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception before_action :authenticate_user! end
34.285714
56
0.795833
389e6b3769e034fd8d95b11620a5f7f234d159c2
20,307
require 'test/unit' require 'stat' require 'socket' # Fixme: needs platform-specific stuff dealt with class TestFile < Test::Unit::TestCase # # Setup some files in a test directory. # def setupTestDir @start = Dir.getwd teardownTestDir begin Dir.mkdir("_test") rescue $stderr.puts "...
27.591033
87
0.57916
01a49568c2d41e4f8118de4e2f741ed60a0ed63f
79
require 'test_helper' class BulkMessagesHelperTest < ActionView::TestCase end
15.8
51
0.835443
26fdcab94ce0ff5b0cfb0f59b2b3cef8e29df100
1,670
# frozen_string_literal: true require 'soda/client' module Sf311CaseService extend self SODA_CREDENTIALS = { domain: 'data.sfgov.org', app_token: 'QPCu2zzyc3jV5UkGfpOrGnXi7' } CASE_DATASET_ID = 'ktji-gk7t' # https://dev.socrata.com/docs/datatypes/floating_timestamp.html SODA_FLOATING_TIMESTAMP_...
24.558824
139
0.690419
e9adf306188f146eeb682693b87fba793fd49dcb
2,586
require 'rails_helper' RSpec.describe Spree::Promotion::Rules::FirstOrder, type: :model do let(:rule) { Spree::Promotion::Rules::FirstOrder.new } let(:order) { mock_model(Spree::Order, user: nil, email: nil) } let(:user) { mock_model(Spree::LegacyUser) } context "without a user or email" do it { expect(ru...
34.026316
104
0.634957
3996b7a7b943c6ece61661124491aff1c4f209de
431
module Kedi class EventLoop def initialize # 线程安全队列 @recv_chan = Queue.new @alive? = false end def acquire() @recv_chan << { } end def schedule(message) end def run @alive? = true loop do break unless @alive? message = @r...
13.060606
32
0.508121
261791cecceac2a91c8f2bd3b8a3639a2efcd224
760
require 'metrics_adapter/version' require 'active_support/all' module MetricsAdapter mattr_accessor :adapter mattr_accessor :logger mattr_accessor :adapter_options self.adapter_options = {} mattr_accessor :extra_attributes self.extra_attributes = {} mattr_accessor :trackers self.trackers = [] mat...
20.540541
66
0.756579
fff9950dd985cbbbc426c4fdb9214e8148fa4eba
3,755
# frozen_string_literal: true describe Facter::Resolvers::SshResolver do describe '#folders' do let(:ecdsa_content) { load_fixture('ecdsa').read.strip! } let(:rsa_content) { load_fixture('rsa').read.strip! } let(:ed25519_content) { load_fixture('ed25519').read.strip! } let(:ecdsa_fingerprint) do ...
39.946809
114
0.681225
21a13f3d1392ad8d98d8d0a9c48753b6bea115f9
2,281
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{amazon_associate} s.version = "0.7.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Dan Pickett"] s.date = %q{2009-08-01} s.description = %q{interfaces with Amazon As...
33.544118
105
0.700132
7999404e2d659745bf8b98f7b4df3fe9b2db15c5
2,977
# # Be sure to run `pod lib lint TKMAccountModule.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 = 'TK...
34.616279
119
0.659725
01094b55d8ef6ecb955ec0e238daba5bdf98ddb0
733
module FHIR # fhir/measure_report_type.rb class MeasureReportType < PrimitiveCode include Mongoid::Document def as_json(*args) result = super result.delete('id') unless self.fhirId.nil? result['id'] = self.fhirId result.delete('fhirId') end result ...
26.178571
101
0.633015
210d7ba79683e1faa7420645d03a492fd3184146
597
require 'spec_helper_acceptance' describe 'splunk class' do context 'default parameters' do # Using puppet_apply as a helper it 'works idempotently with no errors' do pp = <<-EOS class { '::splunk': } EOS # Run it twice and test for idempotency apply_manifest(pp, catch_failures...
22.961538
46
0.653266
ac6155ed4c145cdbc8d170c49cadc15abc175803
1,167
# frozen_string_literal: true lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'mlb_gameday/version' Gem::Specification.new do |spec| spec.name = 'mlb_gameday' spec.version = MLBGameday::VERSION spec.authors = ['Steven Hoffman'] sp...
37.645161
74
0.653813
ffb6b127abc55827f11b54c4c57e433ffe1f924d
1,165
# frozen_string_literal: true module Mutations module IncidentManagement module OncallSchedule class Create < OncallScheduleBase include FindsProject graphql_name 'OncallScheduleCreate' argument :project_path, GraphQL::ID_TYPE, required: true, des...
29.125
78
0.600858
e22e50221004042ba7d300f25cdb14e3051c9da5
19,479
# Copyright (c) 2016, 2022, 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...
43.970655
245
0.701525
260a291b29ffcf0e486a097ebfc5328a74ed04fd
946
module Scanny module Checks # Checks for use of the "before_filter" method with certain filters. class BeforeFiltersCheck < Check FILTERS = [:login_required, :admin_required] # before_filter :login_required def pattern <<-EOT SendWithArguments< receiver = Self...
26.277778
83
0.531712
39b0601f652cb260c66a3e8fb20e7ef275739988
2,862
# 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::BatchAI::Mgmt::V2018_03_01 module Models # # Values returned by the List operation. # class RemoteLoginInformationListResult...
28.62
80
0.539832
4ab6faa3a538c80678d09c7ee6d5f7812a875b17
509
# frozen_string_literal: true require 'rails_helper' RSpec.describe HacktoberfestProjectFetcherError do it 'exposes an errors array and the query that led to the errors' do errors = [1, 2, 3] query = 'To be or not to be?' message = 'That is the question' error = HacktoberfestProjectFetcherError.new...
23.136364
70
0.689587
f8f9874aeaab45551b979653c8e638092f48b697
138
class RemoveDraftsWithMissingProvider < ActiveRecord::Migration[4.2] def change Draft.where(provider_id: nil).destroy_all end end
23
68
0.789855
019cfb43b0899b0f747de732df8ace286b04f697
11,139
# 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::CustomerInsights::Mgmt::V2017_01_01 module Models # # The Role Assignment resource format. # class RoleAssignmentResourceFor...
33.350299
78
0.479486
1c959770dc461fcca13d86008329332640f653fe
1,980
require 'spec_helper' describe ExternalDiffUploader do let(:diff) { create(:merge_request).merge_request_diff } let(:path) { Gitlab.config.external_diffs.storage_path } subject(:uploader) { described_class.new(diff, :external_diff) } it_behaves_like "builds correct paths", store_dir: %r[mer...
29.117647
159
0.687879
edbcd5cae1002165cde42dc839db9542a22b1ec6
1,476
# -*- encoding: utf-8 -*- # stub: jekyll-titles-from-headings 0.4.0 ruby lib Gem::Specification.new do |s| s.name = "jekyll-titles-from-headings".freeze s.version = "0.4.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".f...
38.842105
117
0.661924
79bd5b8530a16041b9931c9740d83244872b660b
177
def solution(s) stack = [] s.each_char do |char| if char == "(" stack << char elsif stack.pop != "(" return 0 end end stack.empty? ? 1 : 0 end
12.642857
26
0.502825
ac751dc7bd6faee14fdc6dd91ebf289f56375061
374
# Matcher that verifies that a process succeeds. RSpec::Matchers.define :succeed do match do |thing| thing.exit_code.should == 0 end failure_message_for_should do |actual| "expected process to succeed. exit code: #{actual.exit_code}" end failure_message_for_should_not do |actual| "expected proce...
24.933333
65
0.735294
6a4ae5aafe1b93e1cd3723695d7b67c02c575565
3,198
require_relative 'test_helper' BYTEFIELD_CODE = <<-eos ;; This the source for the sample diagram illustrated in the project Read Me. ;; Some nice default background colors, used to distinguish header sections. (defattrs :bg-green {:fill "#a0ffa0"}) (defattrs :bg-yellow {:fill "#ffffa0"}) (defattrs :bg-pink {:fill "#f...
32.969072
90
0.65541
f71857af327a5034f6042238b2f694b9bcfbf8bc
2,038
module Rapidfire class AttemptBuilder < Rapidfire::BaseService attr_accessor :user, :survey, :questions, :answers, :params, :attempt_id def initialize(params = {}) super(params) build_attempt(params[:attempt_id]) end def to_model @attempt end def save!(options = {}) ...
29.970588
88
0.618744
4a9e14e41b8d6d054b2be186939291b093ba2bc1
56
FactoryGirl.define do factory :meal do end end
9.333333
21
0.678571
4a63a148566c66724c50ce72fd3b09932ae71495
1,399
# # Cookbook Name:: sys # Recipe:: time # # Copyright 2013, Victor Penso # # 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...
27.431373
74
0.664046
113e1c45620716da4c9f350cfeb6ecaf732e6e0f
112
# frozen_string_literal: true require_relative '../span' module Polites class Span::Delete < Span end end
12.444444
29
0.741071
183eb29c0d8e6ea0afbfe8eca97efc67a9cbc939
5,887
describe 'Ridgepole::Client#diff -> migrate' do context 'when change column (add comment)' do let(:actual_dsl) do erbh(<<-ERB) create_table "employee_clubs", force: :cascade do |t| t.integer "emp_no", null: false t.integer "club_id", null: false t.string "string", null...
33.073034
100
0.600985
abc38c09d511e5445c1bf5c6a3b85a2c996715c6
4,687
# This file is part of Metasm, the Ruby assembly manipulation suite # Copyright (C) 2007 Yoann GUILLOT # # Licence is LGPL, see LICENCE in the top-level directory require 'metasm/exe_format/main' require 'metasm/encode' require 'metasm/decode' module Metasm class MZ < ExeFormat MAGIC = 'MZ' # 0x4d5a class...
28.579268
159
0.688073
4afbba579bdb16a8d5a2454ecc1f036e39b2efb9
1,240
# frozen_string_literal: true lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "cookbook_release/version" Gem::Specification.new do |spec| spec.name = "cookbook_release" spec.version = CookbookRelease::VERSION spec.authors = ["Table ...
35.428571
80
0.691129
6a5f8bc2a59e5dc0e877a7ebeae66d632a4359bb
352
# frozen_string_literal: true module Types module Ci class TestCaseStatusEnum < BaseEnum graphql_name 'TestCaseStatus' ::Gitlab::Ci::Reports::TestCase::STATUS_TYPES.each do |status| value status, description: "Test case that has a status of #{status}.", value: sta...
22
71
0.633523
0848f5b6c6a549079cfe06479747dcb843899a7e
858
module Crawler module Extractor ## # Call all methods,starting with extract_, on 'data_block' # collect all results and send them to #data_extracted ## def extract_data(data_block) result = {} extractable = self.methods.select { |m| m != :extract_data && m.to_s[/extract_/] } extr...
24.514286
88
0.586247
339695f6f468e6aa536e67ea27d6c5ac1599b77a
346
class AddAdditionalFieldsToVendors < ActiveRecord::Migration[5.2] def change add_column :spree_vendors, :t_distance, :string add_column :spree_vendors, :address, :string add_column :spree_vendors, :lat, :float add_column :spree_vendors, :lng, :float add_column :spree_vendors, :is_appointable, :boolean,...
31.454545
70
0.760116
382e190499837f621c210d4f642427b6503db6b3
1,049
Pod::Spec.new do |s| s.name = "NLEPlatform" s.version = "0.0.16-d" s.summary = "NLEPlatform" s.license = { :type => 'Copyright', :text => <<-LICENSE Bytedance copyright LICENSE } s.authors = {"zhangyuanming"=>"zhangyuanming@bytedance.com"} s.homepage = "https://github.co...
43.708333
226
0.655863
e9acc5d413a03e6f8b6fd95f334debeff5b3c376
627
class Digdag < Formula desc "Workload Automation System" homepage "https://www.digdag.io/" url "https://dl.digdag.io/digdag-0.9.1.jar" sha256 "424c04a73abce89851d3f59e9089007a1e47d353a5dd7d2688b6bde992e37cc6" bottle :unneeded depends_on :java => "1.8+" def install libexec.install "digdag-#{version}...
24.115385
75
0.674641
26c8ac8b6ffde9a129599b01d89849f08d0efff7
5,009
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...
44.327434
114
0.762228
abb16706209f01b98314b7598d392131ae025fdc
528
require "active_support" require "active_support/core_ext" require "cc/analyzer" require "cc/yaml" module CC module CLI autoload :Analyze, "cc/cli/analyze" autoload :Command, "cc/cli/command" autoload :Console, "cc/cli/console" autoload :Engines, "cc/cli/engines" autoload :Help, "cc/cli/help" ...
26.4
54
0.69697
62895eabf9d7f3b15f49983c83ecf196d59b9cab
821
module Board::Model::AnpiPost extend ActiveSupport::Concern extend SS::Translation include SS::Document include SS::Reference::Site included do store_in collection: "board_anpi_posts" seqid :id # 氏名 field :name, type: String # 氏名(かな) field :kana, type: String # 電話番号 field :te...
21.605263
77
0.621194
627d355cbc56f4b56313feb41b1b76b748596d59
900
$stdout.sync = true unless ENV["JETS_STDOUT_SYNC"] == "0" $:.unshift(File.expand_path("../", __FILE__)) require "active_support" require "active_support/concern" require "active_support/core_ext" require "active_support/dependencies" require "active_support/ordered_hash" require "active_support/ordered_options" requir...
26.470588
90
0.763333
ab80425821ab1740f47f6f0ffd871b331c083b30
155
name "php" maintainer "Dwight Watson" maintainer_email "dwight@studiousapp.com" license "MIT" description "Configure a Laravel application" version "1.0.0"
25.833333
45
0.8
bfd9b4ab34509391dc4b557792a991e65ac4a4c2
10,808
# 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 module Aws::IAM class InstanceProfile extend Aws::Deprecations # @overload def initialize(name, opti...
30.022222
102
0.623335
3950c72e335fbe6797b379f56cb107a4482b49f2
1,491
require 'test_helper' module Haml class InterpolationHelperTest < MiniTest::Unit::TestCase def test_it_takes_text_and_returns_interpolations replace = "this may \#{be} the \#{dup}" t_name = "this_may_be_the_dup" helper = Haml::I18n::Extractor::InterpolationHelper.new(replace, t_name) ass...
33.886364
97
0.667337
39b5c6e8af67e43190a6797f7b5a286b9b2eca44
1,136
# frozen_string_literal: true module DM module Report module PreparedReport class New def self.call(id, json_var, user, form_values: nil, form_errors: nil, remote: true) # rubocop:disable Metrics/ParameterLists ui_rule = UiRules::Compiler.new(:prepared_report, :new, id: id, user: user, fo...
33.411765
132
0.609155
794c62d43ea7ca0e0343aba76c8f0cf216f119b6
570
require 'ffi' module Multibit extend FFI::Library ffi_lib 'libmultibit_trie' attach_function :make_fixedstridemultibit, [:uint], :pointer attach_function :insert, [:pointer, :string], :void attach_function :search, [:pointer, :string], :bool class MultiBitTrie def initialize(size) ...
27.142857
64
0.635088
3963924a0668bf5d98d77b069b4ea725e8529eda
7,482
require 'rails_helper' describe API::ProjectSnippets do let(:project) { create(:project, :public) } let(:user) { create(:user) } let(:admin) { create(:admin) } describe 'GET /projects/:project_id/snippets/:id' do # TODO (rspeicher): Deprecated; remove in 9.0 it 'always exposes expires_at as nil' do ...
32.960352
130
0.650628
1ada2b49dad12043cd440225964951d552b4efaf
12,030
# encoding: utf-8 require "moped/read_preference" require "moped/readable" require "moped/write_concern" require "moped/collection" require "moped/cluster" require "moped/database" module Moped # A session in moped is root for all interactions with a MongoDB server or # replica set. # # It can talk to a singl...
27.033708
93
0.612968