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
f7e26362debfca1e7263f2aab217afe29f98b0c1
2,468
require 'spec_helper' require 'messages/apps/apps_list_message' module VCAP::CloudController RSpec.describe AppListFetcher do describe '#fetch' do let(:space) { Space.make } let(:app) { AppModel.make(space_guid: space.guid) } let(:sad_app) { AppModel.make(space_guid: space.guid) } let(:or...
29.73494
71
0.602512
2649dde68b6292c670891d2260b8984ac1cb4b92
604
class Ecm::Cms::Folder < ActiveRecord::Base # associations has_many :ecm_cms_pages, class_name: 'Ecm::Cms::Page', dependent: :destroy, foreign_key: 'ecm_cms_folder_id' has_many :ecm_cms_partials, class_name: 'Ecm::Cms::Partial', dependent: :destroy, ...
30.2
44
0.639073
ff65d32d8dd5225c7f47c29e6ab8e8772ed4baab
770
Pod::Spec.new do |s| s.name = "ObjcGitlabApi" s.version = "1.0.1" s.summary = "An Objective-C library for interacting with the GitLab API." s.homepage = "https://github.com/Indatus/objc-gitlab-api" s.license = 'MIT' s.authors = { "Jeff Trespalacios" => "jtrespalacios@inda...
55
123
0.601299
f80f652389230acb69ce2eeb6fe3e7072e100763
1,652
# # Be sure to run `pod lib lint WJCoordinator.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 https://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'WJCoo...
37.545455
107
0.642857
38b24692d02115903a05a96ad957521167858bf3
3,428
require "civo_cli/version" require "civo" require "json" require "thor" require "terminal-table" require 'colorize' require 'config' require 'namegenerator' Dir[File.join(__dir__, '*.rb')].each { |file| require file } module CivoCLI class Error < StandardError; end class Main < Thor puts "This Ruby-based CLI ...
32.037383
141
0.67007
186c148320a3bc5b73a515de9f7879c688bdfce3
268
require 'rufus-scheduler' class Scheduler @seconds = 's' class << self attr_reader :seconds end def initialize @scheduler = Rufus::Scheduler.new end def every(time, unit, &block) @scheduler.every("#{time}#{unit}") { block.call } end end
14.105263
53
0.645522
266a39a13ce2f20fac9eaf17bb1f5f2afbb1bd60
1,294
cask "atom-beta" do version "1.55.0-beta0" sha256 "9f2c79469e4c11ca7fd22077210d09dc831aea5f992dc4b56f0fa6611d74b4f9" url "https://github.com/atom/atom/releases/download/v#{version}/atom-mac.zip", verified: "github.com/atom/atom/" appcast "https://github.com/atom/atom/releases.atom" name "Github Atom Be...
39.212121
136
0.723338
03c06006a7d711fa7321e245531efa89fead8971
1,278
module Spider class FlashHash < Hash attr_accessor :parent_flash, :parent_flash_key attr_reader :accessed, :active def initialize super @sub_flashes = {} @parent_flash = nil @parent_flash_key = nil reset end ...
22.821429
64
0.421753
876e6b4fd392864e0c0bfdd3f2007ee4f419a242
12,241
# # surfaces 1 # http://gnuplot.sourceforge.net/demo_4.6/surface1.html require_relative "gpl" # set samples 21 # set isosample 11 # set xlabel "X axis" offset -3,-2 # set ylabel "Y axis" offset 3,-2 # set zlabel "Z axis" offset -5 # set title "3D gnuplot demo" # set label 1 "This is the surface boundary" at -10,-5,150...
24.531062
94
0.585001
798f5cf80e87373fabfdc9ede574d696c0e46ef8
955
require 'readline' module Sass module Repl class << self def run environment = Environment.new environment.set_var('important', Script::String.new('!important')) loop do unless text = Readline.readline('>> ') puts return end Rea...
22.209302
74
0.539267
87443d971ddcd6396359165d4093be5f7306c344
6,001
# 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...
37.04321
126
0.710548
62ec864c57936e944a966ca5f57950590b1f618e
23,427
require 'spec_helper' require 'perm' require 'perm_test_helpers' require 'securerandom' # The `perm` symbol is an rspec tag used in RSpec.configure to set an exclusion_filter to avoid showing pending perm tests. skip_perm_tests = ENV['CF_RUN_PERM_SPECS'] != 'true' RSpec.describe 'Perm', type: :integration, skip: skip_...
31.572776
142
0.629231
f8394f586ed4f534e381ba76d1fc24785ac2b32f
624
require 'rails_helper' describe AccountPolicy do subject { described_class } let(:anonymous_user) { nil } let(:guest_user) { create(:guest_user) } let(:common_user) { create(:common_user) } permissions :show? do it 'grants access for common user' do expect(subject).to permit(common_user, :account...
22.285714
61
0.692308
080b6934b18afaa0f74f2cd730076b1be3b57992
3,431
=begin #Mailchimp Marketing API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 3.0.25 Contact: apihelp@mailchimp.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'uri' modu...
33.970297
151
0.657826
1c8c7310a7f4cd4a64faaf8df152bc9e639c0cb5
72
Rails.application.routes.draw do mount Spree::Core::Engine => "/" end
18
34
0.708333
4a934c211e61c507bd2c0d86039213ab0f013e5d
746
cask 'deltawalker' do version '2.5.1' sha256 'fa25263ad38e2a61334fee88603e0b67ba098147376d7812dff1aeb6cc2f9e64' # deltawalker.s3.amazonaws.com was verified as official when first introduced to the cask url "https://deltawalker.s3.amazonaws.com/DeltaWalker-#{version}.dmg" appcast 'https://www.deltawalker.com/...
37.3
91
0.699732
ff9f21bb6277ab6769af0f789172907732fcf6fb
117
%w[ configuration_factory test_suite_runner_factory ].each do |file| require_relative("factories/#{file}") end
16.714286
39
0.760684
08680774118d26edb7cd97099f82aa74b128eb17
1,438
require 'helper' module IntegrationTests class TestWithinComparator < Test::Unit::TestCase def setup @tmpdir = Dir.mktmpdir('linkage') end def teardown FileUtils.remove_entry_secure(@tmpdir) end test "within comparator" do database_for('sqlite') do |db| db.create_table...
29.958333
78
0.591794
ffc7227cc1c5a81921f136afbe205f0f4aeed41d
990
class Api::V1::SessionsController < ApplicationController # include CurrentUserConcern def create user = User.find_by(username: params[:username]) .try(:authenticate, params[:password]) if user session[:user_id] = user.id payload = {user_id: user.id} token = e...
22
57
0.525253
39da4b50beb584bfe998aa09f7c0dd66577edbb6
17,897
# typed: false # frozen_string_literal: true require "rubocops/urls" describe RuboCop::Cop::FormulaAudit::Urls do subject(:cop) { described_class.new } let(:offense_list) { [{ "url" => "https://ftpmirror.gnu.org/lightning/lightning-2.1.0.tar.gz", "msg" => 'Please use "https://ftp.gnu.org/gnu/ligh...
37.441423
173
0.547019
18a4608189c1aa8b8186808903976942d25c0b77
392
module Bolt class Node class BaseError < StandardError attr_reader :issue_code def initialize(message, issue_code) super(message) @issue_code = issue_code end def kind 'puppetlabs.tasks/node-error' end end class ConnectError < BaseError def ki...
17.043478
41
0.614796
ed76d06f1d1fa172ace5088592ba4801a8a5b9ad
128
class AddSupplierIdToProducts < ActiveRecord::Migration def change add_column :products, :supplier_id, :integer end end
21.333333
55
0.78125
1849f64c11864873c38edc959f4c8aa5302f46f3
166
# frozen_string_literal: true class RescueJob < ActiveJob::Base include ActiveJob::Status def perform raise NoMethodError, "Something went wrong" end end
16.6
47
0.759036
f74d7d234703b0fe02c48204080e21b0468ca630
177
# frozen_string_literal: true require "spec_helper" describe SvgOptimizer::Plugins::RemoveUselessStrokeAndFill do test_with_fixture_set("remove_useless_stroke_and_fill") end
25.285714
61
0.858757
f79c5752f4bde31907305abbd0518954b2be27ad
1,475
require "acts-as-taggable-on" require "calagator/machine_tag" ActsAsTaggableOn::Tag.send :include, Calagator::MachineTag::TagExtensions # Structure of machine tag namespaces and predicates to their URLs. See # Calagator::MachineTag for details. Calagator::MachineTag.configure do |config| config.urls.merge! \ 'ep...
28.365385
73
0.560678
fffe37b12cd1d3a382d3305442e46f05592c2b0d
656
lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |s| s.name = 'polkastarter-lottery' s.version = '1.2.0' s.summary = "Polkastarter Lottery" s.description = "The Polkastarter Lottery calculation system" s.authors = ["Po...
29.818182
63
0.628049
6214676d4cec81427ed759e041f9236c5d610421
4,575
require 'spec_helper' describe Chef::Resource::AwsServerCertificate do extend AWSSupport when_the_chef_12_server "exists", organization: 'foo', server_scope: :context do with_aws "without a VPC" do cert_string = <<-CERT -----BEGIN CERTIFICATE----- MIIB+TCCAWICAQEwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQVUx...
46.683673
98
0.817049
e22d0d137b57d938ea6a8c3c492e598863577a48
9,275
#!/usr/bin/ruby -Eutf-8:utf-8 # encoding: UTF-8 # Copyright 2015-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.ama...
32.773852
97
0.570782
8743c94b45bcdf6041780ec16d742f0ac2085b37
1,842
# frozen_string_literal: true require "rails-controller-testing" require "rails_helper" module Renalware::Events describe EventsController, type: :controller do routes { Renalware::Engine.routes } let(:user) { @current_user } let(:patient) { create(:patient, by: user) } let(:event_type) { create(:ac...
28.78125
71
0.532573
2691d981636d18002f263dae7d14873c93078079
981
# 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...
39.24
86
0.761468
ffa8237f3e41aea0ffbdab709c8e1576187d10d7
1,402
require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper')) class TcMpfrRounding < Test::Unit::TestCase def setup if GMP::MPFR_VERSION < "3.0.0" @prefix = "GMP" else @prefix = "MPFR" end end def test_rounding_mode assert_equal(0, GMP::GMP_RNDN.mode, "GMP::Rnd.mode shou...
42.484848
101
0.708987
d5735a0c4b4b9554d2b2eb468606456f08be26f3
5,062
####################################################################### # test_credentials_cache.rb # # Tests for the Kerberos::Krb5::Credentials class. ####################################################################### require 'rubygems' gem 'test-unit' require 'etc' require 'test/unit' require 'rkerberos' requi...
32.87013
95
0.707033
e96aff2f58f403770d21fd60133891b9746bd882
2,543
# -*- coding: binary -*- require 'msf/core/post/common' require 'msf/core/post/file' module Msf class Post module OSX module System include ::Msf::Post::Common include ::Msf::Post::File # # Return a hash with system Information # def get_sysinfo system_info = {} cmd_output = cmd_exec("/usr/bin/sw_vers").spl...
22.113043
81
0.651986
5d87dc98f28f13ef89b6ca511195f4cb494ff6c0
529
Pod::Spec.new do |s| s.name = "LYSPicturePreView" s.version = "0.0.1" s.summary = "简单实现一个图片预览组件" s.description = <<-DESC 简单实现一个图片预览组件.简单实现一个图片预览组件 DESC s.homepage = "https://github.com/LIYANGSHUAI/LYSPicturePreView" s.platform = :ios, "8.0" s.license = "MIT" s.author = { "李阳...
29.388889
102
0.63138
bf272684480ddb24e6f84a5f63494d055b698f5a
4,852
class Superlu < Formula desc "Solve large, sparse nonsymmetric systems of equations" homepage "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/" url "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_5.2.1.tar.gz" sha256 "28fb66d6107ee66248d5cf508c79de03d0621852a0ddeba7301801d3d859f463" revision 1 bottle do ...
31.506494
94
0.621187
91dad63dbb3c0a0253da74270573288a741ef538
403
class Pagamento attr_accessor :produto, :quantidade, :preco, :valor def initialize(quantidade:, produto: 'Sem nome', preco: produto.preco) @quantidade = quantidade @produto = produto @preco = preco end def calcular_valor @valor = @quantidade * preco produto.estoque -= quantidade end d...
20.15
72
0.692308
7a388f2cecf5151d4d0b3c546264cb4af024e588
991
class API def self.load_stocks resp = RestClient.get("http://api.marketstack.com/v1/tickers?access_key=#{ENV['API_KEY']}") stock_market_hash = JSON.parse(resp.body, symbolize_names: true) stock_market_array = stock_market_hash[:data] stock_market_array.each do |stock| ...
30.030303
113
0.656912
0802503459cebf1ced71a05c362f0b11358ac5f9
2,741
module RubyInstaller module Build # Use for: Build, Runtime module Components class Base < Rake::Task include Colors attr_accessor :task_index attr_writer :msys attr_accessor :pacman_args attr_accessor :builtin_packages_dir def self.depends [] end def initialize(*_) @msys = nil enable_col...
23.033613
96
0.597227
e2e9baf9bd17ca237ec4192dc0f0995504aadfbc
192
# frozen_string_literal: true component 'rubygem-gettext-setup' do |pkg, _settings, _platform| pkg.version '0.34' instance_eval File.read('build/vanagon/components/_base-rubygem.rb') end
27.428571
70
0.776042
0119a856cf8f4fbd8690ed1346a3cd70fac73763
361
require_relative "lib/bootstrap" RSpec.configure do |config| config.before :suite do AnsibleHelper.playbook("playbooks/install.yml", ENV["TARGET_HOST"], {install_mysql: true}) end end describe "MySQL" do include_examples "mysql server" include_examples("mysql client", "8.0") end describe "User Access" do...
21.235294
94
0.753463
03245cb86c6d297d23f64c035ab59c585be0330b
5,703
# frozen_string_literal: true require "minitest/autorun" require "jwt_sessions" nacl_supported_versions = { "ruby" => ["~> 2.2.6", "~> 2.3.0", "~> 2.4.2"], "jruby" => ["~> 9.1.6.0"] }.each_with_object([]) do |(platform, versions), acc| acc.concat(versions.map { |version| Gem::Dependency.new(platform, version) ...
38.02
129
0.722953
62eb6480be94551581c40d031c384817d9514719
4,854
class GccAT8 < Formula desc "GNU compiler collection" homepage "https://gcc.gnu.org/" url "https://ftp.gnu.org/gnu/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz" mirror "https://ftpmirror.gnu.org/gcc/gcc-8.4.0/gcc-8.4.0.tar.xz" sha256 "e30a6e52d10e1f27ed55104ad233c30bd1e99cfb5ff98ab022dc941edd1b2dd4" revision 2 liveche...
31.934211
113
0.644005
9121b76539cb0a32c00cbe70f3c6328f5fb0ee1f
324
class CreateCustomers < ActiveRecord::Migration[6.0] def change enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto') create_table :customers, id: :uuid, default: 'gen_random_uuid()' do |t| t.string :contact t.string :name t.text :description t.timestamps end end ...
20.25
75
0.679012
bb7878b2389b47c59e1511e22970b1bb5b33ef56
1,003
require 'spec_helper' describe GiactVerification::RequesterFactory do describe ".call" do it 'returns Request if the giact_endpoint is set as :production' do allow(GiactVerification).to receive(:giact_endpoint) .and_return(:production) requester = GiactVerification::RequesterFactory.call ...
30.393939
75
0.73679
61888e8a396620f1c7c27b3544b307d44943c391
378
cask 'principle' do version '5.2' sha256 '1ecd9c186864c96ed3b3f5e8facc1e86489e49d3d6a8b19900527d26af5eb8b4' url "http://principleformac.com/download/Principle_#{version.dots_to_underscores}.zip" appcast 'http://principleformac.com/update2.xml' name 'Principle' homepage 'http://principleformac.com/' depe...
27
88
0.769841
383c9c7d2365bfed6b083fcf4c21b20691b93798
658
require 'twterm/event/notification/abstract_notification' module Twterm module Event module Notification class ListMemberAdded < AbstractNotification # @param [Twterm::List] list def initialize(list) @list = list end # @return [String] notification body de...
19.352941
57
0.574468
797b19b50ca76a27eb48a371a4e5f2b57b199fce
3,498
=begin This file is part of the Arachni::Reactor project and may be subject to redistribution and commercial restrictions. Please see the Arachni::Reactor web site for more information on licensing and terms of use. =end module Arachni class Reactor class Connection # {Connection} error namespace. # # A...
30.417391
86
0.64494
ed214fb567c17cae2549f51d71c9188c6257d161
2,864
class Libffi < Formula desc "Portable Foreign Function Interface library" homepage "https://sourceware.org/libffi/" url "https://mirrors.ocf.berkeley.edu/debian/pool/main/libf/libffi/libffi_3.2.1.orig.tar.gz" mirror "https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/libf/libffi/libffi_3.2.1.orig.t...
32.91954
111
0.606145
61c13b6c8742425f20aaec0619364cd10aaa9fd0
1,571
# Simple AWS CloudFormation. Doesn't try to run the commands, doesn't try to # DSLize every last thing. Simple is the watch word require 'json' module Cumuliform # Manages converting the Cumuliform::Template into a CloudFormation JSON # string module Output # Processes the template and returns a hash repres...
28.563636
79
0.693826
6a64fcc0911aceb7beaaf2d1cc4a03d68dd39e11
1,088
cask 'moodo' do version '1.4.1' sha256 'b9974d621f17a972bf06cae3ae666997b0377ea13b8e7f348cc6c64347fcff7d' # github.com/MooDoApp/MooDoApp.github.io was verified as official when first introduced to the cask url "https://github.com/MooDoApp/MooDoApp.github.io/releases/download/v#{version}/Moo.do-#{version}.dmg" ...
38.857143
106
0.632353
b93b4c186c94bc5882693a157d301189c02de94b
1,730
# 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...
41.190476
86
0.651445
bb1e3b3638e6396ea1af874974c8d94ea590a06b
413
require "codeclimate-test-reporter" require "rspec" CodeClimate::TestReporter.start spec_path = File.dirname(__FILE__) $LOAD_PATH << File.expand_path("../lib", spec_path) support_glob = File.join(spec_path, "support", "**", "*.rb") Dir[support_glob].sort.each { |f| require f } require "simplecov" SimpleCov.start do...
19.666667
60
0.738499
18ce48aaa087d01bf1504efa96713f76748b43c0
3,542
# encoding: UTF-8 require_dependency 'carto/controller_helper' module Carto module Api class OverlaysController < ::Api::ApplicationController include Carto::ControllerHelper ssl_required :index, :show, :create, :update, :destroy before_filter :logged_users_only before_filter :load_vis...
33.102804
113
0.595426
61ec1464a678be4640c2040230c3041f05759369
1,729
# # Be sure to run `pod lib lint SwiftConfettiView.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 https://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'S...
42.170732
116
0.667438
ab427c250d77446484fdd100dbc69fcbe4ba730c
1,690
require "spec_helper" RSpec.describe "User", :type => :model do it "can be saved" do user = User.create(name: "Mordecai", email: "m@rshow.com") user.save! found = User.last expect(found.name).to eq("Mordecai") expect(found.email).to eq("m@rshow.com") end it "requires a name and an email" d...
28.644068
158
0.646154
ab31c45b346dcfe0b0e1a073e7cb4caf4dfc696c
1,429
require "employee" class Startup attr_reader :name, :funding, :salaries, :employees def initialize(name, funding, salaries) @name = name @funding = funding @salaries = salaries @employees = [] end def valid_title?(title) @salaries.key?(title) end def >(other) self.funding > other...
21.328358
64
0.677397
87cacc6d4645204a2d2f1cda0c38033df950ae05
1,431
require_relative '../../../spec_helpers/acceptance_spec_helper' resource 'Stats (prefix: /services/:service_id/stats)' do header 'Accept', 'application/json' header 'Content-Type', 'application/json' let(:existing_service_id) { '10000' } let(:service_id) { existing_service_id } let(:provider_key) { 'statsfo...
26.5
91
0.646401
21ff48450eb1d47cbe2e6652ca153626615b30b7
1,055
# == Schema Information # # Table name: solution_events # # id :integer not null, primary key # solution_id :integer not null # type :string not null # created_at :datetime not null # updated_at :datetime not null # # Indexes # # index_solution_events_...
22.446809
62
0.651185
ff4a29b8a7d0b859b33006624ea8055920f2066e
822
module Jekyll module Tags class PostComparer MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)$/ attr_accessor :date, :slug def initialize(name) who, cares, date, slug = *name.match(MATCHER) @slug = slug @date = Time.parse(date) end end class PostUrl < Liquid::Tag ...
20.55
68
0.541363
ed7a1d471ae50019480993808fe07ed59a6dae37
4,440
require 'digest/sha1' require 'fileutils' require 'tempfile' # Wrapper around a TMail object class Message attr_accessor :body attr_reader :mail, :attachments class << self attr_reader :queue_path, :archive_path attr_accessor :recipient_header_order end def self.queue_path=(path) FileUtils.mk...
20.747664
122
0.612387
ff7aa19f58b382baf1a0ffaaa976d2c7dda3c042
52
module Php2hamlPreprocessor VERSION = "0.0.1" end
13
27
0.75
116cf58c25f319cac5d82e047c5d936629600d9f
2,871
unified_mode true include Iptables::Cookbook::Helpers property :ip_version, Symbol, equal_to: %i(ipv4 ipv6), default: :ipv4, description: 'The IP version, 4 or 6' property :sysconfig, Hash, default: lazy { get_sysconfig(ip_version) }, description: 'The sysconfig sett...
29.90625
78
0.676419
e850f4510f18167d988c59aad22b553098573ccd
89
class CharacterComic < ApplicationRecord belongs_to :comic belongs_to :character end
17.8
40
0.820225
2805612003791b13691733410dd5d6288f9ce5a8
206
module Webhookable extend ActiveSupport::Concern def set_header response.headers["Content-Type"] = "text/xml" end def render_twiml(response) render text: response.text end end
17.166667
55
0.694175
91d133c423e49242fd2d0c7f17f6b9543086a13a
162
# Be sure to restart your server when you modify this file. BattleGameServer::Application.config.session_store :cookie_store, key: '_battle_game_server_session'
40.5
100
0.82716
4a0d5d512c4c4637e0669336b9ccca7312390c57
7,524
class TungstenReplicatorReadMasterEvents include TungstenScript include MySQLServiceScript def main begin topology = TI.topology(opt(:service)) datasource_type = TI.datasource_type(opt(:service), (topology.type == "direct")) case datasource_type when "mysql" if topology.type...
36
264
0.623339
bb524988e5f0e0521c3ca4ec02ad604606086f87
94,389
# 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::RDS class Resource # @param options ({}) # @option options [Client] :client def initi...
36.359399
151
0.622202
912416d53ce107651e980bb3753ba53ef64a9581
17,350
#! /usr/bin/env ruby require 'spec_helper' require 'puppet/application' require 'puppet' require 'getoptlong' require 'timeout' describe Puppet::Application do before(:each) do Puppet::Util::Instrumentation.stubs(:init) @app = Class.new(Puppet::Application).new @appclass = @app.class @app.stubs(:n...
27.893891
114
0.645648
bb0cab569cdd60f53e4a19fd38c99f9b416714a3
2,451
#Watch this video - https://vimeo.com/24093428 - these notes are in support of the video. Try to keep up, have the notes open and ADD YOUR OWN NOTES TO IT TO HELP CLARIFY EVERYTHING FOR YOURSELF. #At the end, you can always clean up your notes and make a pull request if you think that you've made improvements :) # O...
43.767857
195
0.666259
ed568d020a188ace5e4f5b7b82c815a0c7518086
268
class CreateInstruments < ActiveRecord::Migration[5.1] def change create_table :instruments do |t| t.column :brand, :string t.column :description, :string t.attachment :image t.column :price, :integer t.timestamps end end end
22.333333
54
0.660448
1ad6b531ca34b6edf415442220139c18be458bcc
1,466
# frozen_string_literal: true # a coordinate is used to indentify a tile based on the zoom level and the tile grid's x/y coordinates module Honua class Coordinate attr_accessor :row, :column, :zoom def initialize(row, column, zoom = 0) @row = row @column = column @zoom = zoom end ...
21.880597
102
0.590723
62db817158d0beb1d826e095c724e1d67289d008
312
module PokeApi class Move # MoveStatChange object handling all data fetched from /move for stat_changes class MoveStatChange attr_reader :change, :stat def initialize(data) @change = data[:change] @stat = Stat.new(data[:stat]) end end end end
20.8
81
0.612179
f7de95936648fe45e782c5c8ff6424fbe0486f2f
164
require "test_helper" class ServiceWorker::RailsTest < Minitest::Test def test_that_it_has_a_version_number assert ::ServiceWorker::Rails::VERSION end end
20.5
47
0.792683
ed482245dd1122f9af48621abfd677948b54ee56
2,689
module CASServer module Authenticators class Base attr_accessor :options attr_reader :username # make this accessible so that we can pick up any # transformations done within the authenticator # This is called at server startup. # Any class-wide initializiation...
39.544118
165
0.677203
26343091935a58b2b26aedf564db0050186612b0
36
module Defp VERSION = "0.0.2" end
9
19
0.638889
283d9747f2447247f206707de6ff67d9a4edb2d8
880
require 'spec_helper' require 'grocer/pusher' describe Grocer::Pusher do let(:connection) { stub_everything } subject { described_class.new(connection) } describe '#push' do it 'serializes a notification and sends it via the connection' do notification = stub(:to_bytes => 'abc123') subject.push...
22.564103
69
0.636364
e9eb5bed31a2dcaa0f319043d3d27465f36e6fcb
4,165
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/classes' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/shared/join' describe "Array#*" do it "tries to convert the passed argument...
31.793893
96
0.628812
38fea8ec3630d2cc7ae2d59fff6ee752bdaae1cd
2,544
# 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 #...
32.202532
86
0.699292
01074db3754e756c620b54072b0801bd55023dcb
706
# frozen_string_literal: true require "rails_helper" feature "opt-in-undergrad end-to-end journey", type: :feature do background { given_i_am_authenticated } scenario "submit for TRN", "feature_routes.opt_in_undergrad": true do given_i_have_created_an_opt_in_undergrad_trainee and_the_personal_details_is_...
32.090909
71
0.842776
e8443923c77dc325bf03b3f74b3fa620c780d9c7
2,634
# -*- coding: utf-8 -*- require 'spec_helper' require_relative 'shared/block_examples' # rubocop:disable EmptyLines, LineLength describe RubyToBlock::Block::EventsOnStart, to_blocks: true do parts = <<-EOS car1.on(:start) do end EOS describe compact_source_code(parts), character_new_data: true do _parts = ...
21.768595
83
0.611238
6a3e875b860d220af70a1b7bc9b8198d552c5a9b
891
class Jekyll::Site alias :original_site_payload :site_payload def site_payload data = original_site_payload month_index = {} year_index = [] post_count = [] posts.reverse.each do |post| y = post.date.year ...
28.741935
68
0.446689
5ddb3f50c81b80aaae934c6b7bb03068910aaecb
1,254
#!/usr/bin/env ruby require 'test/unit' # begin require 'rubygems' rescue LoadError end # require 'ruby-debug'; Debugger.start # Test --no-stop and $0 setting. class TestDollar0 < Test::Unit::TestCase @@SRC_DIR = File.join(Dir.pwd, File.dirname(__FILE__)) unless defined?(@@SRC_DIR) require File.join(@@SRC...
30.585366
72
0.526316
1ccfeea2e77fb3cbbcd7bd2816bee9f902476142
2,811
require 'spec_helper' RSpec.describe Steps::Details::WhatSupportForm do let(:arguments) { { tribunal_case: tribunal_case, language_interpreter: language_interpreter, language_interpreter_details: language_interpreter_details, sign_language_interpreter: sign_language_interpreter, sign_language_int...
32.686047
105
0.702241
33ea8c23d6501c55a74bb4e51de3b5580c127ce7
872
module API module V1 module Deezer class SearchController < API::V1::BaseController def artists render_data_with_status end def albums render_data_with_status end def tracks render_data_with_status end private ...
18.956522
54
0.482798
5da14e7da0d8854fb8f80f5a217ec7633524149c
278
require "rails_helper" RSpec.describe Filter::Resource::User do let(:filterable_factory) { :user } let(:association_chain) { User.all } describe "#resources" do include_examples "metadata_attribute_filter" include_examples "timestamp_attribute_filter" end end
23.166667
49
0.76259
5df9ea3d03209c9827f2865f8cac2f724d24ca70
656
# Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. require 'indexed_search_test' class EmptyIndex < IndexedSearchTest # with 2 columns and 1 document, one of the columns will get an empty index. def nightly? true end def setup set_owner("a...
21.866667
111
0.719512
6abaa6f8c253179da6e153edb3e9f9cb5b20eb17
1,006
require File.expand_path("../../Abstract/abstract-php-extension", __FILE__) class Php55Yp < AbstractPhp55Extension init homepage "https://pecl.php.net/package/yp" url "https://pecl.php.net/get/yp-1.0.1.tgz" sha256 "097fc6953c8faaf748acb34bb0c11ca81672f46fc19cd48f8a6c7da6714fa468" head "https://git.php.net:/r...
33.533333
92
0.744533
4a8718dac8133cd5dd60760f5fb7c1341430e9f7
22,562
# 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...
50.137778
126
0.543214
18c2c87a5cdcb9507304bc8a80baf049cd943a46
770
def Object.const_missing(const) if const == :ROLLOUT require 'redis' redis_url = ENV['REDIS_URL'] || 'redis://localhost:6379/0/supermarket' redis = Redis.new(url: redis_url) Object.const_set('ROLLOUT', Rollout.new(redis)) features = ENV['FEATURES'].to_s.split(',') # # Features that are...
23.333333
74
0.650649
e9d0968150e4c5cb0feee95e78c605661120dcc6
429
require 'spec_helper_acceptance' # Ensure time synchronization is in use - Section 2.2.1.1 describe package('ntp') do it { should be_installed } end describe package('chrony') do it { should be_installed } end # Ensure ntp is configured - Section 2.2.1.2 describe file('/etc/ntp.conf') do it { should be_f...
23.833333
57
0.689977
26bf62ef7beadf5db57ee95553d83e106f67ef94
2,091
require 'one_gadget/gadget' # https://gitlab.com/david942j/libcdb/blob/master/libc/libc0.3-2.19-14~1/lib/i386-gnu/libc-2.19.so # # Intel 80386 # # GNU C Library (Debian GLIBC 2.19-14~1) stable release version 2.19, by Roland McGrath et al. # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; s...
52.275
158
0.589192
e27f9372897985622b8601cba543fa4562aaf44b
1,116
class Array def to_hash_values(starting_key = 0, &block) key = starting_key block = proc { |key| key + 1 } unless block_given? t = {} each do |entry| t[key] = entry key = block.call key end t end alias_method :to_hash_as_values, :to_hash_values def to_indexed_hash(starting_...
18.295082
102
0.608423
083119cc77303bebb0e518f02a6b372a056ff083
756
Pod::Spec.new do |s| s.name = 'RxReusable' s.version = '0.3.1' s.summary = 'Reusable cells and views for RxSwift' s.homepage = 'https://github.com/devxoul/RxReusable' s.license = { :type => 'MIT', :file => 'LICENSE' } s.author = { 'Suyeol Jeon' => 'de...
32.869565
77
0.534392
619b164e4656bd4c6bbc5cebb46b10b2d4bd1514
1,194
# -*- encoding: utf-8 -*- =begin #OpenAPI Extension generating aliases to maps and arrays as models #This specification shows how to generate aliases to maps and arrays as models. The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: unset =end $:.push ...
30.615385
98
0.663317
03091b5b2a27903e164ba90a15f74294a18c25b4
963
module SimpleCache module Helpable extend ActiveSupport::Concern def cache_association_model(method_name, &block) @association_simple_cache ||= {} @association_simple_cache[method_name] ||= begin cache_key = simple_cache_association_key(method_name.to_sym) begin SimpleCa...
32.1
93
0.708204
ffed8568b88f587eaf6fe6ff2f5eb090996348ea
4,683
# frozen_string_literal: true module Montrose # A schedule represents a group of recurrences # # @author Ross Kaffenberger # @since 0.0.1 # @attr_reader [Array] rules the list of recurrences # class Schedule include Enumerable attr_accessor :rules class << self # Instantiates a schedu...
25.313514
100
0.581892
620a30b67a0c3461f30b4de36a20654c199d99dc
2,251
class LoadError < ScriptError; end module Kernel begin eval "1", nil def _eval_load(*args) self.eval(*args) end rescue ArgumentError def _eval_load(*args) self.eval(args[0]) end end def load(path) raise TypeError unless path.class == String if File.exist?(path) && File...
22.969388
84
0.605509
28529ddf1e7466e55bd3ec40514c95aaae2b7867
1,115
module SessionsHelper def log_in(user) session[:user_id]=user.id end def remember(user) user.remember cookies.permanent.signed[:user_id] = user.id cookies.permanent[:remember_token] = user.remember_token end def current_user?(user) user == current_user end def current_user i...
20.648148
73
0.680717
1ad14fd13ebd1dd8cf42213d56171a59e8737395
1,957
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. config.action_mailer.default_url_options = { :host => "localhost:3000" } # In the development environment your application's code is reloaded on # every request. This slows down response time but ...
34.946429
85
0.76188
1c79c75e5f523c191f08e317db4e99018ff1e01d
1,038
module DropdownHelpers def select_option_on_singleselect(selector, option_text) elem = find(selector) elem.click elem.find('.chosen-drop .chosen-results .active-result', text: option_text).click end def select_option_on_multiselect(parent_selector, option_text) elem = find(parent_selector) op...
28.054054
85
0.736994