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 |
|---|---|---|---|---|---|
e2d7a24e2cd235416ee9a58e3c2a019d55523c4e | 15,333 | # frozen_string_literal: true
require "rubygems"
require "formula_installer"
require "unpack_strategy"
require "cask/cask_dependencies"
require "cask/config"
require "cask/download"
require "cask/staged"
require "cask/verify"
require "cask/quarantine"
require "cgi"
module Cask
class Installer
extend Predicab... | 29.429942 | 117 | 0.663732 |
1ddf7881e81121f6019c79c57677dceb300df619 | 2,610 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Ci::Config::Entry::Script do
let(:entry) { described_class.new(config) }
describe 'validations' do
context 'when entry config value is array of strings' do
let(:config) { %w(ls pwd) }
describe '#value' do
it 'retu... | 23.727273 | 99 | 0.557471 |
33dc5821cac35fadaa1680bd2cf5a7d8b8d7fbec | 973 | require 'test_helper'
class CartsControllerTest < ActionDispatch::IntegrationTest
setup do
@cart = carts(:one)
end
test "should get index" do
get carts_url
assert_response :success
end
test "should get new" do
get new_cart_url
assert_response :success
end
test "should create cart" ... | 19.857143 | 67 | 0.685509 |
2844bbbcacb9233d070c85016eca6255f33edaeb | 612 | class Billing < ActiveRecord::Base
validates :number, uniqueness: true
validates :number, presence: true
validates :project_id, presence: true
validates :period_id, presence: true
# validates :person_id, presence: true
validates :user, presence: true
validates... | 30.6 | 46 | 0.656863 |
ac8512b66fada5fcefc357fccbc0b27a25eb00cd | 5,230 | # frozen_string_literal: true
RSpec.describe TTY::Prompt, "#ask" do
subject(:prompt) { TTY::Prompt::Test.new }
it "asks question" do
prompt.ask("What is your name?")
expect(prompt.output.string).to eq([
"What is your name? ",
"\e[1A\e[2K\e[1G",
"What is your name? \n"
].join)
end
... | 27.382199 | 80 | 0.574187 |
e87307c006de7d1cae378afed01042d9370f8e52 | 1,182 | require 'facter'
require File.join(File.dirname(__FILE__), '..', 'jenkins.rb')
require File.join(File.dirname(__FILE__), '..', 'jenkins/plugins.rb')
module Puppet
module Jenkins
module Facts
# Method to call the Facter DSL and dynamically add facts at runtime.
#
# This method is necessary to ad... | 28.829268 | 80 | 0.593063 |
bf62576cfd6f9b0f16282b3ac11a842c69787265 | 1,619 | #
# deep_merge.rb
#
module Puppet::Parser::Functions
newfunction(:deep_merge, :type => :rvalue, :doc => <<-'DOC') do |args|
@summary
Recursively merges two or more hashes together and returns the resulting hash.
@example Example usage
$hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } ... | 31.134615 | 114 | 0.607165 |
3842c7a05c789ffacffc98897995c333764b542e | 19,010 | # frozen_string_literal: true
require 'spec_helper'
describe Dynamoid::Finders do
let!(:address) { Address.create(city: 'Chicago') }
describe '.find' do
let(:klass) do
new_class(class_name: 'Document')
end
let(:klass_with_composite_key) do
new_class(class_name: 'Cat') do
range :a... | 34.944853 | 131 | 0.60484 |
ed692c39d8966fe17fae6e304001b25ca0f64f36 | 10,113 | require_relative '../../spec_helper'
require 'json'
require 'json-schema'
describe Sarif::GosecSarif do
describe '#parse_issue' do
let(:scanner) { Salus::Scanners::Gosec.new(repository: repo, config: {}) }
let(:path) { 'spec/fixtures/gosec/safe_goapp' }
before { scanner.run }
context 'scan report wi... | 45.968182 | 112 | 0.632849 |
f838ec18911f83f70882becd6bd79e97bf7d53c8 | 47 | module PhgSudokuSolver
VERSION = "0.0.2"
end
| 11.75 | 22 | 0.723404 |
267c386a7a85403ae5edd5d53c58bfe1cfc976be | 54,111 | # frozen_string_literal: true
require "spec_helper"
require_relative './interceptable_spec_models'
describe Mongoid::Interceptable do
class TestClass
include Mongoid::Interceptable
attr_reader :before_save_called, :after_save_called
before_save do |object|
@before_save_called = true
end
... | 26.002403 | 94 | 0.570549 |
1d6d8f7b395192e850e1b837802309af2abd6842 | 162 | class VaclPermission < ActiveRecord::Base
has_many :vacl_permission_collections
has_many :vacl_permission_sets, :through => :vacl_permission_collections
end
| 27 | 74 | 0.833333 |
79084efcb231ac5084d55fce24e4d1fb6f73765e | 1,685 | class Confuse < Formula
desc "Configuration file parser library written in C"
homepage "https://github.com/martinh/libconfuse"
url "https://github.com/martinh/libconfuse/releases/download/v3.3/confuse-3.3.tar.xz"
sha256 "1dd50a0320e135a55025b23fcdbb3f0a81913b6d0b0a9df8cc2fdf3b3dc67010"
license "ISC"
bottle... | 33.7 | 95 | 0.686053 |
f76cfbabb631df52b2576580c5dd86a0d059c5d0 | 1,240 | module ActiveSupport
module Multibyte #:nodoc:
DEFAULT_NORMALIZATION_FORM = :kc
NORMALIZATIONS_FORMS = [:c, :kc, :d, :kd]
UNICODE_VERSION = '5.0.0'
# Regular expressions that describe valid byte sequences for a character
VALID_CHARACTER = {
# Borrowed from the Kconv library by Shinji KONO -... | 45.925926 | 87 | 0.457258 |
ffd629dd89cfe2ba8312f802171cb67214e3d942 | 138 | class Topic < ActiveRecord::Base
has_many :topicals
has_many :articles, :through => :topicals
validates :title, :presence => true
end
| 19.714286 | 42 | 0.73913 |
6197fcb99f113c9c4a30ce5948bed42aa4382db9 | 6,621 | #--
# Copyright (c) 2010-2013 Michael Berkovich, tr8nhub.com
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, mod... | 34.305699 | 152 | 0.6715 |
e83a5b12985fecf6972bb90cfafc1ca29703a106 | 1,535 | class Microplane < Formula
desc "CLI tool to make git changes across many repos"
homepage "https://github.com/Clever/microplane"
url "https://github.com/Clever/microplane/archive/v0.0.23.tar.gz"
sha256 "0243aa58559b8a43f5fa7324eee05d490899aa73294737e47451d1fc994769f5"
license "Apache-2.0"
head "https://gith... | 33.369565 | 106 | 0.726384 |
26abd247dbd230c6d8e710a26206ddb7fb3e42bb | 214 | Rails.application.routes.draw do
# sets views/listings/index.html.erb as the root of the website
root 'listings#index'
# create all the routes neeeded for listings (C.R.U.D.)
resources :listings
end
| 21.4 | 65 | 0.724299 |
21d764fc177809a39ad3a254ab32bf251b510080 | 938 | class Person
def initialize(name, age)
@name = name
@age = age
end
def get_info
@additiona_info = "Interesting"
"Name: #{@name}, age #{@age}"
end
def name
@name
end
def name= (new_name)
@name = new_name
end
end
class PersonNew
attr_accessor :name, :age
end
person2 = PersonNew... | 17.054545 | 40 | 0.685501 |
33a8fd476e0ca0ae988f58d004a50328d243db63 | 274 | class OnyxLion < Cask
version '2.4.8'
sha256 'e637359020d3514cf1fe40d1f616692919c41aed926a395bbc7093b256e42e35'
url 'http://www.titanium.free.fr/download/107/OnyX.dmg'
homepage 'http://www.titanium.free.fr/downloadonyx.php'
license :unknown
app 'OnyX.app'
end
| 24.909091 | 75 | 0.766423 |
f7ffd9151a56f987575ab557cde3e0b1843d46f5 | 395 | # frozen_string_literal: true
module Ivapi
class Client
class Hosting < Base
attr_reader :hosting_id
def initialize(client, hosting_id)
super(client)
@hosting_id = hosting_id
end
def information
params = { command: 'hosting_info', id: hosting_id }
get('/j... | 18.809524 | 60 | 0.622785 |
335156032b78f29a252c85f5d89d940ab0ae0e67 | 642 | require 'test_helper'
class StaticPagesControllerTest <
ActionDispatch::IntegrationTest
test "should get home" do
get root_path
assert_response :success
assert_select "title", "Ruby on Rails Tutorial Sample App"
end
test "should get help" do
get help_path
assert_response :success
assert_select "title", "Help | Ruby ... | 21.4 | 68 | 0.797508 |
ed38cc0f1c69d2f270f2f0fe8feb1172ad87d844 | 520 | # frozen_string_literal: true
class BgsRelatedClaimant < Claimant
include AssociatedBgsRecord
validate { |claimant| ClaimantValidator.new(claimant).validate }
def fetch_bgs_record
general_info = bgs.fetch_claimant_info_by_participant_id(participant_id)
name_info = bgs.fetch_person_info(participant_id)
... | 20.8 | 76 | 0.780769 |
d5f4904a02e8e3d652b794dc7dbf9e0473e27c31 | 7,224 | # frozen_string_literal: true
# encoding: utf-8
module Mongoid
module Association
# This is the superclass for all many to one and many to many association
# proxies.
class Many < Association::Proxy
include ::Enumerable
delegate :avg, :max, :min, :sum, to: :criteria
delegate :length, ... | 33.6 | 93 | 0.599252 |
ac833395e3277b25256f4a8a50f2ec3c181c5097 | 2,263 | # frozen_string_literal: true
require 'spec_helper'
require 'request_store'
RSpec.describe ServiceProtocol::Redis::Client do
module TestNamespace
# Test class
class TestOperation
class << self
include ServiceProtocol::Redis::Connection
def call(params)
if RequestStore[:oper... | 20.026549 | 80 | 0.576668 |
d5ad67b01cb4fca15cabf9ef5d164c4c03e3aa99 | 57 | module InheritedResources
VERSION = '1.5.1'.freeze
end
| 14.25 | 26 | 0.754386 |
abd6e5a3dc7e4993842c2f522cc2d509574f0b43 | 2,451 |
###
# This Ruby source file was generated by test-to-ruby.xsl
# and is a derived work from the source document.
# The source document contained the following notice:
=begin
Copyright (c) 2001 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Auto... | 29.178571 | 113 | 0.705426 |
d5ddce1482e5bbc851ab390ac32c656baed92a60 | 422 | require 'formula'
class Blitzwave < Formula
homepage 'http://oschulz.github.io/blitzwave'
url 'https://github.com/downloads/oschulz/blitzwave/blitzwave-0.7.1.tar.gz'
sha1 '2a53f1a9b7967897415afce256f02693a35f380e'
depends_on 'blitz'
def install
system "./configure", "--disable-debug", "--disable-depend... | 26.375 | 77 | 0.677725 |
ab2ccfd304355f9c5ce5318e42cf1b217d039148 | 121 | class AddUserIdToOrders < ActiveRecord::Migration[5.0]
def change
add_column :orders, :user_id, :integer
end
end
| 20.166667 | 54 | 0.743802 |
3998d3719961dfa9509b2f8442bafce756499966 | 2,739 | require 'asana'
class AsanaService < Service
prop_accessor :api_key, :restrict_to_branch
validates :api_key, presence: true, if: :activated?
def title
'Asana'
end
def description
'Asana - Teamwork without email'
end
def help
'This service adds commit messages as comments to Asana tasks.
On... | 25.361111 | 131 | 0.636729 |
085d528e5b0ccb7f842d9e4f6a53cc94d4101c95 | 384 | if ENV['MY_RUBY_HOME'] && ENV['MY_RUBY_HOME'].include?('rvm')
begin
require 'rvm'
RVM.use_from_path! File.dirname(File.dirname(__FILE__))
rescue LoadError
raise "RVM gem is currently unavailable."
end
end
# If you're not using Bundler at all, remove lines bellow
ENV['BUNDLE_GEMFILE'] = File.expand_pa... | 32 | 78 | 0.723958 |
4a3fe84d7f73dc82917855d5ffa9b9c5b4841949 | 954 | require 'spec_helper'
describe Ci::BuildScheduleWorker do
subject { described_class.new.perform(build.id) }
context 'when build is found' do
context 'when build is scheduled' do
let(:build) { create(:ci_build, :scheduled) }
it 'executes RunScheduledBuildService' do
expect_any_instance_of(... | 23.268293 | 60 | 0.666667 |
01bb6933a5c9d5a0c6b65e9e71b9eccc4553defd | 642 | # frozen_string_literal: true
describe 'Node new page', type: :feature do
let(:current_user) { create :user }
before do
create :zone, default: true
create :status, name: 'Active'
login_as current_user
visit new_node_path
end
it { expect(page).to have_content 'New Node' }
it 'allows a node ... | 23.777778 | 54 | 0.688474 |
91679c9dc2ccf63cb40829e2635672a5ff0bcbfa | 781 | require 'test_helper'
class GeoCertsTest < Test::Unit::TestCase
context 'GeoCerts' do
should 'use the sandbox host' do
setting(GeoCerts, :sandbox, :to => true) do
assert_equal('https://sandbox.geocerts.com', GeoCerts.host)
end
end
should 'use the production host' do
... | 24.40625 | 71 | 0.596671 |
ff0a679380b1fd11463627c64c7a68cbde9135d3 | 1,192 | # frozen_string_literal: true
require './test_helper'
class PokedexTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Pokedex::VERSION
end
def test_fin_pokemon_with_filter
VCR.use_cassette('Find_pokemon') do
pokemon = Pokedex.Find_pokemon('p', 300)
assert_instance_of ... | 22.074074 | 58 | 0.713087 |
1dba133343acbd0800de3d3ff85369dabc692cf7 | 678 | cask "pingplotter" do
version "5.23.2"
sha256 :no_check
url "https://www.pingplotter.com/downloads/pingplotter_osx.zip"
name "PingPlotter"
desc "Network monitoring tool"
homepage "https://www.pingplotter.com/"
livecheck do
url "https://www.pingplotter.com/download/release-notes"
regex(/<h3>v?(\d... | 26.076923 | 79 | 0.69469 |
ede4bb1069f856c37195d465d449ee360c107704 | 1,510 | class Guide
include Mongoid::Document
include Mongoid::Paperclip
include Mongoid::Slug
searchkick
is_impressionable counter_cache: true,
column_name: :impressions_field,
unique: :session_hash
field :impressions_field, default: 0
belongs_to :crop, counter_cache: t... | 22.878788 | 85 | 0.641722 |
bfb2e321afc74035e7cd8bf8cd1a4a827d18d0fc | 664 | require 'rubygems'
require 'blather/client/dsl'
$stdout.sync = true
module Ping
extend Blather::DSL
def self.run; client.run; end
setup 'ping@your.jabber.server', 'password'
status :from => /pong@your\.jabber\.server/ do |s|
puts "serve!"
say s.from, 'ping'
end
message :chat?, :body => 'pong' do... | 17.025641 | 52 | 0.629518 |
4a257b11159dfdd4e6032513339ce41bb3498652 | 471 | # frozen_string_literal: true
require "zombie_check/core_ext/ennumerable"
require "zombie_check/core_ext/string"
require "zombie_check/version"
require "zombie_check/ping"
require "zombie_check/ping/checker"
require "zombie_check/ping/checker_report"
require "zombie_check/ping/host_stat"
require "zombie_check/ping/ping... | 29.4375 | 49 | 0.842887 |
3878e4f182511a08b96a37b8bb8260efb7152dc2 | 873 | # encoding: utf-8
require 'spec_helper'
describe NexaasID::Configuration do
subject do
described_class.build do |c|
c.url = 'http://some/where'
c.user_agent = 'My App v1.0'
c.application_token = 'some-app-token'
c.application_secret = 'some-app-secret'
end
end
it "should use the ... | 26.454545 | 60 | 0.670103 |
288564687847ccf4f1da7cf773642dd8aa645471 | 2,697 | #
# Cookbook:: veeam
# Spec:: standalone_complete
#
# maintainer:: Exosphere Data, LLC
# maintainer_email:: chef@exospheredata.com
#
# Copyright:: 2020, Exosphere Data, LLC, All Rights Reserved.
require 'spec_helper'
describe 'veeam::standalone_complete' do
before do
mock_windows_system_framework # Windows Fram... | 35.025974 | 127 | 0.630701 |
3944e965fe49427c08951291e4acea85337ad5ce | 376 | require "bundler/setup"
require "notable/covid/deaths"
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.exp... | 25.066667 | 66 | 0.755319 |
e8818a62ae00e872db04e3cc8312aaeaf6b158cb | 798 | #
# Cookbook Name:: splunk
# Recipe:: install_forwarder
#
# Author: Joshua Timberman <joshua@getchef.com>
# Copyright (c) 2014, Chef Software, Inc <legal@getchef.com>
#
# 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... | 33.25 | 74 | 0.750627 |
288069cb6061d2318b5ba56eb715c8197e567210 | 93,049 | # 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/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plug... | 50.735551 | 192 | 0.696654 |
08dce3d0e23156446d67261d8d12cd8a25bd4900 | 864 | require 'fog/openstack/models/collection'
require 'fog/identity/openstack/v3/models/policy'
module Fog
module Identity
class OpenStack
class V3
class Policies < Fog::OpenStack::Collection
model Fog::Identity::OpenStack::V3::Policy
def all(options = {})
load_response... | 26.181818 | 69 | 0.577546 |
ff4c428acb689ba7c9c921205980c2132146ea93 | 293 | class CreateWeapons < ActiveRecord::Migration[6.0]
def change
create_table :weapons do |t|
t.string :name
t.string :weapon_category
t.string :weapon_range
t.string :url
t.references :equipment, foreign_key: true
t.timestamps
end
end
end
| 19.533333 | 50 | 0.645051 |
ac65674ed21e9770c61971f0a11d0b5e60b30a23 | 330 | FactoryBot.define do
factory :collection_type_participant, class: Hyrax::CollectionTypeParticipant do
association :hyrax_collection_type, factory: :collection_type
sequence(:agent_id) { |n| "user#{n}@example.com" }
agent_type { 'user' }
access { Hyrax::CollectionTypeParticipant::MANAGE_ACCESS }
... | 36.666667 | 82 | 0.739394 |
ab98634f84b5dd362d3274c30fb9ca2d437050cd | 4,694 | require "metacrunch/hash"
require "metacrunch/transformator/transformation/step"
require_relative "../mab_to_primo"
require_relative "./helpers/datafield_089"
class Metacrunch::UBPB::Transformations::MabToPrimo::AddTitleDisplay < Metacrunch::Transformator::Transformation::Step
include parent::Helpers::Datafield089
... | 34.014493 | 134 | 0.696847 |
b99220822dfaa204c1407251aa4de0c0705ecb44 | 168 | class UpdateInUseToolsToVersion2 < ActiveRecord::Migration[5.1]
safety_assured
def change
update_view :in_use_tools, version: 2, revert_to_version: 1
end
end
| 24 | 63 | 0.785714 |
0899ebfe076e086b1e887a8e1f5f4a3e159fdadf | 884 | # frozen_string_literal: true
require './lib/day_20'
RSpec.describe 'Day 20: Jurassic Jigsaw' do
let(:test_data) do
[]
end
let(:fixture) { File.join fixtures_path, 'day_20.data' }
let(:fixture_data) { [] }
before do
File.readlines(fixture).each do |line|
fixture_data << line.chomp
end
e... | 21.560976 | 70 | 0.664027 |
03e38c8e5b7ebaca09abe34e14e4ee78b9d68ef7 | 79,494 | # frozen_string_literal: true
require "isolation/abstract_unit"
require "rack/test"
require "env_helpers"
require "set"
class ::MyMailInterceptor
def self.delivering_email(email); email; end
end
class ::MyOtherMailInterceptor < ::MyMailInterceptor; end
class ::MyPreviewMailInterceptor
def self.previewing_email(... | 30.633526 | 163 | 0.685096 |
280908d8d05a9818f6b1e56c06979daafec4cfca | 3,648 |
###
# This Ruby source file was generated by test-to-ruby.xsl
# and is a derived work from the source document.
# The source document contained the following notice:
=begin
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en A... | 35.764706 | 201 | 0.7267 |
0130439cf1a3f3a2c9ee950d70bfba6c195cd2ca | 954 | class Udunits < Formula
desc "Unidata unit conversion library"
homepage "https://www.unidata.ucar.edu/software/udunits/"
url "ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.26.tar.gz"
sha256 "368f4869c9c7d50d2920fa8c58654124e9ed0d8d2a8c714a9d7fdadc08c7356d"
bottle do
sha256 "5d06e98f43d762c488ee32fda... | 38.16 | 93 | 0.726415 |
f763d372788c197d00b99e2c420a0c9104b0b633 | 45 | module Representatives::ClassroomsHelper
end
| 15 | 40 | 0.888889 |
ed1554d0dbb374361b3be328546af3d1fbc3a5c1 | 5,458 | class Subliminal < Formula
desc "Library to search and download subtitles"
homepage "https://subliminal.readthedocs.org"
url "https://github.com/Diaoul/subliminal/archive/1.0.1.tar.gz"
sha256 "b2db67d6a6d68c3fc5a2fda9ee5831879548c288af61de726cae508d72fc4816"
head "https://github.com/Diaoul/subliminal.git"
... | 38.43662 | 96 | 0.76878 |
913b534f52ffc36d479aafbe547f6903b45ebdee | 2,260 | # frozen_string_literal: true
module ActiveStorage
# Decorated proxy object representing of multiple attachments to a model.
class Attached::Many < Attached
delegate_missing_to :attachments
# Returns all the associated attachment records.
#
# All methods called on this proxy object that aren't lis... | 33.731343 | 121 | 0.683186 |
7a5f7b157924f90155cb5ed96fc652c0f2e3b72d | 387 | class Bin < ActiveRecord::Base
def encode_id
rand = (1+rand(8)).to_s
id = (self.id + 1000).to_s
#logger.debug "enconding id"
#logger.debug "#{self.id}"
#logger.debug "#{id}"
#logger.debug "#{(id + rand)}"
#logger.debug "#{(id + rand).reverse}"
#logger.debug "#{(id + rand).reverse... | 21.5 | 56 | 0.573643 |
eda00ef2957ba9809760c7940b063414eb56dc81 | 1,007 | #!/usr/bin/env ruby
require 'net/ssh'
module SshCon
def self.connect(host)
opt = {
:keys => '/home/thirai/novakey01',
:passphrase => '',
:port => 22
}
Net::SSH.start(host, 'root', opt) do |ssh|
stderr = ""
ssh.exec!("echo test") do |channel, stream, data|
stderr << data if st... | 22.886364 | 107 | 0.607746 |
5debe2ac5cd702f5cc1ebe781b1f98d4f7017b41 | 911 | #!/usr/bin/env ruby
require 'rubygems'
spec = Gem::Specification.new do |s|
s.name = 'm4dbi'
s.version = '0.6.3'
s.summary = 'Models (and More) for DBI'
s.description = 'M4DBI provides models, associations and some convenient extensions to Ruby DBI.'
s.homepage = 'http://purepistos.net/m4dbi'
... | 25.305556 | 101 | 0.582876 |
21d162cb1e2d7bf1c778e78b1b41341a47d104ef | 8,687 | # rubocop:disable Layout/LineLength, Lint/RedundantCopDisableDirective
# == Schema Information
#
# Table name: events
#
# id :integer not null, primary key
# additional_info :jsonb
# admin_notes :text
# age_restrictions_description :text
# author ... | 31.136201 | 100 | 0.696098 |
edb8869418b218c460910100298e0fc26342fc52 | 547 | if Rails.env.production?
CarrierWave.configure do |config|
config.root = Rails.root.join('tmp') # adding these...
config.cache_dir = 'carrierwave' # ...two lines
config.fog_credentials = {
# Configuration for Amazon S3
:provider => 'AWS',
:aws_access_key_id => ENV['S3_ACCESS_KE... | 32.176471 | 85 | 0.568556 |
f777c2c15c46fc50e0a7189088037b672c83ba01 | 22,545 |
require "spec_helper"
describe "TEAMS API::" , :type => :api do
let (:team) {FactoryGirl.create(:team)}
let (:user) {team.users.first}
let (:project) { team.projects.first }
let (:admin) {FactoryGirl.create(:user, :admin)}
describe 'list all teams' do
context 'as a non-admin' do
before do
... | 26.337617 | 166 | 0.615702 |
392d43ef2d44f38bd1d0c73f7549ae3f2ffea6ba | 865 | # frozen_string_literal: true
require 'spec_helper'
describe 'admin/application_settings/integrations.html.haml' do
let(:app_settings) { build(:application_setting) }
describe 'sourcegraph integration' do
let(:sourcegraph_flag) { true }
before do
assign(:application_setting, app_settings)
al... | 24.714286 | 93 | 0.708671 |
e22b8ce1e615ec44411c13afebfff5f3c5b27859 | 12,559 | require 'spec_helper'
describe Typhoeus::Request do
let(:url) { "http://www.google.com" }
let(:options) { {} }
let(:request) { Typhoeus::Request.new(url, options) }
describe "#inspect" do
let(:url) { "http://www.google.com" }
let(:options) do
{ :body => "a=1&b=2",
:params => { :c => 'ok'... | 30.857494 | 129 | 0.601242 |
18e256f71cc111a6bb0bdea2420ba80a597b0476 | 3,755 | require 'spec_helper'
require 'integration_setup'
require 'ingenico/connect/sdk/factory'
require 'ingenico/connect/sdk/communicator_configuration'
require 'ingenico/connect/sdk/proxy_configuration'
require 'ingenico/connect/sdk/communication_exception'
require 'ingenico/connect/sdk/merchant/services/convert_amount_para... | 41.263736 | 144 | 0.619973 |
798fbd6b90cd92b94a8557a0235606d581b91f75 | 457 | cask 'cuttle' do
version '1.1'
sha256 '7133beb24c3a37fe13f12d0b8110f1fcaf541d80e938cfaafb37a4d47bfcca15'
url "https://github.com/oakmac/cuttle/releases/download/v#{version}/cuttle-v#{version}-mac.dmg"
appcast 'https://github.com/Swordfish90/cool-retro-term/releases.atom',
checkpoint: 'eb9ed3cb8456387... | 35.153846 | 97 | 0.774617 |
5d8ef1f0ec53f0b9963bafcb92bda1393a5b325d | 773 | module Coconductor
module ProjectFiles
class CodeOfConductFile < Coconductor::ProjectFiles::ProjectFile
include Licensee::ContentHelper
EXTENSIONS = %w[md markdown txt].freeze
EXT_REGEX = /\.#{Regexp.union(EXTENSIONS)}/i.freeze
BASENAME_REGEX = /(citizen[_-])?code[_-]of[_-]conduct/i.freez... | 33.608696 | 76 | 0.654592 |
385a3e7fc515b91864805d02e00c1266e2d86779 | 7,282 | # -*- encoding: utf-8 -*-
# stub: github-pages 204 ruby lib
Gem::Specification.new do |s|
s.name = "github-pages".freeze
s.version = "204"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["GitHub, Inc... | 58.725806 | 112 | 0.660258 |
01461f1a295fcf9298dc7efdafda643b5aef3dd4 | 1,116 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v3/errors/size_limit_error.proto
require 'google/protobuf'
require 'google/api/annotations_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("google/ads/googleads/v3/errors/size_limit_error.proto", :syntax ... | 34.875 | 182 | 0.750896 |
b993de26981e232293ae6866db4ef203ecd69443 | 1,456 | # frozen_string_literal: true
require 'oj'
require 'travis/yml/web/helpers'
module Travis
module Yml
module Web
class Parse < Sinatra::Base
include Helpers
MIME_TYPE = 'application/vnd.travis-ci.configs+json'
post '/parse' do
handle
end
post '/v1/parse'... | 22.060606 | 82 | 0.506868 |
bba889b5a1d816ad0a209a079b3317a7893e3214 | 4,161 | require 'nokogiri'
require 'open-uri'
require 'influxdb'
username = ENV['wltp_adminuser']
password = ENV['wltp_adminpass']
jenkins_user = ENV['wltp_adminuser']
jenkins_pass = ENV['wltp_adminpass']
database = 'test'
singlestats = 'd'
fullstats = 'z'
time_precision = 'ns'
influxdb ... | 26.335443 | 128 | 0.622927 |
87bb10ff428b0c5b79e745f52e876609a57b6327 | 1,317 | cask 'imazing-mini' do
version '2'
sha256 :no_check # required as upstream package is updated in-place
# dl.devmate.com was verified as official when first introduced to the cask
url "https://dl.devmate.com/com.DigiDNA.iMazing#{version}Mac.Mini/iMazingMini#{version}forMac.dmg"
name 'iMazing Mini'
homepage ... | 38.735294 | 109 | 0.660592 |
6224c5dbac06b41bf675bf77d3d7978a3f77f85e | 857 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require 'automux/version'
require 'automux/installation'
Gem::Specification.new do |gem|
gem.name = 'automux'
gem.version = Automux::Version::STRING
gem.authors = ["Alex Johnson"]
gem.email = ["github.com/notale... | 38.954545 | 89 | 0.648775 |
614a8ee1fccc6095b2f3ee591f487ee481c45de9 | 3,505 | require 'spec_helper'
describe 'archive::parse_artifactory_url' do
it { is_expected.not_to eq(nil) }
it { is_expected.to run.with_params.and_raise_error(ArgumentError) }
it { is_expected.to run.with_params('not_a_url').and_raise_error(ArgumentError) }
context 'releases' do
it do
is_expected.to run.w... | 42.743902 | 197 | 0.542083 |
915edd88922fae89a3aef71114164878fadb78e4 | 1,506 | class Chatbot::Card
include ActiveModel::Model
include Speechable
attr_accessor :components
validates :components, presence: true, length: {
maximum: 6, too_long: I18n.t('errors.chat_statement.card.too_long')
}
validate :recursive_validation
def nature
"card"
end
def components_as_statemen... | 26.421053 | 118 | 0.666667 |
9199429ef23419d0794557185730ca6ec52e4c50 | 1,908 | require 'spec_helper'
require 'chefspec/cacher'
describe ChefSpec::Cacher do
let(:klass) do
Class.new(RSpec::Core::ExampleGroup) do
extend ChefSpec::Cacher
def self.metadata
{ parent_example_group: { location: 'spec' } }
end
end
end
let(:cache) { described_class.class_variable... | 26.873239 | 90 | 0.623166 |
ab8d6a77dfe66f9ff6bcfa70a23839c471fb0364 | 2,547 | require 'spec_helper'
describe Spree::Admin::ImageSettingsController do
stub_authorization!
context "updating image settings" do
it "should be able to update paperclip settings" do
spree_put :update, { :preferences => {
"attachment_path" => "foo/bar",
"attachment_default_url" => "... | 36.913043 | 143 | 0.584609 |
18fea0e95aa9daf542c6169b81f567be8b64671a | 393 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::EventGrid::Mgmt::V2019_01_01
module Models
#
# Defines values for ResourceRegionType
#
module ResourceRegionType
RegionalResource = "Reg... | 24.5625 | 70 | 0.73028 |
1a67d2ac3dbad9b14c726c32dd193ce02252edf3 | 546 | module AArch64
module Instructions
# LDG -- A64
# Load Allocation Tag
# LDG <Xt>, [<Xn|SP>{, #<simm>}]
class LDG
def initialize xt, xn, imm9
@xt = xt
@xn = xn
@imm9 = imm9
end
def encode
LDG(@imm9, @xn.to_i, @xt.to_i)
end
private
... | 18.827586 | 57 | 0.485348 |
1d98f78f44fe837f0e6f9bb3faaf99abbb9ac17b | 969 | require 'find'
module Ginseng
class FileFinder
attr_accessor :dir, :patterns, :mtime, :atime, :empty
def initialize
@patterns = []
end
def execute
return enum_for(__method__) unless block_given?
Find.find(@dir) do |f|
next unless match_patterns?(f)
next unless matc... | 20.1875 | 57 | 0.621259 |
bb18c2cbbd21fbac9ac2b82d9c54bdb91b8a79c2 | 626 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe CorporationPolicy, type: :policy do
subject { described_class }
let(:user) { User.new }
permissions '.scope' do
pending "add some examples to (or delete) #{__FILE__}"
end
permissions :show? do
pending "add some examples to (or de... | 20.866667 | 58 | 0.691693 |
117ccb090c272e83566eb4eb7c50d034edb4ab8f | 562 | module FunWith
module Patterns
module Loader
# To simplify installing the loader pattern, loader_pattern_configure() is now going to be
# callable on all objects by default, and will include FunWith::Patterns::Loader
module ObjectAPI
def loader_pattern_configure( *args )
... | 33.058824 | 112 | 0.670819 |
4a80760f19fb67905ba8ed375a7a310f43f2b728 | 3,726 | module Bakery
class Croissant
PACKAGE_OF_3 = 5.95
PACKAGE_OF_5 = 9.95
PACKAGE_OF_9 = 16.99
INVALID_AMOUNTS = [1, 2, 4, 7].freeze
def croissant_pricing(pieces)
return invalid_amount if INVALID_AMOUNTS.include?(pieces)
send("show_price_for_#{pieces % 9}_remainder", pieces)
end
... | 28.442748 | 112 | 0.605743 |
e993373ee26b2eda960d46d630a2c5b2591f17d1 | 1,742 | # Copyright 2017 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, so... | 33.5 | 78 | 0.572331 |
ed8c03e0b877addcae6d08b267f2cbddf27a64ae | 1,016 | class Poco < Formula
desc "C++ class libraries for building network and internet-based applications"
homepage "https://pocoproject.org/"
url "https://pocoproject.org/releases/poco-1.10.1/poco-1.10.1-all.tar.gz"
sha256 "7f5931e0bb06bc2880a0f3867053a2fddf6c0d3e5dd96342a665460301fc34ca"
head "https://github.com/... | 32.774194 | 93 | 0.701772 |
d5cf84784812567fafaa823a921b55850298baaf | 12,451 | require "engineer_calculator/version"
require 'yaml'
module Engineer
class Calculator
include Math
attr_accessor :error, :alter
def initialize
@error = {}
@opt = nil
end
def calc(formula)
return nil unless formula
@error = {}
@result = {}
@alter = nil
be... | 36.194767 | 225 | 0.546462 |
03019b0becc70f03b8ec9765b09094e5139c7c87 | 3,446 | class Projects::ClustersController < Projects::ApplicationController
before_action :cluster, except: [:login, :index, :new, :create]
before_action :authorize_read_cluster!
before_action :authorize_create_cluster!, only: [:new, :create]
before_action :authorize_google_api, only: [:new, :create]
before_action :... | 25.153285 | 81 | 0.701103 |
ed0c823f6b32a30048408a66c1ae29064440cb49 | 354 | # frozen_string_literal: true
require_relative "amqp_channel_binding_contract"
require_relative "amqp_operation_binding_contract"
require_relative "amqp_message_binding_contract"
module Multidapter
module Adapters
module Amqp
module Validators
class AmqpContract < Dry::Validation::Contract
... | 19.666667 | 54 | 0.768362 |
bb5f246387aafb9c41d60fdca9f3d431a9fe7453 | 6,644 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Local
Rank = ExcellentRanking
include Msf::Post::Common
include Msf::Post::File
include Msf::Post::Windows::Priv
include Msf::Explo... | 40.266667 | 156 | 0.660747 |
b99af838a40ffa71e5bddd704499740c0bf60da8 | 1,594 | module ApplicationHelper
def theme_class
'lb-Theme--blue'
end
def main_class
"lb-Main--#{controller_name}"
end
def doc_link(slug, options = {})
name = doc_name(slug)
name << options.delete(:link_suffix).to_s
dopts = options.except(:class)
lopts = options.slice(:class)
link_to na... | 28.464286 | 138 | 0.710163 |
bb9a5b378d678f2cc107f8919e8284423972fdaa | 592 | require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "dianvo-native-android-xupdate"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.au... | 26.909091 | 120 | 0.60473 |
6af1f9039cbd8ac8eea5d5c92d476c859bd4cf52 | 884 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "payola_spy"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config... | 36.833333 | 99 | 0.719457 |
ab03225a2dd241480cad933196e506f2a654fd62 | 283 | # Don't forget! This file needs to be 'required' in its spec file
# See README.md for instructions on how to do this
def fizzbuzz(int)
if int % 3 == 0 && int % 5 == 0
"FizzBuzz"
elsif int % 5 == 0
"Buzz"
elsif int % 3 == 0
"Fizz"
else int
puts "FizzBuzz"
end
end | 20.214286 | 65 | 0.614841 |
21d2d02fdf7bfd81da18880f9fa7f1e64400099a | 20,958 | # Define Infinity
if !defined? Infinity
Infinity = 1.0/0
end
module Roby
class Plan
# An EventStructure::EventDeadlines instance that is used by the
# TemporalConstraints relation to maintain the set of event deadlines
attribute(:emission_deadlines) { EventStructure::EventDeadlines.new ... | 39.394737 | 138 | 0.52047 |
26cad5cd3ed9651ad4003e123153f4a2d8013c82 | 48 | module CommentAttribute
VERSION = '0.1.3'
end
| 12 | 23 | 0.729167 |
ab92ae9310026d3a434f5aaa251a170258442674 | 65 | module Nurego
class APIConnectionError < NuregoError
end
end
| 13 | 40 | 0.8 |
9107981526d4f69b402f59bf55fe9737e6832740 | 349 | class CreateSpreePaymentCaptureEvents < ActiveRecord::Migration[4.2]
def change
create_table :spree_payment_capture_events do |t|
t.decimal :amount, precision: 10, scale: 2, default: 0.0
t.integer :payment_id
t.timestamps null: false, precision: 6
end
add_index :spree_payment_capture_e... | 26.846154 | 68 | 0.730659 |
5d0d430824a69fada01d846e2fde87f592259ed3 | 956 | require 'rails_helper'
RSpec.describe 'Expense creation', type: :system do
before :each do
User.delete_all
user1 = User.new(name: 'u_test', email: 'u_test@mail.com', password: 'konohavillage')
user1.save
user1.groups.create(name: 'expense test')
user1.groups.create(name: 'expense test 2')
end
... | 24.512821 | 89 | 0.656904 |
e9746f488a87b10a37c6e94ab64bc457e6cc5573 | 158 | class TaggingSerializer < ActiveModel::Serializer
attributes :id, :spark, :tag
def spark
object.spark.id
end
def tag
object.tag.id
end
end
| 14.363636 | 49 | 0.696203 |
6266d18ef7c6475fb3e7072640389359dd07ae5b | 1,324 | class OsgeoPoints2grid < Formula
desc "Generate digital elevation models using local griding"
homepage "https://github.com/CRREL/points2grid"
url "https://github.com/CRREL/points2grid/archive/1.3.1.tar.gz"
sha256 "6e2f2d3bbfd6f0f5c2d0c7d263cbd5453745a6fbe3113a3a2a630a997f4a1807"
bottle do
root_url "https... | 32.292683 | 112 | 0.716012 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.