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
387def986b5e63b279b556cdb6d4a0a5c11460d6
676
require "spec_helper" describe BazaModels::Model::Manipulation do include DatabaseHelper let(:user) { User.new(email: "test@example.com") } let(:role_user) { Role.new(user: user, role: "user") } let(:role_admin) { Role.new(user: user, role: "administrator") } it "#created_at" do expect(user.created_at)...
25.037037
66
0.689349
87c2fb01fe6542d4d8a74d9b1701d3694a22e317
1,715
class HardlinkOsx < Formula desc "Command-line utility that implements hardlinks on macOS" homepage "https://github.com/selkhateeb/hardlink" url "https://github.com/selkhateeb/hardlink/archive/v0.1.1.tar.gz" sha256 "5876554e6dafb6627a94670ac33e750a7efeb3a5fbde5ede3e145cdb5131d1ba" bottle do sha256 cellar...
41.829268
120
0.769679
01d97f95f312873351971855f348c6eb1684d98a
3,475
require 'spec_helper' require './spec/api_docs/image_hack' resource "Users" do let(:user) { users(:admin) } let(:other_user) { users(:the_collaborator) } before do log_in user end get "/users" do pagination example_request "Get a list of users" do status.should == 200 end end po...
24.821429
121
0.641727
f7492be5ef09455216cfb8a8fb9a1d73433ffa12
84
# frozen_string_literal: true class <%= class_name %>Cache < ApplicationCache end
14
47
0.761905
ff4e654f26993edee508d4f016c91db3a3c4e4af
2,282
## # This module requires Metasploit: http//metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = AverageRanking include Msf::Exploit::Remote::Tcp def initialize(info = {}) super(update_info(info, ...
26.229885
104
0.563979
7ac3b5e151ddb80df64fb1cd5d5f24132e60bd2f
3,034
module RComposite # Layer mode constants # some of photoshops layer modes are directly equvilent to RMagick # some are not, and some arent supported at all. Normal = Magick::OverCompositeOp # PS equivilent Dissolve = Magick::DissolveCompositeOp Darken = Magick::DarkenCompositeOp # PS equivilent Mul...
25.495798
174
0.659196
f794ce1ff8dc0cfd4fc7790bf6d33c6c70efc852
727
# frozen_string_literal: true unified_mode true property :purge_chefdk, [true, false], default: true, description: 'Flag if the chefdk package should be purged before installing chef workstation' property :add_default_chef_repo, [true, false], default: false, description: 'Flag if the default repo should be added using...
34.619048
190
0.781293
019e6b0f2d808f79146bd28ec15653221640b163
2,493
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
28.329545
94
0.711592
1881ff34aa3f523f0cc8eacafc64c443fb5cd3bd
7,495
class SearchStatistic include Mongoid::Document include Mongoid::Timestamps # Search Statistics aggregate a single hour's # worth of search queries for a single database # # This follows a denormalized star schema, with # a database dimension, a date dimension, and # a fact table populated by search_que...
35.187793
113
0.673249
8725edee5e76561791613ab8116e7599027e4ff1
377
module Steroids module Base class Class include Steroids::Concerns::Error class << self def inherited(subclass) instance_variables.each do |var| subclass_variable_value = instance_variable_get(var).dup subclass.instance_variable_set(var, subclass_variable_valu...
23.5625
72
0.639257
397184975f5119735be1b43e649f6697ee8b6152
1,330
# Encoding: utf-8 # # This is auto-generated code, changes will be overwritten. # # Copyright:: Copyright 2018, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # # Code generated by AdsCommon library 1.0.1 on 2018-09-20 09:47:26. require 'ads_common/savon_service' require '...
24.181818
69
0.692481
87c33b97eefe68533f1bcd8255704470f912d2fd
2,130
=begin #DocuSign REST API #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git =end require 'spec_helper' require 'json' re...
29.583333
123
0.742723
e975233ab3e74957f7ba76842d35e23e5a448d6e
2,564
# -*- encoding: utf-8 -*- # stub: guard 2.13.0 ruby lib Gem::Specification.new do |s| s.name = "guard".freeze s.version = "2.13.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Thibaud Guillaume-G...
44.982456
112
0.631435
1d6b39a7831d44d28299d0e174681f7e82266024
7,903
# frozen_string_literal: true require 'spec_helper' RSpec.describe Gitlab::Ci::Reports::TestSuite do include TestReportsHelper let(:test_suite) { described_class.new('Rspec') } let(:test_case_success) { create_test_case_rspec_success } let(:test_case_failed) { create_test_case_rspec_failed } let(:test_case...
29.488806
120
0.680501
ffc6267e18e1cf98e9406b1c1827e27c3d2634e0
2,451
#!/usr/bin/env ruby require 'InterfaceFTL' require 'sys/proctable' class TrainerFTL include InterfaceFTL def hook matches = Sys::ProcTable.ps.select{|p| p.comm =~ /^FTL$/ } abort("No PID") if matches.empty? pid = matches.first.pid puts "Attaching to PID: #{pid}" InterfaceFTL.hook pid end ...
32.68
92
0.615667
0309aef8d24ef2e54c729f33749670fb72a1ee55
1,649
class Pulumi < Formula desc "Cloud native development platform" homepage "https://pulumi.io/" url "https://github.com/pulumi/pulumi.git", :tag => "v1.13.0", :revision => "a09e87a5d0627089bb6a4f624fc60efb49298eb7" bottle do cellar :any_skip_relocation sha256 "e414977bca03f121827db68255a...
33.653061
94
0.676167
11278bcd2f4e8df55e9b8015aa19d418fb6dcef5
544
class Admin::UsersController < ApplicationController before_action :require_login before_action :require_admin skip_before_action :verify_authenticity_token def index; end def promote @user = User.find(params[:user_id]) @user.admin = true @user.save redirect_to admin_users_path end def d...
20.148148
57
0.737132
210ce517d04380a224bdda9c8a43e7fd8d0f32e7
282
# frozen_string_literal: true module Shore module Custom # @see https://github.com/JsonApiClient/json_api_client#custom-paginator class Paginator < JsonApiClient::Paginating::Paginator self.page_param = 'number' self.per_page_param = 'size' end end end
23.5
76
0.72695
28e76a77e0107a94d564aae86d744df38aeac192
560
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 require 'spec_helper' include TwitterCldr::Localized describe LocalizedHash do describe "#to_yaml" do it "should be able to successfully roundtrip the hash" do hash = { foo: "bar", "string_key" => Object.new } ...
25.454545
61
0.680357
218cec2d8567c449b8a6b6eb31bf8d2175209fb7
4,383
# frozen_string_literal: true RSpec.describe "Macros #maybe" do describe "with no args" do subject(:schema) do Dry::Schema.define do required(:email).maybe end end it "generates nil? | filled? rule" do expect { schema }.to raise_error(ArgumentError) end end describe "w...
24.486034
103
0.597536
ac42b960c59bdc4850245e1066f7aea1b169b72a
253
require 'spec_helper' klass = OneviewSDK::LogicalInterconnectGroup RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do let(:current_client) { $client } include_examples 'LIGC7000DeleteExample', 'integration context' end
31.625
79
0.790514
5d6f4cca3653538342678ea63abfdceb15fee854
1,576
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) require File.expand_path('../shared/slice', __FILE__) describe "Array#[]" do it_behaves_like :array_slice, :[] end describe "Array.[]" do it "[] should return a new array populated with the given e...
30.901961
99
0.646574
6a9df819f49a7b188496439fe8c9f9c13732f2aa
159
FactoryGirl.define do factory :user do name "MyString" email "MyString" secret "MyString" token "MyString" password "MyString" end end
15.9
23
0.666667
03328b62b38b582da2ab1c7475e19218756da9fe
800
Pod::Spec.new do |s| s.name = 'LN_Framework' s.version = '1.1.1' s.osx.deployment_target = "10.9" s.ios.deployment_target = "8.0" #s.tvos.deployment_target = "9.0" s.watchos.deployment_target = "2.0" s.license= { :type => "MIT", :file => "LICENSE" } s.summary = '添加了ReactiveObjC.framework库 make ...
33.333333
96
0.63375
ac2c56e6ba6b51cf6227d52541991030abc75fe1
236
require('dynabute/values/base') require('dynabute/values/boolean_value') require('dynabute/values/datetime_value') require('dynabute/values/integer_value') require('dynabute/values/string_value') require('dynabute/values/select_value')
33.714286
41
0.822034
7933892849f59240cc52bb8c2cb2722b32d8b43e
3,545
require 'spec_helper_acceptance' describe 'Inheritance' do let(:rights) { 'full' } let(:user_id_child) { 'roberto' } let(:target_name) { "inherit_#{perm_type}_on_#{asset_type}" } let(:target_child_name) { "child_#{asset_type}" } let(:target_child) { "#{target_parent}/#{target_name}/#{target_child_name}" } ...
30.042373
92
0.569535
036eccaa04c4f12ddd3dc6092b1502490ef8eaa7
1,375
module PgHero module Methods module Settings def names if server_version_num >= 90500 %i( max_connections shared_buffers effective_cache_size work_mem maintenance_work_mem min_wal_size max_wal_size checkpoint_completion_target wal_buffers default_statist...
28.645833
152
0.669091
e8a4247d4eb7b2e96ecc482eee2cd3bd59351337
1,378
# 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...
35.333333
199
0.711901
619efa1420e563fbdf7a862ef2fa648a2dd80802
928
cask "prusaslicer" do version "2.3.2,202107080658" sha256 "aca73fee3c1a9fa8143ac2667ac8ba9637b944684a59d3e84fa591e02ffd9c9a" url "https://github.com/prusa3d/PrusaSlicer/releases/download/version_#{version.before_comma}/PrusaSlicer-#{version.before_comma}+universal-#{version.after_comma}.dmg", verified: "gi...
34.37037
170
0.709052
33c0f9a541f109f3abf46cefd69858310bbc7ac6
4,104
require 'middleman-core/sitemap/resource' require 'middleman-core/core_extensions/collections/step_context' module Middleman module Sitemap module Extensions # Manages the list of proxy configurations and manipulates the sitemap # to include new resources based on those configurations class Pro...
34.2
201
0.637427
11308edd66f7c4af25e9f5d9711f61b19a77d685
3,515
require "sqrl/tif" require "sqrl/cmd/version" require "httpclient" module SQRL class Cmd private def create_session(url) url = upgrade_url(url) session = ClientSession.new(url, [imk, pimk].compact) log.debug headline('-', 'Site Keys') log.debug data_field('imk', imk) log.debug ...
28.346774
102
0.598293
795fccfc0ac8a7f028bb295c529eb2593b34aed9
3,268
# We have keys with this semantical meaning: # # 1.1.1.1 \ # 1.1.2.1 3.1 # 1.1.1.2 / \ / # 2.1 # / \ # 1.2.1.1 - 1.2.2.1 3.2 # # In other words: # # 1.1.1.1 start 1.1.1.1, 1.1.1.2, and 1.2.1.1 in parallel # 1.1.1.2 # 1.1...
22.853147
92
0.518054
01aa883d56dd2ad50036a9e493c4bd793b206090
1,855
require_relative '../spec_helper' require_relative '../../lib/rapid-vaults/generate' describe Generate do context '.openssl' do after(:all) do %w[key.txt nonce.txt].each { |file| File.delete(file) } end it 'generates the key and nonce files from the cli' do Generate.openssl(ui: :cli) e...
36.372549
150
0.636119
2600f265df15011770bf1c5b74ea62c56c6c02ad
1,003
class Jhiccup < Formula desc "Measure pauses and stalls of an app's Java runtime platform" homepage "https://www.azul.com/jhiccup/" url "https://www.azul.com/files/jHiccup-2.0.10-dist.zip" sha256 "7bb1145d211d140b4f81184df7eb9cea90f56720ad7504fac43c0c398f38a7d8" livecheck do url :homepage regex(/href...
27.108108
75
0.663011
ab8229dbae1b7339505478d93bc278819f6be903
6,870
require "cases/migration/helper" module ActiveRecord class Migration class ColumnAttributesTest < ActiveRecord::TestCase include ActiveRecord::Migration::TestHelper self.use_transactional_tests = false def test_add_column_newline_default string = "foo\nbar" add_column "test_mo...
38.813559
130
0.673071
62f3c5e01b271bc4243569af51b92d40f1ef689c
331
class Spree::VolumePriceModel < ActiveRecord::Base has_many :variants has_many :volume_prices, -> { order(position: :asc) }, dependent: :destroy accepts_nested_attributes_for :volume_prices, allow_destroy: true, reject_if: proc { |volume_price| volume_price[:amount].blank? && volume_price[:range].blank?...
36.777778
76
0.734139
e2e5d60e05d945bd7dc21a564ad5c8e64127b344
6,088
require 'spec_helper' require 'ddtrace/contrib/analytics_examples' require 'racecar' require 'racecar/cli' require 'active_support' require 'ddtrace' RSpec.describe 'Racecar patcher' do let(:tracer) { get_test_tracer } let(:configuration_options) { { tracer: tracer } } def all_spans tracer.writer.spans(:kee...
34.590909
99
0.639783
0823fca7ca22e51d53e144af4e0da0a3565b867e
579
cask 'blue-jeans' do version '2.5.1.33' sha256 '20914226694e4a0734d85f8de9a42bc81e7166af933016de66e0a82dd5383e89' url "https://swdl.bluejeans.com/desktop-app/mac/#{version.major_minor_patch}/#{version}/BlueJeansInstaller.dmg" name 'Blue Jeans videoconferencing' homepage 'https://www.bluejeans.com/' instal...
34.058824
113
0.658031
f74b643d2bc39b0986020b85ee2af6ec03d276fa
533
require 'rubytunes/playback' class RubyTunes class Fade INCREMENT = 5 def toggle; volume > 0 ? self.out : self.in end def in while (current ||= volume) < 100 self.volume = (current += INCREMENT) end end def out while (current ||= volume) > 0 self.volume = (cu...
16.65625
59
0.606004
3898f3395b970354247db4cc8014d57d2a9e16bc
1,544
cask "kicad" do version "5.1.8-0" sha256 "a8edcae34a19afbec3c8b7ec4e38ada4d19c0c6a73a94d2f2f4e8f5b48278bbd" # kicad-downloads.s3.cern.ch/ was verified as official when first introduced to the cask url "https://kicad-downloads.s3.cern.ch/osx/stable/kicad-unified-#{version}-10_14.dmg" appcast "https://kicad-do...
45.411765
90
0.697539
4a2a1f3981b716df394b5ce4220b0291fd894406
8,143
# frozen_string_literal: true require_relative './helpers' require 'sqlite3' require 'active_record' DB_FILE = 'gitclub_test.db' RSpec.describe Oso::Oso do # rubocop:disable Metrics/BlockLength context 'a github clone' do # rubocop:disable Metrics/BlockLength context 'org members' do it 'can access the ri...
28.274306
80
0.603217
1cde7443609016ae7aa2c8cb334becc7d0b0d05b
107
require "keima/version" require "keima/client" require "json" module Keima # Your code goes here... end
13.375
26
0.728972
e2609a85d4b97b085c2cb6839510e4cbfac4362f
10,035
# frozen_string_literal: true require "active_support/core_ext/string/inquiry" module ActiveRecord # == Delegated types # # Class hierarchies can map to relational database tables in many ways. Active Record, for example, offers # purely abstract classes, where the superclass doesn't persist any attributes, a...
43.441558
117
0.677927
e877f1a1c7793214a16d3dccbf14c57555a0bc4d
249
class AddUnaccentExtension < ActiveRecord::Migration[5.2] def up execute "create extension unaccent" execute "create extension pg_trgm" end def down execute "drop extension unaccent" execute "drop extension pg_trgm" end end
20.75
57
0.73494
e8aeb93a2ba3e082336af260b525207745feabc7
1,972
# frozen_string_literal: true require 'spec_helper' RSpec.describe 'Deploy-ECS.gitlab-ci.yml' do subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('AWS/Deploy-ECS') } describe 'the created pipeline' do let(:default_branch) { project.default_branch_or_main } let(:pipeline_branch) { default_b...
32.866667
104
0.689655
2656f5005960f79b3af61f24468aed221508e748
1,946
class QuickRegistration include ActiveAttr::Model, PasswordGenerator, HostingServicesGenerators attribute :domain attribute :ns1_ip_address attribute :ns2_ip_address attribute :user attribute :login attribute :email attribute :apache_variation attribute :ip_address attribute :with_ssh, type: Boolea...
27.8
79
0.750257
1a0f3be4f497fab83cb6e49241b2acad39e26564
869
class Workshop < ApplicationRecord geocoded_by :address after_validation :geocode, if: :will_save_change_to_address? include PgSearch pg_search_scope :search_by_category, :against => [:category] pg_search_scope :search_by_area, :against => [:area] acts_as_votable mount_uploader :photo, PhotoUploader ...
17.734694
62
0.757192
086b1cc0ea2b04fa02f7614bcea09ec14ddf00e9
1,264
# frozen_string_literal: true # WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE Gem::Specification.new do |spec| spec.name = 'aws-sdk-lexruntimev2...
39.5
132
0.668513
ff038f70960c0ece92fe64a5cb3d8adcee5602f8
720
# typed: false # frozen_string_literal: true require "cli/parser" module Homebrew extend T::Sig module_function sig { returns(CLI::Parser) } def __version_args Homebrew::CLI::Parser.new do usage_banner <<~EOS `--version` Print the version numbers of Homebrew, Homebrew/homebrew-cor...
21.818182
118
0.701389
7ad16d0f62eafe187f6ddf3b059326ef3b8ad639
587
# frozen_string_literal: true module NgrokAPI module Models class AWSCredentials attr_reader :client, :attrs, :aws_access_key_id, :aws_secret_access_key def initialize(client: nil, attrs: {}) @client = client @attrs = attrs @aws_access_key_id = @attrs[...
18.34375
64
0.58092
115e2c2972ecf908dc36210f426a1a5a10228663
163
# frozen_string_literal: true # Faraday namespace. module Faraday # Exception used to control the Retry middleware. class RetriableResponse < Error end end
18.111111
51
0.779141
e21cd6d062b82cf235b8c1320042e386a76e1ff6
1,332
# frozen_string_literal: true require "test_helper" require "generators/boring/devise/install/install_generator" require "generators/boring/oauth/google/install/install_generator" class OauthGoogleInstallGeneratorTest < Rails::Generators::TestCase tests Boring::Oauth::Google::InstallGenerator setup :build_app t...
28.340426
92
0.747748
d5c14df242b7bfb1273b9bf31dba916cca77f002
466
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails...
46.6
93
0.776824
4ac9ef6695ddfc91b0100495a2ae7d11dd069678
35,941
# vim:ts=4:sw=4: # = RedCloth - Textile and Markdown Hybrid for Ruby # # Homepage:: http://whytheluckystiff.net/ruby/redcloth/ # Author:: why the lucky stiff (http://whytheluckystiff.net/) # Copyright:: (cc) 2004 why the lucky stiff (and his puppet organizations.) # License:: BSD # ...
31.721977
237
0.447261
28220f7ecedc306f2dc5cf20b702c1253b93d22c
1,296
# -*- encoding: utf-8 -*- # stub: jekyll-theme-architect 0.1.0 ruby lib Gem::Specification.new do |s| s.name = "jekyll-theme-architect".freeze s.version = "0.1.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s...
37.028571
112
0.665895
4a3591bfdb3ec4ff1355e256c5eeaa410afcab12
1,516
# frozen_string_literal: true RSpec.describe YoutubeAudio::Format do let(:response_raw) do JSON.parse( { # url=mock&s=mock-signature&sp=sig mimeType: 'audio/mp4', approxDurationMs: '1000', audioQuality: 'low', url: 'url-mock' }.to_json ) end subject { describe...
26.137931
77
0.64314
f70e6223224c2c24b86812da14abf08d69eebb6e
1,953
# frozen_string_literal: true require 'spec_helper' RSpec.describe ::AcaEntities::Contracts::People::PersonReferenceContract, dbclean: :after_each do let!(:required_params) do { hbx_id: '1234', first_name: 'first name', last_name: 'last name', middle_name: 'middle name', dob: Date...
22.976471
97
0.630824
18c67f05ff86b914e9915ad151ba3ebf11592d1a
139
class AddAwsMediaKeyToRecordings < ActiveRecord::Migration[6.0] def change add_column :recordings, :aws_media_key, :string end end
23.166667
63
0.776978
aca0bb1d794ced4166b728ea52ff1583f960cd63
7,318
require 'spec_helper' describe ProjectsHelper do describe "#project_status_css_class" do it "returns appropriate class" do expect(project_status_css_class("started")).to eq("active") expect(project_status_css_class("failed")).to eq("danger") expect(project_status_css_class("finished")).to eq("s...
33.113122
112
0.680377
91321296f214d8946740f0763f4fc10ff8544ed5
925
# frozen_string_literal: true module CoEditPDF # Policy to determine if an account can collaborate a particular pdf class CollaborationRequestPolicy def initialize(pdf, target_account, auth_scope = nil) @pdf = pdf @requestor_account = pdf.owner @target_account = target_account @auth_sco...
25.694444
73
0.685405
5de13b81e0b1f1b77dbb33735322cb6be5595434
1,766
RSpec.feature "Partner management", type: :feature do before do sign_in(@user) end let!(:url_prefix) { "/#{@organization.to_param}" } context "When a user views the index page" do before(:each) do @second = create(:partner, name: "Bcd") @first = create(:partner, name: "Abc") @third = ...
30.982456
89
0.65402
622945431cc9f65b580927624208c9cd0cce0d5a
1,430
module Xmlenc module Builder class EncryptedData include Xmlenc::Builder::ComplexTypes::EncryptedType ALGORITHMS = { 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc' => Algorithms::DES3CBC, 'http://www.w3.org/2001/04/xmlenc#aes128-cbc' => Algorithms::AESCBC[128], 'htt...
28.039216
86
0.613986
26f3bfbcbc84fc1e843f4aa7fc99ad5190aa62be
1,250
# frozen_string_literal: true require "active_record_unit" class RelationCacheTest < ActionView::TestCase tests ActionView::Helpers::CacheHelper def setup super view_paths = ActionController::Base.view_paths lookup_context = ActionView::LookupContext.new(view_paths, {}, ["test"]) @view_render...
30.487805
144
0.732
ed4caad43e912a7183de6edc2d470d84f1259d7f
6,043
require 'spec_helper' RSpec.describe NgrokAPI::Services::AgentIngressesClient do let(:base_url) { 'https://api.ngrok.com' } let(:path) { '/agent_ingresses' } let(:not_found) do NgrokAPI::Errors::NotFoundError.new(response: agent_ingress_result) end before(:each) do @client = class_double("HttpClient...
33.38674
97
0.634619
e2c52cf5aa3dcc5b5878b09dd872bed1f1755ecf
190
#!/usr/bin/ruby # -*- coding: UTF-8 -*- class Example VAR1 = 100 VAR2 = 200 def show puts "第一个常量的值为 #{VAR1}" puts "第二个常量的值为 #{VAR2}" end end # 创建对象 object=Example.new() object.show
12.666667
25
0.636842
ede61aaa3b68d4ad1b56cd23d428d722d0e99030
134
class AddSeniorToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :senior, :boolean, default: false end end
22.333333
56
0.738806
f8a9880ff5522a683925ff183ab7fbc6060d6546
577
class CreateIteasykitIteasykitPlants < ActiveRecord::Migration[5.2] def change create_table :iteasykit_plants do |t| t.boolean :active t.timestamps end reversible do |dir| dir.up do Iteasykit::Plant.create_translation_table! :site => :string, :phone => :string, :address_map =>...
26.227273
136
0.589255
01110e9056a766cd3c9229731abcbd905e405273
1,184
begin require 'geohash' rescue LoadError => e require 'pr_geohash' end module Sunspot module Query class Geo MAX_PRECISION = 12 DEFAULT_PRECISION = 7 DEFAULT_PRECISION_FACTOR = 16.0 def initialize(field, lat, lng, options) @field, @options = field, options @geohash = ...
21.925926
89
0.584459
f7d49acdbc6d6392fede05844c4b1ddccfe07c5f
490
# frozen_string_literal: true module QueueHelper private def poll(queue, success = true) test_order = [] queue.poll do |test| yield test if block_given? test_order << test failed = !(success.respond_to?(:call) ? success.call(test) : success) if failed queue.report_failure! ...
22.272727
75
0.632653
e9ee2c86d0f28e46915dd82814ca363c128cda3f
1,388
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'openhouse/version' Gem::Specification.new do |spec| spec.name = 'openhouse' spec.version = OpenHouse::VERSION spec.date = '2017-06-20' spec.authors = ['Eugenio Bruno'] spec.e...
37.513514
83
0.678674
91719392e32204270c4b7d50eca587d705c63325
1,461
require 'faraday' module Trace # This class is a base for tracers sending information to Zipkin. # It knows about zipkin types of annotations and send traces when the server # is done with its request # Traces dealing with zipkin should inherit from this class and implement the # flush! method which actually...
23.190476
102
0.654346
396ef0909cf035e915e40472948806ff86031c30
5,680
module Fastlane module Actions class GetManagedPlayStorePublishingRightsAction < Action def self.run(params) unless params[:json_key] || params[:json_key_data] UI.important("To not be asked about this value, you can specify it using 'json_key'") json_key_path = UI.input("The serv...
46.178862
387
0.657394
acf575e24e5b42a2183e4fedaa24320e314093e3
199
# frozen_string_literal: true module Emails class CreateService < ::Emails::BaseService def execute(extra_params = {}) @user.emails.create(@params.merge(extra_params)) end end end
19.9
54
0.713568
0129b237274c822c89b4c07980f0716baf33b0aa
209
class DebugAction < ActionFilter def initialize(tags=nil, descs=nil) super require 'rubinius/debugger' end def before(state) Rubinius::Debugger.start if self === state.description end end
19
58
0.717703
1a7994fd3bf72ab6946ab6df3b4249f2bc5957ce
709
require "language/node" class Marked < Formula desc "Markdown parser and compiler built for speed" homepage "https://marked.js.org/" url "https://registry.npmjs.org/marked/-/marked-4.0.2.tgz" sha256 "01905d4e1d509fe3d0a181dfa6becfb0b8bff804d8470ce9a46c414fd8ffd089" license "MIT" bottle do sha256 cella...
28.36
112
0.736248
333b33db52d86c77cb3f3e7da2f757a0e2caca87
917
require 'socialkit' require 'ostruct' describe "Service::TwitterStream" do let(:config) {OpenStruct.new :config => {"twitter" => {"key" => "key", "query" => ['batman']}} } let(:manager) { OpenStruct.new :config_reader =>...
26.2
72
0.598691
1c82b18167105d30d5cd3d2b3889747ab155e979
5,149
require 'spec_helper' describe "index" do let(:migration) { ::ActiveRecord::Migration } let(:connection) { ::ActiveRecord::Base.connection } describe "add_index" do before(:each) do each_table connection do |table| connection.drop_table table, cascade: true end define_schema(:auto_create => f...
29.422857
101
0.634881
62a98df380c0f11b13e80af30a7910d52bf39565
1,282
# frozen_string_literal: true module Kitchen module Directions module BakeCheckpoint def self.v1(checkpoint:, number:) checkpoint.wrap_children(class: 'os-note-body') checkpoint.prepend(child: <<~HTML <div class="os-title"> <span class="os-title-label">#...
28.488889
73
0.579563
08300085ce935ec45d8edd0db34154188f1d8fc3
956
require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) Pod::Spec.new do |s| s.name = "react-native-mapbox-gl" s.summary = "React Native Component for Mapbox GL" s.version = package['version'] s.authors = { "Nick Italiano" => "ni6@njit.edu" } s.homepage = "https://github.c...
29.875
84
0.649582
abdc88df29aa62b5c88a64dfc70cd7b484e28c28
348
class ChangeBookingsAcceptanceStatusDefaultToInteger < ActiveRecord::Migration def up remove_column :bookings, :accaptance_status add_column :bookings, :acceptance_status, :integer, default: 0 end def down remove_column :bookings, :acceptance_status add_column :bookings, :accaptance_status, :boolea...
31.636364
78
0.784483
e9e03d08c7bd26cc1579674c919c1695bf5beaf7
1,006
module Homeland module Paper class Engine < ::Rails::Engine isolate_namespace Homeland::Paper initializer 'homeland.paper.init' do |app| if Setting.has_module?(:paper) Homeland.register_plugin do |plugin| plugin.name = 'paper' plugin.display_name...
32.451613
84
0.54672
018d98af5e7a260c9f1476d59bd35522381874a9
63
FactoryGirl.define do factory :form_image do end end
9
24
0.698413
bbb3c439b02a485de4948b10abbdaae8e0384ca3
2,645
class OsmGpsMap < Formula desc "GTK+ library to embed OpenStreetMap maps" homepage "https://nzjrs.github.com/osm-gps-map/" url "https://github.com/nzjrs/osm-gps-map/releases/download/1.2.0/osm-gps-map-1.2.0.tar.gz" sha256 "ddec11449f37b5dffb4bca134d024623897c6140af1f9981a8acc512dbf6a7a5" license "GPL-2.0" ...
30.056818
93
0.636673
1c72a924445c98ecd35e45643d34cae90c0c924a
1,546
require 'twitter' module T module Collectable MAX_NUM_RESULTS = 200 def collect_with_count(count, &block) collect_with_number(count, :count, &block) end def collect_with_cursor(collection=[], cursor=-1, &block) require 'retryable' object = retryable(:tries => 3, :on => Twitter::E...
28.109091
101
0.644243
18b8eb887801463b8220542d36dbd750a38602fa
2,610
# encoding: UTF-8 require 'spec_helper' describe SheetsController, search: true do it_should_behave_like "inherit_resources with", 'sheet', %w{new show index edit destroy} describe 'create' do let(:administrator) { Fabricate :administrator } let(:skill_keyword) { Fabricate(:skill_keyword) } le...
27.765957
116
0.657471
6a070d9208e2f55633e6de1eb9991def187ea63c
273
FactoryBot.define do factory :project_keeper, class: 'BeachApiCore::ProjectKeeper' do keeper { BeachApiCore::Instance.current } after(:build) do |project_keeper| project_keeper.project = build(:project, project_keepers: [project_keeper]) end end end
27.3
81
0.736264
f71c87232f9d46a9f4fc9a3bcce9820fdabbff60
212
class CreatePartnerRegistrations < ActiveRecord::Migration[5.2] def change create_table :partner_registrations do |t| t.string :description t.decimal :cost t.timestamps end end end
19.272727
63
0.70283
62c9a2b0df9d7f1cee5c0cf205f5956cf0762c43
4,471
# 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 use ...
31.70922
99
0.670096
61f75bc3c3a1166be25fcaa610f7e112a9935901
2,689
# 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...
40.134328
130
0.669394
ac0c15d4b12941076a820901cb48ab0e50e976ce
1,038
# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require 'test/unit/context/version' Gem::Specification.new do |gem| gem.name = "test-unit-context" gem.version = Test::Unit::Context::VERSION gem.authors = ["kares"] gem.email = ["self@kares.org"] gem.summa...
38.444444
80
0.645472
268b99d3f90aa4c0a5476cd859ad5f52c57eb2a0
3,642
require "spec_helper" describe InfluxDB::PointValue do describe "trailing 'i' adding" do it 'should convert an int into a string with a trailing i appended' do expected = 'ints value=42i' point = InfluxDB::PointValue.new(series: "ints", values: { value: 42 }) actual = point.dump expect(a...
35.359223
89
0.553267
265459d5c822db8c6ea9118f8d4a9b342c8203f0
684
# elseif example # Original example puts "Hello, what's your name?" STDOUT.flush name = gets.chomp puts 'Hello, ' + name + '.' if name == 'Satish' puts 'What a nice name!!' else if name == 'Sunil' puts 'Another nice name!' end end # Modified example with elseif puts "Hello, what's your name?" STDOUT.flush ...
17.538462
38
0.646199
388c7b5ad233f3cf3c7f27b2b4e423744404c7b6
1,049
RSpec.describe PartnerMailer, type: :mailer do describe "#recertification_request" do subject { PartnerMailer.recertification_request(partner: partner) } let(:partner) { create(:partner) } let(:fake_partner_base_url) { Faker::Internet.domain_name } before do allow(ENV).to receive(:[]).with("PART...
43.708333
106
0.720686
035a48483492d6cdcc4b95337403ba67ac2a787f
6,157
# frozen_string_literal: true module Reality::Describers::Wikidata::Impl module Modules # Get deleted revision information. # # The "submodule" (MediaWiki API term) is included in action after setting some param, providing # additional tweaking for this param. Example (for {Reality::Describers::Wikid...
36.217647
647
0.625305
391dd5075cb2cfd15946b3a7e12d9d76bc69bef5
14,022
module Shoulda module Context class << self attr_accessor :contexts def contexts # :nodoc: @contexts ||= [] end def current_context # :nodoc: self.contexts.last end def add_context(context) # :nodoc: self.contexts.push(context) end def rem...
31.090909
115
0.579874
bf0289f61547272d79ec881d74c1aba44a12ce21
490
require File.join(Rails.root, "app", "data_migrations", "resolve_census_employee_validation_failures") # This rake task is to remove the invalid benefit group assignments for the EE's # format: RAILS_ENV=production bundle exec rake migrations:resolve_census_employee_validation_failures namespace :migrations do desc "...
61.25
114
0.85102
61bdcaa416a6a81e3f6375389107b51ca7c04a38
2,160
require_relative 'unit' require_relative 'skills/skill' Dir[File.dirname(__FILE__) + '/skills/*.rb'].each do |s| require_relative 'skills/' + File.basename(s, '.rb') end # class Player # ------------ # methods and stats unique to just the player unit class Player < Unit attr_accessor :energy, :energy_per_turn, :...
25.714286
101
0.658796
0123f03d421a48d659dff3b948adffbdef03bd2b
10,082
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic...
40.817814
245
0.694207
e8d0dd3dec470a5e43d042874bca1fcda8356593
1,518
# frozen_string_literal: true class Groups::ContributionAnalyticsController < Groups::ApplicationController include Analytics::UniqueVisitsHelper before_action :group before_action :check_contribution_analytics_available! before_action :authorize_read_contribution_analytics! layout 'group' track_unique_...
24.483871
77
0.769433
7975a4455f3dae0e70c703f7feb8b2a382f40a0e
175
require File.dirname(__FILE__) + '/../test_helper' class HostTest < ActiveSupport::TestCase # Replace this with your real tests. def test_truth assert true end end
19.444444
50
0.731429