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
91469b05ae6f66ef4723c544a9936c5910df1996
148
require "securerandom" require "proxy_chain_rb/version" require "proxy_chain_rb/server" module ProxyChainRb class Error < StandardError; end end
18.5
34
0.817568
1dcfc3d6a316c7a1c5fec3503594bb4f90763cd9
213
require Rails.root.join('spec/shared/controllers/shared_examples_for_cloud_network_controller') describe CloudNetworkController do include_examples :shared_examples_for_cloud_network_controller, %w(amazon) end
35.5
95
0.877934
ff9a5de2079c46d88be2d86df15d76df21ee46ec
1,270
# # Be sure to run `pod spec lint QRPayFramework.podspec' to ensure this is a # valid spec and to remove all comments including this before submitting the spec. # # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html # To see working Podspecs in the CocoaPods repo see https://git...
32.564103
106
0.668504
03a226d43ece88c64b371cc05df9a241436e8052
356
$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../..') $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../../lib') require 'yajl' unless file = ARGV[0] puts "\nUsage: ruby examples/from_file.rb benchmark/subjects/item.json\n\n" exit(0) end json = File.new(file, 'r') hash = Yajl::P...
23.733333
77
0.705056
e84218fa3c2a347e2d2792b4518b818be772a59a
8,645
class ScrumBoard < ApplicationRecord ## Constants DEFAULT_SPRINT_DURATION = 2.weeks NUM_SPRINTS_FOR_AVG_VELOCITY = 3 ## Associations has_many :scrum_queues, -> { order(ended_on: :asc) }, dependent: :destroy, inverse_of: :scrum_board has_many :scrum_st...
29.505119
99
0.685946
620f0b8ff5ce3997e91ebc214d67d306a37039d2
5,052
class OciCli < Formula include Language::Python::Virtualenv desc "Oracle Cloud Infrastructure CLI" homepage "https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm" url "https://files.pythonhosted.org/packages/58/63/2ae0966975943638c55ecf3831a7fbdc061f84ad627f28e849223003c5d0/oci-cli-3.0.4.tar...
48.114286
145
0.804434
6a55dec7d756ae11b72c3f25c4f09c0c08e44495
2,376
# frozen_string_literal: true require "cases/helper_sqlserver" require "models/book" class FetchTestSqlserver < ActiveRecord::TestCase let(:books) { @books } before { create_10_books } it "work with fully qualified table and columns in select" do books = Book.select("books.id, books.name").limit(3).offset...
33.942857
89
0.689815
391d4b56a30008337b16e537d4073e9d6785e1c6
655
# frozen_string_literal: true # encoding: utf-8 require 'spec_helper' describe 'has_one associations' do context 'destroying parent in transaction with dependent child' do require_transaction_support let(:person) { Person.create! } let(:game) { Game.create!(person: person) } before do Person...
18.714286
68
0.639695
212fab37f203d83e46f68d7182ed6fc80679eba0
815
ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'minitest/reporters' Minitest::Reporters.use! class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all # Add more helpe...
27.166667
82
0.655215
7a265b0de1c2ee96a1389626d354765ba8e2d206
354
cask 'minbox' do version '2.0.12' sha256 '3c5a6bd1888453ef6de902da9bf29f873516572d4f7ff7d7d096c5425ae9dcd2' url 'https://minbox.com/download' appcast 'https://minbox.com/updates.xml', checkpoint: 'd6f20222f6fca106398c29a026237661e4805106af60d373f71f17948aa5d425' name 'Minbox' homepage 'https://mi...
27.230769
88
0.762712
1d1be55a1dc1a120c5fbf169866ff71d27a33821
2,684
#-- encoding: UTF-8 #-- copyright # OpenProject is an open source project management software. # Copyright (C) 2012-2020 the OpenProject GmbH # # 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 ChiliProj...
30.850575
91
0.708644
7ae0ed6cfe8568fcb16f6662a5a6bafdf9945e9c
400
# == Schema Information # # Table name: jedd_reposts # # id :integer not null, primary key # vspace_user_id :integer # jedd_directory_id :integer # created_at :datetime # updated_at :datetime # class Repost < ActiveRecord::Base self.table_name = 'jedd_reposts' belon...
22.222222
60
0.6625
7942506a84707a3b54437937a3abb3d9f49b5ad2
733
# frozen_string_literal: true class ForBlockReport < BaseReport set_lang :ru set_report_name :for_block set_human_name "Индикаторы (IoC) для блокировки (последние сутки)" set_report_model 'Indicator' set_required_params [] set_formats %i[txt] def txt(blank_document) @file_name = "#{Time.now.utc} #{@...
23.645161
68
0.675307
1885539518092b1c67777cb735930991c6b9a035
233
require 'rubygems' begin require 'bacon' rescue LoadError require 'mac_bacon' end lib_path = File.expand_path("#{File.dirname(__FILE__)}/../lib") $LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path) require 'facon'
21.181818
65
0.759657
4af8206eeaeec3e51683204a3ff79b97a1d7c69e
629
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'flutter_lyric' s.version = '0.0.1' s.summary = 'lyric_widget' s.description = <<-DESC lyric_widget DESC s.homepage = 'http://...
28.590909
83
0.537361
03b2a2d3f3cfa2a2d910a3e7f76f6d83e015db22
2,087
# frozen_string_literal: true require 'spec_helper' describe 'Rsyslog::Actions::Outputs::Omkafka' do let(:data) do { broker: 'foo', topic: 'default', key: 'primary', dynatopic: 'off', 'dynatopic.cachesize' => 512, 'partitions.auto' => 'off', 'partitions.number' => 10, ...
23.188889
71
0.547197
618130a3a13f7885b0ddde64c39066f030bd32a3
609
# # Cookbook:: national_parks_cookbook # Spec:: default # # Copyright:: 2017, The Authors, All Rights Reserved. require 'spec_helper' describe 'national_parks_cookbook::tomcat' do context 'When all attributes are default, on an unspecified platform' do let(:chef_run) do runner = ChefSpec::ServerRunner.new...
26.478261
85
0.70936
26d8f26830179fad799cb6e71ea48983a0043463
923
require "goon_model_gen" require "goon_model_gen/source/type" module GoonModelGen module Source class Enum < Type class Element attr_reader :value, :name def initialize(value, name) @value, @name = value, name end end attr_reader :base_type, :elements ...
27.147059
116
0.632719
91784b82b0a3346334a1bc8622b22cd0b067c25d
606
require 'simplecov' module SimpleCov::Configuration def clean_filters @filters = [] end end SimpleCov.configure do clean_filters load_adapter 'test_frameworks' end ENV["COVERAGE"] && SimpleCov.start do add_filter "/.rvm/" end $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH...
20.2
69
0.729373
bb0752e46c50edda8d19a1319c38c3386706e281
897
require 'spec_helper' require 'presenters/v3/app_environment_variables_presenter' module VCAP::CloudController::Presenters::V3 RSpec.describe AppEnvironmentVariablesPresenter do let(:app) do VCAP::CloudController::AppModel.make( environment_variables: { 'CUSTOM_ENV_VAR' => 'hello' }, ) en...
25.628571
79
0.576366
79be65d1144aa74938083198fab39c6ca6e98842
405
module OpenProductAssembly class Engine < Rails::Engine engine_name 'open_product_assembly' config.autoload_paths += %W(#{config.root}/lib) def self.activate Dir.glob(File.join(File.dirname(__FILE__), "../../app/decorators/**/*.rb")) do |c| Rails.configuration.cache_classes ? require(c) : ...
27
88
0.674074
f78d38f5b05aea430aa4807dc953121b083c0f8a
597
require 'asciidoctor' require 'asciidoctor/extensions' require 'open3' include Asciidoctor def python3_preprocessor(name) klass = Class.new(Asciidoctor::Extensions::Preprocessor) do class << self attr_accessor :script end def process document, reader script = self.class.script out, err...
23.88
84
0.670017
edbf71aa6ab63a9227116c370acc32d904c80e2c
1,222
class Gsar < Formula desc "General Search And Replace on files" homepage "http://tjaberg.com/" url "http://tjaberg.com/gsar121.zip" version "1.21" sha256 "05fb9583c970aba4eb0ffae2763d7482b0697c65fda1632a247a0153d7db65a9" bottle do cellar :any_skip_relocation sha256 "be008a03610074b4c66f775ae1802ed2...
42.137931
122
0.803601
112f963edb0ad227de3c36d975ee160c50dfce45
1,520
module PageObjectModel class ShopPageNavigation < PageObjectModel::Page trait "* id:'sliding_tabs'" element :toggle_button, "* id:'togglebutton_home'" element :featured_category, "* text:'Featured'" element :left_selection, "* id:'left_selection'" element :right_selection, "* id:'right_selection'"...
38.974359
115
0.676974
1a2166ad8f0abf0ac6905e9442bc19c853a0f661
673
# encoding: utf-8 module Github module Validations module Presence # Ensures that esential arguments are present before request is made # def _validate_presence_of(*params) params.each do |param| raise ArgumentError, "parameter cannot be nil" if param.nil? end e...
25.884615
79
0.670134
1d3af967178cd93fdbd06780cfb4096dd2a5bd59
1,060
class GetPrintImagesService def initialize() # @print_uids = Print.pluck(:eb_uid) end def call begin get_print_images return true rescue StandardError => e puts "SOMETHING BROKE" return false end end private # attr_reader :print_uids def get_print_images c...
22.553191
99
0.642453
f86ac8cae37a5ba0ed922c6d48eaea869256bf57
1,478
# Installs a relatively minimalist version of the GPAC tools. The # most commonly used tool in this package is the MP4Box metadata # interleaver, which has relatively few dependencies. # # The challenge with building everything is that Gpac depends on # a much older version of FFMpeg and WxWidgets than the version # th...
31.446809
93
0.728687
185f88538384c0b08cfebe721c78d7dd6e90fdc2
5,000
module Souls class Compute < Thor desc "setup_vpc_nat", "Set Up VPC Cloud Nat" method_option :range, default: "10.124.0.0/28", aliases: "--range", desc: "GCP VPC Network IP Range" def setup_vpc_nat puts(Paint["Initializing NAT Setup This process might take about 10 min...", :yellow]) Souls::Gc...
35.211268
114
0.6172
18261a5cb81ea704c89c7f84e5c0855496d5f654
1,206
module Api class LabelsController < ApplicationController include Contributable before_action :ensure_signed_in, except: [:index, :show] def create @label = Label.new(label_params) if @label.save render json: @label else render json: @label.errors.full_messages, status:...
18.84375
61
0.579602
791dd0dcf4c716549f42959d84db98e8a3c93208
1,441
require 'active_model' require 'models/helpers/metadata_helpers' require 'messages/metadata_validator_helper' module VCAP::CloudController::Validators class LabelSelectorRequirementValidator < ActiveModel::Validator MAX_REQUIREMENTS = 50 MISSING_LABEL_SELECTOR_ERROR = 'Missing label_selector value'.freeze ...
31.326087
112
0.729355
d5e74d4a60e09fa38cf10f400bcaddc4ee398b82
8,781
Revs::Application.routes.draw do root :to => "catalog#index" get "bookmarks", :to => "application#routing_error" # we are not using blacklight bookmarks, so a request to get them should fail nicely Blacklight.add_routes(self) # override devise controllers as needed devise_for :users, :controllers => { :se...
41.616114
207
0.643321
083d3d308a95e39e5428cdea41f65b8f77a87f9f
1,344
## -*- Ruby -*- ## Tree builder class for Japanese encoding ## 1998 by yoshidam require 'xml/dom/builder' module XML module DOM class JapaneseBuilder<Builder require 'kconv' include Kconv require 'uconv' include Uconv def nameConverter(str) u8toeuc(str) end def cdataConverter(str)...
22.779661
65
0.575149
2116f4a0d44560d1247152fa910fe151f2b20193
1,373
require 'logger' require 'nokogiri' require 'json' require './page_saver.rb' require './config_loader.rb' ############## Initialize conf = ConfigLoader.load('tennis.conf') JSON_OUTDIR = conf::JSON_OUT_DIR || 'file/json' HTML_OUTDIR = conf::HTML_OUT_DIR || 'file/html' logdir = conf::LOG_DIR || 'log' #$log = Logger.new(...
30.511111
70
0.694829
1a4da0a9eefadb3f61cc56c7cae44f6a7fc72fea
1,021
# # Be sure to run `pod lib lint RSDTesting.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = "RSDTestin...
30.939394
104
0.605289
79e234f6b655e02266fee2c92b69a16664a2716f
3,024
# 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::V2018_12_01 module Models # # Response for ListFrontendIPConfiguration API service call. # class LoadBalancer...
29.359223
80
0.549603
5d54d7f3975f3ee0363b146f0d819564c6f79cd0
5,275
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: peer/chaincode_shim.proto require 'google/protobuf' require 'peer/chaincode_event_pb' require 'peer/proposal_pb' require 'google/protobuf/timestamp_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_message 'protos.ChaincodeMessage' ...
40.576923
124
0.753365
4a48ed915b4aac891dcb7a1eedca42f281836108
1,594
class Libu2fServer < Formula desc "Server-side of the Universal 2nd Factor (U2F) protocol" homepage "https://developers.yubico.com/libu2f-server/" url "https://developers.yubico.com/libu2f-server/Releases/libu2f-server-1.1.0.tar.xz" sha256 "8dcd3caeacebef6e36a42462039fd035e45fa85653dcb2013f45e15aad49a277" rev...
28.464286
93
0.650565
4a5b03eb2b01548dd8477dcf84cb0ad00b6682e1
1,270
# frozen_string_literal: true called_from_env_rb = caller.detect { |f| f =~ /\/env\.rb:/ } if called_from_env_rb env_caller = File.dirname(called_from_env_rb) require 'rails' require 'cucumber/rails/application' ENV['RAILS_ENV'] ||= 'test' ENV['RAILS_ROOT'] ||= File.expand_path(env_caller + '/../..') req...
37.352941
98
0.74252
2614d56af132f60010fe6571a33afbb4e2b7f292
1,222
require 'sidekiq/web' Rails.application.routes.draw do root to: 'static_pages#home' if Rails.env.production? Sidekiq::Web.use Rack::Auth::Basic do |username, password| ActiveSupport::SecurityUtils.secure_compare( ::Digest::SHA256.hexdigest(username), ::Digest::SHA256.hexdigest(Rails.appl...
29.095238
92
0.662029
ac31ddc0e6ccad407b261ae059a044dd5b6aa104
1,004
describe Transducers::Process do let(:base_process) { described_class.new(init: init, step: step, completion: completion) } let(:init) { instance_double(Proc) } let(:step) { instance_double(Proc) } let(:completion) { instance_double(Proc) } describe '#taking' do let(:process) { base_process.taking(2) } ...
29.529412
92
0.677291
f8276c9023dcc2c3bb82ed9a25adb2f2eaf3dd16
1,129
require File.dirname(__FILE__) + '/../../../spec_helper' not_supported_on :ironruby do has_tty? do # needed for CI until we figure out a better way require 'readline' describe "Readline::HISTORY.[]=" do before(:each) do Readline::HISTORY.push("1", "2", "3") end after(:each) do Readl...
28.225
83
0.641275
ed386e3a767f05db8f02984638b201ee84323647
89
FactoryGirl.define do factory :bitcoin do price 1.5 currency "MyString" end end
11.125
21
0.719101
8777659d8c74eaaf2b19562b3e71360fcdf82c16
409
# frozen_string_literal: true require 'test_helper' class Editor::UsersControllerTest < ActionDispatch::IntegrationTest test 'should get index' do get editor_users_index_url assert_response :success end test 'should get list' do get editor_users_list_url assert_response :success end test '...
19.47619
67
0.760391
18283d409100368e3f5100f7153ca059b5953c81
3,177
class Madlib < Formula desc "Library for scalable in-database analytics." homepage "https://madlib.incubator.apache.org/" url "https://github.com/apache/madlib/archive/rel/v1.12.tar.gz" sha256 "4f21b1f463f22ee7ddefbe2e4c52e254a7156aefef980f1b3f26479f5f8c1672" head "https://github.com/apache/madlib.git" bot...
33.09375
123
0.694051
1c404f8b1880a4fb48ebafe2d69ae190b5247215
283
require File.expand_path('../support/helpers', __FILE__) describe "apache2::mod_fastcgi" do include Helpers::Apache it 'enables fastcgi_module' do skip if %w{rhel fedora}.include?(node['platform_family']) apache_enabled_modules.must_include "fastcgi_module" end end
23.583333
61
0.756184
abd6ab0aff6aa65de33a64081650259ff33f49cb
1,420
require "ips_validator/version" require 'ips_validator/loader' require 'ips_validator/validator' module IpsValidator class Runner class << self def run(args) num_valid = 0 num_invalid = 0 num_error = 0 total = 0 puts "\n" statuses = [] ...
26.792453
99
0.493662
0383b77a344efb448c3b619266fde6d400edd6e0
155
class ApplicationController < ActionController::Base protect_from_forgery with: :exception def hello render html: "Hello world" end end
19.375
52
0.729032
7a3bda7c21ae1aa2df3367d89648316cf79c0426
634
class Micropost < ApplicationRecord # Joins microposts with user belongs_to :user # Default sorting default_scope -> { order(created_at: :desc) } # CarrierWave method, PictureUploader -> picture_uploader.rb mount_uploader :picture, PictureUploader # Makes sure that user is associated with post validates...
28.818182
76
0.722397
91e8d70e89026f97cdaa2421bbad4311cf3e9364
750
# frozen_string_literal: true module Importer module Eprints class JsonParser include Enumerable include LeafAddons::Importer::Eprints::JsonAttributes include LeafAddons::Importer::Eprints::JsonDownloader # For locally overriden methods include Importer::Eprints::JsonAttributesOverr...
25.862069
68
0.685333
039fd2c2b01b36bf45d0ed7ed0f0d9e165dc6eac
14,064
# frozen_string_literal: true # 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 inv...
48.496552
154
0.751422
1dfb52a4fda43c7e8f7539101449223415b30a81
2,834
#!/usr/bin/ruby # # Copyright:: Copyright 2012 Trimble Navigation Ltd. # License:: Apache license, # Original Author:: Matt Lowrie # # Wrapper module for Win32 API constants and methods. # require 'win32/api' module ApiDefs # Constants # # Defined in winuser.h # MOUSEEVENTF_LEFTDOWN = '0002'.hex MOUSEEVE...
26
80
0.674312
9193b83e968eae37a923b6c084548a87249aafb6
2,817
require "topological_inventory/satellite/logging" require "receptor_controller-client" module TopologicalInventory module Satellite class Connection class << self def connection(account_number) new(account_number) end end @sync = Mutex.new @receptor_client = nil...
34.353659
139
0.618388
e946375564b1f82e6ceb39284928291d70033d57
5,769
class RegistrationsController < DeviseController prepend_before_action :require_no_authentication, only: [:new, :create, :cancel] prepend_before_action :authenticate_scope!, only: [:edit, :update, :destroy] prepend_before_action :set_minimum_password_length, only: [:new, :edit] # GET /resource/sign_...
34.54491
102
0.705668
2601d8802c085e1e676acfd79f5bd1b5c36fb690
897
# frozen_string_literal: true require 'spec_helper' RSpec.describe Keycloak do it 'has a version number' do expect(Keycloak::VERSION).not_to be nil end describe 'Module configuration' do describe '.installation_file=' do it 'should raise an error if given file does not exist' do expect{ K...
30.931034
116
0.722408
626c43a6ac1fe48131bc0cdb41626afe2b015618
1,227
# Uncomment this if you reference any of your controllers in activate # require_dependency 'application' class <%= class_name %> < Spree::Extension version "1.0" description "Describe your extension here" url "http://yourwebsite.com/<%= file_name %>" # Please use <%= file_name %>/config/routes.rb instead for ...
31.461538
102
0.684597
268a3c5d4fd5f17bae03118c7e74a69de7d38abb
5,367
require "timeout" require "log4r" require_relative "helper" require_relative "shell" require_relative "command_filter" module VagrantPlugins module CommunicatorWinRM # Provides communication channel for Vagrant commands via WinRM. class Communicator < Vagrant.plugin("2", :communicator) def self.match...
32.331325
93
0.617105
1a105eb3bacffdab1c16af6192803419f46a6481
3,899
require "os/mac/architecture_list" module CctoolsMachO # @private OTOOL_RX = /\t(.*) \(compatibility version (?:\d+\.)*\d+, current version (?:\d+\.)*\d+\)/ # Mach-O binary methods, see: # /usr/include/mach-o/loader.h # /usr/include/mach-o/fat.h # @private def mach_data @mach_data ||= begin of...
24.067901
92
0.595794
086c66ccc6c00e2b8599398421f8f4e64d91b1bb
2,351
module Jekyll module SidebarItemFilter def docs_sidebar_link(item) return sidebar_helper(item, 'docs') end def ios_sidebar_link(item) return sidebar_helper(item, 'ios') end def android_sidebar_link(item) return sidebar_helper(item, 'android') end def unity_sidebar_link...
26.41573
125
0.598894
1dc3ed12a7751850687d06d0e28129745dbc94c5
6,503
module Pod class Command class Spec < Command class Lint < Spec self.summary = 'Validates a spec file' self.description = <<-DESC Validates `NAME.podspec`. If a `DIRECTORY` is provided, it validates the podspec files found, including subfolders. In case the arg...
46.120567
139
0.564509
bf2d52e11803792b6420577f1d2ed2865b435ccd
589
require 'spec_helper' require 'ddtrace/opentracer' RSpec.describe Datadog::OpenTracer::ScopeManager do subject(:scope_manager) { described_class.new } describe '#activate' do subject(:activate) { scope_manager.activate(span, finish_on_close: finish_on_close) } let(:span) { instance_double(Datadog::OpenT...
25.608696
89
0.726655
38da49eb7fca59e1f6098a166d09d2ae143d3de1
1,012
# == Schema Information # # Table name: shipping_addresses # # id :integer not null, primary key # transaction_id :integer not null # status :string(255) # name :string(255) # phone :string(255) # postal_code :string(255) # city ...
25.948718
88
0.583992
217b028545dbe16ccd79198babdf14eebe732074
81,719
# frozen_string_literal: true # WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::EC2 class Vpc extend Aws::Deprecations # @overload def i...
40.077979
808
0.618498
219fd4c2a45b9af96941e14865adf3c36d856583
2,588
# lib/api/v1/cloud.rb module API module V1 class Cloud < Grape::API resource :cloud do desc 'Get pricing for cloud providers', { notes: <<-NOTE Cette methode permet de connaitre toutes les informations sur les prix par heure de differents providers. ## Requ...
33.179487
119
0.428516
ac85014af7df0798963532e04a63a75cdf53c0f8
1,100
# options to add to the keystone.conf as secrets (will not be saved in node # attribute) default['openstack']['identity']['conf_secrets'] = {} default['openstack']['identity']['conf'].tap do |conf| # [DEFAULT] if node['openstack']['identity']['syslog']['use'] # [DEFAULT] option in keystone.conf to read addition...
39.285714
75
0.688182
2183386e0b1e133a9cd2086668bb3c0a253f985d
651
require_relative '../test_config' class ShowPostTest < MiniTest::Test include DatabaseTesting def context @context ||= OpenStruct.new end def test_will_show_post form = CreatePost::Form.new :email => 'test@example.com' creation = CreatePost.new context, form post = creation.output.first in...
27.125
60
0.743472
bf08e14c2bacc9e998bfce20a50a6a7df435a461
5,349
module Squall # OnApp User class User < Base # Public: Lists all users. # # Returns an Array. def list response = request(:get, '/users.json') response.collect { |user| user['user'] } end # Public: Create a new User # # options - Params for creating the User: # ...
28.913514
80
0.511684
28b09510f4814e1271b1026a83945f0ffa890cfc
52
module GovukTechDocs VERSION = "2.3.0".freeze end
13
26
0.730769
797ed755976fd1d83f7099ca58d10bfefd83d85d
535
COMMON_SESSION = { :boot_wait => "10", :cpu_count => "1", :disk_format => "VDI", :disk_size => "40960", :hostiocache => "off", :ioapic => "on", :iso_download_timeout => "1000", :kickstart_port => "7122", :kickstart_timeout => "10000", :memory_size=> "384", :pae => "on", :postinstall_timeout => "...
24.318182
43
0.575701
6134b782d220bc91b0b124cb7d02019d379eb7e3
659
require File.expand_path("../../Abstract/abstract-php-extension", __FILE__) class Php56Mongo < AbstractPhp56Extension init homepage 'http://pecl.php.net/package/mongo' url 'http://pecl.php.net/get/mongo-1.5.4.tgz' sha1 'd4d34c7450630726a44c1fd3d4fc4c5a8d738f25' head 'https://github.com/mongodb/mongo-php-driv...
28.652174
75
0.694992
6a9594796cbfa3196c2a7874f241ebc3394f5155
2,973
require 'spec_helper_acceptance' test_name 'client -> 1 server without TLS' describe 'rsyslog client -> 1 server without TLS' do let(:client){ only_host_with_role( hosts, 'client' ) } let(:server){ hosts_with_role( hosts, 'server' ).first } let(:client_fqdn){ fact_on( client, 'fqdn' ) } let(:server_fqdn){ fa...
29.147059
77
0.605113
b911f1df4ba91392b0a40215bee4c366c8adc093
1,596
require "log4r" require "json" module VagrantPlugins module AWS module Action # This terminates the running instance. class TerminateInstance def initialize(app, env) @app = app @logger = Log4r::Logger.new("vagrant_aws::action::terminate_instance") end ...
30.692308
82
0.595238
79524a026cc408483d0bb1542dab299aaff92e9f
2,697
#!/usr/bin/env rspec require 'spec_helper' init_param, = Puppet::Type.type(:init_param) describe init_param do let(:attribute_class) { @class.attrclass(attribute_name) } let(:attribute) {@resource.property(attribute_name)} before(:each) do @class = init_param @provider = double 'provider' allo...
29.637363
96
0.683352
e82ed43d85d59c27cf35c9ed1b9580ffd3a858e9
2,456
require_relative "./helper" class TestClassifier < Minitest::Test include Linguist def fixture(name) File.read(File.join(samples_path, name)) end def test_classify db = {} Classifier.train! db, "Ruby", fixture("Ruby/foo.rb") Classifier.train! db, "Objective-C", fixture("Objective-C/Foo.h") ...
32.746667
90
0.692997
393c68677948b1104df8e00e1b80a72b6598d096
2,211
require 'spec_helper' feature 'Tiered Calculator Promotions' do stub_authorization! let(:promotion) { create :promotion } before do visit spree.edit_admin_promotion_path(promotion) end it 'adding a tiered percent calculator', js: true do select2 'Create whole-order adjustment', from: 'Add action o...
31.140845
81
0.694256
b9b2d7a4e6a76c6cb5bb541897bf5d6a6b576571
68
# frozen_string_literal: true class Bearer VERSION = "3.0.1" end
11.333333
29
0.720588
4ab0c206dfe94feef352078f37ce73b326bbc02d
1,413
module Seek module Biosamples module PhenoTypesAndGenoTypes def self.included(base) base.has_many :phenotypes base.has_many :genotypes base.accepts_nested_attributes_for :genotypes,:allow_destroy=>true base.accepts_nested_attributes_for :phenotypes,:allow_destroy=>true ...
32.860465
123
0.650389
5d2db78f2da2ebd8ba561706024e502f305570e4
2,202
require 'okcomputer' # /status for 'upness' (Rails app is responding), e.g. for load balancer # /status/all to show all dependencies # /status/<name-of-check> for a specific check (e.g. for nagios warning) OkComputer.mount_at = 'status' OkComputer.check_in_parallel = true OkComputer::Registry.deregister 'database' # d...
50.045455
117
0.754768
7a3ffc2afad035ce9f72c82e715ac520da15c4a5
325
require 'mxx_ru/cpp' require 'restinio/asio_helper.rb' MxxRu::Cpp::exe_target { target 'sample.hello_world' RestinioAsioHelper.attach_propper_asio( self ) required_prj 'nodejs/http_parser_mxxru/prj.rb' required_prj 'fmt_mxxru/prj.rb' required_prj 'restinio/platform_specific_libs.rb' cpp_source 'main.cp...
20.3125
51
0.778462
33743cdd918929e110806b875c82653a7e336ad6
340
class SpotifyNotifications < Cask version '0.4.8' sha256 '953028e9a1aad445005869598050cb8612980821a796563936f557e03b319f50' url 'https://github.com/citruspi/Spotify-Notifications/releases/download/0.4.8/Spotify.Notifications.-.0.4.8.zip' homepage 'http://spotify-notifications.citruspi.io/' link 'Spotify Not...
34
115
0.797059
79e1f873802831c3dbba1914c92f4d4bdaf8289f
2,023
require 'fog/vcloud/models/compute/vdcs' require 'fog/vcloud/models/compute/vdc' Shindo.tests("Vcloud::Compute | vdc", ['vcloud']) do Fog::Vcloud::Compute::SUPPORTED_VERSIONS.each do |version| tests("api version #{version}") do pending if Fog.mocking? instance = Fog::Vcloud::Compute.new( :vc...
41.285714
122
0.620366
ffb19da620a74fbeee4d0ea2b886b6a2a7c9cf42
1,010
# for serverspec documentation: http://serverspec.org/ require_relative 'spec_helper' pkgs = ['influxdb'] files = ['/etc/influxdb/influxdb.conf'] dirs = ['/var/lib/influxdb/data', '/var/lib/influxdb/meta', '/var/lib/influxdb/wal'] ports = ['8086', '2003'] pkgs.each do |pkg| describe package("#{pk...
20.2
145
0.654455
d51c7dbedbfaa86a231ab83a6b1481324630b486
145
class KJess::Response class Version < KJess::Response keyword 'VERSION' arity 1 def version args.first end end end
13.181818
33
0.627586
f75fab05923f825e9e29d9b14d46eff424a84d65
288
require "codeclimate-test-reporter" CodeClimate::TestReporter.start $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) $LOAD_PATH.unshift File.expand_path("../../spec", __FILE__) require "blog/config/application.rb" require "rspec" require "rack/test" ENV["RACK_ENV"] = "test"
24
59
0.746528
7a05ca3fc886299b0c6d369a6254a45a71198345
441
# TODO class Spaceship @thruster_count = 2 def self.thruster_count end end class SpritelySpaceship < Spaceship @thruster_count = 4 def add(rval) @thruster_count + rval end end class EconolineSpaceship < Spaceship @thruster_count = 1 end puts SpritelySpaceship.thruster_count puts EconolineSpaceshi...
16.961538
41
0.800454
21668f3dcbdc1f0896390a81a23f4204f0baaa61
9,808
# typed: true # frozen_string_literal: true require "extend/ENV/shared" require "development_tools" # ### Why `superenv`? # # 1. Only specify the environment we need (*NO* LDFLAGS for cmake) # 2. Only apply compiler-specific options when we are calling that compiler # 3. Force all incpaths and libpaths into the cc in...
27.019284
118
0.686378
79bc89645eeb533664561ab0795d9e6a4e641a22
6,108
# encoding: UTF-8 require 'gooddata' describe GoodData::Project do before(:all) do GoodData.logging_on @client = ConnectionHelper::create_default_connection @p = GoodData::Project.create_object(title: 'a', client: @client) @domain = @client.domain('dummy_domain') @roles = [ GoodData::Proje...
49.658537
195
0.601343
ac5e98b6de224fb71fdb5ba9e9e052cb618b9456
19,904
=begin #Ahello REST API documentation #На данной странице вы можете выполнять запросы к API, для этого необходимо указать 'appId', который был передан вам сотрудниками тех. поддержки в поле api_key. Укажите также PartnerUserId (это CRM Id пользователя или его email ), partnerUserId передается в заголовке запроса. Важ...
42.439232
568
0.689761
e27155c637b4d4f05760c8f962b175b7b1965b4e
125
name 'glance-server' description 'OpenStack glance service' run_list( 'role[glance-api]', 'role[glance-registry]', )
17.857143
38
0.704
6a51173955d2ceda95e787146c8d4b09c26d99cf
781
module Algs4ruby class Stack class LinkedList include Enumerable Node = Struct.new(:item, :next) attr_accessor :first, :size def initialize @size = 0 end def push(item) node = Node.new(item, first) self.first = node self.size += 1 ...
16.270833
49
0.507042
bbd7cd0b3ac99d2a7411595a32368186c64c4b27
3,846
require 'capybara/poltergeist' require 'rspec/expectations' require 'capybara/rspec' require 'open-uri' module Scrape456 # Given a username and password, retrieves all event attendee data from 123Signup. # # Usage: # # csv_result = Scrape456::Download.new( # username: ENV['LOGIN_USER_1'], # password...
31.785124
103
0.654446
fffb97fdb2d81b63819a12266bd32f4a88d2a452
2,288
describe Spaceship::TunesClient do describe '#login' do it 'raises an exception if authentication failed' do expect do subject.login('bad-username', 'bad-password') end.to raise_exception(Spaceship::Client::InvalidUserCredentialsError, "Invalid username and password combination. Used 'bad-user...
38.779661
242
0.702797
4a9db404d0e3c8fe75f6de5c8233828cf8b1e19c
8,205
require_relative "rexml_test_utils" require 'rexml/sax2listener' require 'rexml/parsers/sax2parser' require 'rexml/document' class SAX2Tester < Test::Unit::TestCase include REXMLTestUtils include REXML def test_characters d = Document.new( "<A>@blah@</A>" ) txt = d.root.text p = Parsers::SAX2Parser.n...
29.303571
168
0.650335
ed8a0860e407f85d399d754ae6fba206322acecb
1,222
require 'jshint' require 'jshint/reporters' namespace :jshint do desc "Runs JSHint, the JavaScript lint tool over this project's JavaScript assets" task :lint => :environment do |_, args| # Our own argument parsing, since rake jshint will push extra nil's. reporter_name = :Default file = nil report...
29.804878
84
0.684124
21876cbf25d23c910292431fddae7a5b5b6b2240
17,587
# frozen_string_literal: true module RailsCursorPagination # Use this Paginator class to effortlessly paginate through ActiveRecord # relations using cursor pagination. For more details on how this works, # read the top-level documentation of the `RailsCursorPagination` module. # # Usage: # RailsCursor...
36.412008
80
0.64633
62b727ab7d8abc88b0a5f820a9dfedafd032dfa8
298
# encoding: UTF-8 class Tuneinstructor < Cask version '3.4' sha256 '7909eeaf0b3cbe41c511f2c450a6249c9d8a311a482547cf8fc11537b11ecbd4' url 'http://www.tune-instructor.de/_data/TuneInstructor3.4b.dmg' homepage 'http://www.tune-instructor.de/com/start.html' link 'Tune•Instructor.app' end
27.090909
75
0.778523
9198235286ef03c87032f9ee3c572e1e6f65f4ab
1,544
class Libdca < Formula desc "Library for decoding DTS Coherent Acoustics streams" homepage "https://www.videolan.org/developers/libdca.html" url "https://download.videolan.org/pub/videolan/libdca/0.0.7/libdca-0.0.7.tar.bz2" sha256 "3a0b13815f582c661d2388ffcabc2f1ea82f471783c400f765f2ec6c81065f6a" license "GPL...
39.589744
95
0.740285
ff876a25c94a16f32e74d36284fd7b34b7f730e0
1,507
require 'optparse' module Bini # An extension of [OptionParser] that behaves like a hash, with saving, loading, and # mashing in other hashs. class OptionParser < ::OptionParser def initialize super @options = {} on("-V", "--version", "Print version") { |version| @options[:version] = true}...
25.982759
89
0.628401
5d8bb42a8462f74a982518a0a000d5fa9f335960
1,757
# 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 `rails #...
37.382979
86
0.723392
e8eb3333b88e1e533a3e9e424aa80b726a2d6bcf
3,008
# frozen_string_literal: true require 'spec_helper' RSpec.describe Gitlab::Ci::Pipeline::Chain::Sequence do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user) } let(:pipeline) { build_stubbed(:ci_pipeline) } let(:command) { Gitlab::Ci::Pipeline::Chain::Command.new(project: project) } ...
29.490196
91
0.676529
33df41e3a43ca913fc17ca564f42d35088f32060
658
class Keyword < ActiveRecord::Base attr_accessible :keyword validates :keyword, presence: true has_many :keyword_data def self.topN(n) end def self.search(query) end def self.sorted(field) end def self.create_or_update(keyword, data) keyword_id = Keyword.find_or_create_by_name(keyword: key...
18.8
65
0.712766