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
111fe0fa8c279c1e3f08bc221b7955fb03dde728
1,287
require 'yaml' module Koine class TestRunner class Builder def initialize(arguments) initialize_from_yaml_config(arguments.config_file) end def build TestRunner.new(@adapters) end private def initialize_from_yaml_config(config_file) config = YAML.loa...
23.833333
90
0.61927
bbe1939171a7b44d470537d4a19b41c1841f121c
6,978
#encoding: utf-8 class PhotosController < ApplicationController before_action :doorkeeper_authorize!, only: [:update], if: lambda { authenticate_with_oauth? } before_action :load_record, :only => [:show, :update, :repair, :destroy, :rotate] before_action :require_owner, :only => [:update, :destroy, :rotate] ...
32.607477
108
0.6274
217f1770302db83331812f5b1afa5f9a842ace7b
120
class AddStatusToFollow < ActiveRecord::Migration[5.1] def change add_column :follows, :status, :string end end
20
54
0.741667
e810b7e7e3e5eabd6a8c7fb847cd4e09621f7a6b
9,863
require 'spec_helper' RSpec.describe 'Stacks Request' do describe 'GET /v3/stacks' do before { VCAP::CloudController::Stack.dataset.destroy } let(:user) { make_user } let(:headers) { headers_for(user) } it 'returns 200 OK' do get '/v3/stacks', nil, headers expect(last_response.status).to...
29.707831
109
0.440028
6195308bdf12bc891ed2ae5b807b358a131d5dc1
916
Pod::Spec.new do |s| s.name = 'FontasticIcons' s.version = '0.2.1' s.summary = 'Objective-C wrapper for iconic fonts.' s.description = <<-DESC - [Entypo](http://entypo.com) pictograms by Daniel Bruce. - [FontAwesome](http://fortawesome.github.com/Font-A...
48.210526
106
0.590611
6a16f55f92a6a56c2aad1bd4beda50d183c0b27f
239
cask :v1 => 'faux-pas' do version :latest sha256 :no_check url 'http://api.fauxpasapp.com/download_latest' appcast 'http://api.fauxpasapp.com/appcast' homepage 'http://fauxpasapp.com' license :unknown app 'FauxPas.app' end
19.916667
49
0.707113
395a6f1ab98f82e2e4cd9cfb0227aff0951af286
2,182
# 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::Batch::Mgmt::V2018_12_01 module Models # # Model object. # # class CertificateBaseProperties include MsRestAzure ...
28.710526
79
0.539872
6ace21cf53b25fa187cae27b3059931fe159d8eb
367
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::DataMigration::Mgmt::V2018_04_19 module Models # # Defines values for ProjectTargetPlatform # module ProjectTargetPlatform SQLDB = "SQLD...
22.9375
70
0.711172
0320a0c8c3fe10b777617162d703aa76df22040d
359
# frozen_string_literal: true class PreviewComponentPreview < ViewComponent::Preview def default render(PreviewComponent.new(cta: "Click me!", title: "Lorem Ipsum")) end def without_cta render(PreviewComponent.new(title: "More lorem...")) end def with_content render(PreviewComponent.new(title: ...
22.4375
72
0.721448
61ec3c2a41ca54c2a2621ce84f46af636e837836
1,552
require 'test/unit' module ActionController; end class ActionController::Base attr_reader :action_name def self.process(req, res) new.process req, res end def process(req, res) params = req.parameters @action_name = params['action'] end def controller_class_name self.class.name.split(':...
16.510638
58
0.724227
7af994d1ba5f8603cdcb45c2acc4d774542e2735
1,851
#!/usr/local/bin/ruby # -*- coding: utf-8 -*- puts 1 + 2 # return 3 # <=> 联合比较运算符。如果第一个操作数等于第二个操作数则返回 0,如果第一个操作数大于第二个操作数则返回 1,如果第一个操作数小于第二个操作数则返回 -1。 puts 1 <=> 2 # return -1 # === 用于测试 case 语句的 when 子句内的相等。 puts (1..10) === 5 # return true # .eql? 如果接收器和参数具有相同的类型和相等的值,则返回 true。 puts 1 == 1.0 # true puts 1.eql?(1.0...
20.797753
81
0.662345
1ccec6595cbef86b834cd4fa2900b7b7a6255280
1,085
require 'utils/value_stringifier' module ActiveFlags class Flag < ApplicationRecord belongs_to :subject, polymorphic: true validates :subject, :key, :value, presence: true validates :key, uniqueness: { scope: :subject } after_save :notify_subject_flag_has_changed, if: proc { |flag| flag.saved_chang...
29.324324
101
0.700461
e2b2660ea71702d20fadd136252580e48cf56ad2
3,481
module Projects class DestroyService < BaseService include Gitlab::ShellAdapter DestroyError = Class.new(StandardError) DELETED_FLAG = '+deleted'.freeze def async_execute project.update_attribute(:pending_delete, true) job_id = ProjectDestroyWorker.perform_async(project.id, current_user...
32.839623
136
0.700948
e931966cca57bd7831adb258da2f0dc03afefe4c
1,335
# # YARV benchmark driver # require 'yarvutil' require 'benchmark' require 'rbconfig' def exec_command type, file, w <<-EOP $DRIVER_PATH = '#{File.dirname($0)}' $LOAD_PATH.replace $LOAD_PATH | #{$LOAD_PATH.inspect} require 'benchmark' require 'yarvutil' # print '#{type}' begin puts Benchmark.measure{...
16.280488
71
0.646442
d5d1a0169b1339d5a7214cf3c9f3942dbbc05dd0
5,869
# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative sou...
52.401786
104
0.544045
21f7cc037cfd9c587e2f1395d7b3be7aae1d8905
3,435
module AddPermissions module Permissions def self.included(base) base.extend ClassMethods end module ClassMethods def add_permissions before_create :creatable? before_save :updateable? before_destroy :destroyable? include AddPermissions::Perm...
25.072993
147
0.513828
3869d025813c73e6ecb1032bf507b78537642725
7,289
require 'spec_helper' describe "gitlab::gitlab_shell_install" do let(:chef_run) { ChefSpec::Runner.new.converge("gitlab::gitlab_shell_install") } describe "under ubuntu" do ["14.04", "12.04", "10.04"].each do |version| let(:chef_run) do runner = ChefSpec::Runner.new(platform: "ubuntu", version:...
35.21256
93
0.572232
b917cd9f17a6c2886cccfc5e3083b6eb788fa73b
846
class Torsocks < Formula homepage "https://gitweb.torproject.org/torsocks.git/" url "https://git.torproject.org/torsocks.git", :tag => "v2.0.0", :revision => "ea105bb76ea1e9f9660dd2307639b75ca6d76569" head "https://git.torproject.org/torsocks.git" bottle do sha1 "75a53b9a12c5f3b1dbcdfd659f9bdecf67...
28.2
77
0.676123
085ee77c09d6f679edc2a4bf54ebbb054776b7b0
13,225
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmat...
49.163569
154
0.751153
bf05b8f1ba7c50e3f1d7d2b5e4b5511fe28393b3
1,931
cask 'steelseries-engine' do version '3.17.0' sha256 '913620d8666cd8bdd48c00ab94c4ffb4d8cae2e4160f270bbb98cb02fbd9d116' # steelseriescdn.com was verified as official when first introduced to the cask url "https://downloads.steelseriescdn.com/drivers/engine/SteelSeriesEngine#{version}.pkg" appcast 'https://st...
48.275
173
0.626618
61497cd2030b1946d3d9c7bd85e9bd27b08f2548
74
class BienvenidoController < ApplicationController def index end end
8.222222
50
0.810811
26eadf465b2270925c2c9fe20d2f7be2564e24f6
8,352
require File.dirname(__FILE__) + '/test_helper' class TestRailsGenerator < Test::Unit::TestCase context "a rails generator with one empty goal" do setup do @app = App.new("foobar") @app.route :posts @generator = @app.generator(Rails) end should "have a generate method" do assert ...
39.961722
140
0.650263
e9d3a82ba15b3c6112c89816801b17a739cd7a57
3,150
class ProjectMember < Member SOURCE_TYPE = 'Project' include Gitlab::ShellAdapter belongs_to :project, class_name: 'Project', foreign_key: 'source_id' # Make sure project member points only to project as it source default_value_for :source_type, SOURCE_TYPE validates_format_of :source_type, with: /\AProj...
20.588235
86
0.653016
260b5cf0ade12dad42f6f38f30e89afc36a1ecc5
3,245
# frozen_string_literal: true require 'spec_helper' RSpec.describe Gitlab::Config::Entry::Factory do describe '#create!' do before do stub_const('Script', Class.new(Gitlab::Config::Entry::Node)) Script.class_eval do include Gitlab::Config::Entry::Validatable validations do ...
24.770992
120
0.557165
1a0f61463db0542e7b8d82176127bd32b2a8e3a4
1,664
class PaymentAddress < ActiveRecord::Base include Currencible belongs_to :account after_commit :gen_address, on: :create has_many :transactions, class_name: 'PaymentTransaction', foreign_key: 'address', primary_key: 'address' validates_uniqueness_of :address, allow_nil: true def gen_address payload ...
23.43662
116
0.686899
bf7f9f5db7b67553eb349937e349c8a9c70ac4d4
122
require 'rails_helper' RSpec.describe TopicNotification, type: :model do it { should validate_presence_of :topic } end
20.333333
49
0.786885
6ad52dfd8ff56da52a9df6dbfc897ad692570c61
279
class CreateCourses < ActiveRecord::Migration def self.up create_table :courses do |t| t.string :grade t.string :section t.string :code t.references :academic_year t.timestamps end end def self.down drop_table :courses end end
16.411765
45
0.65233
3853da35b8816e8c9500fefb45538fff39171638
629
# frozen_string_literal: true require "rails_helper" module WasteExemptionsEngine RSpec.describe RenewingRegistration, type: :model do describe "#workflow_state" do it_behaves_like "a postcode transition", previous_state: :site_grid_reference_form, address_type:...
31.45
78
0.631161
e87184480d259d3761032b21d4323e3652e02646
292
{ 'info' => { 'api_server' => '', 'api_username' => '', 'api_password' => '', 'space_slug' => '', 'enable_debug_logging' => 'true' }, 'parameters' => { 'error_handling' => 'Error Message', 'space_slug' => '', 'team_name' => 'Testing', } }
19.466667
41
0.458904
1c33d6b04278ed9ccf352da88445debc0e4f6556
1,666
module Bot module DiscordCommands # Urban Dictionary module Urban extend Discordrb::Commands::CommandContainer class UrbanDictionary::Definition def long_text? text.length > 1024 end def long_example? example.length > 1024 end end ...
32.038462
128
0.567827
ab776f909854ff65fa05ceaa8372730d8f9f7e5b
1,033
module CircuitSwitch class Configuration CIRCUIT_SWITCH = 'circuit_switch'.freeze attr_accessor :reporter, :due_date_notifier attr_writer :report_paths, :report_if, :due_date, :with_backtrace, :allowed_backtrace_paths, :strip_paths def report_paths @report_paths ||= [Rails.root] end d...
21.081633
109
0.668925
d5cce6308bf55b2ad4601aa4a7d33d5ccb9b1d27
5,595
module Bosh::Director module DeploymentPlan class RuntimeManifestParser include ValidationHelper def initialize(logger, deployment=nil) @deployment = deployment @logger = logger end def parse(runtime_manifest) parse_releases(runtime_manifest) parse_addons(...
38.061224
191
0.586774
d500c4717a4410119f9e9cd417778abdd593923d
18,639
describe User do context "validations" do it "should ensure presence of name" do expect(FactoryGirl.build(:user, :name => nil)).not_to be_valid end it "should ensure presence of user id" do expect(FactoryGirl.build(:user, :userid => nil)).not_to be_valid end it "should invalidate inc...
33.889091
112
0.620098
abf4c55fde61ec6066efe4aef4234277ff62b7a0
578
cask 'discord' do version '0.0.239' sha256 'a4a262322e98785273b5774ebfb054d89f0e8170be8bde55f086596f4d32191c' url "https://cdn.discordapp.com/apps/osx/#{version}/Discord.dmg" name 'Discord' homepage 'https://discordapp.com' license :gratis app 'Discord.app' zap delete: [ '~/Library/Ap...
30.421053
79
0.648789
bb936b44c51d28a15d431b5d5dd8eef95bccaa5a
647
cask 'futuniuniu' do version '10.4.642_202004131013' sha256 'f49aa27c4bdd0ae7f395e04e3539c713b97de871a0bd089eafd870d3ac5804a6' # software-file-1251001049.file.myqcloud.com/ was verified as official when first introduced to the cask url "https://software-file-1251001049.file.myqcloud.com/FTNNForMac_#{version}_w...
40.4375
106
0.769706
4ad2ffacb08ed91d39ac21a31ca421b4812c61e6
693
# # TeNOR - VNF Provisioning # # Copyright 2014-2016 i2CAT Foundation, Portugal Telecom Inovação # # 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...
34.65
74
0.76912
110f8c331ea5f8177c4d1c74532caa1afdc1a2fb
495
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Network::Mgmt::V2020_07_01 module Models # # Defines values for PcError # module PcError InternalError = "InternalErro...
24.75
70
0.70101
f86547660e385bbb1dbd2ec765e4fc277cc27779
259
module CollectionFilters class Engine < ::Rails::Engine isolate_namespace CollectionFilters config.generators do |g| g.test_framework :rspec g.fixture_replacement :factory_bot g.factory_bot dir: 'spec/factories' end end end
21.583333
41
0.718147
21e9ae73ed3e8fab4bc83ae07ee3e8bad2362e03
5,487
module Vidibus module Secure class Error < StandardError; end class KeyError < Error; end class InputError < Error; end class << self # Define default settings for random, sign, and crypt. def settings @settings ||= { :random => { :length => 50, :encoding => :base64 },...
33.87037
135
0.585566
6280191d74ffb0285d49b815cb108b5b8996ce91
173
Rails.application.config.middleware.use OmniAuth::Builder do provider :storenvy, ENV['STORENVY_KEY'], ENV['STORENVY_SECRET'] #, :scope => 'store_write user store_read' end
57.666667
108
0.774566
61d63ba3d58bc366e9c5106ed3c1ecbc9ba777d4
2,605
require_relative 'enumerable_enumeratorized' describe :enumerable_find, shared: true do # #detect and #find are aliases, so we only need one function before :each do ScratchPad.record [] @elements = [2, 4, 6, 8, 10] @numerous = EnumerableSpecs::Numerous.new(*@elements) @empty = [] end it "pass...
33.397436
82
0.663724
035ac0173051b11b5fe8ab13998de8d09893a8e5
155
class AddSlugsToUsers < ActiveRecord::Migration def change add_column :artists, :slug, :string add_index :artists, :slug, unique: true end end
22.142857
47
0.729032
1ce5ba6b5e367a80cb4cc082f21a3f67457b7800
5,645
#!/usr/bin/env ruby # Usage: # auto-style.rb [repo_path] [args...] require 'shellwords' require 'tmpdir' ENV['LC_ALL'] = 'C' class Git attr_reader :depth def initialize(oldrev, newrev, branch) @oldrev = oldrev @newrev = newrev @branch = branch with_clean_env do @revs = {} IO.popen([...
24.543478
141
0.573605
6a1748c2771ecd7c64fcbbe451647ada7f61a6c3
779
class MicropostsController < ApplicationController before_action :logged_in_user, only: [:create, :destroy] before_action :correct_user, only: :destroy def create @micropost = current_user.microposts.build(micropost_params) if @micropost.save flash[:success] = "Micropost created!" redirect_...
24.34375
65
0.711168
1a6398de69158f8c130f3f482f66cb635e7c9386
53,519
# encoding: UTF-8 RUBY_ENGINE = 'unknown' unless defined? RUBY_ENGINE RUBY_ENGINE_OPAL = (RUBY_ENGINE == 'opal') RUBY_ENGINE_JRUBY = (RUBY_ENGINE == 'jruby') RUBY_MIN_VERSION_1_9 = (RUBY_VERSION >= '1.9') RUBY_MIN_VERSION_2 = (RUBY_VERSION >= '2') require 'set' # NOTE RUBY_ENGINE == 'opal' conditional blocks are filt...
33.056825
202
0.5871
b92f33022d807a0789381755d64ae81505089be3
336
daniel = User.create! name: "daniel", password: "secret" daniel.tasks.create! name: "paint the fence" daniel.tasks.create! name: "wax the car" daniel.tasks.create! name: "sand the deck" ryanb = User.create! name: "ryanb", password: "secret" ryanb.tasks.create! name: "record some RailsCasts" ryanb.tasks.create! name: "...
37.333333
56
0.732143
bf1f7f0b2a728170d1e49ad6cc0868598ba5c355
575
require File.dirname(__FILE__) + '/../../spec_helper' describe "Bignum#>=" do before(:each) do @bignum = bignum_value(14) end it "returns true if self is greater than or equal to other" do (@bignum >= @bignum).should == true (@bignum >= (@bignum + 2)).should == false (@bignum >= 5664.2).should...
28.75
71
0.636522
abdb8615b413f2af24a0a8be90417dfbf3b708eb
195
# frozen_string_literal: true module RubyEventStore ::RSpec.describe Flipper do it "has a version number" do expect(RubyEventStore::Flipper::VERSION).not_to be nil end end end
19.5
60
0.728205
012b32bffa2abc816622e19fdfd70b009e79e445
139
class AddStatusToSolutions < ActiveRecord::Migration[5.0] def change add_column :solutions, :status, :integer, default: 0 end end
27.8
58
0.741007
79cfdca8fd462c85cafa3bf46dd73dd8b37f4b0a
1,372
# Encoding: utf-8 # # This is auto-generated code, changes will be overwritten. # # Copyright:: Copyright 2013, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # # Code generated by AdsCommon library 0.9.6 on 2014-08-12 14:22:33. require 'ads_common/savon_service' require '...
29.191489
77
0.739796
3392f55db09df7847e311a2b88094d62df07748a
2,193
require 'test_helper' class UserTest < ActiveSupport::TestCase # test "the truth" do # assert true # end def setup @user = User.new(name: "Example User", email: 'user@example.com', password: 'foovar', password_confirmation: 'foovar') end test "should be valid" do assert @user.valid? end ...
28.855263
122
0.677611
f726f0896dc3171bf70baa41e748d47f70c10f98
2,286
# -------------------------------------------------------------------------- # # Copyright 2002-2020, OpenNebula Project, OpenNebula Systems # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # no...
38.1
94
0.500437
871ad1e80d78f5df85ef36cb2ca2a77b510caf3b
75
Rails.application.routes.draw do mount CasPer::Engine => "/cas_per" end
15
36
0.733333
6a7811e9e8858d1d4c118ad26bbbddbbbaa8e36c
489
class CreateSpreePartLots < ActiveRecord::Migration def change create_table :spree_part_lots do |t| t.integer :assembly_lot_id, null: false, index: true t.integer :part_lot_id, null: false, index: true t.integer :parent_id, null: true, index: true t.integer :lft, null: false, index: true ...
34.928571
58
0.678937
4a537383be7866cdac33a33bf332d21f2ff8a323
1,995
module Fastlane::Actions describe 'QuitCoreSimulatorServiceAction' do describe '#run' do it 'does nothing if CoreSimulatorService is not running' do allow(Fastlane::Actions).to receive(:sh).and_return('') config = FastlaneCore::Configuration.create( QuitCoreSimulatorServiceAction....
33.813559
108
0.639599
7abce1616f5c99c9c9529fb823518639074667fa
867
# Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "." # css_dir = "stylesheets" # sass_dir = "sass" # images_dir = "images" # javascripts_dir = "javascripts" # You can select your preferred output style here (can be overridden via the command line): # out...
34.68
96
0.748558
4adf6f8c8b3da20a4227508783dc6f068f638f2d
8,159
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # web site for more information on licensing and terms of use. # http://metasploit.com/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank ...
34.572034
90
0.595416
ff137a46345c8484adc87516be44ecc00647212e
389
# Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attac...
48.625
69
0.784062
089cf397499ea661fb3dead0c864d023fdaf1654
2,785
class CreateReports < ActiveRecord::Migration def self.up create_table "reports" do |t| t.string "source", :limit => 3 # Short string to identify source; needed for uniqueid validation t.integer "reporter_id" t.integer "location_id" t.string "uniqueid", :limit =>...
37.133333
118
0.609695
267788d2a4e6c286ea23e43d008cbcc66c8908b2
436
class CreatePreneedSubmissions < ActiveRecord::Migration def change create_table :preneed_submissions do |t| t.string :tracking_number, null: false t.string :application_uuid, null: true t.string :return_description, null: false t.integer :return_code, null: true t.timestamps null: ...
27.25
56
0.706422
0350e731c3a31f04d4683fec629e00ce943d1027
2,748
# frozen_string_literal: true module Neo4j::Driver module Internal module Retry class ExponentialBackoffRetryLogic include Ext::ExceptionCheckable DEFAULT_MAX_RETRY_TIME = 30.seconds INITIAL_RETRY_DELAY = 1.second RETRY_DELAY_MULTIPLIER = 2.0 RETRY_DELAY_JITTER_FACT...
33.925926
115
0.60917
aba33840ac6516a373da76fa7318de1486db134d
6,153
# == Schema Information # # Table name: current_route_stop_patterns # # id :integer not null, primary key # onestop_id :string # geometry :geography({:srid geometry, 4326 # tags :hstore # stop_p...
35.982456
185
0.708435
6264aa1d1ebaa2bb41e998f8c945c55911ece6ed
858
# encoding: utf-8 require File.expand_path('../../../spec_helper.rb', __FILE__) describe Backup::Configuration::Compressor::Gzip do before do Backup::Configuration::Compressor::Gzip.defaults do |compressor| compressor.best = true compressor.fast = true end end after { Backup::Configuration::...
28.6
68
0.70979
f855a5723efd267d8d75b70861495e8d412128c6
581
#!/usr/bin/env ruby -w require 'rmagick' # Demonstrate the annotate method Text = 'RMagick' granite = Magick::ImageList.new('granite:') canvas = Magick::ImageList.new canvas.new_image(300, 100, Magick::TextureFill.new(granite)) text = Magick::Draw.new text.pointsize = 52 text.gravity = Magick::CenterGravity text.a...
18.741935
60
0.70568
11758c7be601cc677d39bd7f4ebd7ecfeb835a99
1,415
require "test/unit" class BSTTest < Test::Unit::TestCase def test_bst assert_equal(nil, BST.new.get("a")) assert_equal(1, BST.new.add_all({"a" => 1, "b" => 2}).get("a")) bst = BST.new.add_all({"a" => 1, "b" => 2, "c" => 3}) assert_equal(1, bst.get("a")) assert_equal(2, bst.get("b")) assert_...
20.214286
69
0.542756
e85c97ad16e638cfe017b063d40bcda06c8ea3cc
426
Rails.application.routes.draw do resources :friendships, only: [:new, :create] resources :messages resources :sessions, only: [:new, :create] resources :users root 'home#index' delete 'log_out' => 'sessions#destroy' get 'all_friends' => 'users#all_friends' delete 'unfriend' => 'friendships#destroy' g...
32.769231
54
0.713615
1ddf7e7fe330603bb1c40f86e7c33822349a529e
4,349
# 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::Consumption::Mgmt::V2019_06_01 module Models # # The notification associated with a budget. # class Notification incl...
31.064286
79
0.464705
ac61ded99ac9a63ab85a1a31a8ba9c4f04519ac2
2,380
namespace :data_requests do # UUIDS=123abc,456def rake data_requests:lookup_users_by_device desc 'Recursively lookup users using a network of shared devices' task lookup_users_by_device: :environment do ActiveRecord::Base.connection.execute('SET statement_timeout = 0') uuids = ENV.fetch('UUIDS', '').spli...
41.754386
99
0.735714
e86b09f156d95775cd21782ccd519d34bde27006
560
# frozen_string_literal: true require "spec_helper" describe GraphQL::StaticValidation::FragmentTypesExist do include StaticValidationHelpers let(:query_string) {" fragment on Cheese { id flavor } "} it "finds non-existent types on fragments" do assert_equal(1, errors.length) frag...
23.333333
74
0.673214
ffe6a79f68e0ef247fd36461c3a298daf19f678b
224
class CreateAccountBooks < ActiveRecord::Migration def change create_table :account_books do |t| t.references :account t.references :book t.string :lean_pub_link t.timestamps end end end
18.666667
50
0.6875
1cccc3d7dd34ccd2b4ac0d40d44c5b872c2064a2
1,593
require 'orm_adapter' module Ckeditor IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/jpg', 'image/pjpeg', 'image/tiff', 'image/x-png'] autoload :Utils, 'ckeditor/utils' autoload :Http, 'ckeditor/http' module Helpers autoload :ViewHelper, 'ckeditor/helpers/view_helper' autoload :For...
30.056604
113
0.711237
619a58cc77f81b8c6acd9dc371fffefb6d939b6f
1,096
cask 'filezilla' do if MacOS.version <= :snow_leopard version '3.8.1' sha256 '86c725246e2190b04193ce8e7e5ea89d5b9318e9f20f5b6f9cdd45b6f5c2d283' else version '3.24.0' sha256 '6f57b0c91d0f20d545cd854855d35dcb1b088bc9e2c73cfaca4984bda93df5a9' end # sourceforge.net/filezilla was verified as officia...
42.153846
144
0.730839
1c0158d81ba29c254ba093b2870e184f49d4b966
1,080
# == Schema Information # # Table name: visits # # id :integer not null, primary key # visit_token :string # visitor_token :string # ip :string # user_agent :text # referrer :text # landing_page :text # user_id :integer # referring_domain ...
25.116279
59
0.587037
3375883e6ff7aaa76ba387f3d731add3dab2579c
329
module Ecm::Meta module Generators class GuardRspecGenerator < Rails::Generators::Base desc 'Installs Guard Rspec' def add_to_application_gemfile append_file 'Gemfile.application', "\ngem 'guard-rspec', group: :development" %x(bundle install) %x(guard init) end end ...
23.5
85
0.662614
6a42379e7c641f9f36117d3bda34546559d60c83
2,071
require 'loghouse_query/parsers' require 'loghouse_query/storable' require 'loghouse_query/pagination' require 'loghouse_query/clickhouse' require 'loghouse_query/permissions' require 'loghouse_query/csv' require 'log_entry' require 'log' class LoghouseQuery include Parsers include Storable include Pagination ...
23.534091
127
0.691453
79c87abc043ff23820658b51a14fff4457adf0f6
1,361
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::MediaServices::Mgmt::V2018_06_01_preview module Models # # Represents a ContentKeyPolicyRestriction that is unavailable in the # current API versi...
26.686275
81
0.602498
03ab1e85413d55e16c2ecdabe9f4dbe486bd6952
33,370
require 'test_helper' module Pd::Application class Teacher1819ApplicationTest < ActiveSupport::TestCase include Pd::Teacher1819ApplicationConstants include ApplicationConstants include RegionalPartnerTeacherconMapping freeze_time test 'application guid is generated on create' do teacher_a...
41.350682
150
0.723374
6a9a80f5adfd85a7feda097b1d398cd57ab96673
2,732
# encoding: utf-8 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. require 'rspec' require 'ms_rest_azure' module MsRestAzure describe MSITokenProvider do it 'should throw error if nil data is passed into ...
41.393939
171
0.739019
622037a2338d49b5b32e51c75a4f4d81528c280b
1,194
# # Cookbook Name:: xs_maintenance # Recipe:: hotfix-XS62ESP1004 # # Copyright (C) 2014 Todd Pigram # # 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/LICEN...
30.615385
105
0.735343
ff4a39a77e9d30cb5808a6d7911ffc173b03aa2c
1,320
require_relative 'lib/slack_app/version' Gem::Specification.new do |spec| spec.name = "slack_app" spec.version = SlackApp::VERSION spec.authors = ["Gerry Larios"] spec.email = ["gerardo.larios69@gmail.com"] spec.summary = %q{A Ruby wrapper for the Slack Api. Block kit incl...
41.25
87
0.661364
e8c69ae8546bc33788410d6b03fa9340a8caf1d6
837
require_dependency "hasura_handler/application_controller" module HasuraHandler class AuthHookController < ApplicationController def get_mode @headers = clean_headers authenticate end def post_mode @headers = raw_params['headers']. to_h. map{ |k,v| [standardize_header(k...
20.925
88
0.630824
6ac9aa2fedec2214484c0bc13aac15503c07a8b5
763
execute 'apt-get update' if platform_family?('debian') splunk_app 'bistro' do splunk_auth 'admin:notarealpassword' cookbook_file 'bistro-1.0.2.spl' checksum '862e2c4422eee93dd50bd93aa73a44045d02cb6232f971ba390a2f1c15bdb79f' action [:install, :enable] end splunk_app 'bistro-disable' do app_name 'bistro' sp...
25.433333
77
0.771953
6ae9a1bbdce7d5f538a8a349be601b69a0f78514
1,433
require "shogi_koma/painter" require "cairo" class PainterTest < Test::Unit::TestCase def setup @painter = ShogiKoma::Painter.new end class SetFontTest < self def test_found part_of_name = "M" assert_match(/#{part_of_name}/, @painter.set_font(part_of_name)) end def test_not_found ...
22.390625
70
0.667132
bb266d406e50390afb9371c5a20b772f2d4d252f
85
require "airesis_i18n/engine" require "airesis_i18n/version" module AiresisI18n end
14.166667
30
0.835294
ff0482067332996a89b61ed85cff872539c4f3b3
171
module Payments class NotUsersFriendshipError < StandardError def initialize(msg = I18n.t('api.errors.payments.not_users_friendship')) super end end end
21.375
76
0.74269
7a8a48b62c3c3331b2c0fa2c9719b772b3fe85e3
458
cask 'musescore' do version '2.0.3.1' sha256 'a166a21bf6259331a42b3a5ed73cfb69f653095a27a676fbf94a747d98153b29' # ftp.osuosl.org/pub/musescore was verified as official when first introduced to the cask url "https://ftp.osuosl.org/pub/musescore/releases/MuseScore-#{version.major_minor_patch}/MuseScore-#{version...
32.714286
117
0.759825
f85422d032aef5a711d8efb024b1855465e1acb5
2,027
require('rspec') require('word_freq') describe('String#word_freq') do it('will return 1 if the word the method is called on is the same as the word given as the argument') do expect('path'.word_freq('path')).to(eq(1)) end it('will return 0 if the word the method is called on is not the same as the word given...
61.424242
160
0.71929
613dca130a0016ee1b768b675804d0d4cf8aa549
851
# Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "/" css_dir = "css/generated" sass_dir = "scss" images_dir = "img" javascripts_dir = "js" # You can select your preferred output style here (can be overridden via the command line): # output_style = :expan...
34.04
96
0.749706
5de980519a553098419ef76e0fb15e46c9363bc3
4,005
Pod::Spec.new do |s| s.name = 'Parse' s.version = '1.11.0' s.license = { :type => 'Commercial', :text => "See https://www.parse.com/about/terms" } s.homepage = 'https://www.parse.com/' s.summary = 'Parse is a complete technology stack to power your app\'s backen...
46.569767
115
0.485643
d59dbfc32abfe523453e3d67c421c1e4cd5caaba
47
module UpdateInBatches VERSION = "0.0.2" end
11.75
22
0.723404
1a1079fd8a0264e0f66cc61d3ddf3bf6d1c2d7b0
966
ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' require 'rails/test_help' require "minitest/reporters" Minitest::Reporters.use! class ActiveSupport::TestCase # Run tests in parallel with specified workers parallelize(workers: :number_of_processors) # Setup all fixtures in test/fixtures/*.ym...
25.421053
82
0.674948
7a90244a3622c3083ffb62868a03c01b82c38aa1
13,578
module Axlsx # XML Encoding ENCODING = "UTF-8".freeze # spreadsheetML namespace XML_NS = "http://schemas.openxmlformats.org/spreadsheetml/2006/main".freeze # content-types namespace XML_NS_T = "http://schemas.openxmlformats.org/package/2006/content-types".freeze # extended-properties namespace APP_NS...
34.030075
201
0.745986
91a6ad1f178d64cec805a8f72e5b71d6e3b83d10
205
class RemoveTwitterHandleFromCongressMembers < ActiveRecord::Migration[5.1] def change remove_columns :congress_members, :twitter_handle, :twitter_picture_url, :member_profile_response_api end end
34.166667
105
0.834146
01cbba229deefe037f24828dd34d4b9f6a77d8a6
2,568
#simplest ruby program to read from arduino serial, #using the SerialPort gem #(http://rubygems.org/gems/serialport) require "serialport" #params for serial port port_str = "COM3" #may be different for you baud_rate = 115200 data_bits = 8 stop_bits = 1 parity = SerialPort::NONE $port = SerialPort.new(port_str, bau...
20.380952
74
0.408879
e2b8898d05180b37059b42f93f1611ed2806cb37
823
module Spree module ParanoiaDeprecations def paranoia_destroy Spree::Deprecation.warn <<-WARN.strip_heredoc, caller Calling #destroy (or #paranoia_destroy) on a #{self.class} currently performs a soft-destroy using the paranoia gem. In Solidus 3.0, paranoia will be removed, and this will per...
41.15
144
0.714459
62e0d711bb9b5c6ee6919500ee46e39eb9007549
4,606
# frozen_string_literal: true require 'spec_helper' RSpec.describe Projects::Integrations::Jira::IssuesFinder do let_it_be(:project, refind: true) { create(:project) } let_it_be(:jira_service, reload: true) { create(:jira_service, project: project) } let(:params) { {} } let(:service) { described_class.new(pr...
33.136691
141
0.594225
6288673ca68ced24731eade827ec4ab6a9c51b4f
1,710
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
38.863636
86
0.730409
5de5339b70e6a3d30b8413703f069beee8cef3e5
6,057
require './spec/support/sidekiq' class Gitlab::Seeder::Pipelines STAGES = %w[build test deploy notify] BUILDS = [ # build stage { name: 'build:linux', stage: 'build', status: :success, queued_at: 10.hour.ago, started_at: 9.hour.ago, finished_at: 8.hour.ago }, { name: 'build:osx', stage: 'build', ...
31.878947
93
0.666832
6ad6212198dd2ab7b6f7c4b496db49849e847240
573
require "spec_helper" require_relative "../lib/adyen/errors" RSpec.describe AdyenOfficial::Payments, service: "recurring service" do # client instance to be used in dynamically generated tests client = create_client(:basic) # methods / values to test for # format is defined in spec_helper test_sets = [ ...
31.833333
76
0.720768
5d35246c26474bd916f8847833282ea4f6bf739b
42
module Mkswapfile VERSION = "0.1.1" end
10.5
19
0.690476