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
03a98f45592dffdb17d7586473d67b4f612d50f7
652
class Experience < ApplicationRecord belongs_to :head EXP_TYPE_COMPANY = 0 EXP_TYPE_SCHOOL = 1 EXP_TYPES = [ EXP_TYPE_COMPANY, EXP_TYPE_SCHOOL ] validates :head, presence: true validates :place, presence: true validates :title, presence: true validates :exp_type, presence: true, inclusion: ...
23.285714
79
0.707055
87788c8f878a106addf8dfa5bfbacc6a7b728638
272
Then /^I should see error in provider side fields:$/ do |table| table.rows.each do |field| assert has_xpath?(".//*[ label[normalize-space(text()) = '#{field.first}'] ]/..//p[@class='inline-errors']"), "Field '#{field.first}' with error not found" end end
38.857143
113
0.625
abae52d8a41951b36317e37602113190a3c040f3
8,912
require 'erb' module YARD module Generators class Base include Helpers::BaseHelper include Helpers::FilterHelper class << self def template_paths @@template_paths ||= [TEMPLATE_ROOT] end ## # Convenience method to registering a template path. ...
30.83737
131
0.541741
915884bac32fc2278993271aaf0410b6c0d42f8a
2,090
# This is an example test for Sauce Labs and Appium. # It expects SAUCE_USERNAME and SAUCE_ACCESS_KEY to be set in your environment. # # Before this test will work, you may need to do: # # gem install rspec selenium-webdriver rest-client # # Run with: # # rspec sauce_example.rb require 'rspec' require 'selenium-webdri...
29.027778
105
0.710048
62fe58a69d86d9c2a2b2b94cdf380871a1d67139
212
# frozen_string_literal: true class CreateFields < ActiveRecord::Migration[5.0] def change create_table :fields do |t| t.string :name_en t.string :name_pl t.timestamps end end end
16.307692
49
0.674528
26f7cc624989e9e1efb741479d1a23ed7962e7dd
333
Paperclip::Attachment.default_options[:url] = ':s3_domain_url' Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename' Paperclip::Attachment.default_options[:s3_host_name] = 's3.amazonaws.com' Mime::Type.unregister(:pdf) Mime::Type.register "application/force-download", :pdf...
55.5
99
0.768769
0807ded13aaff865424c9f019f0cf232c26abdc1
287
class CreatePublishes < ActiveRecord::Migration[6.1] def change create_table :publishes do |t| t.datetime :PublishDate t.references :publisher, null: false, foreign_key: true t.references :book, null: false, foreign_key: true t.timestamps end end end
26.090909
61
0.69338
395b38a25c38a750104b797cd45cf2857ac30372
6,667
require 'rails_helper' include AuthHelper include Requests::JsonHelpers RSpec.describe UsersController, :type => :controller do render_views describe 'GET index' do context 'not logged in as admin' do before { get :index } it { should redirect_to new_session_path(continue: request.fullpath) } ...
35.462766
208
0.627869
acbdf356eebcb439e1fc09ffd82110a6645269b7
77
require_relative '../../../../stdlib/rdoc/markup/' + File.basename(__FILE__)
38.5
76
0.675325
18f52a8ec4525007e65af7c5a438d620ef9f31c0
894
cask "logos" do version "9.3.0.0052" sha256 "569e175d9a2092744044cee82e467ce50edac3e7ebac6410cd51491e9113279d" url "https://downloads.logoscdn.com/LBS#{version.major}/Installer/#{version}/LogosMac.dmg", verified: "downloads.logoscdn.com/" name "Logos" desc "Bible study software" homepage "https://www...
28.83871
94
0.689038
08d5191ddc965b8a59c25159129e9f64d63763fc
1,823
module Cms::Extensions::ColumnValuesRelation extend ActiveSupport::Concern class LiquidExports < SS::Liquidization::LiquidExportsBase def key?(name) find_value(name).present? end def [](method_or_key) find_value(method_or_key) || super end def find_value(id_or_name) if id_or...
30.898305
124
0.665387
ac153cee7ea380398c3473646daf58bf408f59e3
762
module SoupCMS module Api module Resolver module Markdown class LinkRef < Base def resolve(html) doc = Nokogiri::HTML.fragment(html) links = doc.css('a') links.each do |link| next unless link['href'].start_with?('ref:') ref_...
23.8125
85
0.543307
e238a88ff7569110d0be734ddab5fb7a52283eab
137
module LoanTypesHelper def all_loan_type LoanType.all.collect { |x| [x.name.to_s + ' - ' + x.interest_rate.to_s, x.id] } end end
19.571429
83
0.671533
f7050d7f8fbba8a6903a12db746de735a4290d23
6,315
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details. if NewRelic::Agent::Instrumentation::RackHelpers.version_supported? && defined? Rack require File.join(File.dirname(__FILE__), 'example_app') requ...
34.508197
129
0.699762
1dd34f89ee370cf4f1ed6623a00429400d81694b
2,833
# # Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # Author: Emilien Macchi <emilien.macchi@enovance.com> # # 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.apach...
28.33
75
0.591246
bf3ea6cabc077d7112da3c6e384a73cd490e5e24
936
#!/usr/bin/env ruby file_path = File.expand_path("../input", __FILE__) input = File.readlines(file_path) keypad = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] x = nil keypad = [[x, x, 1, x, x], [x, 2, 3, 4, x], [5, 6, 7, 8, 9], [x, "A", "B", "C", x], ...
23.4
161
0.507479
26956f4eb702b8b057e311eec685a1a9a07d1b3c
3,354
# 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...
39
124
0.724806
393adfca672c06e455a1fc81e89bf4654bd3f917
8,097
# frozen_string_literal: true require "rails_helper" describe Types::EveMarketGroupType do describe "get market groups" do let!(:eve_type_1) do create(:eve_type, type_id: 400, market_group: eve_market_group_1) end let!(:eve_type_2) do create(:eve_type, type_id: 500, ...
27.35473
57
0.358281
03554bc3a931ccb50b9de328b62a3e828f7085b3
473
# frozen_string_literal: true require 'spec_helper' RSpec.describe Rumale::LinearModel::Loss::EpsilonInsensitive do let(:y) { Numo::DFloat[4, 1, 1, 3] } let(:t) { Numo::DFloat[4, 3, 2, 1] } let(:loss) { described_class.new(epsilon: 1).loss(y, t) } let(:dout) { described_class.new(epsilon: 1).dloss(y, t) } ...
29.5625
66
0.668076
e26f997272cab7678ef80b1d8662f16c478a8efc
2,318
# frozen_string_literal: true require 'spec_helper' describe RemarkAce do describe '#to_s' do it 'should be remark string' do rmk = RemarkAce.new(' foo-bar _ baz @@ COMMENT') expect(rmk.to_s).to eq 'remark foo-bar _ baz @@ COMMENT' end end describe '#==' do before(:all) do @rmk1 ...
22.72549
62
0.599223
79a80d00fe26311ec25460d1b7426b0d29fcb269
426
require 'sidekiq' require 'enquiry/services/mailchimp' module Enquiry class MailchimpWorker include Sidekiq::Worker def perform(mailchimp_params) mailchimp_params = Enquiry::Utils.symbolize_keys(mailchimp_params) MailchimpService.add_contact_to_list( mailchimp_params[:list_id], ...
22.421053
72
0.7277
0343ab16cd3dd965db3123082030c19d74cba128
850
Gem::Specification.new do |spec| spec.name = "embulk-filter-amazon_rekognition" spec.version = "0.1.2" spec.authors = ["toyama0919"] spec.summary = "Amazon Rekognition filter plugin for Embulk" spec.description = "Amazon Rekognition" spec.email = ["toyama0919@gmail.com"...
38.636364
87
0.655294
381fe1bc75e0704faeffc78dfc138727c8386de6
4,970
# coding: utf-8 # vim: et ts=2 sw=2 RSpec.describe HrrRbSsh::Message::SSH_MSG_CHANNEL_OPEN_CONFIRMATION do let(:id){ 'SSH_MSG_CHANNEL_OPEN_CONFIRMATION' } let(:value){ 91 } describe "::ID" do it "is defined" do expect(described_class::ID).to eq id end end describe "::VALUE" do it "is defi...
28.238636
84
0.588732
6acbf46eb209dc7e633b0f1fd4c9656b4d508a81
1,819
class Spinach::Features::AdminSettings < Spinach::FeatureSteps include SharedAuthentication include SharedPaths include SharedAdmin include Gitlab::CurrentSettings step 'I modify settings and save form' do uncheck 'Gravatar enabled' fill_in 'Home page URL', with: 'https://about.gitlab.com/' fill_...
30.316667
88
0.715228
e2fde44c2f2c371824939cf52b7d38411e0ec52d
9,429
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX - License - Identifier: Apache - 2.0 # This code example determines of the users available to you in # AWS Identity and Access Management (IAM), how many of them are associated # with a policy that provides administrator privileges. # #...
35.052045
88
0.727225
1a430e8cd088913c01a212567f6cb72d3fdd46ad
106
require 'sidebar' require 'authors_sidebar' AuthorsSidebar.view_root = File.dirname(__FILE__) + '/views'
21.2
60
0.783019
081c30b4c7e7a568f647fe387435fec9aa832fc7
6,282
# 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...
36.736842
245
0.685132
39a1240c61dcb0eb8b4407c44831f458dfcfa31f
5,484
class Module # Provides a delegate class method to easily expose contained objects' public methods # as your own. Pass one or more methods (specified as symbols or strings) # and the name of the target object via the <tt>:to</tt> option (also a symbol # or string). At least one method and the <tt>:to</tt> optio...
34.929936
155
0.53337
0319e2a3eb437d0083a3537e0358b13811add039
82
# Module to hold the RedTube API Client module RedtubeApi VERSION = "0.1.0" end
16.4
39
0.731707
08ae0e9f64769c2191114bef798411045e22f649
3,119
require 'spec_helper' # see documentation here: https://www.keepalived.org/manpage.html def vrrp_script_file_name(name) "/etc/keepalived/conf.d/00_keepalived_vrrp_script__#{name}__.conf" end platforms = %w(debian ubuntu centos) platforms.each do |platform| describe "keepalived_vrrp_script on #{platform}" do ...
33.537634
102
0.663995
e9e754fce9b5b5132085a26b017e9436f5385de6
874
# coding: utf-8 require_relative './button' require_relative './label' module WS ### ■WSのウィンドウ用のスーパークラス■ ### class WSWindowBase < WSLightContainer ### ■ウィンドウの定義■ ### # Mix-In include WindowFocus # 公開インスタンス attr_accessor :border_width # ウィンドウボーダーの幅 attr_reader :window_focus ...
21.85
108
0.620137
f89e7c6d1232b7a8e1966a770841ebd5a8ef9237
507
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module PlylstIt class Application < Rails::Application # Settings in config/environments/* take prec...
31.6875
82
0.757396
bfb9c84a762663df3d6c01a4a589025c25a9f00d
5,175
verbose = $VERBOSE $VERBOSE = nil class Model FILE_DIGEST = Digest::MD5.hexdigest(File.open(__FILE__).read) def self.model_name @_model_name ||= ActiveModel::Name.new(self) end def initialize(hash = {}) @attributes = hash end def cache_key "#{self.class.name.downcase}/#{self.id}-#{self.update...
19.751908
91
0.71343
9182ff177b2e61d2bdd5658ef6e69bfa3a724036
1,016
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| spec.name = "razor-mk-agent" spec.version = "009" spec.authors = ["Puppet"] spec.email = ["info@puppet.com"] spec.description = "T...
35.034483
74
0.652559
1a216fae893cf5c6626c6aead050ad6ecfca5cdd
475
class SessionsController < ApplicationController def new end def create @user = User.find_by(email: params[:session][:email]) if @user && @user.authenticate(params[:session][:password]) session[:user_id] = @user.id redirect_to user_path(@user.id) else flash.now[:danger] = 'Invalid...
19.791667
63
0.667368
1cf2e311ed1daf62dc2ca86ed7fcc2642afff7c5
2,502
module OrgTodoist class Calendar attr_reader :cal def initialize client_id, client_sec, calendar_id @cal = Google::Calendar.new(:client_id => client_id, :client_secret => client_sec, :calendar => calendar_id, ...
30.144578
120
0.593525
01328cb6234b3b19a57b5fad944a5d17f395ea1f
1,115
class Cc65 < Formula desc "6502 C compiler" homepage "https://cc65.github.io/cc65/" url "https://github.com/cc65/cc65/archive/V2.17.tar.gz" sha256 "73b89634655bfc6cef9aa0b8950f19657a902ee5ef0c045886e418bb116d2eac" head "https://github.com/cc65/cc65.git" bottle do # sha256 "d8238bad77a894edec5e5caefd7ae6...
30.972222
93
0.726457
03b16eccd7df6ca1d26b17ef45ff51f682a0192d
52
json.partial! "products/product", product: @product
26
51
0.769231
ff3b7a65ce1f025ea8656ead34c47d975ec23506
1,451
module Api class CoursesController < ApplicationController respond_to :json load_and_authorize_resource include Response def graphql @course = Course.find(params[:course_id]) query = params[:query] accept = params[:accept] results = perform_graphql_query(query,accept) js...
25.017241
122
0.653343
5d6193d0daea197e336a6bfa12337f19deed6f60
389
cask 'soundsource' do version '4.0.0' sha256 '1a5bc1dc714e8cec80aebf92d14b200fc094e8066ca5bf49b8a41a6a37788ae5' url 'https://rogueamoeba.com/soundsource/download/SoundSource.zip' appcast 'https://rogueamoeba.com/soundsource/releasenotes.php' name 'SoundSource' homepage 'https://rogueamoeba.com/soundsource/...
27.785714
75
0.77635
111685ba60e57ebc3bf0e97b7069051434010044
153
require 'jcropper' require 'rails' module Jcropper class Railtie < Rails::Railtie rake_tasks do load "tasks/jcropper.rake" end end end
15.3
32
0.699346
fff3b6b367348b553a60178e7b18454b41efa43b
1,389
module Connect module ControllerAdditions extend ActiveSupport::Concern included do include Connect::ControllerAdditions::Helper helper Connect::ControllerAdditions::Helper end module Helper def current_access_token @current_token ||= request.env[Rack::OAuth2::Server::Reso...
28.346939
146
0.708423
6a5c057384fed4789523270cd4cc9e297edfbaa1
4,813
require 'active_support/core_ext/module/attribute_accessors' module ActiveRecord module AttributeMethods module Dirty # :nodoc: extend ActiveSupport::Concern include ActiveModel::Dirty included do if self < ::ActiveRecord::Timestamp raise "You cannot include Dirty after Time...
26.445055
93
0.641388
112a5f1bce236eb6ab70db2c6ee21564ca25d79b
3,028
# frozen_string_literal: true module GraphQL module DSL ## # This mixin help to reuse selections sets module SelectionSet ## # Declare new GraphQL field # # This method can help to avoid name collisions i.e. +__field(:object_id)+ # # @param name [String, Symbol] field ...
28.299065
130
0.543593
79174fd58f2d007a08a2f28f07fe4332a91ee519
1,842
# -*- encoding: utf-8 -*- # stub: machinist 2.0 ruby lib Gem::Specification.new do |s| s.name = "machinist".freeze s.version = "2.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Pete Yandell".fre...
39.191489
112
0.637894
91441aa9829be709eb1d2db56cb9c59f1769ab59
341
class Subject < ActiveRecord::Base def records Record.where("metadata->'650' @> '[{\"0\" : \"#{identifier}\"}]'::jsonb") end def related_subjects @related_subjects ||= begin if related_identifiers.length > 0 Subject.where(identifier: related_identifiers) else [] end ...
14.826087
77
0.59824
26a31e827e2537268524ee761ed8615dadcb8f20
2,427
# frozen_string_literal: true class SchemesController < ApplicationController before_action :authenticate_user!, except: :show before_action :set_scheme, except: %i[create new] before_action :process_scheme_params, only: %i[create] before_action :set_channel, only: %i[show] before_action :set_app def show...
24.515152
107
0.695509
7988bdcbf684e0cf0f5140ecdb5d68144aaef8d6
5,454
require 'chef/provider/lwrp_base' require 'shellwords' require_relative 'helpers' require_relative 'helpers_rhel' class Chef class Provider class MysqlService class Rhel < Chef::Provider::MysqlService use_inline_resources if defined?(use_inline_resources) def whyrun_supported? tr...
31.165714
153
0.540337
8788a3eebbf8ccddc8e4fa4ec1288e608c1b8ac9
2,373
class Imake < Formula desc "Build automation system written for X11" homepage "https://xorg.freedesktop.org" url "https://xorg.freedesktop.org/releases/individual/util/imake-1.0.8.tar.bz2" sha256 "b8d2e416b3f29cd6482bcffaaf19286d32917a164d07102a0e531ccd41a2a702" license "MIT" revision 3 bottle do sha...
38.901639
92
0.71555
18b0a8499129a3acb9ae431852675c6445366851
291
class Cms::Column::Base include SS::Document include SS::Model::Column include Cms::Addon::Column::Layout include SS::Reference::Site store_in collection: 'cms_columns' def alignment_options %w(flow center).map { |v| [ I18n.t("cms.options.alignment.#{v}"), v ] } end end
22.384615
75
0.687285
ed99c67ba7c2e38f142a1c2b7198c5738e112c85
2,000
require 'test_helper' class TestOperatorSkipWhile < Minitest::Test include Rx::MarbleTesting def test_ignore_values_until_block_falsy source = cold(' -123456|') expected = msgs('------456|') source_subs = subs(' ^ !') actual = scheduler.configure do source.skip_while { |x| x ...
22.727273
57
0.629
f8b940650b58a4ca6a4e27311395401343baf1cf
542
Puppet::Type.newtype(:mysql_database) do @doc = 'Manage MySQL databases.' ensurable autorequire(:file) { '/root/.my.cnf' } autorequire(:class) { 'mysql::server' } newparam(:name, namevar: true) do desc 'The name of the MySQL database to manage.' end newproperty(:charset) do desc 'The CHARACTER...
21.68
53
0.667897
1ccc99d3095734f68f2b5b35cb8c2a301ca3cb5b
1,626
# frozen_string_literal: true require_relative "lib/rails_sortable/version" Gem::Specification.new do |spec| spec.name = "rails_sortable" spec.version = RailsSortable::VERSION spec.authors = ["Conor Devine"] spec.email = ["conor.devine@thoughtbot.com"] spec.summary = "A g...
43.945946
120
0.698032
3396321c3b8fdff1bf783a00d03840657c594da4
1,534
Pod::Spec.new do |s| s.name = "ADXLibrary-Cauly" s.version = "1.9.1" s.summary = "ADX Library for iOS" s.license = {"type"=>"MIT", "file"=>"LICENSE"} s.authors = {"Chiung Choi"=>"god@adxcorp.kr"} s.homepage = "https://github.com/adxcorp/AdxLibrary_iOS" s.description = "ADX Library for iOS" s.source = { ...
36.52381
132
0.509126
1a2fbe85527466675a60bc7afc88ee89d5103a4a
1,835
# frozen_string_literal: true require 'mini_nrepl/clj' module MiniNrepl # Clojure fn's atop Clj module CljLib include Clj extend self # rubocop:disable ModuleFunction # @param path [String] Path to clojure file with ns declaration # @return [String] Clojure code to read ns name from given filesy...
28.671875
78
0.429428
ff7a0c8b0e8b8664774e6e29e743169fcf0d8589
184
# frozen_string_literal: true require 'tencentcloud-sdk-common' require_relative 'v20201127/client' require_relative 'v20201127/models' module TencentCloud module Apcas end end
15.333333
35
0.815217
bb24420247aadbd59d4faa30419805cb2c2e78cf
188
module Sinatra module Helpers def current_user @user = User.find(session[:user_id]) end def is_logged_in? !!session[:user_id] end end end
14.461538
43
0.574468
1d9f3ab8ad84dad2c6435da48b8ec16e62aab865
323
require "notification_file_lookup" module NotificationHelper include ActionView::Helpers::TagHelper def banner_notification if node = Static.banner content_tag(:section, "<div>#{node[:file]}</div>", {:id => "banner-notification", :class => node[:colour]}, false) else '' end end e...
21.533333
71
0.659443
bbedc70481f9eedff49e4174bbca13d331d32006
3,726
class PetAdoptions::CLI BUDDIES = ["Dogs", "Cats","Rabbits", "Birds", "Equine", "Pigs", "Barnyard", "Small"] def call puts "\nWelcome to PetAdoptions. Where you can find your next Bud".light_blue puts "-----------------------------------------------------------" start end ...
27.397059
155
0.545894
01d82fb5e43ee243aa9861f20db8d382db5bba7c
5,868
# == Ruby Version Manager - Ruby API # # Provides a wrapper around the command line api implemented as part of the api. # If you're not familiar with rvm, please read https://rvm.beginrescueend.com/ # first. # # == Usage # # When using the rvm ruby api, you gain access to most of the commands, including the set # funct...
36.447205
115
0.694274
21d7f260e3da0d26289930ca5d4f7e49492287f9
1,419
class Cvsutils < Formula desc "CVS utilities for use in working directories" homepage "https://www.red-bean.com/cvsutils/" url "https://www.red-bean.com/cvsutils/releases/cvsutils-0.2.6.tar.gz" sha256 "174bb632c4ed812a57225a73ecab5293fcbab0368c454d113bf3c039722695bb" license "GPL-2.0" bottle do sha256 ...
48.931034
120
0.766737
79cf54b55d5d0d251ae6f0e0cc3dfeacdaa1de32
943
class RelatedTagQuery attr_reader :query def initialize(query) @query = query.strip end def tags if query =~ /\*/ pattern_matching_tags elsif query.present? related_tags else [] end end def wiki_page_tags results = wiki_page.try(:tags) || [] results.reject! d...
17.462963
119
0.640509
035335a1d335ac50c631b99d5e8550b3ac105f63
445
# frozen-string-literal: true require 'bundler/setup' require 'holidays_api_client' require 'webmock/rspec' require 'i18n' RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = '.rspec_status' # Disable RSpec exposing methods globally o...
23.421053
66
0.759551
bb65e8f6482a4f555c3b955656aba0e69ed23815
735
# frozen_string_literal: true Datadog.configure do |c| enabled = ENV['DATADOG_ENABLED'] == 'true' hostname = ENV.fetch('DATADOG_TRACE_AGENT_HOSTNAME', 'localhost') debug = ENV['DATADOG_DEBUG'] == 'true' c.tracer enabled: enabled, hostname: hostname, distributed_tracing: true, debug: debug c.use :rails, serv...
49
182
0.756463
f8ed2d15b5265315cb85420be8274c6381510da2
475
# coding: utf-8 # overwrite db:migarate task 'db:migrate' => :environment do ENV['RAILS_ENV'] ||= 'development' sh "bundle exec ridgepole -c config/database.yml -f db/Schemafile -E#{ENV['RAILS_ENV']} --apply" sh 'bin/rake db:schema:dump' # test用に schema.rb ファイルを作成しておく end task 'db:migrate:dryrun' => :environmen...
33.928571
108
0.696842
bbdd991a6b88f1e80d8a6dc7dbd9602c95e192e5
1,217
require 'spec_helper' describe 'Xdelivery::API::Response::Base' do describe "當沒有登入的情況 ..." do before do @data = "{\"status\":false}" stub_request(:any, Xdelivery::API::Base::BASE_URL).to_return(body: @data, status: 401) @http_response = begin RestClient.get(Xdelivery::API::Base::BASE_UR...
25.354167
92
0.618735
5dae980f04f6624a165db3cac57d66d288a8f9be
99
class RemoveTermsTable < ActiveRecord::Migration[6.0] def change drop_table :terms end end
16.5
53
0.747475
7a54353a61f3a8963f8d08647c4b80b63971dd08
260
# Add your variables here first_number = 5 second_number = 6 sum = first_number + second_number difference = first_number - second_number sum = first_number + second_number product = first_number * second_number quotient = first_number / second_number
16.25
41
0.780769
f77bded1c86db4688da4cd65b386bffe3161d3a9
6,018
# Copyright © 2011-2019 MUSC Foundation for Research Development # All rights reserved. # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, this list...
44.25
145
0.706215
4a688da30f05fc455960284fa3ca0038bc6484e6
3,709
# 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...
44.154762
109
0.709625
6a09427ccd5758cb90960218d6d6de82afb4cd6e
5,885
# # Author:: Adam Jacob (<adam@chef.io) # Copyright:: Copyright 2009-2016, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
27.119816
149
0.603738
1ca0df14ef099d48bd7252205c1309af30652f2b
1,959
# Main AWS loader file. The intent is for this to be # loaded only if AWS resources are needed. require 'aws-sdk' # TODO: split once ADK v3 is in use require 'resource_support/aws/aws_backend_factory_mixin' require 'resource_support/aws/aws_resource_mixin' require 'resource_support/aws/aws_singular_resource_mixin' r...
40.8125
106
0.827973
3378837ce7a307f25676bcdb13e0742a6dccd16e
329
# lib/generators/plutus/plutus_generator.rb require 'rails/generators' require 'rails/generators/migration' require_relative 'base_generator' module Plutus class ScopeGenerator < BaseGenerator def create_migration_file migration_template 'scope_migration.rb', 'db/migrate/scope_plutus_accounts.rb' end ...
25.307692
84
0.802432
21e9db9b87d3e99ddd215bdc95c0c9ac653071a0
462
cask 'clipy' do version '1.0.7' sha256 'f1d060033e6fb18bc8fbab33f35ff3d7245edf905a2018fe0fbbb25d80c65c67' url "https://github.com/Clipy/Clipy/releases/download/#{version}/Clipy_#{version}.dmg" appcast 'https://clipy-app.com/appcast.xml', checkpoint: 'baf6a41c333410ae8d4b43bffa5b5cd3c0b17c884cf5084d43...
28.875
88
0.746753
bb8980f0b8075610e631d1fff5d09942839e6653
1,535
require 'zip' class ZipFileExtractor OUTPUT_PATH = File.join('public', 'spree_themes') IGNORED_FILES_REGEX = /\/(\.|__)/ attr_reader :file_path, :theme def initialize(file_path, theme) @file_path = file_path @theme = theme end def extract FileUtils.mkdir_p(OUTPUT_PATH) parse_file end ...
24.758065
94
0.637134
ace35dda53ea3c5a36f36d6bab90c3a3ee0bc2c6
4,005
require "abstract_unit" module ActionDispatch module Routing class RouteSetTest < ActiveSupport::TestCase class SimpleApp def initialize(response) @response = response end def call(env) [ 200, { "Content-Type" => "text/plain" }, [response] ] end en...
25.673077
105
0.571036
bfc3b12b13966a3804a5e4b0a0b6b8800c574026
1,167
class Fortio < Formula desc "HTTP and gRPC load testing and visualization tool and server" homepage "https://fortio.org/" url "https://github.com/fortio/fortio.git", tag: "v1.6.8", revision: "55f745ffeee860b7dc4006474260627632fae388" license "Apache-2.0" bottle do sha256 "f7d300df19352a4...
30.710526
93
0.69066
62b18a027a3b400b9bafdeb4ed2ca6dcee47c04f
173
begin require 'dke/ruby_provider' rescue LoadError warn('Your dke RubyGem is missing or out of date.', 'Install the latest version using `gem install dke`.') end
24.714286
61
0.722543
ac581b56fd59aa98819081894821d82a7b1dbc9c
2,480
module Fech # Fech:SearchResult is a class representing a search result # from Fech::Search. class SearchResult attr_reader :committee_name, :committee_id, :filing_id, :form_type, :period, :date_filed, :description, :amended_by, :amendment # @param [Hash] attrs The attributes of the search result. d...
33.513514
131
0.6375
391478eae5f458895ab6c92745249f762efa9593
1,047
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'prpr/code_pipeline/version' Gem::Specification.new do |spec| spec.name = "prpr-code_pipeline" spec.version = Prpr::CodePipeline::VERSION spec.authors = ["kokuyouwind"] ...
38.777778
104
0.657116
211103786492b9f9d239f6f83e00d4680a37dd82
1,529
module Spaceship class UpdateChecker UPDATE_URL = "https://fastlane-refresher.herokuapp.com/spaceship" def self.ensure_spaceship_version return if defined?(SpecHelper) # is this running via tests return if ENV["FASTLANE_SKIP_UPDATE_CHECK"] require 'faraday' require 'json' resp...
35.55814
102
0.607587
4a276a52764cd6257f42f62b15df5eed8f1e4723
69
require 'rails_helper' RSpec.describe Category, type: :model do end
13.8
40
0.782609
ab4899a06db6883dedc1afb92492e8879f69a19a
460
require "spec_helper" require "circleci/env/command/vault/read" describe Circleci::Env::Command::Vault::Read do let(:cmd) { Circleci::Env::Command::Vault::Read.new(name: "name", password: "pass") } describe "#run" do it "should call read" do allow(cmd).to receive(:read).with("name", "pass").and_return("...
32.857143
106
0.691304
26a32036766861bd6c45a39fae2f18e846ff03a1
2,185
# # loader.rb - # $Release Version: 0.9.6$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # # # module IRB class LoadAbort < Exception;end module IrbLoader @RCS_ID='-$Id$-' alias ruby_load load alias ruby_require require def irb_load(fn, priv = nil) path = search...
18.208333
66
0.625172
bbf35e3c2450bc77797668c8b50360cebfc506c7
244
# frozen_string_literal: true class CreateTicketScannings < ActiveRecord::Migration[4.2] def change create_table :ticket_scannings do |t| t.integer :physical_ticket_id, null: false t.timestamps null: false end end end
20.333333
58
0.729508
6ac30b4eaf00f4cea838b5888fa88c1c2298fae6
75
# frozen_string_literal: true module FoundersToolkit::Auth::Emailable end
15
39
0.826667
62fd07ba25c59c301921d472aab6c24d2b73a16a
2,884
# coding: utf-8 require_relative "levenshtein/experiment" require_relative "levenshtein/iterative_with_two_matrix_rows" require_relative "levenshtein/iterative_with_two_matrix_rows_optimized" require_relative "levenshtein/iterative_with_full_matrix" require_relative "levenshtein/recursive" require_relative "levenshtei...
38.453333
90
0.742718
e833257dc84a0929380f9e7b1b6a5ca802c0d655
8,138
require 'spec_helper' describe Conjur::CLI::Complete, wip: true do def expects_completions_for string, point=nil expect(described_class.new("conjur #{string}",point) .completions .map { |c| c.chomp ' ' }) end describe 'conjur bash completion' do describe 'for conjur subcommands b...
33.628099
82
0.549767
7a892e69d8474fb7e5ba3d908c43977e8fc29103
3,304
require 'spec_helper' describe PensioAPI::Transaction do before :each do stub_pensio_response('/merchant/API/payments', 'payments') stub_pensio_response('/merchant/API/getTerminals', 'get_terminals') stub_pensio_response('/merchant/API/refundCapturedReservation', 'refund_captured_reservation') end l...
31.169811
98
0.721852
bbdf2ee87b3134b840886618799bba0755b1a41b
1,755
require 'hanami/routes' require 'hanami/routing/default' module Hanami # @since 0.9.0 # @api private module Components # @since 0.9.0 # @api private module App # hanami-router configuration for a single Hanami application in the project. # # @since 0.9.0 # @api private c...
29.25
119
0.585755
91ad6097c36fc94ac18cd12aa46dcae1a42b5f85
144
class AbsoluteDateTimeRoot include Neo4j::ActiveNode property :name, type: String, constraint: :unique id_property :uuid, auto: :uuid end
24
51
0.770833
f7a4d5381040c4feecc762cc577e1714fba99ee6
1,620
class ServicesController < ApplicationController def search @categories = Service.categories end def index results = Geocoder.search(params[:postcode], region: "gb") if results.length > 0 @top_result = Service .where("recommended = TRUE AND category && ...
37.674419
164
0.507407
6a964b83b8d77cca5654e15fc80730ab6b88ddba
278
require 'rails_helper' RSpec.describe "home/show.html.erb", type: :view do let(:vehicle) { create(:vehicle) } before do assign(:vehicle,vehicle) render 'home/show.html.erb' end it "should render the table" do expect(rendered).to include(vehicle.vin) end end
21.384615
51
0.701439
089e02de2b753a5543e5b35c5f278eccad76e809
555
namespace :db do namespace :second_base do task "drop:_unsafe" do SecondBase.on_base { Rake::Task['db:drop:_unsafe'].execute } end namespace :migrate do task :reset => ['db:second_base:drop:_unsafe', 'db:second_base:create', 'db:second_base:migrate'] end end end %w{ drop:_unsafe }.ea...
24.130435
103
0.672072
395f32600605e1097ca1afb9fb823c49af05b1d0
1,149
=begin #EVE Swagger Interface #An OpenAPI for EVE Online OpenAPI spec version: 0.8.6 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.3.1 =end require 'spec_helper' require 'json' require 'date' # Unit tests for EVEOpenAPI::GetUniverseAsteroidBeltsAsteroidBeltIdNotFound ...
26.72093
103
0.781549
e88c9518122556bc0bf5945e5170a3847eef90a1
155
class CountryVersion < PaperTrail::Version include VersionSession self.table_name = :log_countries self.sequence_name = :log_countries_id_seq end
25.833333
44
0.8
4a9729f011b76eff429809992456fa2208326bfd
1,271
class Tile38 < Formula desc "In-memory geolocation data store, spatial index, and realtime geofence" homepage "http://tile38.com" url "https://github.com/tidwall/tile38/archive/1.9.1.tar.gz" sha256 "58ea936660105e5bcceedc05e9a4382bb9696d4f7a84edfe83cad09734a2164d" head "https://github.com/tidwall/tile38.git" ...
26.479167
93
0.732494
28702026900fbb3584f1299d345769721c8f5ab0
1,028
namespace "check" do desc "Check that the require files match the about_* files" task :abouts do about_files = Dir['src/about_*.rb'].size about_requires = `grep require src/path_to_enlightenment.rb | wc -l`.to_i puts "Checking path_to_enlightenment completeness" puts "# of about files: #{about_f...
30.235294
103
0.672179
18c343a9c272a40d8d9e8cc7a54de91848ac8fbc
750
# Set RAILS_ROOT and load the environment if it's not already loaded. unless defined?(Rails) ENV["RAILS_ROOT"] = File.expand_path("../example", __FILE__) require File.expand_path("../example/config/environment", __FILE__) end Teaspoon.configure do |config| config.driver = ENV['TEASPOON_DRIVER'] || "selenium" c...
35.714286
94
0.725333
38cbd2fcd504625d858dd9671715b60f23876224
2,504
# frozen_string_literal: true require 'slack' module Slackify # Where the configuration for Slackify lives class Configuration attr_reader :custom_message_subtype_handlers, :slack_bot_token, :unhandled_handler, :custom_event_type_handlers attr_accessor :handlers, :slack_secret_token, :slack_client, :appro...
32.102564
115
0.716853