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 |
|---|---|---|---|---|---|
1c6bf53dea2837a62387bb3cf7f8f9d6dbb0716b | 1,928 | #
# Cookbook:: ruby_rbenv
# Recipe:: user_install
#
# Copyright:: 2011-2017, Fletcher Nichol
#
# 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-2.0... | 35.703704 | 90 | 0.637448 |
4a01da4a56e7d54582fd6ba8a2102c50dd8dd483 | 33 | module MonthlyExpencesHelper
end
| 11 | 28 | 0.909091 |
62262eb1ced153e985a5cebe7dbf03d5197c886b | 1,599 | class CloudNuke < Formula
desc "CLI tool to nuke (delete) cloud resources"
homepage "https://gruntwork.io/"
url "https://github.com/gruntwork-io/cloud-nuke/archive/v0.1.30.tar.gz"
sha256 "5f79e00b32bfba7e669127e50adccb6d21c0f8351d66733bbfa7bddd5d8653a3"
license "MIT"
head "https://github.com/gruntwork-io/cl... | 43.216216 | 122 | 0.750469 |
6afe53bdab4cc749cd48f11f9f8058b7a813a41d | 1,195 | require_relative 'lib/swq/version'
Gem::Specification.new do |spec|
spec.name = "swq"
spec.version = Swq::VERSION
spec.authors = ["norioc"]
spec.email = ["norionorioc@gmail.com"]
spec.summary = %q{helps you find sw quotes}
spec.description = %q{helps you find sw quotes... | 39.833333 | 87 | 0.643515 |
623a6b66e0852449a467ab23afac8d86285ae2dd | 750 | require 'test_helper'
class PackageMapperTest < ActiveSupport::TestCase
test "truth" do
assert_kind_of Class, GRPC::Rails::PackageMapper
end
test "#service" do
package_mapper = GRPC::Rails::PackageMapper
.new("helloworld", TestRegistry.new([]))
instance = package_mapper.service("greeter") { se... | 30 | 78 | 0.730667 |
ff930b16b32027e23188d4f7d15b833eb6b88ead | 42 | module Coolifyk
VERSION = "1.0.1.9"
end
| 10.5 | 21 | 0.666667 |
1af8b5eb2fa157d4fb4128872cfe85e8e35f553f | 1,674 | # -*- encoding: utf-8 -*-
# stub: aws-sdk-pinpointemail 1.6.0 ruby lib
Gem::Specification.new do |s|
s.name = "aws-sdk-pinpointemail".freeze
s.version = "1.6.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "changelog_uri" => "htt... | 45.243243 | 254 | 0.670848 |
d5fb79509f1b795255fc8e1e77519e9a098d9804 | 1,219 | =begin
#Molecule API Documentation
#The Hydrogen Molecule API
OpenAPI spec version: 1.3.0
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.14
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for MoleculeApi::Curren... | 25.395833 | 102 | 0.747334 |
f8951feca56cd68b0fd6b1e06acd44c5268349f8 | 1,938 | module Datagrid
module Drivers
class Array < AbstractDriver #:nodoc:
def self.match?(scope)
!Datagrid::Drivers::ActiveRecord.match?(scope) && (scope.is_a?(::Array) || scope.is_a?(Enumerator))
end
def to_scope(scope)
scope
end
def where(scope, attribute, value)
... | 22.534884 | 107 | 0.582043 |
0192379d0d2631f464a8638dfe04d4902e21dd10 | 360 | cask 'jump' do
version '8.4.3'
sha256 'c879dc05f2415f64d26b23b6f753e88d0a10382c87112cbd6e32ee7659e419f3'
url "https://mirror.jumpdesktop.com/downloads/JumpDesktopMac-#{version}.zip"
appcast 'https://jumpdesktop.com/downloads/viewer/jdmac-web-appcast.xml'
name 'Jump Desktop'
homepage 'https://jumpdesktop.co... | 30 | 78 | 0.769444 |
330ace9da1b762faf26334cd71f381418d1d8fdf | 2,959 | module Odania
class Consul
attr_reader :service, :config, :event, :health
def initialize(consul_url)
consul_url = ENV['CONSUL_ADDR'] if consul_url.nil?
consul_url = 'http://consul:8500' if consul_url.nil?
$logger.info "Consul URL: #{consul_url}" if $debug
Diplomat.configure do |config|
# Set up a ... | 20.692308 | 85 | 0.625549 |
e8fc0d48476746b9951f2bab461d741a8bc17f42 | 82 | module CapeJS
module Rails
class Engine < ::Rails::Engine
end
end
end
| 11.714286 | 34 | 0.658537 |
b98709b8b8f918e59f4e74b1ca0fac796d3c4ee7 | 9,049 | =begin
#IronWorker CE API
#The ultimate, language agnostic, container based task processing framework.
OpenAPI spec version: 0.5.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the ... | 33.391144 | 618 | 0.642281 |
08ac592434619e3cf134b7c258b96d5530e11416 | 377 | RSpec.describe Magick::Image, '#trim' do
it 'works' do
# Can't use the default image because it's a solid color
hat = described_class.read(IMAGES_DIR + '/Flower_Hat.jpg').first
expect(hat.trim).to be_instance_of(described_class)
expect(hat.trim(10)).to be_instance_of(described_class)
expect { ha... | 31.416667 | 68 | 0.718833 |
bf37ced41c0f0681b96d1eab3b3efc2065cbaaad | 726 | # encoding: UTF-8
#
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
require_relative 'object'
require_relative '../mixins/obj_id'
require_relative '../mixins/rest_reso... | 25.928571 | 79 | 0.714876 |
bb7f0aeae45badc306e5930f75778635725f1aea | 5,063 | module RSpec::Matchers::BuiltIn
RSpec.describe BeBetween do
class SizeMatters
include Comparable
attr :str
def <=>(other)
str.size <=> other.str.size
end
def initialize(str)
@str = str
end
def inspect
@str
end
end
shared_examples "be... | 32.044304 | 153 | 0.587794 |
01f9eb041a17a383cc3422b037cc2e7f15870a1a | 2,715 | require 'uri'
require 'net/http'
require 'rack'
# Copied shamelessly from Capybara
# Used to run a mock service in a new thread when started by the AppManager or the ControlServer
module Pact
class Server
class Middleware
attr_accessor :error
def initialize(app)
@app = app
end
... | 24.241071 | 116 | 0.591529 |
38f7dcad43ca4104b1259c9f8f6ddc26cf90d2b3 | 33,006 | # == Schema Information
#
# Table name: features
#
# id :bigint not null, primary key
# ancestor_ids :string
# fid :integer not null
# is_blank :boolean default(FALSE), not null
# is_name_position_overriden :... | 41.885787 | 307 | 0.689935 |
62b4deaa994db20bf39cb737bd98d4a67ce2217c | 850 | require 'spec_helper'
describe Facebook::Messenger::Incoming::Messaging::PassThreadControl do
let :payload do
{
'sender' => {
'id' => '3'
},
'recipient' => {
'id' => '3'
},
'timestamp' => 1_458_692_752_478,
'pass_thread_control' => {
'new_owner_app_id' ... | 22.368421 | 71 | 0.596471 |
e9cb913d5e5db8f2393598ee85fcad22168611a7 | 89 | # desc "Explaining what the task does"
# task :welcome_css do
# # Task goes here
# end
| 17.8 | 38 | 0.685393 |
6a8dccda3a42272f05702c8eb0d53eb9bc51ec73 | 15,921 | require 'linguist/language'
require 'test/unit'
require 'pygments'
class TestLanguage < Test::Unit::TestCase
include Linguist
Lexer = Pygments::Lexer
def test_ambiguous_extensions
assert Language.ambiguous?('.cls')
assert_equal Language['TeX'], Language.find_by_extension('cls')
assert Language.am... | 43.619178 | 90 | 0.71189 |
7ab717093cc6949b6d0db31fab7a5e1820ed07d7 | 2,779 | require 'spec_helper'
require 'hanami_request_test'
RSpec.describe 'API influencers', type: :request, vcr: true do
include HanamiRequestTest
subject { last_json_response }
let(:endpoint) { '/api' }
context 'when searching for :name' do
context 'when no result is found' do
it 'returns an empty :data... | 37.554054 | 110 | 0.619288 |
d5a4d1fe3e43ab8773c2483fc3f32f3bf885367c | 472 | # loop - class Loop - command loop - repeats block until break called
class Loop < BaseCommand
def call(*args, env:, frames:)
if args[0].instance_of? Block
result = true
block = args[0]
begin
loop { result = block.call env: env, frames: frames }
rescue VirtualMachine::BreakCalled
... | 22.47619 | 69 | 0.614407 |
2171e84f044fba07731c82ad7ba37d5dfd1efa2e | 84 | FactoryBot.define do
sequence :email do |n|
"email#{n}@example.com"
end
end
| 14 | 27 | 0.666667 |
f758706dd7e5a78d79d15a1c66768bac52a4ee2f | 1,681 | # frozen_string_literal: true
require_relative "../adapter"
module Lita
# A namespace to hold all subclasses of {Adapter}.
module Adapters
# An adapter for testing Lita and Lita plugins.
# @since 4.6.0
class Test < Adapter
# When true, calls to {#run_concurrently} will block the current thread. ... | 26.68254 | 98 | 0.649613 |
1a92eb416bfac0d9838f10dbc7468c0b878871c2 | 11,327 | require 'spec_helper_acceptance'
describe 'iis_application' do
before(:all) do
# Remove 'Default Web Site' to start from a clean slate
remove_all_sites();
end
context 'when creating an application' do
context 'with normal parameters' do
before(:all) do
@site_name = SecureRandom.hex(10)... | 33.81194 | 118 | 0.559283 |
6a908e3cdf078f3800ef4e24313886cc550a8b66 | 87 | class PhonesCarrier < ActiveRecord::Base
belongs_to :phone
belongs_to :carrier
end
| 17.4 | 40 | 0.793103 |
d599b41a34c71dc3e57006ca0f98e1ca533fbe6a | 122 | class Cities < ActiveRecord::Migration
def change
create_table :cities do |t|
t.string :name
end
end
end | 17.428571 | 38 | 0.672131 |
f80af8f4f27e3be92772df6883c286b41b1cf31b | 2,903 | module OverSIP::SIP
class TlsServer < TcpServer
TLS_HANDSHAKE_MAX_TIME = 4
def post_init
@client_pems = []
@client_last_pem = false
start_tls({
:verify_peer => true,
:cert_chain_file => ::OverSIP.tls_public_cert,
:private_key_file => ::OverSIP.tls_private_cert,
... | 32.617978 | 122 | 0.665518 |
33e8f1572f55befa440e46ba78a48c463b7dd488 | 431 | # frozen_string_literal: true
class UffizziCore::Rating < UffizziCore::ApplicationRecord
include AASM
self.table_name = Rails.application.config.uffizzi_core[:table_names][:ratings]
aasm(:state) do
state :active, initial: true
state :disabled
event :activate do
transitions from: [:disabled],... | 20.52381 | 81 | 0.698376 |
26e85bef9c7018483d243c32805231f84910add0 | 1,714 | require "fileutils"
require_relative 'credential'
module UserConfig
module Definitions
class AzureCredential < Credential
def initialize (provider, user_config_query_lambda)
super(provider, user_config_query_lambda)
end
def get_client_id()
return query("client_id")... | 26.78125 | 82 | 0.621354 |
08fedb4076e176ecb4502eb5ac11ef98229a50f1 | 153 | require 'test_helper'
module SemiStatic
class ProductTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
end
| 15.3 | 45 | 0.679739 |
39570cf007f82cbb7516126825f519f8f4e1914b | 13,447 | module Melbourne
module AST
class BackRef < Node
attr_accessor :kind
def initialize(line, ref)
@line = line
@kind = ref
end
Kinds = {
:~ => 0,
:& => 1,
:"`" => 2,
:"'" => 3,
:+ => 4
}
def mode
unless mode = Kind... | 19.602041 | 71 | 0.503384 |
5d67f521a7cc57e5284cd52f7500166a44a0303d | 6,199 | # Copyright 2016 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 applicable law or agreed to in writing, ... | 34.631285 | 88 | 0.559606 |
7a04064f76adab938fe7ec4a6a72c055a66f38a7 | 1,095 | # frozen_string_literal: true
FactoryBot.define do
factory(:channel_announcement, class: 'FactoryBotWrapper') do
node_signature_1 { build(:signature, :wire) }
node_signature_2 { build(:signature, :wire) }
bitcoin_signature_1 { build(:signature, :wire) }
bitcoin_signature_2 { build(:signature, :wire) ... | 30.416667 | 85 | 0.672146 |
3825666ab079bd282b05563990381bd8742e989c | 1,799 | class GitSecret < Formula
desc "Bash-tool to store the private data inside a git repo"
homepage "https://sobolevn.github.io/git-secret/"
license "MIT"
head "https://github.com/sobolevn/git-secret.git"
stable do
url "https://github.com/sobolevn/git-secret/archive/v0.3.2.tar.gz"
sha256 "07b32b096e5ff5b... | 33.314815 | 120 | 0.682601 |
edfd874b80878dc3d31d68fc57e6501e27d85064 | 173 | class CreateFeeds < ActiveRecord::Migration[5.0]
def change
create_table :feeds do |t|
t.string :title
t.string :url
t.timestamps
end
end
end
| 15.727273 | 48 | 0.635838 |
6a3dd20f58d7aa23e9adb12290a82bb0f781c7f3 | 1,741 | # frozen_string_literal: true
require 'support/test_field_type'
RSpec.describe EditInPlace::FieldTypeRegistrar do
let(:registrar) { described_class.new }
describe '#dup' do
let(:dup) { registrar.dup }
it 'returns a new FieldTypeRegistrar' do
expect(dup).to be_an_instance_of described_class
end... | 25.231884 | 87 | 0.651924 |
3911f4208e2b4134de0586052adb99d62bb19d30 | 744 | class Organisation < ActiveRecord::Base
has_and_belongs_to_many :users
has_many :pull_requests, -> { order("created_at desc") }, through: :users
scope :order_by_pull_requests, -> { order("organisations.pull_request_count desc") }
paginates_per 99
class << self
def create_from_github(response)
par... | 23.25 | 103 | 0.68414 |
f790e0cd1f53c4ec4fedcd2d75dfb920db4b58f5 | 2,786 | # Copyright 2015 Google 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-2.0
#
# Unless required by applicable law or agreed to in writing,... | 32.395349 | 98 | 0.667983 |
2895f46cc7ad5d6f55a92f768288ba348c134e8e | 4,031 | # frozen_string_literal: true
require 'vk/api/methods'
module Vk
module API
class Board < Vk::Schema::Namespace
module Methods
# Returns a list of topics on a community's discussion board.
class GetTopics < Schema::Method
# @!group Properties
self.open = true
... | 80.62 | 432 | 0.677499 |
2876b8b26e8abea61e6bf11aa83b2c2a8ae72c17 | 15,034 | module Playwright
# @ref https://github.com/microsoft/playwright-python/blob/master/playwright/_impl/_frame.py
define_channel_owner :Frame do
private def after_initialize
if @initializer['parentFrame']
@parent_frame = ChannelOwners::Frame.from(@initializer['parentFrame'])
@parent_frame.sen... | 27.534799 | 111 | 0.624185 |
79e232e519510d7d9e5194e166ac4920ccb07a8f | 2,013 | class Libmagic < Formula
desc "Implementation of the file(1) command"
homepage "https://www.darwinsys.com/file/"
url "ftp://ftp.astron.com/pub/file/file-5.34.tar.gz"
mirror "https://fossies.org/linux/misc/file-5.34.tar.gz"
sha256 "f15a50dbbfa83fec0bd1161e8e191b092ec832720e30cd14536e044ac623b20a"
bottle do
... | 34.118644 | 94 | 0.642822 |
e8107ebf9e62c252c169dc5ab39b5a374daaeabb | 1,547 | require 'spec_helper'
describe InboxHelper do
describe "commentable_description_link" do
context "for Deleted Objects" do
it "should return the String 'Deleted Object'" do
@commentable = FactoryGirl.create(:comment)
@work = @commentable.ultimate_parent
@work.destroy
@commen... | 40.710526 | 192 | 0.689076 |
38bb3ee57e45277562adb8c48afa1a07c46d848c | 733 | #
# Author:: Daniel Deleo (<dan@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
#
# ht... | 33.318182 | 74 | 0.742156 |
6a1c908adad39f5c568dfa66464721f0804d638c | 1,348 | # frozen_string_literal: true
require "active_support/concern"
module BitPlayer
module ContentProviders
# Presentation logic for a "new" or "edit" view on a data model.
module FormViewProvider
extend ActiveSupport::Concern
included do
def self.data_class(klass)
@source_class = ... | 22.098361 | 74 | 0.558605 |
113b29adcff3699a5cce05034c25ef3a6451e7ee | 122 | class AddSquirrelImageLink < ActiveRecord::Migration
def change
add_column :squirrels, :img_link, :string
end
end
| 20.333333 | 52 | 0.770492 |
9101981f08806aef9158575c59d90d5a7fd8806c | 772 | # encoding: UTF-8
# frozen_string_literal: true
class MigrateStates < ActiveRecord::Migration
def change
execute %{UPDATE deposits SET aasm_state = 'submitted' WHERE aasm_state = 'submitting'}
execute %{UPDATE deposits SET aasm_state = 'accepted' WHERE aasm_state = 'checked' OR aasm_state = 'warning'}
ex... | 51.466667 | 113 | 0.738342 |
ab1c17590673750c9194d64a8b9be5ba158726d2 | 204 | exclude :test_strftime__gnuext_complex, "need important implem changes and almost useless feature"
exclude :test_strftime__offset, "works with (-23..23) +24:00 and -24:00 'virtual' offsets not supported"
| 68 | 104 | 0.79902 |
08f01efcbd447ab2a937fa9153f0d9844a217d7c | 428 | require 'haml'
require 'action_controller/railtie'
Lolita.default_route = :rest
require 'lolita/rails/routes'
module ActionDispatch::Routing
class Mapper
protected
def lolita_rest_route mapping, controllers
resources mapping.plural,:only=>mapping.only.is_a?(Array) ? mapping.only : [:index,:new,:creat... | 26.75 | 126 | 0.735981 |
ac2f1290b5f7168228ebe64b9639fd2b47de0dd0 | 614 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional ... | 38.375 | 93 | 0.775244 |
39fccc8a4f5c6e5cb69e5a324eb8f1a66cfe73ef | 3,385 | #=============================================================================
# ** RGSS3 Decrypter
# Algorithm: fux2
# Implementator: Shadow Momo
#-----------------------------------------------------------------------------
# * eg: decrypt("Game.rgss3a")
#--------------------------------------------------------------... | 28.208333 | 79 | 0.529394 |
39fe704f5ce1c87b32cd00315b24a7a7c8f54bb4 | 1,352 | require 'rom/initializer'
require 'rom/http/types'
require 'rom/http/attribute'
require 'rom/http/schema'
require 'rom/http/schema/dsl'
module ROM
module HTTP
# HTTP-specific relation extensions
#
class Relation < ROM::Relation
include ROM::HTTP
adapter :http
schema_class HTTP::Schem... | 21.460317 | 61 | 0.616864 |
618ab9900bf8b441e7d925836c71ae45fc02daae | 915 | require "formula"
class Ridenum < Formula
homepage "https://github.com/trustedsec/ridenum"
url "https://github.com/trustedsec/ridenum.git", :using => :git, :revision => "a6ed473"
version "1.7"
depends_on "python3"
resource "pexpect" do
url "https://pypi.python.org/packages/52/97/13924c85a4b7544a4174781... | 30.5 | 128 | 0.725683 |
5d13ac1352905f0eb4de4cbb04b226511cd7dd9e | 78 | module WriMetadata
def self.table_name_prefix
'wri_metadata_'
end
end
| 13 | 28 | 0.769231 |
ab935d3004837b7bfbe523ac6d6c107093ecc2d3 | 290 |
require_relative '../helper'
collection = 'dubaipeeps'
punks = ImageComposite.new( 25, 14 ) # 25x14 = 350
punks.add_glob( "./#{collection}/ii/*.png" )
punks.save( "../collections/dubaipunks/dubaipunks-24x24.png" )
punks.zoom(2).save( "./tmp/dubaipeeps-24x24@2x.png" )
puts "bye"
| 17.058824 | 62 | 0.675862 |
bb6f6bef5d718d16db4d4fa4dcd8fe332def563d | 737 | class SessionsController < ApplicationController
def new
end
def create
@user = User.find_by(email: params[:session][:email].downcase)
if @user && @user.authenticate(params[:session][:password])
if @user.activated?
log_in @user
params[:session][:remember_me] == '1' ? remember(@user)... | 25.413793 | 79 | 0.636364 |
edf753a17b3b8f27011947020c3bcdcc4d3941cf | 23 | Travis::Features.start
| 11.5 | 22 | 0.826087 |
031ff8ff1170a0432e7bbc3bbdd3113d719b73d6 | 5,834 | require "language/go"
class Rclone < Formula
desc "rsync for cloud storage"
homepage "https://rclone.org/"
url "https://github.com/ncw/rclone/archive/v1.36.tar.gz"
sha256 "a573b70e3aeb355b943dddd6ae9375386fc21bf12dfba601d8d7280f97c4c884"
bottle do
cellar :any_skip_relocation
sha256 "3620712255134b1c... | 33.337143 | 92 | 0.723003 |
5d831cdd22b5f810e4ad346b31516e729698f30c | 519 | require 'netatlas/command_listener'
require 'netatlas/event_publisher'
require 'netatlas/collector_publisher'
require 'netatlas/scheduler'
require 'netatlas/worker'
class NetAtlas::PollerGroup < Celluloid::SupervisionGroup
supervise NetAtlas::CommandListener, :as => :command_listener
supervise NetAtlas::EventPublis... | 39.923077 | 69 | 0.797688 |
b9ae986132597a7908328737ff686004ad0a2c0c | 1,601 | # 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 = %q{juke}
s.version = "0.1.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_... | 28.589286 | 105 | 0.628357 |
e89cbaa06d50f9fe2aba2c43d4ad7891d5da4e87 | 761 | module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PayflowNvResponse < Response
def profile_id
@params['profileid']
end
def payment_history
@payment_history ||= get_history
end
protected
def get_history
hist = []
@params.reject {|key,v... | 26.241379 | 111 | 0.508541 |
6a4e9db9cbcc254bb3642e4468f922e1c57b11c9 | 66 | FactoryGirl.define do
factory :laugh do
volume 10
end
end
| 11 | 21 | 0.712121 |
38ca4681d9cfcc7defd58495af147cb897c30689 | 43 | module DeviseToken
VERSION = '0.1.1'
end
| 10.75 | 19 | 0.697674 |
b9b24692a84467b26cffd4a56a886386b8295bbf | 4,982 | require 'rails_helper'
RSpec.describe 'Confirmable', type: :feature do
def visit_user_confirmation_with_token(confirmation_token)
visit user_confirmation_path(confirmation_token: confirmation_token)
end
def resend_confirmation
user = create_user(confirm: false)
ActionMailer::Base.deliveries.clear
... | 32.141935 | 148 | 0.679647 |
080302acffb3e257eab29ee222da616f3ba0c9ef | 456 |
Gem::Specification.new do |spec|
spec.name = "truth_or_dare"
spec.version = "0.0.3"
spec.authors = ["Julie Graceffa"]
spec.email = ["julie.graceffa@gmail.com"]
spec.summary = %q{Truth or dare game}
spec.description = %q{Allows user to play truth or dare game and pick t... | 30.4 | 87 | 0.609649 |
f725869dca71d02da877df4fc68b6b33e6188452 | 1,483 | Dummy::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... | 38.025641 | 84 | 0.770061 |
e95422080dfe5c8fb318d0837ae1be6e8a19a597 | 4,482 | # frozen_string_literal: true
require 'spec_helper'
describe RuboCop::Cop::Style::NumericLiteralPrefix, :config do
subject(:cop) { described_class.new(config) }
context 'octal literals' do
context 'when config is zero_with_o' do
let(:cop_config) do
{
'EnforcedOctalStyle' => 'zero_with... | 32.014286 | 75 | 0.597947 |
d54dbe2e4d969c41ffaf3132e7c378fffb0887c8 | 1,169 | # frozen_string_literal: true
require 'spec_helper'
require 'cfn-model/parser/cfn_parser'
describe CfnParser do
before :each do
@cfn_parser = CfnParser.new
end
context 'a template with a lambda function' do
it 'has assocated role_object when ref id' do
json_test_templates('lambda_function/lambda_... | 29.974359 | 96 | 0.717707 |
113c94425a0c0598880054528133c54ffda31910 | 301 | module Travis
module Feierabend
class MemoryStorage
def initialize
@in_use = {}
end
def store(label, data)
@in_use[label] ||= []
@in_use[label].push(data)
end
def list_in_use(label)
@in_use[label] || []
end
end
end
end
| 15.842105 | 33 | 0.531561 |
bf1a45e329c130552e9a667086fd097199721702 | 181 | FactoryBot.define do
factory :lock_script do
address
hash_type { "type" }
args { "0x#{SecureRandom.hex(20)}" }
code_hash { "0x#{SecureRandom.hex(32)}" }
end
end
| 20.111111 | 45 | 0.635359 |
3384d953aff4580194d0ba37984ea8a64809cd4d | 2,020 | require "set"
module Celluloid
module ClassMethods
extend Forwardable
def_delegators :"Celluloid::Supervision::Container::Pool", :pooling_options
# Create a new pool of workers. Accepts the following options:
#
# * size: how many workers to create. Default is worker per CPU core
# * args: arr... | 28.055556 | 128 | 0.606931 |
1867501cd4f2f5b34bacd927beb8a48c0871eec4 | 2,754 | require 'spec_helper'
require 'fileutils'
require 'bosh/director/core/templates/template_blob_cache'
module Bosh::Director::Core::Templates
describe TemplateBlobCache do
let(:job_template) { double('Bosh::Director::DeploymentPlan::Job', download_blob: '/template1', blobstore_id: 'blob-id') }
let(:job_templa... | 33.180723 | 128 | 0.665214 |
e96e6537a9eae27abed922721c2c6bc54610d62a | 4,455 | # Provides implementation for Spree payment process logic for Spree::PaymentMethod::PAYONE::CashOnDelivery
module Spree::PAYONE
module Provider
module Payment
class CashOnDelivery < Spree::PAYONE::Provider::Payment::Base
# Sets initial data.
def initialize(options)
super(opt... | 42.428571 | 106 | 0.679012 |
919c1e4a5b2050309402b169e3b47266d879c445 | 1,346 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'techbook_helper/version'
Gem::Specification.new do |spec|
spec.name = "techbook_helper"
spec.version = TechbookHelper::VERSION
spec.authors = ["Georg Romas"]
spec.ema... | 40.787879 | 153 | 0.673848 |
bbd8320d6dda7a15832fb949d1c63964d1511bed | 1,489 | # encoding: utf-8
require 'spec_helper'
describe Github::Client::Issues::Comments, '#create' do
let(:user) { 'peter-murach' }
let(:repo) { 'github' }
let(:number) { 1 }
let(:inputs) { { 'body' => 'a new comment' } }
let(:request_path) { "/repos/#{user}/#{repo}/issues/#{number}/comments" }
before {
... | 29.78 | 75 | 0.657488 |
bf7794dbb6d864389d81ad47aedf3fd9f30c2483 | 447 | require 'base64'
require 'json'
require 'stringio'
require 'zlib'
module Jets::Job::Helpers
module LogEventHelper
def log_event
encoded = event["awslogs"]["data"]
compressed_string = Base64.decode64(encoded)
gz = Zlib::GzipReader.new(StringIO.new(compressed_string))
uncompressed_string = ... | 24.833333 | 64 | 0.715884 |
795d7fccf94a0ca7f3236105c6a41e6adb70d59f | 158 | module TharyelViewTool
class Renderer
def self.copyright(name, msg)
"© #{Time.now.year} | <b>#{name}</b> #{msg}".html_safe
end
end
end
| 19.75 | 65 | 0.626582 |
1adc08bc8f8a6b47811bd10083ec670684761cba | 1,097 | module PermitYo
module Default
module UserExtensions
def self.included(recipient)
recipient.extend ClassMethods
end
module ClassMethods
def acts_as_authorized_user
include PermitYo::Default::UserExtensions::InstanceMethods
end
end
module InstanceM... | 23.340426 | 69 | 0.587967 |
01cf9740d1f5cf454c98f64b795ec7cf27800c34 | 903 | require 'spec_helper'
describe 'Projects > Snippets > User comments on a snippet', :js do
let(:project) { create(:project) }
let!(:snippet) { create(:project_snippet, project: project, author: user) }
let(:user) { create(:user) }
before do
project.add_master(user)
sign_in(user)
visit(project_snip... | 23.763158 | 77 | 0.664452 |
bb8a10462a68971ecdfd4da3e9aad1916e211c64 | 192 | Rails.application.routes.draw do
root to: proc { [404, {}, ['404 (Not Found)']] }
post '/distance', to: 'distances#create', as: 'distance'
get '/cost', to: 'costs#show', as: 'cost'
end
| 27.428571 | 58 | 0.614583 |
1a78bfddf7476ccf7472cd7aaf7613a55cdaad3e | 2,565 | module Dapp
module Dimg
module Build
module Stage
class ImportArtifact < ArtifactBase
def initialize(dimg)
@dimg = dimg
end
def signature
hashsum [*dependencies.flatten, change_options]
end
def image
@image ||= I... | 33.311688 | 175 | 0.548538 |
e2fe6078760f98574a2eb74c99205d875c7f0d88 | 616 | require 'rails/generators'
module Mei
class RoutesGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
desc """
This generator makes the following changes to your application:
1. Injects route declarations into your routes.rb
"""
# Add Mei to the rou... | 22.814815 | 65 | 0.646104 |
1d890ac3cc51837301a13f7759c8ecb5b56184d4 | 2,078 | require_relative '../../../../test_helper'
require_relative '../endpoint_test_helper'
class UsersTest < Minitest::Test
extend Smartsheet::Test::EndpointHelper
attr_accessor :mock_client
attr_accessor :smartsheet_client
def category
smartsheet_client.users
end
def self.endpoints
[
{
... | 23.613636 | 79 | 0.443696 |
2183c667227220c8877dbf33b8d30c17722d2688 | 4,961 | # 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::ComprehendMedical
# When ComprehendMedical returns an error respon... | 29.706587 | 102 | 0.667406 |
0376034ec47f97f1770ae439182e0bef79680650 | 59 | class Employee < ApplicationRecord
has_many :entries
end
| 14.75 | 34 | 0.813559 |
1d478243ca41abe4dcb55ab3356fa578156d8fdf | 1,121 | #
# Cookbook Name:: redis
# Recipe:: default
#
# Copyright 2010, Estately, 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-2.0
#
# Unless... | 24.369565 | 74 | 0.724353 |
6a2bdda7953aeeb71b12943be62dc8e18dd7b634 | 242 | # frozen_string_literal: true
require "helper"
class TestSimpleCovHtml < Minitest::Test
def test_defined
assert defined?(SimpleCov::Formatter::HTMLFormatter)
assert defined?(SimpleCov::Formatter::HTMLFormatter::VERSION)
end
end
| 22 | 65 | 0.77686 |
5d4bab1119771c114382ddb081a6ac10d24a6b13 | 9,690 | # frozen_string_literal: true
require "singleton"
module Mime
class Mimes
attr_reader :symbols
include Enumerable
def initialize
@mimes = []
@symbols = []
end
def each
@mimes.each { |x| yield x }
end
def <<(type)
@mimes << type
@symbols << type.to_sym
... | 26.842105 | 131 | 0.577296 |
792f37cf666457a99969c81461cbbffd32646d8a | 1,411 | module Doorkeeper
module OAuth
class AuthorizationCodeRequest
include Validations
include OAuth::RequestConcern
validate :attributes, error: :invalid_request
validate :client, error: :invalid_client
validate :grant, error: :invalid_grant
validate :redirect_uri, ... | 25.654545 | 74 | 0.592488 |
7a1b34481141f5fe5ac6c5e88b17eab45c0558f3 | 603 | require_relative '../spec_helper'
DEPENDS_TEST_DIR = 'spec/fixtures/depends'
DEPENDS_BASE_DIR = DEPENDS_TEST_DIR
def update_appmap_index
cmd = [
'./exe/appmap-index',
'--appmap-dir',
DEPENDS_TEST_DIR
]
if ENV['DEBUG'] == 'true'
cmd << '--verbose'
end
system cmd.join(' ') or raise "Failed to... | 21.535714 | 88 | 0.688226 |
f857e9cf5461c4d2b4b078a1a9d233e21af041c9 | 7,322 | describe AutotestResultsJob do
let(:assignment) { create :assignment }
let(:grouping) { create(:grouping, assignment: assignment) }
let(:test_runs) { create_list(:test_run, 3, grouping: grouping, status: :in_progress) }
context 'when running as a background job' do
let(:job_args) { [assignment.id] }
le... | 45.478261 | 116 | 0.623737 |
1cf1c815277820a2697954dc2bd5969f863eff72 | 837 | namespace :v1x2, :path => "v1.2" do
resources :stageaction, :only => %i(show update)
get "/openapi.json", :to => "root#openapi"
post "/graphql", :to => "graphql#query"
resources :actions, :only => [:show]
resources :requests, :only => %i(create index show) do
resources :requests, :only => [:index]
... | 32.192308 | 86 | 0.633214 |
f8eca64707642d51d0e6937a99623642c9732872 | 823 | cask "alt-tab" do
version "6.34.0"
sha256 "85791a9f5fec9f3fca4da9e2a709e73d9019bdc470067cab97142174da678ceb"
url "https://github.com/lwouis/alt-tab-macos/releases/download/v#{version}/AltTab-#{version}.zip"
name "AltTab"
desc "Enable Windows-like alt-tab"
homepage "https://github.com/lwouis/alt-tab-macos"
... | 27.433333 | 99 | 0.715674 |
2189d739bdc7718056979308cf770249ce9a177a | 415 | module OfxS4m
class Header
attr_accessor :head
attr_accessor :version
def initialize(head = nil)
@head = head
clear_head
end
private
def clear_head
if @head
@head = @head.split("\n").map{|item| item.split(":") if item.split(":").size == 2 }.compact.to_h
@vers... | 21.842105 | 104 | 0.580723 |
7a27822888b94d501fd8fa68460b6343b21e663d | 2,215 | # -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<fnichol@nichol.ca>)
#
# Copyright (C) 2013, Fletcher Nichol
#
# 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.o... | 34.609375 | 75 | 0.684424 |
87e4a2f72aa00f1be518472677fe25511b978615 | 2,429 | class ShibbolethSp < Formula
desc "Shibboleth 2 Service Provider daemon"
homepage "https://wiki.shibboleth.net/confluence/display/SHIB2"
url "https://shibboleth.net/downloads/service-provider/3.0.4/shibboleth-sp-3.0.4.tar.bz2"
sha256 "f5dc0fd028b74db4aaae76b59ec98e8a719c38cfe0f1d722feb2d5e0b9880cff"
revision ... | 27.91954 | 115 | 0.657884 |
2810938ddfcde179e45d9cb26c4d714e0da67440 | 6,233 | require 'active_support/core_ext/class/subclasses'
require 'active_support/core_ext/object/blank'
require 'stringio'
require 'rack_console/expr_helpers'
require 'rack_console/configuration'
require 'rack_console/method_introspection'
require 'rack_console/formatting'
module RackConsole
module AppHelpers
include ... | 25.650206 | 116 | 0.577892 |
1a24818de1cec1b4df6ba602f0d2898a97e2dc63 | 201 | FactoryGirl.define do
factory :stock_item, class: Spree::StockItem do
backorderable true
stock_location
variant
after(:create) { |object| object.adjust_count_on_hand(10) }
end
end
| 20.1 | 63 | 0.726368 |
e940d0a7cfc6d50636d457d8f03f87452e37a4f8 | 2,312 | #
# Cookbook:: ruby_rbenv
# Resource:: system_install
#
# Author:: Dan Webb <dan.webb@damacus.io>
#
# Copyright:: 2017-2018, Dan Webb
#
# 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
#
# h... | 28.54321 | 106 | 0.721021 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.