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
036b6dcb32b06df876ecddbf2973587b86a6761f
71
d_hash = { :name => "Grey", :age => 28 } puts d_hash puts d_hash[:age]
17.75
40
0.591549
bb266f62aca40b738c4991242cedbf7b970e1dbd
1,403
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads/v4/resources/ad_group_extension_setting.proto require 'google/protobuf' require 'google/ads/google_ads/v4/enums/extension_setting_device_pb' require 'google/ads/google_ads/v4/enums/extension_type_pb' require 'google/api/field_be...
40.085714
162
0.774056
263014d229df2dadf11c3bdb372beda86a40db98
12,725
# # Author:: Daniel DeLeo (<dan@kallistec.com>) # Copyright:: Copyright (c) 2008 Opscode, 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 # # ...
41.584967
153
0.632456
08a0a66ededce532b694d82f4ae934bcca1489fc
2,361
module CruiseControl class CruiseControl::Configuration @default_polling_interval = 20.seconds @sleep_after_build_loop_error = 30.seconds @build_request_checking_interval = 5.seconds @dashboard_refresh_interval = 30.seconds @dashboard_url = nil @email_from = 'cruisecontrol@thoughtworks.com' ...
31.48
158
0.695044
26e2f1e3ea0277cb04d804243e059945c48d0849
15,190
# frozen_string_literal: true # Assuming you have not yet modified this file, each configuration option below # is set to its default value. Note that some are commented out while others # are not: uncommented lines are intended to protect your configuration from # breaking changes in upgrades (i.e., in the event that...
48.685897
154
0.752535
03a7cf249cf3627551cc56652edf80bcffc3c736
2,668
shared_context 'simple_check' do |metrics_prefix, check_name, success_result| describe '#metrics' do subject { described_class.metrics } context 'Check is passing' do before do allow(described_class).to receive(:check).and_return success_result end it { is_expected.to include(have_...
37.055556
143
0.69078
1ae7ea9f25fb5e8a6d325f39a8fc027be0236cbd
1,807
HEADERS = %w[domain id name code registrar].freeze namespace :contacts do desc 'Starts collect invalid validation contacts' task scan_org: :environment do contacts = [] Contact.where(ident_type: 'org').each do |contact| contacts << contact unless checking_contacts(contact) end contacts.sele...
24.753425
85
0.73658
8752da0f77aa5f1928d4dcce2b687796049b258c
9,808
module ActiveMerchant #:nodoc: module Billing #:nodoc: class BarclaysEpdqGateway < Gateway TEST_URL = 'https://secure2.mde.epdq.co.uk:11500' LIVE_URL = 'https://secure2.epdq.co.uk:11500' self.supported_countries = ['GB'] self.default_currency = 'GBP' self.supported_cardtypes = [:vis...
31.7411
108
0.533442
d5b1a0b2ce18ff9db2ea4a6fcb5bedc35b412331
1,660
# 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::Storage::Mgmt::V2017_10_01 module Models # # The response from the ListKeys operation. # class StorageAccountListKeysResult ...
28.62069
75
0.528916
01a1397bc6a16030ab87174de81898d7a1f4a3f4
154
module EventsHelper def link_to_map title, address link_to h(title), "http://maps.google.com/maps?q=#{url_encode address.gsub(/\s/,' ')}" end end
25.666667
90
0.694805
5d84f4c934195710bdba1817ad4b7a1a539c66e0
1,965
class UsersController < ApplicationController # GET /users # GET /users.json def index ActiveSupport::Deprecation.warn("from index page") @users = User.all respond_to do |format| format.html # index.html.erb format.json { render json: @users } end end # GET /users/1 # GET /use...
22.329545
83
0.617303
e21299705a7fb985ef222e432a82c324291146da
15,553
require "rubygems" require "bundler" require "shellwords" require "set" module GemfileUtil # # Adds `override: true`, which allows your statement to override any other # gem statement about the same gem in the Gemfile. # def gem(name, *args) options = args[-1].is_a?(Hash) ? args[-1] : {} # Unless we...
39.777494
168
0.630168
28232d8c7697db1302e5344292d70d4d99f30f99
134
# frozen_string_literal: true FactoryBot.define do factory :architecture do platform name { Faker::Lorem.word } end end
13.4
30
0.716418
1c96e6769acc76914ca55d17b50b82eab7bf9b18
11,003
=begin * Puppet Module : Provder: netdev * Author : Jeremy Schulman * File : junos_l2_interface.rb * Version : 2012-11-07 * Platform : EX | QFX | SRX * Description : * * This file contains the Junos specific code to control basic * Layer 2 interface configuration on platforms tha...
32.553254
104
0.574389
f863c0f999f6ec15e10f1c0c90fad870a8ca02c0
365
# encoding: utf-8 require 'capybara/rspec' require 'capybara/rails' module TestServer module SpecHelper module Capybara include ::Capybara::DSL end end end RSpec.configure do |c| c.include TestServer::SpecHelper::Capybara c.before(:all) do Capybara.default_driver = :rack_test Capybara...
17.380952
45
0.720548
3305b1bd4260a4c58c26031ad58a7cfbd645f5a9
1,863
require 'rails_helper' describe Users::OmniauthCallbacksController, type: :controller do describe '#twitter' do let(:twitter_auth_hash) { OmniAuth.config.mock_auth[:twitter] } let(:github_auth_hash) { OmniAuth.config.mock_auth[:github] } let(:user) { build(:user) } let(:invitation) { build(:invitati...
32.684211
91
0.697262
0857c784b416cfe7b1ae4acd72dad32e6fe0428d
967
# This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause this # file to always be loaded, without a need to explicitly require ...
53.722222
92
0.770424
26823f96c59400365354f33b6720b5535074d234
23,763
# frozen_string_literal: true require 'spec_helper' require 'bolt_spec/bolt_server' require 'bolt_spec/conn' require 'bolt_spec/file_cache' require 'bolt_server/config' require 'bolt_server/transport_app' require 'json' require 'rack/test' require 'puppet/environments' require 'digest' describe "BoltServer::Transport...
36.004545
118
0.581703
5d2195e5cc8e8c6899cbd6734b4e26e06fe51f98
1,306
class TestMapScreen < PM::MapScreen attr_accessor :infinite_loop_points start_position latitude: 35.090648651123, longitude: -82.965972900391, radius: 4 title "Gorges State Park, NC" def get_title self.title end def promotion_annotation_data @promotion_annotation_data end def annotation_dat...
25.115385
117
0.662328
212d319f0eb87d43c9c0d91bbe75b2588d3ee7d2
4,967
module Windows module ServiceConstants SC_MANAGER_ALL_ACCESS = 0xF003F SC_MANAGER_CREATE_SERVICE = 0x0002 SC_MANAGER_CONNECT = 0x0001 SC_MANAGER_ENUMERATE_SERVICE = 0x0004 SC_MANAGER_LOCK = 0x0008 SC_MANAGER_MODIFY_BOOT_CONFIG = 0x0020 SC_MANAGER_QUERY...
34.493056
55
0.674854
01bcdeac9775c353329ad3302ac913aa77ca5134
551
# == Schema Information # # Table name: provider_item_images # # id :integer not null, primary key # provider_item_id :integer not null # imagen :string not null # created_at :datetime not null # updated_at :datetime not null # class ...
23.956522
59
0.618875
f81620a338718f6285e0822728a59143c4a8a17b
478
module Worker class EmailNotification def process(payload, metadata, delivery_info) payload.symbolize_keys! set_locale(payload) mailer = payload[:mailer_class].constantize action = payload[:method] args = payload[:args] message = mailer.send(:new, action, *args).message ...
19.12
56
0.654812
1a341bdbdebb8daedd11537e9711c9b5080bcbc8
1,025
cask "amethyst" do if MacOS.version <= :el_capitan version "0.10.1" sha256 "9fd1ac2cfb8159b2945a4482046ee6d365353df617f4edbabc4e8cadc448c1e7" url "https://ianyh.com/amethyst/versions/Amethyst-#{version}.zip" else version "0.15.5" sha256 "a3d39e9c36ff13ac6f7e0c656c741acd285124ef53a03264fe03efc590...
31.060606
142
0.742439
79248fcd40fca434a49d609567978b2289c9c40a
1,110
# frozen_string_literal: true module Curator module DescriptiveFieldSets extend Curator::NamespaceAccessor IDENTIFIER_TYPES = %w(local-accession local-other local-call local-barcode iiif-manifest internet-archive isbn ismn isrc issn issue-number lccn matrix-number music-plate music...
44.4
139
0.684685
4a8987be12357b15d35a4b398237e36773071dee
987
# frozen_string_literal: true module UiRules class BinLoadPurposeRule < Base def generate_rules @repo = RawMaterialsApp::BinLoadRepo.new make_form_object apply_form_values common_values_for_fields common_fields set_show_fields if %i[show reopen].include? @mode form_name 'bi...
21.933333
63
0.625127
abee7002aab9a3bba1f0cdf1468e00c657849491
187
class AddUserAndPostRefToLikes < ActiveRecord::Migration[5.2] def change add_reference :likes, :user, foreign_key: true add_reference :likes, :post, foreign_key: true end end
26.714286
61
0.754011
bf1f2bae7daef66d6a1b9936f810bd6dbcec0239
10,848
# frozen_string_literal: true require 'spec_helper' RSpec.describe Gitlab::Ci::Ansi2html do subject { described_class } it "prints non-ansi as-is" do expect(convert_html("Hello")).to eq('<span>Hello</span>') end it "strips non-color-changing control sequences" do expect(convert_html("Hello \e[2Kworl...
35.220779
192
0.655697
3966b646829b93b6b14e26ead28991290d891024
1,972
# Generated by jeweler # DO NOT EDIT THIS FILE DIRECTLY # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec' # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = "git_fetcher" s.version = "0.2.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_ruby...
30.338462
105
0.625254
ff9e2403754be180e7157a853f17a486fe2375c2
253
class User < ActiveRecord::Base has_secure_password has_many :donations has_many :charities validates :username, presence: true, uniqueness: true, length: {minimum: 5} validates :password, presence: true, length: {minimum: 6} end
28.111111
79
0.715415
f84b618060b676b5b9998f64a0e818249d430ce0
3,737
# frozen_string_literal: true describe 'GraphQL API Query' do describe 'searchEpisodes' do let!(:work) { create(:work, :with_current_season) } let!(:episode1) { create(:episode, work: work, sort_number: 1) } let!(:episode2) { create(:episode, work: work, sort_number: 3) } let!(:episode3) { create(:ep...
25.59589
87
0.385871
2651403a0fe085ceed5df4daccf1dce3a8f84143
38
module Qcloud VERSION = "0.1.0" end
9.5
19
0.657895
33a283187d8f57b2d4748b0d7020bf2ef086d5fb
2,353
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web serv...
35.119403
87
0.759881
610b05523aa5f1789e862685cf0dae8fd7d2e0f5
1,668
require 'spec_helper' RSpec.describe "Creates a new project with default configuration" do before(:all) do drop_dummy_database remove_project_directory run_kerosene setup_app_dependencies end it "uses custom Gemfile" do gemfile_file = IO.read("#{project_path}/Gemfile") expect(gemfile_fil...
23.828571
71
0.684652
1dfbf551eca7d96ec1e7887f81c0220372583261
1,301
class Nanomsgxx < Formula desc "Nanomsg binding for C++11" homepage "https://achille-roussel.github.io/nanomsgxx/doc/nanomsgxx.7.html" url "https://github.com/achille-roussel/nanomsgxx/archive/0.2.tar.gz" sha256 "116ad531b512d60ea75ef21f55fd9d31c00b172775548958e5e7d4edaeeedbaa" revision 1 bottle do cel...
28.911111
93
0.679477
392b4047dfd10bc9494cc8d909d53f0794835e21
94
require 'test_helper' class QuickComplimentsComplimentsHelperTest < ActionView::TestCase end
18.8
66
0.861702
5d62be34de188d5f232642b692bba1d131e5e979
1,778
#-- # Copyright (c) 2011 Scott Steadman, Michael Berkovich, Geni Inc # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, c...
33.54717
91
0.730034
ffe7ed57a09f634ff2b2593fe3012352e3fea6ee
2,620
# frozen_string_literal: true require "project_types/script/test_helper" describe Script::Layers::Application::BuildScript do include TestHelpers::FakeFS describe ".call" do let(:language) { "assemblyscript" } let(:extension_point_type) { "discount" } let(:script_name) { "name" } let(:op_failed_ms...
34.025974
110
0.64771
1cf5e920641ac98e7fa4ff973b5cbc1875b4d026
1,344
class Ey::Core::Client class Real def get_users(params={}) query = Ey::Core.paging_parameters(params) url = params.delete("url") request( :params => params, :path => "/users", :query => query, :url => url, ) end end # Real class Mock def...
31.255814
131
0.473958
b9919095a06fbe6e47ddbe83630cb97d15292c6f
7,467
require 'spreedly/common' require 'httparty' raise "Mock Spreedly already required!" if defined?(Spreedly::MOCK) =begin rdoc Provides a convenient wrapper around the http://spreedly.com API. Instead of mucking around with http you can just Spreedly.configure and Spreedly::Subscriber.find. Much of the functionality is...
33.186667
205
0.655417
089350ae355cf594ccf29d73adc4226f4bcee956
513
module Bookafy class Company < BaseService def initialize super end def uri 'company' end def info() response = get(uri) unless response.code == 200 return nil end response_json = JSON.parse(response.body)['response'] company_json = response_js...
17.689655
59
0.604288
26d10d64af4f8a3bc629ff5c987e7f293ace7c9a
1,178
class Gsoap < Formula desc "SOAP stub and skeleton compiler for C and C++" homepage "https://www.genivia.com/products.html" url "https://downloads.sourceforge.net/project/gsoap2/gsoap-2.8/gsoap_2.8.109.zip" sha256 "27de421db6f8abfc443f2e1d5ccdcbd7e6373095b2c72df2b17f50a9c5f80d14" license any_of: ["GPL-2.0-or-...
31
90
0.712224
621285f496c192b3ba14d3cba919684419f9f6c0
249
puts "Enter a color: " color = gets.chomp() puts "Enter a plural noun: " plural_noun = gets.chomp() puts "Enter a celebrity: " celebrity = gets.chomp() s puts ("Roses are " + color) puts ( plural_noun + " are blue") puts ("I admire " + celebrity)
19.153846
33
0.666667
7a9bbbc19d04b7232967c15e89048cdb75b671a8
2,333
# frozen_string_literal: true module Cards class WorkCardComponent < ApplicationV6Component def initialize(view_context, work:, width:, show_button: true, show_note: false, user: nil, caption: "", note: "") super view_context @work = work @width = width @show_button = show_button @s...
32.402778
118
0.497214
2686738f57d40c4efe771b5b810062303134b7f9
1,143
module Bretels module Actions def concat_file(source, destination) contents = IO.read(find_in_source_paths(source)) append_file destination, contents end def replace_in_file(relative_path, find, replace) path = File.join(destination_root, relative_path) contents = IO.read(path) ...
31.75
82
0.64392
bb8016506e9060d6f07cdb7c781e41299101214a
87
class CommentSerializer < ActiveModel::Serializer attributes :id, :author, :text end
21.75
49
0.781609
d534ed1be2c14bf3a541e81a2c1d20bf62465204
3,690
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::DataFactory::Mgmt::V2017_09_01_preview module Models # # Google BigQuery service dataset. # class GoogleBigQueryObjectDataset < Dataset ...
29.758065
75
0.423848
2171e2cd9f7a1a8da431820430c0c4338058d23a
1,071
require 'rails_helper' FactoryBot.define do factory :user do first_name { "John" } last_name { "Doe" } username { "John_Doe"} is_admin { false } password {"VeryStrongPassword123"} email {"something@outlook.com"} end end RSpec.describe User, type: :model do id = 1, username = "Attribu...
24.906977
150
0.686275
28604f7005fb8895e7e2ffee11262937f2f7eae6
964
module Dom module Admin class UserForm < Domino selector 'form.user' def submit_with(options) within(node) do fill_in('user_email', :with => options[:email]) if options[:email] fill_in('user_first_name', :with => options[:first_name]) if options[:first_name] fill...
34.428571
119
0.610996
39491a4f5e37ff1d969e17714f5669356a0c549f
5,714
require 'watir' class CompaniesController < ApplicationController before_action :set_company, only: [:show, :edit, :update, :destroy] # GET /companies # GET /companies.json def index @companies = Company.paginate(:page => params[:page], :per_page => 5).search(params[:search]) #where(["Description LI...
31.744444
162
0.623906
08e92804a0266b1d3a205b3efcb2c5b215a3fef5
9,148
# coding: utf-8 module Natto # Module `Binding` encapsulates methods and behavior # which are made available via `FFI` bindings to MeCab. module Binding require 'ffi' require 'rbconfig' extend FFI::Library MECAB_PATH = 'MECAB_PATH'.freeze # @private def self.included(base) ba...
34.520755
97
0.669327
f876b942b1ff9dd2c8b2df097cf097696b4519d0
5,160
# require_relative '../puppet_x/Automation/Lib/Constants.rb' # require_relative '../puppet_x/Automation/Lib/Log.rb' # require_relative '../puppet_x/Automation/Lib/Remote/c_rsh.rb' # # ############################################################################## # name : 'vios' factor # param : none # return : hash of...
36.595745
103
0.516473
6a2e5ef9a84c1535d9bfc7fe7525c40753dba8ce
5,119
require 'spec_helper' require 'metasploit/framework/login_scanner/manageengine_desktop_central' RSpec.describe Metasploit::Framework::LoginScanner::ManageEngineDesktopCentral do it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: false it_behaves_like 'Metaspl...
32.814103
127
0.650713
212a7a06ba5ca0380b716208e3408c746520e86c
54
module Salesforce class CaseStatus < Base end end
10.8
25
0.759259
1aefde1f5cb44fd65ed0a598ea4c8d29fb78be10
4,770
class Gitless < Formula include Language::Python::Virtualenv desc "Simplified version control system on top of git" homepage "https://gitless.com/" url "https://files.pythonhosted.org/packages/9c/2e/457ae38c636c5947d603c84fea1cf51b7fcd0c8a5e4a9f2899b5b71534a0/gitless-0.8.8.tar.gz" sha256 "590d9636d2ca743fdd9...
39.75
145
0.752411
38b91a867c45210c9315102101078ee8b2703863
1,466
class Podiff < Formula desc "Compare textual information in two PO files" homepage "https://puszcza.gnu.org.ua/software/podiff/" url "https://download.gnu.org.ua/pub/release/podiff/podiff-1.2.tar.gz" sha256 "6902c10ceb9bb131d40cb2a7023ebb61df0ee7cf8abf1833129df65120244bd0" license "GPL-3.0" livecheck do ...
30.541667
94
0.722374
385c060a2084541296bbe7e42ac720cf4b369e07
370
module TricksHelper def add_trick_to_course(course, trick) link_to "Add to #{course.name}", add_course_trick_path(course, trick) end def trick_link(trick: trick, course: course) if course link_to trick.name, course_trick_path(course, trick) else link_to tric...
24.666667
77
0.645946
1d3001aa73fb384501a79779d01a963e8747d9fd
646
# frozen_string_literal: true module Cloudtasker module UniqueJob module ConflictStrategy # This strategy raises an error on conflict, both on client and server side. class Raise < BaseStrategy RESCHEDULE_DELAY = 5 # seconds # Raise a Cloudtasker::UniqueJob::LockError def on_...
22.275862
82
0.637771
03b5ba58ed5893e2ecf2388069a4e5dcb9e87b67
596
=begin STRING PERMUTATIONS CHALLENGE DESCRIPTION: Write a program which prints all the permutations of a string in alphabetical order. We consider that digits < upper case letters < lower case letters. The sorting should be performed in ascending order. INPUT SAMPLE: Your program should accept a file as its first ...
22.923077
103
0.741611
18caaaeb697f0d41619dba253385e0520d8507ed
3,495
class User < ApplicationRecord has_many :microposts, dependent: :destroy has_many :active_relationships, class_name: "Relationship", foreign_key: "follower_id", dependent: :destroy has_many :passive_relationships, class_name: "Relationship", ...
30.657895
96
0.704149
1db2d2ccf7bb84de37a398677d83676bb326200f
3,064
# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
36.915663
98
0.730091
e25861917bd9a3917ea53371089bfb0e30708241
3,438
#-- # Copyright (c) 2007-2009, John Mettraux, jmettraux@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy...
28.65
79
0.696626
79fe7e34723a9ee0e197ee511567dc6e6742ee58
1,081
class Balance < Formula desc "Software load balancer" homepage "https://www.inlab.net/balance/" url "https://www.inlab.net/wp-content/uploads/2018/05/balance-3.57.tar.gz" sha256 "b355f98932a9f4c9786cb61012e8bdf913c79044434b7d9621e2fa08370afbe1" bottle do cellar :any_skip_relocation sha256 "77589c441e...
38.607143
95
0.790009
08d3e20c61a017dfb27098f4b549fbdef9f6f6e9
122
require 'test_helper' class AgreemntTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
15.25
44
0.704918
1dbf24c1aacd0b4a1d8549912449c1b59f68ee35
4,113
require 'netstring' require 'logger' require 'benchmark' module JRPC class TcpClient < BaseClient attr_reader :namespace, :transport attr_accessor :logger def_delegators :@transport, :close, :closed?, :connect MAX_LOGGED_MESSAGE_LENGTH = 255 def initialize(uri, options = {}) super @l...
34.563025
109
0.641138
e26e7bd35491bde226780bb7f415738f90daa051
2,446
require 'fileutils' require 'sys/filesystem' require 'digest/sha1' module Daisy class Storage def initialize(config) config.deep_symbolize_keys! @name = config[:name] @mount_point = config[:mount_point] case config[:quota][:unit].to_sym when :bytes @quota = config[:quota][:...
22.036036
94
0.621832
1d9d905e94dc62299b769a34b158c4d9f4223b77
1,317
## # NOTE: Hashie does not make it easy to write a custom KeyConversion. # So here we are. :construction_worker: :arrow_heading_down: ## # Reopen String to underscore the camel-cased strings. Miss you ActiveSupport. module Underscore def underscore word = self.dup word.gsub!(/::/, '/') word.gsub!(/([A-Z]...
22.706897
78
0.661352
7aa6d473f6fc908b51c1d6c1230644847d384e3e
403
require 'liquid' module TackleBox module Email class Template module Tags class RandomDate < Liquid::Tag def render(context) today = Date.today return today.strftime("%b #{rand(today.day - 1) + 1}") end end end end end end Liquid::...
18.318182
90
0.598015
797759ee95b3b6c79ff971032ada1cfd8c272cb4
892
# encoding: utf-8 module QueryBuilder::CQL module Contexts # Describes the user-defined trigger for the table # class Trigger < Base attribute :table, required: true attribute :name, required: true # Returns the full name of the type # # @return [String] # d...
20.744186
73
0.610987
01d7b7d2e966f88300d0f41740b64ec0b776e38c
325
# class ItemSerializer < ActiveModel::Serializer # attributes :id,:title,:code,:state,:reference,:domain # # has_many :kits, :through => :kit_items # has_many :items, :through => :item_components # # has_many :kit_items # has_many :item_components # # has_many :owners # # has_and_belongs_to_many :owners #...
25
57
0.707692
bb9319aea8bf852c2ffd06445a15e0ecee5b3b02
33,552
require "test/unit" require "testutil" require "util" require "openid/consumer/idres" require "openid/protocolerror" require "openid/store/memory" require "openid/store/nonce" module OpenID class Consumer class IdResHandler # Subclass of IdResHandler that doesn't do verification upon # construction....
34.804979
171
0.548343
793a6c3626a0efc33cbb2465e4037dff782e4f46
1,593
Pod::Spec.new do |s| s.name = "PSPDFKit" s.version = "3.5.2" s.homepage = "http://pspdfkit.com" s.license = { :type => 'Commercial', :file => 'PSPDFKit.embeddedframework/PSPDFKit.framework/Resources/LICENSE' } s.author = { "PSPDFKit GmbH" => "support@pspdfkit.com" } s.summary ...
59
158
0.666667
61ec8a39cb7d10b2e0a110f07fcf481a82c9f4fc
1,662
class Provider < ApplicationRecord include NewWithTypeStiMixin include AuthenticationMixin include ReportableMixin include AsyncDeleteMixin include EmsRefresh::Manager include TenancyMixin belongs_to :tenant belongs_to :zone has_many :managers, :class_name => "ExtManagementSystem" has_many :endpoi...
25.181818
104
0.694946
f8021993c01223450490111261ce12e9115f5588
1,073
class Service::Firebase < Service string :firebase, :secret white_list :firebase url 'https://www.firebase.com' logo_url 'https://www.firebase.com/images/logo.png' maintained_by :github => 'anantn' supported_by :email => 'support@firebase.com' def receive_push url = data['firebase'].to_s url.gsu...
23.326087
74
0.640261
62f197948a17ac3aac7c609817cc9b4f16c1ac22
124
module Startbootstrap module Freelancer module Rails class Engine < ::Rails::Engine end end end end
13.777778
36
0.653226
acdc27926f3e88440747350922b6d11a12da96d4
1,449
# 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...
38.131579
111
0.710145
ac5c6b6f48108fd7df7e332051932b5413e0e2cc
231
# frozen_string_literal: true class ChangeYearToBeIntegerInCarModels < ActiveRecord::Migration[6.0] def up change_column :car_models, :year, :integer end def down change_column :car_models, :year, :string end end
19.25
69
0.748918
ffb33892de0138f034680a6f7dd78ecbc2372d81
2,360
# Helper class for arguments validation module SequelDM::ArgsValidator class << self # Checks that specifid +obj+ is a symbol # @param obj some object # @param obj_name object's name, used to clarify error causer in exception def is_symbol!(obj, obj_name) unless obj.is_a?(Symbol) raise ...
30.649351
78
0.649576
4a88bd273cbb11287cc52935db02fc98a79d2822
1,806
test_name "Validate Sign Cert" do need_to_run = false hosts.each do |host| need_to_run ||= !host['use_existing_container'] end skip_test 'No new hosts to create, skipping' unless need_to_run skip_test 'not testing with puppetserver' unless @options['is_puppetserver'] hostname = on(master, 'facter hostna...
35.411765
88
0.689922
ac3a2c4d803056e5e1b98b60ee3d1d6c28d0797b
2,971
class Vte3 < Formula desc "Terminal emulator widget used by GNOME terminal" homepage "https://developer.gnome.org/vte/" url "https://download.gnome.org/sources/vte/0.48/vte-0.48.1.tar.xz" sha256 "d3b7d6a13e6b850f3ea1c35af2746ef78039493ed4bb87cb7a36f29b260861f6" bottle do sha256 "7021496e3792f5c6b6a5e3c65...
27.509259
92
0.623023
bb6cbe3540ae6e4a3765b2eec65dd3a506afe597
297
module FormtasticBootstrap module Inputs class RangeInput < Formtastic::Inputs::RangeInput include Base include Base::Stringish def to_html generic_input_wrapping do builder.range_field(method, input_html_options) end end end end end
19.8
57
0.673401
7945070cd4a7b6ebc77fc3a4418c5098bde174ba
1,695
require "test_helper" class KenkenizerTest < Minitest::Test def test_that_it_has_a_version_number refute_nil ::Kenkenizer::VERSION end end class KenkenTest < Minitest::Test def test_pow ken = Kenken.new("ken") assert_equal (ken ^ 2), "kenken" end def test_pow_when_str_is_hayapi ken = Kenken...
20.670732
52
0.680236
d580e5f49a860262d45217aa483a6837a0f6df76
1,343
# -*- encoding: utf-8 -*- # stub: angularjs-rails 1.3.15 ruby lib Gem::Specification.new do |s| s.name = "angularjs-rails" s.version = "1.3.15" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Hirav Gandhi"] s.d...
34.435897
105
0.647803
e2ddf1bf80b641ff64370b5df1b08934370249a6
216
class Class def descendants descendants = [] ObjectSpace.each_object(singleton_class) do |k| next if k.singleton_class? descendants.unshift k unless k == self end descendants end end
18
51
0.680556
5df1cd29e35d997ed7e8824fc52acb05904aa7c1
5,265
require 'test_helper' class ExternalAuthorsControllerTest < ActionController::TestCase # Test create POST /:locale/users/:user_id/external_authors # def test_should_create_external_author # user = create_user # @request.session[:user] = user # assert_difference('ExternalAuthor.count') do # po...
37.340426
137
0.670465
87bb124338479758e07e384b31eda63b169d9ff4
19,346
require 'securerandom' require 'mittsu/core/event_dispatcher' module Mittsu class BufferGeometry include EventDispatcher DrawCall = Struct.new(:start, :count, :index) attr_reader :id, :name, :type, :uuid, :attributes, :draw_calls, :bounding_box, :bounding_sphere def initialize @id = (@@id ||...
27.835971
155
0.5688
ed91ac648d9d9fd9f4c7fe558cd47fbe3970bbed
1,485
require 'rack' require 'grape' module Grape # An Endpoint is the proxy scope in which all routing # blocks are executed. In other words, any methods # on the instance level of this class may be called # from inside a `get`, `post`, etc. block. class Endpoint def initialize(&block) @block = block ...
22.5
94
0.553535
abfe7de0024b73a6f8e0ccb4f1b1ccf9116ed2c4
1,768
# Encoding: utf-8 # # This is auto-generated code, changes will be overwritten. # # Copyright:: Copyright 2019, Google Inc. All Rights Reserved. # License:: Licensed under the Apache License, Version 2.0. # # Code generated by AdsCommon library 1.0.2 on 2019-05-06 15:08:25. require 'ads_common/savon_service' require '...
28.063492
72
0.732466
03436ee1cbdea33acc02d6f916432241e8528363
5,828
# frozen_string_literal: true require_relative '../../support/helpers/stub_env' require_relative '../../support/time_travel' require_relative '../../../tooling/rspec_flaky/flaky_example' RSpec.describe RspecFlaky::FlakyExample, :aggregate_failures do include ActiveSupport::Testing::TimeHelpers include StubENV ...
31.333333
113
0.670041
0182ae82e928b7a87ae1b21730b0bbd4982ffc72
843
# https://www.hackerrank.com/challenges/mars-exploration/problem?h_r=next-challenge&h_v=zen&h_r=next-challenge&h_v=zen # Letters in some of the SOS messages are altered by cosmic radiation during transmission. # Given the signal received by Earth as a string, s , determine how many letters of the SOS message have been...
38.318182
131
0.748517
e990e425cb6bf659aa2798f270c306bb36a107f6
6,515
# frozen_string_literal: true module EventsHelper ICON_NAMES_BY_EVENT_TYPE = { 'pushed to' => 'commit', 'pushed new' => 'commit', 'created' => 'status_open', 'opened' => 'status_open', 'closed' => 'status_closed', 'accepted' => 'fork', 'commented on' => 'comment', 'deleted' => 'remove...
28.827434
163
0.639908
1cffd7a803ad4879a6cc52c86ba47b91352a004a
1,501
#-- encoding: UTF-8 #-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2017 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject,...
36.609756
91
0.754164
b92e35a051d172779d20e7937b009e0e8ec99a27
3,991
# frozen_string_literal: false require "rss/utils" module RSS class Converter include Utils def initialize(to_enc, from_enc=nil) if "".respond_to?(:encode) @to_encoding = to_enc return end normalized_to_enc = to_enc.downcase.gsub(/-/, '_') from_enc ||= 'utf-8' ...
23.203488
80
0.567276
62d71abc214f53413ac8b07add176e747f16922d
7,092
require File.dirname(__FILE__) + '/../../test_helper.rb' module ORMAdaptersTests module ActiveRecordAdapterTests class ActsAsAuthenticTest < ActiveSupport::TestCase def test_user_validations user = User.new assert !user.valid? assert user.errors.on(:login) assert user.errors...
32.682028
101
0.643965
08403a6340b8790a64c373d8397bebe85e55e24c
769
require_relative '../../jenkins/type' require_relative '../../jenkins/config' module Puppet::X::Jenkins::Type::Cli def self.newtype(*args, &block) type = Puppet::Type.newtype(*args, &block) # The jenkins master needs to be avaiable in order to interact with it via # the cli jar. type.autorequire(:se...
26.517241
78
0.644993
edd30e51ff1a8cf09185147064450d0daf1497bf
657
cask "font-mali" do version :latest sha256 :no_check # github.com/google/fonts/ was verified as official when first introduced to the cask url "https://github.com/google/fonts/trunk/ofl/mali", using: :svn, trust_cert: true name "Mali" homepage "https://fonts.google.com/specimen/Mali" fo...
26.28
87
0.704718
39aabb5965ab82e7005ad9020a6d972739d419b6
288
# frozen_string_literal: true module TaxCloud #:nodoc: module Responses #:nodoc: # Response to a TaxCloud Authorized API call. # # See https://api.taxcloud.net/1.0/TaxCloud.asmx?op=Authorized. class Authorized < Generic response_key :authorized end end end
22.153846
67
0.697917
1c720c5a8e2c4bace6ba8065501e58688fd253e6
6,195
require "action_dispatch/http/request" require "action_dispatch/middleware/exception_wrapper" require "action_dispatch/routing/inspector" require "action_view" require "action_view/base" require "pp" module ActionDispatch # This middleware is responsible for logging exceptions and # showing a debugging page in ca...
30.367647
144
0.626634
62be66974fa7dc3497683d4875dbb32b228883bd
17,864
require 'spec_helper' describe 'metricbeat' do on_supported_os(facterversion: '2.4').each do |os, os_facts| context "on #{os}" do let(:facts) { os_facts } it { is_expected.to compile } describe 'metricbeat::config' do if os_facts[:kernel] == 'windows' it do is_ex...
37.139293
250
0.517241
9186b00280dfa4b8283869548104abe447f30e85
3,342
require_relative "boot" require "dotenv" require "rails/all" Dotenv.overload(".env", ".env.#{Rails.env}").tap do |env| if env.empty? raise "Cannot run Supermarket without a .env file." end end %w{ active_record action_controller action_mailer sprockets }.each do |framework| require "#{framework}/rai...
35.553191
99
0.720527
28aa34d09e4b2a29552ac67dac6829691b3567a7
3,410
Capybara::SpecHelper.spec '#click_link' do before do @session.visit('/with_html') end it "should wait for asynchronous load", :requires => [:js] do @session.visit('/with_js') @session.click_link('Click me') @session.click_link('Has been clicked') end it "casts to string" do @session.clic...
28.416667
72
0.678592