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 |
|---|---|---|---|---|---|
3965f0efc201adc20c5e79e4ae3911858debf47e | 1,273 |
describe 'tungsten::service' do
let(:chef_run) {
ChefSpec::SoloRunner.new(platform: 'centos', version: '6.5') do |node|
node.set['tungsten']['systemUser'] = 'bob'
node.set['tungsten']['homeDir'] = '/home/bob'
end.converge(described_recipe)
}
it 'should create an init.d script' do
expect... | 35.361111 | 160 | 0.660644 |
d5f2f4b4f4b0483c1a9f739b2d3315d68b151604 | 2,282 | class K3d < Formula
desc "Little helper to run Rancher Lab's k3s in Docker"
homepage "https://k3d.io"
url "https://github.com/rancher/k3d/archive/v4.4.3.tar.gz"
sha256 "b7ff3d5fac9d0bc6c58c3e5abdb5b2f38bf63a7a6bf0c3872e64f63879f4c160"
license "MIT"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)... | 43.884615 | 122 | 0.718668 |
bb575c117dcbaf3069f2af888756dfc0f35d2cef | 710 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe "Run command with arguments" do
before :all do
setup_environment
end
after :all do
command_helpers_teardown
end
describe "help command" do
it "outputs the name, description, version number and usage for the git-cmd command" do
... | 27.307692 | 108 | 0.711268 |
6127416a57d63aade4b89fb2f541518592f6f5fe | 16,717 | require "pact_broker/pacts/verifiable_pact_messages"
require "pact_broker/pacts/verifiable_pact"
require "pact_broker/pacts/selectors"
module PactBroker
module Pacts
describe VerifiablePactMessages do
let(:pending_provider_tags) { [] }
let(:non_pending_provider_tags) { [] }
let(:provider_branch... | 59.703571 | 432 | 0.687085 |
bb68484f43728e9298f2d3fb3ba60e3fe28c5def | 3,404 | class Job
module SdmExtension
def process_new_sdm
Rails.logger.info("I'm about to process sdm job #{self.id}")
# sdm colour: #31B369
# the coordinates may be stored as a proper coordinate string or by
# four simple values supplied by simple users. Here one converts
# the latter in... | 37 | 124 | 0.592244 |
bb608f16f7a90500919e0bbdffb1682767796830 | 776 | class Ecm::Youtube::Backend::CategoriesController < Itsf::Backend::Resource::BaseController
def self.resource_class
# Set the resource class here.
#
# Default: Ecm::Youtube::Category
#
Ecm::Youtube::Category
end
private
def collection_scope
# Customize the collection scope here for col... | 22.171429 | 91 | 0.635309 |
ede25467bc5f2dcf1b155cfef1879820d1e0b54d | 2,434 | require 'csv'
namespace :reports do
namespace :shop do
# Following task will generate daily report with terminated benefit applications
# RAILS_ENV=production bundle exec rake reports:shop:benefit_application_terminated_list['termination_date']
# RAILS_ENV=production bundle exec rake reports:shop:benefit_... | 42.701754 | 154 | 0.643796 |
1acf3220a06ea741ed81c7a808f3657b440206b5 | 1,788 | require File.join(File.dirname(__FILE__), 'hao_de_generator')
module Merb::Generators
class HaoDeLayout < HaoDeGenerator
@@after_generation_messages = []
def self.source_root
File.join(File.dirname(__FILE__), 'templates', 'layout')
end
desc <<-DESC
Generates a hao de layout.
... | 27.9375 | 106 | 0.646532 |
ffe9f76ff3d51fe4d10b965956097cd9b29fbfdc | 8,575 | # 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::IAM
class RolePolicy
extend Aws::Deprecations
# @overload def initialize(role_name, nam... | 29.568966 | 102 | 0.620758 |
b9f58f62fe5c92db9b87acee3fd210d56a6b13bf | 187 | def compose(f,g)
lambda {|x| f[g[x]]}
end
s = compose(Math.method(:sin), Math.method(:cos))
p s[0.5] # => 0.769196354841008
# verify
p Math.sin(Math.cos(0.5)) # => 0.769196354841008
| 20.777778 | 49 | 0.631016 |
ab7e334f08c85d2decbf364b395fa8a403178f4c | 476 | # frozen_string_literal: true
ENV["RAILS_ENV"] = "test"
begin
require "pry-byebug"
rescue LoadError
end
PROJECT_ROOT = File.expand_path("../", __dir__)
RSpec.configure do |config|
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.example_status_persistence_file_path = "t... | 19.833333 | 72 | 0.762605 |
acb38508fc06ea77198f29c05a6c8cee6fbc4a17 | 248 | require 'spec_helper'
describe Rgentpl::Application do
describe '#exec' do
it 'executes application' do
# Fix rake_taks bug
ARGV = []
expect { Rgentpl::Application.exec }.to output(/commands:/).to_stdout
end
end
end
| 19.076923 | 75 | 0.66129 |
abfb18b194504ddac926d36c823fde350690f55e | 1,182 | # frozen_string_literal: true
require 'rails_helper'
describe 'hunters/:id/hunter_backstories/new' do
let(:user) { create :user }
let(:hunter) { create :hunter, user: user, playbook: playbook }
let(:playbook) { create :playbook }
before :each do
sign_in user
end
subject { visit "/hunters/#{hunter.id... | 30.307692 | 78 | 0.662437 |
bb11dd85909950344f6b278632f53623b9148a8f | 1,242 | # frozen_string_literal: true
require_dependency "wf/application_controller"
module Wf
class FormsController < ApplicationController
breadcrumb "Forms", :forms_path
def index
@forms = Wf::Form.order("id DESC").page(params[:page])
end
def new
@form = Wf::Form.new
end
def edit
... | 20.7 | 88 | 0.60467 |
e91ddee17632c94eebcdf2d9c799820889a572e8 | 2,191 | # frozen_string_literal: true
Gem::Specification.new do |s|
s.name = "rubygems-update"
s.version = "3.1.0.pre1"
s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
s.email = ["", "", "drbrain@segment7.net"... | 49.795455 | 179 | 0.697398 |
1ded1a611a2f7cde668da5e2a89bf20efb6014a5 | 1,234 | # == Schema Information
#
# Table name: transactions
#
# id :integer not null, primary key
# description :text
# created_at :datetime not null
# updated_at :datetime not null
# audited :boolean
# type :string defaul... | 36.294118 | 72 | 0.589951 |
28ae704ee0f7ed79c50a274ef3ccc8f7b07e52c9 | 9,660 | require "cgi"
# We abuse Homebrew's download strategies considerably here.
# * Our downloader instances only invoke the fetch and
# clear_cache methods, ignoring stage
# * Our overridden fetch methods are expected to return
# a value: the successfully downloaded file.
module Hbc
class AbstractDownloadStrategy
... | 28.495575 | 116 | 0.614907 |
ed51dd176e18ed890c54d94d9d06d44264034700 | 3,707 | class Pgloader < Formula
desc "Data loading tool for PostgreSQL"
homepage "https://github.com/dimitri/pgloader"
url "https://github.com/dimitri/pgloader/releases/download/v3.6.2/pgloader-bundle-3.6.2.tgz"
sha256 "e35b8c2d3f28f3c497f7e0508281772705940b7ae789fa91f77c86c0afe116cb"
license "PostgreSQL"
revision... | 32.80531 | 94 | 0.68492 |
799d801a2e185a6aa8bf4d75d16d806a045122bf | 156 | require 'rails_helper'
module B1Admin
RSpec.describe Permission, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end
| 19.5 | 58 | 0.717949 |
622f2e286d8bf7e27078839368ef4437235d3e42 | 2,076 | module Redistat
class Event
include Database
include Options
attr_reader :id
attr_reader :key
attr_accessor :stats
attr_accessor :meta
def default_options
{ :depth => :hour,
:store_event => false,
:connection_ref => nil,
:enable_grouping => true,
:l... | 20.969697 | 99 | 0.535164 |
f876ef07aa79e8c4f8d189a8d1a92e1bbb917122 | 861 | require File.expand_path("../../Abstract/abstract-php-extension", __FILE__)
class Php71Imagick < AbstractPhp71Extension
init
desc "Provides a wrapper to the ImageMagick library."
homepage "https://pecl.php.net/package/imagick"
url "https://pecl.php.net/get/imagick-3.4.3.tgz"
sha256 "1f3c5b5eeaa02800ad22f506c... | 30.75 | 80 | 0.689895 |
7a1adedefb3bbe2837d46cf8c249020b10e54e38 | 1,150 | # encoding: utf-8
require 'test_helper'
#require "webmock/test_unit"
class TestCampaignStats < Test::Unit::TestCase
context "Yandex Campaign Stats" do
setup do
set_sandbox_access
# webmock campaign stats
stub_request(:post, "https://api-sandbox.direct.yandex.ru/json-api/v4/").
with( ... | 31.944444 | 222 | 0.626087 |
5d383264d317c9ca58bad81733b2380f1a441d80 | 1,573 | =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.12963 | 182 | 0.750795 |
28c0b6dfe7300d43a9e575073cf6453643da654f | 37 | module ArJdbc
VERSION = '51.1'
end
| 9.25 | 18 | 0.675676 |
33fc830fbb130c5f1082246b2dc30e2b17461b3d | 2,523 | require File.expand_path('../boot', __FILE__)
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "sprockets/railtie"
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require *Rails.groups(:assets => %w(... | 40.693548 | 126 | 0.718985 |
e81cb380d618d52ad1f5f094b7fb1537b3752c06 | 151 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_scientificprotocols_session'
| 37.75 | 89 | 0.821192 |
ff51c2cae98b1f2cee90632d991df240858d58c5 | 6,667 | require 'rbconfig'
# ruby 1.8.7 doesn't define RUBY_ENGINE
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
ruby_version = RbConfig::CONFIG["ruby_version"]
path = File.expand_path('..', __FILE__)
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/concurrent-ruby-1.1.7/lib/concurrent-ruby"
$:.unshift "... | 79.369048 | 109 | 0.668517 |
389fe2a50b2d8626124bda169eeff1ef20072457 | 43,245 | # 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::Transfer
# @api private
module ClientApi
include Seahorse::M... | 66.942724 | 160 | 0.749751 |
e2d4d6c756085ddd9be4a6f2e8883f1e30d70595 | 251 | class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::RefreshWorker < MiqEmsRefreshWorker
require_nested :Runner
def self.ems_class
parent
end
def self.settings_name
:ems_refresh_worker_embedded_ansible_automation
end
end
| 20.916667 | 98 | 0.808765 |
1d649bb3a60d5f4b9c4eeee5d16165db2f441609 | 5,208 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
include Msf::Auxiliary::Report
class MetasploitModule < Msf::Post
def initialize(info={})
super(update_info(info,
'Name' => 'Multi Recon Local Exploit Sugges... | 27.410526 | 118 | 0.637289 |
bfee8a7f544b125b243d84304e7521ed17514e23 | 889 | # -*- coding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'marauder/marauder'
Gem::Specification.new do |s|
s.name = 'prism-marauder'
s.version = Marauder::VERSION
s.summary = "service locator based on prism"
s.descri... | 37.041667 | 89 | 0.652418 |
1c36cbe7afa4c76ac098835422779d0c16a305fe | 545 | cask 'editready' do
version '2.5.2'
sha256 'd1d7ee821943f9faf1a09ed6e2477848e76f4a452a9759ef48e946cc6535572b'
url "https://www.divergentmedia.com/fileRepository/EditReady%20#{version}.dmg"
appcast 'https://www.divergentmedia.com/autoupdater/editready/2_x'
name 'Divergent Media EditReady'
homepage 'https://... | 32.058824 | 80 | 0.717431 |
bbb83dd833ca2a42e022d1c388a4c16410ca2ec3 | 1,482 | require "#{File.dirname(__FILE__)}/../spec_helper"
describe Bonsai::Generate do
describe "generator" do
before :all do
@path = File.expand_path("spec/tmp-generator")
FileUtils.rm_rf @path
Bonsai::Generate.new(@path)
end
it "should create base directories" do
%w(content content... | 30.875 | 96 | 0.622132 |
87498a75c3fe4403e50379b1aae5a56f5dfc60b9 | 838 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'icomoon_as_well/version'
Gem::Specification.new do |spec|
spec.name = "icomoon_as_well"
spec.version = IcomoonAsWell::VERSION
spec.authors = ["Alex"]
spec.email ... | 32.230769 | 57 | 0.642005 |
912b453ef5d5ecee3f36a1e4882086ee338ce275 | 2,130 | require 'test_helper'
require_relative '../lib/sandi_meter/method_arguments_counter'
describe SandiMeter::MethodArgumentsCounter do
let(:test_loader) { SandiMeter::ArgsLoader.new }
let(:analyzer) { SandiMeter::MethodArgumentsCounter.new }
context 'when variable/method arguments' do
let(:args_add_block_1) { ... | 35.5 | 76 | 0.660563 |
6a6189c8babc1080f99880f979c6948f8806bd05 | 851 | name "tftp"
maintainer "Opscode, Inc."
maintainer_email "matt@opscode.com"
license "Apache 2.0"
description "Installs/Configures tftpd"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.2.0"
%w{ debian ubuntu fedora scientific centos redhat}.ea... | 25.787879 | 72 | 0.6651 |
ab243beea0fdd971e53806e3257219da7e51f6ec | 1,221 | cask "graphicconverter" do
version "11.6.1,5515"
sha256 "39b9b6c882c8df0fb0ca0e8108a400e8e58088c3c3b9bc5236c7ca30ce195320"
url "https://www.lemkesoft.info/files/graphicconverter/gc#{version.major}_build#{version.csv.second}.zip",
verified: "lemkesoft.info/"
name "GraphicConverter"
desc "For browsing, e... | 38.15625 | 108 | 0.714169 |
389607134493f5aed696e5b5cafcda9837fb8b1e | 6,449 | require 'pathname'
Puppet::Type.newtype(:dsc_xexchmailboxserver) do
require Pathname.new(__FILE__).dirname + '../../' + 'puppet/type/base_dsc'
require Pathname.new(__FILE__).dirname + '../../puppet_x/puppetlabs/dsc_type_helpers'
@doc = %q{
The DSC xExchMailboxServer resource type.
Automatically generat... | 39.084848 | 443 | 0.717476 |
914ae645b9f74abf2fab972a8adbb5c032ca8d35 | 102 | class Product < ApplicationRecord
has_many :line_items
has_many :orders, through: :line_items
end
| 20.4 | 40 | 0.794118 |
01085ec5aa89762e15bd645ea4c91fc816b86c0b | 1,049 | # frozen_string_literal: true
require 'text'
module OrgSelection
# This class provides a search mechanism for Orgs that looks at records in the
# the database along with any available external APIs
class OrgToHashService
class << self
# Convert an Identifiable Model over to hash results like:
# ... | 26.897436 | 83 | 0.575786 |
87573529f182789276a9c1c3b760dd70865a4889 | 1,533 | # -*- encoding: utf-8 -*-
# stub: ipaddr 1.2.2 ruby lib
Gem::Specification.new do |s|
s.name = "ipaddr".freeze
s.version = "1.2.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Akinori MUSHA".free... | 39.307692 | 125 | 0.654925 |
1d52f77622243f7bdded00d0d4f401e7dde2e77d | 16,405 | require "active_record"
db_namespace = namespace :db do
desc "Set the environment value for the database"
task "environment:set" => [:environment, :load_config] do
ActiveRecord::InternalMetadata.create_table
ActiveRecord::InternalMetadata[:environment] = ActiveRecord::Migrator.current_environment
end
... | 40.208333 | 267 | 0.695215 |
393a8cd23cc55d1d6b29dad24066b2cc0bb2fdac | 989 | Rails3017::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web... | 36.62963 | 84 | 0.773509 |
4aa627776cd0752514d5e2b78767e18056203887 | 976 | 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)
module ILike
class Application < Rails::Application
# Settings in config/environments/* take precede... | 40.666667 | 99 | 0.722336 |
e9077ff53b73d5539cc3ae93edce7c968e22e4f7 | 1,036 | # Copyright (c) 2015 Vault12, Inc.
# MIT License https://opensource.org/licenses/MIT
require 'test_helper'
class VerifySessionTest < ActionDispatch::IntegrationTest
test 'start session token flow' do
post '/start_session'
_fail_response :bad_request # wrong token
@client_token = RbNaCl::Random.random_b... | 29.6 | 69 | 0.740347 |
335730971e340f393e00700328f08ac266db2cec | 820 | #
# Cookbook:: pozoledf-sample-app
# Spec:: default
#
# Copyright:: 2021, The Authors, All Rights Reserved.
require 'spec_helper'
describe 'pozoledf-sample-app::default' do
context 'When all attributes are default, on Ubuntu 20.04' do
# for a complete list of available platforms and versions see:
# https://... | 27.333333 | 66 | 0.708537 |
61eaa00b9af2f72e6b8fbca6f7ed414628efd596 | 3,014 | require "rails_helper"
RSpec.describe CheckboxesAnswerPresenter do
describe "#response" do
it "returns all none nil values as an array" do
step = build(:checkbox_answers, response: ["Yes", "No", "Morning break", ""])
presenter = described_class.new(step)
expect(presenter.response).to eq(["Yes",... | 32.408602 | 95 | 0.604512 |
03b5e9da3c958a25bfdbc44b9c813b7ca640bdd3 | 119 | class AddCountryToUsers < ActiveRecord::Migration[5.1]
def change
add_column :users, :country, :string
end
end
| 19.833333 | 54 | 0.739496 |
ab4290b43105e5517f719b17bd58583fa7c13d9d | 1,347 | require 'spec_helper'
describe "Identifiers" do
def generate_tags
system('ctags -R .')
end
def symbol_type(symbol, full_path = '')
symbol_data = "{'symbol': '#{symbol}', 'full_path': '#{full_path}'}"
vim.command("echo rustbucket#identifier#New(#{symbol_data}).Type()")
end
specify "resolving a b... | 21.046875 | 72 | 0.570898 |
33f7c37b6ac66152cf71dd7f9d4ff4e73f0f3b50 | 1,691 | require "formula_installer"
require "development_tools"
require "messages"
module Homebrew
module_function
def reinstall_formula(f, build_from_source: false)
if f.opt_prefix.directory?
keg = Keg.new(f.opt_prefix.resolved_path)
keg_had_linked_opt = true
keg_was_linked = keg.linked?
back... | 26.421875 | 84 | 0.694855 |
1823f8a3ec82af6dca311a3ee6cbdd2ca54a4fc1 | 3,144 | class Qt5Base < Formula
desc "Qt5 Core Libraries"
homepage "http://qt-project.org/"
url "http://download.qt.io/official_releases/qt/5.10/5.10.0/submodules/qtbase-everywhere-src-5.10.0.tar.xz"
sha256 "fd5578cd320a13617c12cf2b19439386b203d6d45548e855f94e07be9829f762"
keg_only "Qt5 very picky about i... | 27.33913 | 114 | 0.624046 |
e8fe297bcdf4bbf1b887475d6fb6f5851b61628a | 607 | cask 'idocument-plus' do
version '2.7'
sha256 'a3ec0e2ada87b7795f1d7bc1b12610a800c2ce6b4442d07e7e24703c8f34a1e2'
# amazonaws.com/IcyBlaze-iDocument2 was verified as official when first introduced to the cask
url "https://s3.amazonaws.com/IcyBlaze-iDocument2/Download/idocument_plus_#{version}.dmg"
appcast 'ht... | 40.466667 | 96 | 0.797364 |
e28424bec9fac479b95dc11446f79a0ec38b23a7 | 4,543 | require "mega_lotto"
# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly re... | 45.888889 | 129 | 0.744002 |
abec26ff9f51f415e498c60402020aba71396e0c | 140 | require_relative '../../spec_helper'
require 'date'
describe "DateTime._strptime" do
it "needs to be reviewed for spec completeness"
end
| 20 | 49 | 0.757143 |
f7b5f234065def72d1b5747a4776acd0eac2f12f | 437 | class TaxonNameClassification::Icvcn::Valid::Accepted < TaxonNameClassification::Icvcn::Valid
NOMEN_URI='http://purl.obolibrary.org/obo/NOMEN_0000127'.freeze
def self.disjoint_taxon_name_classes
self.parent.disjoint_taxon_name_classes +
self.collect_descendants_and_itself_to_s(TaxonNameClassification:... | 24.277778 | 99 | 0.778032 |
5d2c2fb3bac7887c197dc8291be64d8371111f6c | 1,936 | # frozen_string_literal: true
module JekyllAdmin
module FileHelper
# The file the user requested in the URL
def requested_file
find_by_path(path)
end
# The file ultimately written to disk
# This may be the requested file, or in the case of a rename will be read
# from the new path that... | 24.2 | 77 | 0.614669 |
03fdc78e908f29ad2fc0374712b078c1bab644e4 | 1,696 | class Velero < Formula
desc "Disaster recovery for Kubernetes resources and persistent volumes"
homepage "https://github.com/vmware-tanzu/velero"
url "https://github.com/vmware-tanzu/velero/archive/v1.5.3.tar.gz"
sha256 "f541416805f792c9f6e5ec2620b0c0f5d43d32ee6714f99fb9fadd8ee9072378"
license "Apache-2.0"
... | 41.365854 | 97 | 0.714623 |
e8f5f8ceaddde3fe4bfb0423ae4d3bdebb5e7b24 | 2,148 | # frozen_string_literal: true
require 'recaptcha/configuration'
require 'uri'
require 'net/http'
if defined?(Rails)
require 'recaptcha/railtie'
else
require 'recaptcha/client_helper'
require 'recaptcha/verify'
end
module Recaptcha
CONFIG = {
'server_url' => 'https://recaptcha.net/recaptcha/api.js',
'... | 25.879518 | 102 | 0.703445 |
21cd71e15f5852c7c3ed4bdb5ff0093bbfde6629 | 2,368 | # 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... | 36.430769 | 113 | 0.726351 |
ffb96c7314a0b9bc8fb6814d921e06e810769c70 | 349 | # encoding: utf-8
#
require 'spec_helper'
describe DealCategory do
describe '#attributes' do
it { should be_subclass_of(Category) }
end
describe '#associations' do
it { should have_many(:deals).as_inverse_of(:category).with_dependent(:nullify) }
end
describe '#fabrication' do
it { should have_... | 18.368421 | 85 | 0.716332 |
1cc19dc8dcfd4b069a95c681ffb0c8c91cb4a5ed | 2,597 | $LOAD_PATH << File.join(File.dirname(__FILE__), '..', '..', 'lib')
require 'logger'
require 'benchmark'
require 'message_bus'
require_relative "../helpers"
backends = ENV['MESSAGE_BUS_BACKENDS'].split(",").map(&:to_sym)
channel = "/foo"
iterations = 10_000
results = []
puts "Running publication benchmark with #{iter... | 25.213592 | 152 | 0.732769 |
7a1c60827119ed3c1ab43753d8a08265ce25268f | 4,958 | #Processes the Sexp from routes.rb. Stores results in tracker.routes.
#
#Note that it is only interested in determining what methods on which
#controllers are used as routes, not the generated URLs for routes.
class Brakeman::Rails3RoutesProcessor < Brakeman::BaseProcessor
include Brakeman::RouteHelper
attr_reader... | 22.953704 | 85 | 0.623235 |
01aec040d202c2f98fee887b3705fa17dd08ef65 | 741 | require 'formula'
class Unrar < Formula
homepage 'http://www.rarlab.com'
url 'http://www.rarlab.com/rar/unrarsrc-5.1.6.tar.gz'
sha1 'af9220d85cb96ce102b7375c1e5e501b64fc89fd'
def install
system "make"
bin.install 'unrar'
end
test do
contentpath = "directory/file.txt"
rarpath = testpath/"a... | 27.444444 | 74 | 0.711201 |
6a79ea96494ab5ad5f89f0ddb8f0597d7fe67536 | 2,221 | module GreenhouseIo
class JobBoard
include HTTParty
include GreenhouseIo::API
attr_accessor :api_token, :organization
base_uri 'https://api.greenhouse.io/v1'
def initialize(api_token = nil, default_options = {})
@api_token = api_token || GreenhouseIo.configuration.api_token
@organizat... | 33.149254 | 133 | 0.676272 |
1d874a61794e9d1cca322d125b713bafa3ceb4d8 | 13,509 | # Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmat... | 49.123636 | 154 | 0.751129 |
e2769785dfbf77b411bf425f679f89bd81ca2a92 | 543 | # frozen_string_literal: true
require 'json'
require 'rb_json5'
require 'json_refs'
require 'json_schemer'
require_relative 'duh/version'
require_relative 'duh/exceptions'
require_relative 'duh/schema'
require_relative 'duh/loader'
module RgGen
module DUH
extend Core::Plugin
setup_plugin :'rggen-duh' do |p... | 20.884615 | 56 | 0.714549 |
4ae431b9bb6aa5fc3252ce70cc122a60fd640372 | 145 | module Knock
class Engine < ::Rails::Engine
config.eager_load_paths += Dir["#{config.root}/lib/**/"]
isolate_namespace Knock
end
end
| 20.714286 | 60 | 0.682759 |
2670fafffd313c33b70e3a6ee857e31f4e84d6f6 | 115 | class Api::Communities::Posts::Hot::WeekPolicy < ApplicationPolicy
def index?
!exiled? && !banned?
end
end
| 19.166667 | 66 | 0.695652 |
03a15cc236c9a17893b903915b31a328ea2f8686 | 363 | require "bundler/setup"
require "banacle"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with :rsp... | 24.2 | 66 | 0.752066 |
032f82a571f099582e45395c2b15b6cc3db9e33a | 273 | module Opbeat
# @api private
module DataBuilders
class DataBuilder
def initialize config
@config = config
end
attr_reader :config
end
%w{transactions error}.each do |f|
require "opbeat/data_builders/#{f}"
end
end
end
| 16.058824 | 41 | 0.626374 |
289dbb123485069775642da2d421ca15f1ff01f9 | 121 | class AddCreatorToBands < ActiveRecord::Migration
def change
add_reference :bands, :creator, index: true
end
end
| 20.166667 | 49 | 0.760331 |
f844dd0e1580936bec3b84f69c473eb0d1b283a8 | 5,302 | class ErrsController < ApplicationController
include ActionView::Helpers::TextHelper
before_filter :find_app, :except => [:index, :all, :destroy_several, :resolve_several, :unresolve_several, :merge_several, :unmerge_several]
before_filter :find_problem, :except => [:index, :all, :destroy_several, :resolve_sever... | 33.556962 | 146 | 0.680687 |
bf832decf6fd23c609ce7aa138108a33cb05f0a6 | 19,059 | require 'spec_helper'
describe Spree::CheckoutController, type: :controller do
let(:token) { 'some_token' }
let(:user) { stub_model(Spree::LegacyUser) }
let(:order) { FactoryBot.create(:order_with_totals) }
let(:address_params) do
address = FactoryBot.build(:address)
address.attributes.except('created... | 34.652727 | 145 | 0.633979 |
e9fef2b8f74d77b40c17afc15e98797836770d16 | 874 | # frozen_string_literal: true
module Backmeup
# Run a script if it exist and return true, otherwise return false.
class ScriptIfExist
def self.run(**args)
new(**args).run
end
def initialize(env:, root:, script_name:)
@env = env
@root = root
@script_name = script_... | 20.325581 | 70 | 0.618993 |
d5cfda98857f1b5f1dc45fd0fb5908c676ce66ca | 4,798 | #
# Author:: Stephen Delano (<stephen@opscode.com>)
# Copyright:: Copyright (c) 2010 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 28.730539 | 92 | 0.657566 |
7a484bcc6c106b32d619cd3ce5eb17a03d5f2cd0 | 650 | require File.expand_path('../../spec_helper', __FILE__)
describe "A Not node" do
relates "(not true)" do
compile do |g|
f = g.new_label
t = g.new_label
g.push :true
g.git f
g.push :true
g.goto t
f.set!
g.push :false
t.set!
end
end
relates <<-ruby... | 13.541667 | 55 | 0.504615 |
016a3540f3957ca9ec22b1dd4a319531bd55c347 | 338 | cask "sketch@43" do
version "43,38999"
url "https://download.sketch.com/sketch-#{version.csv.first}-#{version.csv.second}.zip"
name "Sketch"
desc "Digital design and prototyping platform"
homepage "https://www.sketch.com/"
auto_updates true
depends_on macos: ">= :mojave"
app "Sk... | 24.142857 | 91 | 0.647929 |
621a42f04e3d0db5a14f569261d987b3ec9fa83e | 337 | class CreateSupportBrbInvoiceSituations < ActiveRecord::Migration[5.2] # :nodoc:
def change
create_table 'extranet.brb_invoice_situations' do |t|
t.string :name
t.boolean :status, default: true
t.timestamps
t.boolean :deleted, default: false
t.datetime :deleted_at, default: nil
... | 24.071429 | 80 | 0.688427 |
e8d0cb148c82d100dd84fee1e062d30577b5512c | 3,611 | 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.988372 | 100 | 0.758239 |
4aa80938518a23efb29b3d16af383ff7dcc7bf59 | 1,693 | class Perltidy < Formula
desc "Indents and reformats Perl scripts to make them easier to read"
homepage "https://perltidy.sourceforge.io/"
url "https://downloads.sourceforge.net/project/perltidy/20200907/Perl-Tidy-20200907.tar.gz"
sha256 "72c9324a188ecf7c9cd4ed8b7718be993ad77d4d9bc770b284caa17278467c18"
licen... | 36.021277 | 93 | 0.652688 |
62f144fded50779dacd9cd4d85103a80d9195596 | 753 | class PaperclipOptions < Hash
def self.s3_options
if ENV['S3_ACCESS_KEY_ID'] and ENV['S3_SECRET_ACCESS_KEY'] then
{
:storage => :s3,
:s3_credentials => { :access_key_id => ENV['S3_ACCESS_KEY_ID'], :secret_access_key => ENV['S3_SECRET_ACCESS_KEY'] },
:path => ":class/:attachment/:id/:... | 28.961538 | 138 | 0.646746 |
625eb950b0e8e69a109e5634fbfcd7aa3a0f3181 | 19,386 | require 'spec_helper'
module Bosh::Director::DeploymentPlan
describe InstanceSpec do
include Support::StemcellHelpers
subject(:instance_spec) { described_class.create_from_instance_plan(instance_plan) }
let(:links_manager) do
instance_double(Bosh::Director::Links::LinksManager).tap do |double|
... | 36.785579 | 123 | 0.550655 |
626c2e282e326bb0cff1f67724d65a373ed7fc0a | 338 | require 'chefspec'
describe 'expect_exception::no_error' do
let(:chef_run) { ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04').converge(described_recipe) }
it 'does not raise an error' do
expect(Chef::Formatters::ErrorMapper).to_not receive(:file_load_failed)
expect { chef_run }.to_not rais... | 30.727273 | 112 | 0.745562 |
5d23bb1dd1da2832365717acb451e0e7b562cc1f | 848 | lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |spec|
spec.name = "fluent-plugin-prometheus-format"
spec.version = "2.0.0"
spec.authors = ["Sumo Logic"]
spec.email = ["collection@sumologic.com"]
spec.summary = %q{Fluent... | 36.869565 | 96 | 0.675708 |
ff27cd7782a50fdf1d279036e3028f16108626bd | 168 | # frozen_string_literal: true
class AddMediaIdToTwitterImages < ActiveRecord::Migration[5.2]
def change
add_column :twitter_images, :media_id, :string
end
end
| 21 | 62 | 0.779762 |
abd9d83532c562442fc3e32750cfd9c86b6d9fca | 306 | class SorceryBruteForceProtection < ActiveRecord::Migration[4.2]
def change
add_column :internal_users, :failed_logins_count, :integer, default: 0
add_column :internal_users, :lock_expires_at, :datetime, default: nil
add_column :internal_users, :unlock_token, :string, default: nil
end
end
| 38.25 | 74 | 0.77451 |
d5e1ee084f42be7a7d0998d99cab850641b9350b | 759 | module Util
module Memoization
def valid_ivar_name(str)
str.match(/[\w_]+/)[0]
end
MEMOIZE_PREFIX = 'memoize_'
def memoize(method_name = nil)
method_name = @@method_added unless method_name
return if method_name.to_s.start_with? MEMOIZE_PREFIX
alias_method "#{MEMOIZE_PREFIX}... | 26.172414 | 90 | 0.662714 |
f8c1248e6c7213f57e347e7afe660737744af83c | 680 | require 'spec_helper'
describe ExternalSystem do
it "has a valid factory" do
expect(FactoryGirl.build(:external_system)).to be_valid
end
it "fails without code" do
expect(FactoryGirl.build(:external_system, code: nil)).not_to be_valid
end
it "returns untranslated name" do
external_system = Fact... | 27.2 | 77 | 0.742647 |
bfcd76bd07d7e894ae937a6b9bd7842c84d7829e | 905 | # frozen_string_literal: true
module Names
def self.string_search(scope, search_string, columns)
model = scope.is_a?(ActiveRecord::Relation) ? scope.model : scope
query = columns.map { |column| "lower(#{model.table_name}.#{column}) like :term" }.join(' OR ')
search_string
.split(/\s+/)
.selec... | 26.617647 | 116 | 0.669613 |
1873a3016165257c4b00449854985b810ea6ca1f | 265 | cask :v1 => 'rdio' do
version :latest
sha256 :no_check
url 'https://www.rdio.com/media/static/desktop/mac/Rdio.dmg'
appcast 'http://www.rdio.com/media/static/desktop/mac/appcast.xml'
homepage 'http://www.rdio.com'
license :gratis
app 'Rdio.app'
end
| 22.083333 | 68 | 0.698113 |
edbf99e47cc23a02fc221440cb956aed92a07be4 | 403 | class AppointmentsController < ApplicationController
def index
@appointments = Appointment.order('appt_time ASC')
@appointment = Appointment.new
end
def create
@appointment = Appointment.create(appointment_params)
@appointments = Appointment.order('appt_time ASC')
end
private
def appoin... | 22.388889 | 59 | 0.744417 |
eda02a2b42c9e59d7db6aba2cc4a1fa787329177 | 35,404 | # 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... | 53.805471 | 168 | 0.555728 |
d57544b0f773da4108aea433e00bc894fd0d8c23 | 1,471 | require 'rspec'
require 'bosh/template/test'
require_relative '../spec_helper'
require_relative '../collector_config'
require_relative '../common_config'
require_relative '../elasticsearch_config'
describe 'jaeger-collector' do
job_name = 'jaeger-collector'
let(:release) { Bosh::Template::Test::ReleaseDir.new(File... | 49.033333 | 147 | 0.737593 |
f7a7d375a6c4b9df20f5a7d13f604c765a4761e4 | 131 | class ChangeNameOnWastePickers < ActiveRecord::Migration
def change
change_column_null :waste_pickers, :name, false
end
end
| 21.833333 | 56 | 0.801527 |
7945b37ab28ccc1f02504acbdfaa9c443f5b4d4e | 3,387 | module SpreeSitemap::SpreeDefaults
include Spree::Core::Engine.routes.url_helpers
include Spree::BaseHelper # for meta_data
def default_url_options
{ host: SitemapGenerator::Sitemap.default_host }
end
def add_login(options = {})
add(login_path, options)
end
def add_signup(options = {})
add(... | 31.361111 | 125 | 0.709182 |
1a3a9fc15abdc3416a154bd1b52a3725c8f9d772 | 1,751 | module Carto::Limits
def soft_geocoding_limit?
Carto::AccountType.new.soft_geocoding_limit?(self)
end
alias_method :soft_geocoding_limit, :soft_geocoding_limit?
def hard_geocoding_limit?
!soft_geocoding_limit?
end
alias_method :hard_geocoding_limit, :hard_geocoding_limit?
def soft_here_isolines_... | 28.704918 | 78 | 0.816105 |
28ee210186a5a8b3563d6cf47ddf29ae341bfc9d | 1,637 | RSpec.describe StackMaster::TemplateCompilers::Cfndsl do
let(:compile_time_parameters) { {'InstanceType' => 't2.medium'} }
before(:all) { described_class.require_dependencies }
let(:template_dir) { 'spec/fixtures/templates/rb/cfndsl/' }
describe '.compile' do
def compile
described_class.compile(tem... | 36.377778 | 132 | 0.681735 |
1abc7742450c87580951b2bd3cdbf7f83b9231e8 | 2,311 | class Mdk < Formula
desc "GNU MIX development kit"
homepage "https://www.gnu.org/software/mdk/mdk.html"
url "http://ftpmirror.gnu.org/mdk/v1.2.8/mdk-1.2.8.tar.gz"
mirror "https://ftp.gnu.org/gnu/mdk/v1.2.8/mdk-1.2.8.tar.gz"
sha256 "7bff1e10b829c6e1f3c278bfecbe82f0f658753ce80ea58b6f71c05f9490b0db"
revision 1... | 37.274194 | 95 | 0.509303 |
7a98a1735bffd36288388c968a0c250d5ff01e40 | 4,050 | # typed: false
require 'datadog/core'
require 'datadog/tracing/pipeline'
module Datadog
# Datadog APM tracing public API.
#
# The Datadog team ensures that public methods in this module
# only receive backwards compatible changes, and breaking changes
# will only occur in new major versions releases.
# @p... | 28.321678 | 121 | 0.64321 |
081cb2d5632591be2fe2e0f928bcd1c7df620444 | 539 | require "rails_helper"
describe LieutenantAssignmentCollection do
subject { described_class.new(params) }
let(:form_answer) { create(:form_answer) }
let!(:ceremonial_county) { create(:ceremonial_county) }
context "Single assignment" do
let(:params) do
{
form_answer_ids: form_answer.id.to_s,
... | 24.5 | 75 | 0.706865 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.