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
110db494f5aded2d546d90b369aa826bef436561
569
# frozen_string_literal: true module ReleaseTools module SharedStatus extend self def dry_run? ENV['TEST'].present? end def critical_security_release? ENV['SECURITY'] == 'critical' end def security_release? return true if ENV['SECURITY'].present? @security_release ...
17.242424
52
0.650264
21750a3be6bc218ffb8bb7cca20eb7fdd23a0386
188
class Version include Mongoid::Document include Mongoid::Timestamps::Created field :title field :body belongs_to :article belongs_to :user index({ :article_id => 1 }) end
14.461538
38
0.712766
e2be813723359d7b29839477f2f73b91929cec95
441
# frozen_string_literal: false require 'spec_helper' RSpec.describe Struct do let(:s1) do person = described_class.new(:name, :age) person.new('bob', 60) end describe '#attributes' do it 'to be { ... }' do expect(s1.attributes).to eq(name: 'bob', age: 60) end end describe '#replace' ...
16.961538
55
0.600907
879e0987ff70b26cb879bf8fd18a53a7d30b3aba
644
require "fog/core/model" module Fog module Google class SQL ## # A Google Cloud SQL service flag resource # # @see https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/flags class Flag < Fog::Model identity :name attribute :allowed_string_values, :aliases => "a...
26.833333
76
0.631988
5d87a943a5dd1828aacdee8b16187f847bcffac9
767
module Releasetool module Util DIR = "release_notes" VERSION_FILE = ENV['RELEASETOOL_VERSION_FILE'] || "config/initializers/00-version.rb" #rails out of box TEMPLATE_FILE = "__TEMPLATE__.md" # relative to DIR RELEASE_MARKER_FILE = ".RELEASE_NEW_VERSION" # should be a config var def stored_versio...
31.958333
126
0.713168
ed32dd149060e5f8ea6c0bd96f43bd6438bca972
3,789
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
41.184783
102
0.757192
ac2a483e5fd469115260e05895e40268931cafb9
767
Pod::Spec.new do |s| s.name = 'Collor' s.version = '1.1.23' s.summary = 'A MVVM data-oriented framework for UICollectionView.' s.homepage = 'https://github.com/voyages-sncf-technologies/Collor' s.screenshots = 'https://raw.githubusercontent.com/voyages-sncf-technolog...
51.133333
123
0.6206
62fd99bd254980538ab7ec89879c68333300d81f
1,164
# == Schema Information # # Table name: users # # id :integer not null, primary key # email :string(255) default(""), not null # encrypted_password :string(255) default(""), not null # reset_password_token :string(255) # reset_password_sent_at :datetime...
36.375
80
0.609966
e906a176e008b3b7b83a02b00fe95562feaf8c7b
1,438
# # Cookbook Name:: delivery-cluster # Spec:: delivery_spec # # Author:: Salim Afiune (<afiune@chef.io>) # # Copyright:: Copyright (c) 2015 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wit...
29.346939
74
0.733658
e979fe29791aba7ba4442db39301c690dbdb37e6
600
# frozen_string_literal: true require 'grpc_mock/api' require 'grpc_mock/version' require 'grpc_mock/configuration' require 'grpc_mock/adapter' require 'grpc_mock/stub_registry' module GrpcMock extend GrpcMock::Api class << self def enable! adapter.enable! end def disable! adapter.disabl...
15.789474
51
0.67
bf756a0dd5978afae267e01393ba345a853298bc
826
require 'spec_helper' describe Signalwire::Relay::Calling::SendDigits do let(:client) { Signalwire::Relay::Client.new(project: 'myproject', token: 'mytoken') } let(:call) { Signalwire::Relay::Calling::Call.new(client, mock_call_hash.dig(:params, :params, :params)) } let(:digits) { '1234' } subject { described_...
28.482759
108
0.640436
87c4bf81b95d55b267c4991b5abcefa9e37ccdf4
475
cask :v1 => 'propresenter' do version '5.2.8' sha256 '47981ded0b025db373897b0103e9fa2894f4f0a073596da3725a739d33716e11' url "https://www.renewedvision.com/downloads/ProPresenter5_#{version}_b11499.dmg" appcast 'https://www.renewedvision.com/update/ProPresenter5.php', :sha256 => 'f70029136ad0273f64bdb...
36.538462
87
0.783158
bfb0086ac2d38495b4fe0e87d961828bfef75e71
7,732
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic...
39.85567
245
0.693482
d5ed894e7cc0b5b80a5d56be67d2c3e5f1afd95b
2,178
require 'one_gadget/gadget' # https://gitlab.com/libcdb/libcdb/blob/master/libc/libc0.1-i686-2.19-18+deb8u3/lib/i386-kfreebsd-gnu/i686/cmov/libc-2.19.so # # Intel 80386 # # GNU C Library (Debian GLIBC 2.19-18+deb8u3) stable release version 2.19, by Roland McGrath et al. # Copyright (C) 2014 Free Software Foundation, ...
53.121951
158
0.598255
39d33344a3e7064c776e0e9ee82520d038f269a6
1,474
# frozen_string_literal: true RSpec.describe PrawnHtml::Tags::A do subject(:a) { described_class.new(:a, attributes: { 'style' => 'color: #fb1' }) } it { expect(described_class).to be < PrawnHtml::Tag } context 'without attributes' do before do a.process_styles end it "styles doesn't include...
30.708333
149
0.662822
e99a6b4c41d2f5b82350c81057258622e572dee4
1,674
module AcceptanceTest class << self def included(klass) klass.class_eval do def self.log_to_console Xeroizer::Logging.const_set :Log, Xeroizer::Logging::StdOutLog end def self.no_log Xeroizer::Logging.const_set :Log, Xeroizer::Logging::DevNullLog end ...
31
98
0.682198
ff46dd5a50dc018a31c4264df416d6a2d233fcdc
961
# frozen_string_literal: true require 'telegram/core_ext' module Telegram module API module Bot module Types # See the {https://core.telegram.org/bots/api#maskposition official documentation}. # # @!attribute [rw] point # @return [String] # @!attribute [rw] x_shif...
21.355556
91
0.463059
4aa4a20d4c4f4d8c9a503a21a7457393f38f9094
1,394
# frozen_string_literal: true module Theme class Project < ShopifyCli::ProjectType hidden_feature title("Theme") creator("Theme::Commands::Create") connector("Theme::Commands::Connect") register_command("Theme::Commands::Deploy", "deploy") register_command("Theme::Commands::Generate", "gener...
34
98
0.753945
26b29cf8c9009df054dbbeeea0c7c8b9aa9fb27f
661
Pod::Spec.new do |s| s.name = "SOMessaging" s.version = "1.0.0" s.summary = "Messaging library for iOS 7.x " s.platform = :ios, '7.0' s.source = { :git => "https://github.com/SocialObjects-Software/SOMessaging.git", :tag => "1.0.0" } s.description = <<-DESC ...
36.722222
107
0.588502
ab95a02b6f1107139b7849d0ee24ed08153d16a5
527
Pod::Spec.new do |s| s.name = 'Train' s.version = '0.0.2' s.summary = 'A simple dependency injection framework for objective c, written while traveling in a train.' s.homepage = 'https://github.com/tomersh/Train' s.author = { 'Tomer Shiri' => 'train@shiri.info' } s.source =...
40.538462
113
0.586338
4a8e969ad0610a75a4466dba8548eb1f2a5b5334
307
require "jekyll" require "fileutils" require "fyntech_feed/version" require "fyntech_feed/generator" module FyntechFeed autoload :MetaTag, "fyntech_feed/meta-tag" autoload :PageWithoutAFile, "fyntech_feed/page-without-a-file.rb" end Liquid::Template.register_tag "feed_meta", FyntechFeed::MetaTag
25.583333
69
0.794788
1d68a87417e9b9c2c1ad76cf63ca9c4ee841f53e
7,535
# frozen_string_literal: true module Jekyll class Renderer attr_reader :document, :site attr_writer :layouts, :payload def initialize(site, document, site_payload = nil) @site = site @document = document @payload = site_payload end # Fetches the payload used in Liquid ren...
28.327068
89
0.645919
e277aefc03cb4599af875840c918003328c2c67e
2,597
# 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 = "wunderground" s.version = "1.2.0" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rub...
35.094595
105
0.615325
213cff9381185122cf2cd5efec0533bfffa08287
2,775
class Neo4j < Formula desc "Robust (fully ACID) transactional property graph database" homepage "https://neo4j.com/" url "https://neo4j.com/artifact.php?name=neo4j-community-4.1.0-unix.tar.gz" sha256 "b598edeb3401e5ec40fb7bc3370307addfcaa21565f731016c9c7f8e70af659a" bottle :unneeded # Upstream does not in...
33.433735
109
0.645405
ac69c1a667d93934bef958624b81191df6c638bd
90,541
# frozen_string_literal: true require 'spec_helper' describe Repository do include RepoHelpers include GitHelpers TestBlob = Struct.new(:path) let(:project) { create(:project, :repository) } let(:repository) { project.repository } let(:broken_repository) { create(:project, :broken_storage).repository } ...
30.817223
150
0.662738
911549425b6793c8e833fc93389b31582989ee38
9,286
require 'rubygems' require 'RMagick' # This script draws ukulele chords for use in # tabs or elsewhere # # Author:: Tom MacWright (mailto:macwright@gmail.com) # Copyright:: Copyright (c) 2008 Tom MacWright # License:: BSD License CHORD_LIST = { 'C' => [3, 0, 0, 0], 'Cm' => [3, 3, 3, 0], 'C7' ...
28.660494
77
0.326513
387984d89a3ef103e948576ebfd0c6849794820c
2,203
#!/usr/bin/env ruby # require './lib/db.rb' require "inifile" require 'dbi' class IniLoad def initialize @ini = IniFile.load("./sclman.conf") end def search( section, name ) val = @ini[section][name] return "#{val}" end end ini = IniLoad.new dbname = ini.search("DB", "dbname") dbuser = ini.searc...
28.24359
110
0.589197
01045b14a9e1191dccf791b043245cc34be84f8b
713
$:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "record_revision/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "record_revision" s.version = RecordRevision::VERSION s.authors = ["ponpocopocopon"] s.email ...
32.409091
98
0.667602
08fbd379616625bbe5958bc020376e7097a67718
3,459
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. #Bundler.require(*Rails.groups) Bundler.require(:default, Rails.env) # IMS-LTI OAUTH_10_SUPPORT = true require 'oauth/request_proxy/actio...
43.78481
139
0.730558
f8a1f3e3b3c6392d1bf75706c106f67a2ca700dc
1,060
class SponsorsController < ApplicationController before_action :set_sponsor, only: [:update, :edit, :show, :destroy] before_action :authorize_sponsor, except: [:index, :new, :create] def index @sponsors = Sponsor.all authorize @sponsors end def show end def new @sponsor = Sponsor.new ...
18.275862
87
0.679245
03b409c4aa91a1a7958f437cac3148e3b8e6f797
1,559
dir = File.dirname(__FILE__) require File.expand_path("#{dir}/../helper/spec_helper") describe "an RogueGemFinder instance" do before(:each) do GemInstaller::TestGemHome.use @registry = GemInstaller::create_registry @rogue_gem_finder = @registry.rogue_gem_finder @gem_command_manager = @registry.gem_c...
38.02439
149
0.744067
e2392b239d30c264342fefe1d90a8e2702683156
794
module Railspress class Category < Taxonomy has_many :sub_categories, class_name: Railspress::Category.name, foreign_key: :parent, primary_key: :id def self.cloud cats = all.reject{|r| r.posts.empty?} total_posts = cats.inject(0){|sum, t| sum += t.count} cats.map{|t| {category: t, size: 1.0...
44.111111
120
0.685139
acfdd0fd983d9b2852c9051a211e925a910372c1
3,237
# frozen_string_literal: true # == Schema Information # # Table name: training_slides # # id :bigint(8) not null, primary key # name :string(255) # estimated_ttc :string(255) # wiki_page :string(255) # slide_slugs :text(65535) # description :text(65535) # translatio...
28.901786
89
0.703429
1a760508723bd1c9f2ffac981fdce34197d6eadd
9,951
require 'set' module ActiveRecord class Base class ConnectionSpecification #:nodoc: attr_reader :config, :adapter_method def initialize (config, adapter_method) @config, @adapter_method = config, adapter_method end end # Check for activity after at least +verification_timeout+ ...
35.539286
149
0.643654
8707a247f3884736cf02b36bd2781da89f1e2328
2,499
module Netzke module Core module DynamicAssets class << self def ext_js(form_authenticity_token) res = initial_dynamic_javascript(form_authenticity_token) << "\n" include_base_js(res) # Ext-specific JavaScript res << File.new(File.expand_path("../../../../ja...
35.197183
151
0.603041
d5522994990023dba35f541b838f782c2ad0ec43
38
module Steep VERSION = "0.49.1" end
9.5
20
0.657895
6af0c34c18b5dee75eac12fba3e3c27cde1ecfe9
1,082
cask "reaper" do version "6.17.0,6.17" if MacOS.version <= :mojave sha256 "dff7839871a244f4d3343dd4f5386faace7a56f42df427df4d4995063a77f568" url "https://www.reaper.fm/files/#{version.major}.x/reaper#{version.after_comma.no_dots}_x86_64.dmg" else sha256 "baaff9741d6982086aa2ec301014b11c8f4883c3bcfd3...
34.903226
113
0.748614
acd0bd1717131f9d39f5217e726a524397a6d151
2,457
module Calagator module DuplicateChecking class DuplicateFinder < Struct.new(:model, :fields) def find scope = model.all scope = yield(scope) if block_given? scope = apply_query(scope) unless na? group_by_fields(scope.to_a) end def fields super.map(&:to_sym) end pr...
26.419355
102
0.601954
4a77356c818b3c4ec92a219d5925d83735adae8f
1,037
=begin #Selling Partner API for Merchant Fulfillment #The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping for non-Prime and Prime orders using Amazon’s Buy Shipping Services. OpenAPI spec version: v0 Generated by: https://github.com/swagger-api/swagger-cod...
29.628571
182
0.784957
6250b8bedfa6718c1cc55db941cd6c1867af1896
263
class AddCounterCacheColumnForRelatedContentLinks < ActiveRecord::Migration def change rename_column :contact_records, :websites_count, :contact_form_links_count add_column :contact_records, :related_content_links_count, :integer, default: 0 end end
32.875
83
0.825095
ff0120c6b99a5e959890d6f65a36c403106bc127
672
# # Cookbook:: apache2 # Recipe:: mod_authn_dbd # # Copyright:: 2013, OneHealth Solutions, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
32
74
0.754464
8756b5e3b9f59310824c256e5a09bd606fcbf20b
1,630
require 'rails_helper' module Genova module Command describe Executor do let(:executor) { Command::Executor.new } let(:io_mock) { double(IO) } describe 'command' do context 'when command was successful.' do it 'should be return stdout' do allow(io_mock).to receive...
28.103448
88
0.539877
abff51de79c3d17680b8f29588d425dc0380fddb
3,617
RSpec.describe 'Glueby::Contract::Timestamp' do describe '#save!' do subject { contract.save! } let(:contract) do Glueby::Contract::Timestamp.new( wallet: wallet, content: "\01", prefix: '' ) end let(:wallet) { TestWallet.new(internal_wallet) } let(:internal_wa...
41.102273
148
0.699475
87fe2b9d300204d61b23e5663b8e4c80bec14222
1,040
{ matrix_id: '1638', name: 'tols2000', group: 'Bai', description: 'TOLOSA MATRIX', author: 'S. Godet-Thobie', editor: 'Z. Bai, D. Day, J. Demmel, J. Dongarra', date: '1991', kind: 'computational fluid dynamics problem', problem_2D_or_3D: '1', num_rows: '2000', num_cols: '2000...
30.588235
133
0.658654
6a81f7ac5848fed16a315dba5642060e1d7c7ccb
5,133
# mundi_api # # This file was automatically generated by APIMATIC v2.0 ( # https://apimatic.io ). require 'date' module MundiApi # Response object for getting a customer class GetCustomerResponse < BaseModel # TODO: Write general description for this method # @return [String] attr_accessor :...
31.29878
79
0.543931
7af30a2f2e64f96960ac0e0157f814e47d406438
6,579
# frozen_string_literal: true require 'dry-logic' require 'dry/logic/rule_compiler' require 'dry/logic/predicates' module Typed module Builder # Entrypoint def self.any AnyHandler.instance end Result = ::Struct.new(:ok, :value, :message) class Result ...
27.4125
112
0.489132
b9152b2bb97c42a4bd1eb4d72a770267a7e7dcbb
2,344
require 'active_support/core_ext/integer/time' # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data the...
38.42623
85
0.780717
21532358aee8c5373c055badbdc44d3381a85c70
460
require 'spec_helper' describe Notification do it { should belong_to(:user) } it { should belong_to(:action_user) } it { should belong_to(:notifiable) } it { should_not allow_mass_assignment_of(:user_id) } it { should_not allow_mass_assignment_of(:action_user_id) } it { should_not allow_mass_assignment_of...
32.857143
62
0.769565
f742692f4831902ba6098b4002ed84933af8848a
538
require 'test_helper' require 'merge_sort' require 'sort_strategy_test' class MergeSortTest < Minitest::Test SORT_STRATEGY = MergeSort include SortStrategyTest def test_time_complexity_output best = MergeSort::TIME_COMPLEXITY_BEST worst = MergeSort::TIME_COMPLEXITY_WORST average = MergeSort::TIME_...
26.9
48
0.737918
28fb1bf561509701cc54c338331fc04d6edce984
314
require 'test_helper' class ServiceTypeTest < Test::Unit::TestCase def test_new membership = ServiceType.new('MEMBERSHIP', "Membership", "Membership for this shop.") assert_equal "MEMBERSHIP", membership.id end def test_indexed assert_equal 'MEMBERSHIP', ServiceType[:membership].id end end
22.428571
89
0.742038
e977fc0118f0335a3bea3b00b65de3e78d78957c
1,976
# 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...
42.042553
126
0.742409
280d88bd05153d011f3c5d9c510fb626cbe84ad3
2,722
# == Schema Information # # Table name: tafsirs # # id :integer not null, primary key # group_verse_key_from :string # group_verse_key_to :string # group_verses_count :integer # hizb_number :integer # juz_number :integer # language_name :string # manzil_n...
32.404762
74
0.616458
1859721778fd6cd14ea38fac35338e8a727ed0d3
8,675
require 'psych' require 'delegate' module Travis::Yaml module Parser class Psych class SetNode < DelegateClass(::Psych::Nodes::Mapping) def children super.select.with_index { |_,i| i.even? } end end class ScalarSequence < DelegateClass(::Psych::Nodes::Mapping) ...
38.727679
104
0.575908
bb734ffea20de5a60c42ae3c06005fbb2f0d1950
628
Pod::Spec.new do |s| s.name = "TLTiltSlider" s.version = "1.0" s.summary = "A UISlider subclass which adjusts its appearance based on the positional attitude of an iOS device." s.homepage = "https://github.com/TeehanLax/TLTiltSlider" s.license = 'MIT' s.author = { "Ash Furro...
41.866667
120
0.622611
6aa6bbc5989d8caf5a2e476a8d9f57facde49e3d
264
class Rsvps < ActiveRecord::Migration[6.0] def change create_table :rsvps do |t| t.datetime :created_at t.integer :user_id, index: true, foreign_key: true t.integer :event_id, index: true, foreign_key: true end end end
24
58
0.640152
f8c55067073b2c082ce2b2bd65fe0d69f00b12fc
1,598
require_relative '../spec_helper.rb' describe 'neo4j::config' do let(:chef_run) { ChefSpec::SoloRunner.new.converge(described_recipe) } let(:neo4j_server_properties_template) { chef_run.template('/var/lib/neo4j/conf/neo4j-server.properties') } let(:neo4j_properties_template) { chef_run.template('/var/lib/neo4j/c...
47
109
0.765332
3800f1e34fab39ae707802b30e18c6c9be36cd81
4,830
# frozen_string_literal: true # == Schema Information # # Table name: pledges # # id :integer not null, primary key # user_id :integer # created_at :datetime not null # updated_at :datetime not null # wishlist_item_id :integer # quantity :intege...
27.919075
95
0.637888
b9c678e012941a53597eb8bfbc9680b1407c1e7d
134
require 'rails_helper' RSpec.describe PostPostCategory, type: :model do pending "add some examples to (or delete) #{__FILE__}" end
22.333333
56
0.761194
f8468eebf017eb9e497fc2b47df8c2a938fbca0f
962
class AuthorizeApiRequest def initialize(headers = {}) @headers = headers end # Service entry point - return valid user object def call { user: user } end private attr_reader :headers def user # check if user is in the database # memoize user object @user ||= User.fin...
22.904762
75
0.686071
393733730f88881b31b9c4fc40ce3b4cfbd67551
501
module Kontena::Cli::Vault class UpdateCommand < Clamp::Command include Kontena::Cli::Common parameter 'NAME', 'Secret name' parameter '[VALUE]', 'Secret value' def execute require_api_url token = require_token secret = value if secret.to_s == '' secret = STDIN.read ...
23.857143
70
0.61477
115ca932f3eeca93cdb72962806c2de24f28573a
131
## $:.unshift(File.dirname(__FILE__)) ## minitest setup require 'minitest/autorun' ## our own code require 'base32-alphabets'
11.909091
37
0.709924
e24f97bdd4661c5718f76c0251d53bbf86dad164
2,733
# config valid for current version and patch releases of Capistrano lock "~> 3.11.0" set :repo_url, 'git@github.com:ali-hassan/decomates.git' set :application, 'marketplace' set :user, 'ubuntu' set :puma_threads, [4, 16] set :puma_workers, 3 # Don't change these unless you know what you're...
31.056818
100
0.669594
b9ed541254a2047a58210fc86569e55698381df1
1,061
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'hashie_mash_knockoff/version' Gem::Specification.new do |spec| spec.name = 'hashie_mash_knockoff' spec.version = HashieMashKnockoff::VERSION spec.authors = ['Michael Po...
36.586207
104
0.653157
918f87f9a092b0da845e82b28b2e3e56211ca849
613
# == Schema Information # # Table name: containers # # content :jsonb # created_at :datetime not null # id :integer not null, primary key # locale :string # page_id :integer # row_order :integer # slug :string # type :string # updated_at :datetime not nul...
20.433333
53
0.624796
1c24ab9927e59bc07c8480d3f8de9fe85247e6fe
971
require_relative 'common' module Kontena::Machine::Aws class KeypairProvisioner attr_reader :ec2, :region, :public_key, :keypair_name # @param [String] access_key_id aws_access_key_id # @param [String] secret_key aws_secret_access_key # @param [String] region def initialize(access_key_id, secre...
24.897436
109
0.644696
628421f69d243b8143c81d9e5c4a3564fcfe7921
128
class AddRecipeToComments < ActiveRecord::Migration[6.0] def change add_column :comments, :recipe, :text end end
18.285714
56
0.703125
e28163ae454cb76b623fec58e4400e70367662df
5,373
# 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::V2018_06_01 module Models # # Spark Server dataset. # class SparkObjectDataset < Dataset include MsRestAzure ...
30.355932
78
0.427136
183827cc442271328e5ade3da717e4c938d3166e
209
class CreateUserInterests < ActiveRecord::Migration def change create_table :user_interests do |t| t.belongs_to :user t.belongs_to :interest t.timestamps null: false end end end
19
51
0.698565
d5ea3a233da8fabace4e1b94296c46411c768527
2,053
class AccountYear attr_accessor :account, :year, :debits, :credits def initialize(account:, year:, debits: false, credits: false) @account = account @year = year @debits = debits @credits = credits end def collection @collection ||= ( # All the groups categories = items.map { |...
25.036585
115
0.590843
213f1f16fe9fa61e6aec8b43144780163cd372d1
3,419
require 'gitlab' # @summary # This class wraps Gitlab::Client and provides the method implementations # required by pdksync main to access the Gitlab API for creating merge # requests, adding labels, and so forth. class PdkSync::GitlabClient # @summary # Creates a new Gitlab::Client and logs in the user ba...
37.163043
87
0.718924
28ccca809602ef8342377483018552a4e2f579de
3,499
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(:default, :assets, Rails.env) module Samson class Application < Rails::Application # Settings in config/environment...
42.670732
116
0.724779
282c50689f96c52598491b8f60950c0db755b580
5,266
# frozen_string_literal: true module Spree module Stock class Package attr_reader :stock_location, :contents attr_accessor :shipment # @param stock_location [Spree::StockLocation] the stock location this package originates from # @param contents [Array<Spree::Stock::ContentItem>] the con...
36.825175
113
0.657045
33579d4ad44470fed1be1e650efce09a00429ea0
321
edition_id = 644875 edition = Edition.where(id: edition_id).first if edition.present? edition.minor_change = true # Skip validation here, because normally editions in a superseded state cannot # have their minor_change field modified. edition.save(validate: false) else "Edition #{edition_id} not found." end...
24.692308
80
0.766355
26f46fa1180fa33448bdc93a031fe1d223127d75
3,031
module Charyf module Utils class Machine DefaultExists = Class.new(ArgumentError) NotInState = Class.new(ArgumentError) InvalidDefinition = Class.new(LoadError) InvalidEvent = Class.new(ArgumentError) class << self def state(name, default: false, final: false, action: nil,...
23.679688
141
0.533157
61236fac8da8ab45f2efa1fb808cd4a0308036ad
125
class AddUserToProf < ActiveRecord::Migration[5.1] def change add_reference :profs, :user, foreign_key: true end end
20.833333
50
0.744
ed63516e9b5a56c2b025f4175aa79b73d88e2b1d
38
module Draper VERSION = "1.2.0" end
9.5
19
0.657895
01964507a40f7d26c68cb7ac58f5706ef71a49b2
157
class AddScheduleOptionToLeagues < ActiveRecord::Migration[5.0] def change add_column :leagues, :schedule, :integer, default: 0, null: false end end
26.166667
69
0.751592
62b3209df57904612161e1f82a394d13d7759477
333
cask 'vuescan' do version '9.7.19' sha256 '549dcd2c3562f3628fae2eb4b339aec15f11a778bd3cfb59a9b00018af3ecfa1' url "https://www.hamrick.com/files/vuex64#{version.major_minor.no_dots}.dmg" appcast 'https://www.hamrick.com/alternate-versions.html' name 'VueScan' homepage 'https://www.hamrick.com/' app 'VueS...
27.75
78
0.75976
e8e6b772ea37e46171abf59c1a0767baa899f536
1,494
module MetaTags class Renderer LINE_SEPARATOR = "\n" attr_reader :template, :vendors delegate :content_tag, :tag, to: :template def initialize(template, vendors: nil) @template = template @vendors = vendors end def render [ charset_tag, title_tag, ...
21.342857
71
0.621151
ab11609a3b8f3bdb4b73f54e12e2d5da7e13b1ff
9,520
# # This class was auto-generated from the API references found at # https://epayments-api.developer-ingenico.com/s2sapi/v1/ # require 'ingenico/connect/sdk/domain/payment/bank_transfer_payment_method_specific_output' require 'ingenico/connect/sdk/domain/payment/card_payment_method_specific_output' require 'ingenico/co...
70.518519
213
0.772374
7a3a80aa6b6c26ad51f6e69deb577147f5e6c5a5
180
Sequel.migration do up do add_column :storage_apps, :state, String, size: 50, default: 'active', null: false end down do drop_column :storage_apps, :state end end
18
86
0.694444
26ed8cbf51e00a4d7ccab8996dd0da6fcfe8fcef
1,406
Pod::Spec.new do |s| s.name = 'BBMetalImage' s.version = '1.2.0' s.summary = 'A Swift library for GPU-accelerated image/video processing based on Metal.' s.description = <<-DESC 80+ built-in filters. Filter chain supported. Customized...
33.47619
102
0.576814
f7be54dcac9b2eab12a20d2673e1ca50792358e9
3,020
module Wikiplus class Admin::PagesController < Admin::ApplicationController before_action :check_abilities, except: [:index, :show] def index @pages = Page.where(mainpage_id: nil).order(:sortid) @list = [] @pages.each{|p| add_to_list_page p, 1 } end def show @pa...
24.354839
212
0.568543
182791666de9df9b750c5d59e74a0a3928c3ebc7
1,601
shared_examples_for 'a jdk build sexp' do let(:export_jdk_version) { [:export, ['TRAVIS_JDK_VERSION', 'openjdk7']] } let(:sexp) { [:if, '"$(command -v jdk_switcher &>/dev/null; echo $?)" == 0'] } let(:run_jdk_switcher) { [:cmd, 'jdk_switcher use openjdk7', assert: true, echo: true] } let(:set_du...
27.603448
95
0.648969
ffe127ac38caa46beb45e387e6df3bf92d0dec21
1,341
# frozen_string_literal: true class GenerationTestCase include ::RSpec::Matchers def initialize(router) @router = router end def run!(tests) _run! :path, tests _run! :url, tests end private def _run!(type, tests) _for_each_test(type, tests) do |actual, expected| expect(actual).t...
18.369863
68
0.611484
01dbae1765b686f71cf75b06402214b4d3c1fd05
1,771
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suit...
41.186047
85
0.779221
f83c02c2f8fb7ceacef3c3222e2e030c2e53f35a
1,925
require 'spec_helper' describe Puppet::Type.type(:iis_site).provider(:webadministration) do let(:resource) do result = Puppet::Type.type(:iis_site).new(name: 'iis_site') result.provider = subject result end context 'verify provider' do it { is_expected.to be_an_instance_of Puppet::Type::Iis_site...
33.77193
93
0.528831
d5fb337a2456e62320b1c03c5653d9cc0ab3cb4e
90
module BookingSync module Public class Availability < Public::Base end end end
15
37
0.722222
62afd6cda7b639878ac8b6d001709841550bc407
66
require 'mtgox/order' module MtGox class Buy < Order end end
9.428571
21
0.712121
5dd5ac885c9398dc134b198836d131f3bbcd2bdc
149
class AddOptionsToRedcapProjectAdmins < ActiveRecord::Migration[5.2] def change add_column :redcap_project_admins, :options, :string end end
24.833333
68
0.791946
28074c801b6ce38c833427efc3b838ccc20d342e
219
class CreateEmailLists < ActiveRecord::Migration[4.2] def change create_table :email_lists do |t| t.references :email, index: true t.references :list, index: true t.timestamps end end end
19.909091
53
0.675799
d53b1852e4a3734e5dfefd105b29acd6d5d5ac55
1,126
require 'spec_helper' include MacOS describe MacOS::XCVersion do context 'when given an Xcode object with a download url' do it 'returns the appropriate --url syntax containing the url' do xcode = MacOS::Xcode.new('10.0', '/Applications/Xcode.app', 'https://www.apple.com') expect(XCVersion.download_u...
38.827586
96
0.695382
18c0b1da8deb48cc333dae9aeddf561edcbe19ab
9,620
# require 'forwardable' module Geokit # Contains class and instance methods providing distance calcuation services. # This module is meant to be mixed into classes containing lat and lng # attributes where distance calculation is desired. # # At present, two forms of distance calculations are provided: # ...
38.023715
101
0.625052
336801806c110f318fa0bfdb6f7246e2596b3240
2,006
require 'rails_helper' RSpec.feature "AccessExistingDemos", type: :feature do before do t = Template.create!(name: "Windows 7 Enterprise SP1 64-bit - Sysprepped", skytap_id: 248757, region_name: 'US-East') @demo = Demo.create!(template: t, email: 'me@skytap.com') end scenario "User confirms after co...
32.885246
125
0.710369
6a1d9ad02032f22a363eca802c39a9e7c5391160
1,255
module VCAP::CloudController class AppCreate class InvalidApp < StandardError; end def initialize(user_audit_info) @user_audit_info = user_audit_info @logger = Steno.logger('cc.action.app_create') end def create(message, lifecycle) app = nil AppModel.db.transaction do ...
26.702128
133
0.669323
218c754c63040fd3443be02433030feac26f3da7
7,045
## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # web site for more information on licensing and terms of use. # http://metasploit.com/ ## require 'msf/core' require 'yaml' class Metasploit3 < Msf::Auxiliary # # ...
30.899123
161
0.576579
f7a43f7b1e773b4b2a5a0d66eba280f8096aa427
972
require 'test_helper' class SetupsControllerTest < ActionController::TestCase setup do @setup = setups(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:setups) end test "should get new" do get :new assert_response :success end tes...
19.44
55
0.676955
e21b9dd7800219ad63feee66016f37da28bab94d
566
class AboutUsPage < Fae::StaticPage @slug = 'about_us' # required to set the has_one associations, Fae::StaticPage will build these associations dynamically def self.fae_fields { header: { type: Fae::TextField, validates: { presence: true } }, introduction: { type: Fae::TextArea }, body: {...
24.608696
103
0.574205
184bd94b75906bacef1a79da5e99e63ac2b59df4
1,096
require 'test/unit' require 'mocha/setup' require_relative '../../../../lib/fluent_command_builder' class PathTest < Test::Unit::TestCase include FluentCommandBuilder def test_should_join_path_on_initialize p = Path.new 'a', 'b' assert_equal 'a/b', p.path end def test_should_normalise_path_on_unix ...
23.826087
57
0.676095
2151e783abacd9421ca8094bd4e8afce4d3e326c
342
name "#{@hostinfo[:role]}: swap usage > 50%" message "A #{@hostinfo[:role]} machine is swapping heavily" applies { @hostinfo[:role] } notify.groups @hostinfo[:owner_groups] notify.people @hostinfo[:owners] metric.datadog_query <<EOQ avg(last_10m):avg:system.swap.pct_free{chef_role:#{@hostinfo[:role]}} by {host} < 0....
24.428571
85
0.722222