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 |
|---|---|---|---|---|---|
6a27f55b1ead2a2ab66b91aaf13f2c86f7ce0fca | 662 | require_relative 'boot'
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 Aliceandbob
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rai... | 33.1 | 82 | 0.765861 |
f722dbd75fd5ca6af6a1f7ca208086a2f8d990cc | 892 | module Cryptoexchange::Exchanges
module Gdac
module Services
class Pairs < Cryptoexchange::Services::Pairs
PAIRS_URL = "#{Cryptoexchange::Exchanges::Gdac::Market::API_URL}/public/marketsummaries"
def fetch
ctx = OpenSSL::SSL::SSLContext.new
ctx.verify_mode = OpenSSL::SSL... | 31.857143 | 96 | 0.529148 |
ab7e41436377e3909d33e7c236d9a0ec1f2947dc | 2,112 | # -*- encoding : utf-8 -*-
module Pacto
def self.consumers
@consumers ||= {}
end
def self.simulate_consumer(consumer_name = :consumer, &block)
consumers[consumer_name] ||= Consumer.new(consumer_name)
consumers[consumer_name].simulate(&block)
end
class Consumer
include Logger
include Rese... | 26.074074 | 108 | 0.650568 |
bb5b9d99c3c337da0f2dc3001696d69684e59093 | 487 | module BubbleWrap
module Device
module Screen
module_function
# Certifies that the device running the app has a Retina display
# @return [TrueClass, FalseClass] true will be returned if the device has a Retina display, false otherwise.
def retina?(screen=NSScreen.mainScreen)
if s... | 25.631579 | 114 | 0.663244 |
1d264013027f28f572d42f02ecc60958373f6ee3 | 1,048 | require 'spec_helper'
RSpec.describe 'Paribu integration specs' do
let(:client) { Cryptoexchange::Client.new }
let(:btc_tl_pair) { Cryptoexchange::Models::MarketPair.new(base: 'BTC', target: 'TL', market: 'paribu') }
it 'fetch pairs' do
pairs = client.pairs('paribu')
expect(pairs).not_to be_empty
p... | 30.823529 | 107 | 0.70229 |
1a56f316b021f8f71777468669419aa359aede56 | 221 | class Form::ProductCategory < ProductCategory
REGISTRABLE_ATTRIBUTES = %i(id product_id category_id _destroy)
belongs_to :product, class_name: 'Form::Product'
def selectable_categories
Category.all
end
end | 24.555556 | 65 | 0.778281 |
38fd24be28e2db1531a0b9bff4725f7a2a294d18 | 203 | #!/usr/bin/env ruby
module Dice
def roll
r_1 = rand(6); r_2 = rand(6)
r1 = r_1>0?r_1:1; r2 = r_2>0?r_2:6
total = r1+r2
printf( "You rolled %d and %d (%d).\n", r1, r2, total )
end
end | 20.3 | 59 | 0.551724 |
38936cb1e6430d25fedcb791218271e9625e3644 | 1,566 | # sudo acpid and wget are not included in the minimal DVD ISO. To fix
# this, use the *bin* ISO or run "yum install ..." in %post
Veewee::Session.declare({
:cpu_count => '1',
:memory_size=> '480',
:disk_size => '10140',
:disk_format => 'VDI',
:hostiocache => 'on',
:os_type_id => 'RedHat',
:virtualbox => {... | 31.32 | 111 | 0.52682 |
f81b1fc2f97d0c2f79bf042ffe37d24fa5bfcc54 | 540 | describe :yaml_each_document, :shared => true do
it "calls the block on each succesive document" do
documents = []
YAML.send(@method, $multidocument) do |doc|
documents << doc
end
documents.should == [["Mark McGwire", "Sammy Sosa", "Ken Griffey"],
["Chicago Cubs", "St Lo... | 28.421053 | 71 | 0.588889 |
620856a3bec840f5a7e94e4dc3f992079f371324 | 1,843 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::NotificationHubs::Mgmt::V2017_04_01
module Models
#
# Description of a NotificationHub AdmCredential.
#
class AdmCredential
include MsR... | 27.102941 | 70 | 0.52306 |
2690cda0815ccd3c497ebba386b603b8a7ecf57f | 3,360 | module HttpdConfigmapGenerator
class Saml < Base
MELLON_CREATE_METADATA_COMMAND = "/usr/libexec/mod_auth_mellon/mellon_create_metadata.sh".freeze
SAML2_CONFIG_DIRECTORY = "/etc/httpd/saml2".freeze
SP_METADATA_FILE = "#{SAML2_CONFIG_DIRECTORY}/sp-metadata.xml".freeze
IDP_METADATA_FILE = "#{S... | 31.401869 | 105 | 0.603571 |
5ddf93595cb785085dd472c66c67eca4be7d1572 | 143 | require 'spec_helper'
describe ExchangeRestApi do
it 'has a version number' do
expect(ExchangeRestApi::VERSION).not_to be nil
end
end
| 17.875 | 50 | 0.762238 |
e80a4ed994a80d043678cc7967720886d5b6a4e2 | 4,628 | module Enumerize
module Integrations
module RSpec
class Matcher
def initialize(expected_attr)
self.expected_attr = expected_attr
end
def in(*expected_values)
self.expected_values = expected_values.flatten
self
end
def with_default(expe... | 28.925 | 97 | 0.618842 |
26aa98c5478edae5674759e76b11f91fe205a2c0 | 372 | cask "shutter-encoder" do
version "14.3"
sha256 "a24371fb5e9677422d59bb14b859052a400498e78608f022ada221c93b4ca149"
url "https://www.shutterencoder.com/Shutter%20Encoder%20(MAC%20Version%20#{version}).zip"
appcast "https://www.shutterencoder.com/changelog.txt"
name "Shutter Encoder"
homepage "https://www.sh... | 31 | 91 | 0.774194 |
792c1c997f90f4b7bee71bf9af52c254fb8af618 | 3,367 | # frozen_string_literal: true
ENV['RAILS_ENV'] = ENV['RACK_ENV'] = 'test'
begin
require 'bootsnap'
Bootsnap.setup(cache_dir: "#{ENV.fetch('VENDOR_PATH', 'tmp')}/bootsnap")
rescue LoadError
# Bootsnap depends on ActiveSupport, but as AS heavily modifies stdlib
# we still want to test Sinatra without it
end
if... | 25.9 | 74 | 0.728542 |
879c675d5a23f1c3efab85f1d19b43de100ede1a | 455 | require "email_queue/version"
require "active_record"
require "mysql"
require "mail"
require "hirb"
Hirb.enable
require "email_queue/config/mail"
require "email_queue/config/db"
require "email_queue/schema"
require "email_queue/models/queue"
require "email_queue/models/archive"
require "email_queue/models/app"
requi... | 19.782609 | 46 | 0.806593 |
ed8c9f57c7657715ec904f1c6e7eefcf43b1ccae | 371 | cask "font-poly" do
version :latest
sha256 :no_check
# github.com/google/fonts/ was verified as official when first introduced to the cask
url "https://github.com/google/fonts/trunk/ofl/poly",
using: :svn,
trust_cert: true
name "Poly"
homepage "https://fonts.google.com/specimen/Poly"
fo... | 24.733333 | 87 | 0.692722 |
e82f1518879ad16d8ed7b1fd3efc5e66a997be6d | 184 | class AddDelegateToStateChange < ActiveRecord::Migration[5.2]
def change
add_reference :state_changes, :delegate, index: true, foreign_key: {to_table: :staff_profiles}
end
end
| 30.666667 | 98 | 0.777174 |
0896c7f0f39a6a08091e59021e2b8740b78c8303 | 519 | require_relative '../../spec_helper'
require 'prime'
describe "Prime#prime?" do
it "returns a true value for prime numbers" do
Prime.prime?(2).should be_true
Prime.prime?(3).should be_true
Prime.prime?(2**31-1).should be_true # 8th Mersenne prime (M8)
end
it "returns a false value for composite num... | 28.833333 | 67 | 0.680154 |
4ac61d5d2d1786b8d70087205ea7c1feb4f90619 | 691 | # Copyright 2011-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 36.368421 | 78 | 0.75398 |
79ee3a9661e37d0c2e787633e582ae6d548ea1cf | 275 | node['pw_base']['gemrc-files'].each do |file|
directory File.dirname(file) do
owner 'root'
group 'root'
mode 00755
recursive true
action :create
end
template file do
source 'gemrc.erb'
owner 'root'
group 'root'
mode 00644
end
end
| 16.176471 | 45 | 0.629091 |
211bc3253d14adb9e3750ad3ad9220ea26097e90 | 1,061 | # frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'redis' do
redis_name = case fact('osfamily')
when 'Debian'
'redis-server'
else
'redis'
end
it 'runs successfully' do
pp = <<-EOS
include redis
EOS
... | 22.104167 | 59 | 0.62394 |
03ff0ca0e66b38ac5bf3661b71e20b023e139d30 | 412 | require "hstore_accessor/version"
require "hstore_accessor/type_helpers"
require "hstore_accessor/serialization"
require "hstore_accessor/macro"
require "active_support"
require "active_record"
require "bigdecimal"
module HstoreAccessor
extend ActiveSupport::Concern
include Serialization
include Macro
end
Activ... | 22.888889 | 51 | 0.832524 |
b951a28b40af92d20a2f292fba59fca1a6d10bc1 | 1,251 | =begin
#convertapi
#Convert API lets you effortlessly convert file formats and types.
OpenAPI spec version: v1
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 CloudmersiveConvertApiClient::Ge... | 26.0625 | 102 | 0.754596 |
ff12e5e4a3c3c1f3c3b90ba64468163fe082106c | 2,096 | #%Header {
##############################################################################
#
# File adanaxis-data/ruby/AdanaxisAIKhaziVendor.rb
#
# Copyright: Andy Southgate 2002-2007, 2020
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation fi... | 30.376812 | 78 | 0.703721 |
913cb3e3d465093ffa699f05face37a5176340cd | 104 | class Project < ActiveRecord::Base
belongs_to :department
belongs_to :volunteer
has_many :skills
end
| 17.333333 | 34 | 0.807692 |
e8b7059a132ab118b85cf6ef0d36a2e510c0cb35 | 207 | FactoryBot.define do
factory :locations_service_area, class: '::Locations::ServiceArea' do
active_year { Date.today.year }
issuer_provided_code { "MAS001" }
covered_states { ['MA'] }
end
end
| 25.875 | 71 | 0.705314 |
ab9ef7b8587380c774dff2b2350e97b9cc2f0ba7 | 119 | module GitlabCi
Version = File.read(Rails.root.join("VERSION"))
Revision = `git log --pretty=format:'%h' -n 1`
end
| 23.8 | 49 | 0.680672 |
18d2d4fa3fafc7b892f3af644a48373260699d87 | 831 | module Smartdown
class Engine
class ConditionalResolver
def call(node, state)
node.dup.tap do |new_node|
new_node.elements = resolve_conditionals(node.elements, state)
end
end
private
def evaluate(conditional, state)
if conditional.predicate.evaluate(state)... | 25.181818 | 72 | 0.624549 |
4a9a5678a3736411a5077ddf6941418d2df02a37 | 242 | require 'chef/provider/lwrp_base'
class Chef
class Provider
class MariadbClient
class Fedora < Chef::Provider::MariadbClient
def packages
%w(MariaDB-client MariaDB-devel)
end
end
end
end
end
| 17.285714 | 50 | 0.644628 |
33b1bac98495f96b8ea326e76624ea597cd710ed | 482 | # frozen_string_literal: true
module Vulnerabilities
class Scanner < ApplicationRecord
self.table_name = "vulnerability_scanners"
has_many :occurrences, class_name: 'Vulnerabilities::Occurrence'
belongs_to :project
validates :project, presence: true
validates :external_id, presence: true, uniq... | 26.777778 | 83 | 0.744813 |
bb0a0be87274fdf230a7dc654f025e2f2c6e5fa0 | 19,031 | # frozen_string_literal: true
require "spec_helper"
require "dependabot/dependency"
require "dependabot/dependency_file"
require "dependabot/python/update_checker/latest_version_finder"
RSpec.describe Dependabot::Python::UpdateChecker::LatestVersionFinder do
before do
stub_request(:get, pypi_url).
with(he... | 31.984874 | 80 | 0.570543 |
f8b6c05ce5c3192d689c0d3094345b7b1d78c33d | 2,361 | require 'thor'
require 'loadmop'
module Loadmop
class CLI < Thor
class_option :adapter,
aliases: :a,
desc: 'adapter for database'
class_option :host,
aliases: :h,
banner: 'localhost',
desc: 'host for database'
class_option :username,
aliases: :u,
desc: 'username... | 27.453488 | 164 | 0.649725 |
ab77b9c8186c4d7db92eb92f58cdc3fd6f14e648 | 233 | class Person::KeyAccountSerializer < ApplicationSerializer
type :key_accounts
attributes :email,
:first_name,
:last_download,
:last_name,
:primary,
:remote_id
end
| 21.181818 | 58 | 0.575107 |
33045db0e9a17efaa262fea08a5fc6964b08824c | 98 | # typed: true
def meth; end;
def foo; end;
def bar; end;
begin; meth; rescue; foo; else; bar; end
| 16.333333 | 40 | 0.663265 |
1dda67364906ba18ebbfc99b1b5aa14222c820bd | 3,772 | require "test_helper"
class ConfigTest < Rugged::TestCase
def setup
@repo = FixtureRepo.from_rugged("testrepo.git")
path = Dir.mktmpdir("rugged-global-config")
cfg = Rugged::Config.new(File.join(path, ".gitconfig"))
cfg['user.name'] = "The test suite"
Rugged::Settings['search_path_global'] = pat... | 26.56338 | 78 | 0.674443 |
ed8c24927c1e1daa923c22fa31024b0db3286b43 | 352 | class CreateWatches < ActiveRecord::Migration[5.1]
def change
create_table :watches do |t|
t.string :name
t.string :dimensions
t.text :description
t.float :price
t.string :avatar
t.references :brand_id
t.references :genre_id
t.references :owner_id
t.timestamp... | 20.705882 | 50 | 0.642045 |
39d6cc59de444cd55dacece917b39f0b5894396a | 176 | class AddPropertiesToTags < ActiveRecord::Migration
def change
add_reference :tags, :recipe, index: true, foreign_key: true
add_column :tags, :tag, :string
end
end
| 25.142857 | 64 | 0.738636 |
799309c17b1c7fdd746616d54dcae2b0cd1f21e9 | 5,363 | module ActiveRecord
module Locking
# == What is Optimistic Locking
#
# Optimistic locking allows multiple users to access the same record for edits, and assumes a minimum of
# conflicts with the data. It does this by checking whether another process has made changes to a record since
# it was ope... | 36.986207 | 119 | 0.659146 |
3997c98038e8b39f0c64016dfa2387f6a50d11ad | 31,136 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::DevTestLabs::Mgmt::V2016_05_15
#
# The DevTest Labs Client.
#
class Policies
include MsRestAzure
#
# Creates and initiali... | 45.255814 | 184 | 0.692639 |
1cb7c698bf780ddaf45fb79623e49c9864741445 | 5,600 | require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
#require 'spork/ext/ruby-debug'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restar... | 36.601307 | 113 | 0.7325 |
6ae9bd28a4ba4f791ca33ee56070333213ec22be | 1,297 | require "spec_helper"
module Sales
module Tax
RSpec.describe Calculate do
subject { Sales::Tax::Calculate }
context ".round_up" do
it "is expected to return nearest value to 0.05" do
expect(subject.round_up(16.49)).to eq(16.5)
expect(subject.round_up(16.59)).to eq(16.... | 25.94 | 77 | 0.464919 |
0117a58e75b5c738916376fd09715f09413096ba | 6,326 | require 'test/unit'
require_relative '../lib/dok_matrix'
require_relative '../lib/sparse_matrix_factory'
require_relative 'sparse_matrix_generator'
require_relative '../lib/dok_matrix_factory'
class DOKMatrixTest < Test::Unit::TestCase
# Called before every test method runs.
# Can be used to set up fixture informa... | 27.867841 | 85 | 0.661872 |
619814c0b30ff597952381312ee825300728f3e1 | 103 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "aging"
require "minitest/autorun"
| 20.6 | 58 | 0.737864 |
6244b57acd223614e36c84e7920af0ab07a35aa0 | 938 | module R10K
module Environment
def self.factory
@factory ||= R10K::KeyedFactory.new
end
def self.register(key, klass)
factory.register(key, klass)
end
def self.retrieve(key)
factory.retrieve(key)
end
def self.generate(type, name, basedir, dirname, options = {})
f... | 24.051282 | 65 | 0.660981 |
111f35989070c4f78680f3f215a33aeab92d5534 | 439 | Shindo.tests('Fog::Compute[:opennebula]', ['opennebula']) do
compute = Fog::Compute[:opennebula]
tests("Compute collections") do
%w{networks}.each do |collection|
test("it should respond to #{collection}") { compute.respond_to? collection }
end
end
tests("Compute requests") do
%w{list_netwo... | 25.823529 | 83 | 0.669704 |
b92ae6aceeb79cba86b1776ceb1eee621c8f78ff | 148,413 | # 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::Macie2
# @api private
module ClientApi
include Seahorse::Mod... | 71.697101 | 195 | 0.768639 |
6a51920e410137e1e1791794de469380c41b252f | 441 | require 'bundler/setup'
require 'fundamenthus'
require 'pry'
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
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 `M... | 24.5 | 66 | 0.727891 |
1d8976e4160127b8a5a89a768b33404a4fdadf96 | 4,211 | module Searchgasm
module Helpers
module ControlTypes
module Select
# Please see order_by_links. All options are the same and applicable here. The only difference is that instead of a group of links, this gets returned as a select form element that will perform the same function when the value is cha... | 53.987179 | 293 | 0.630017 |
79e9f5bd9b0a8fb19a6ec3fd37a5799cb2c2bc6b | 8,218 | describe Hubspot::ContactList do
let(:example_contact_list_hash) do
VCR.use_cassette("contact_list_example", record: :none) do
HTTParty.get("https://api.hubapi.com/contacts/v1/lists/1?hapikey=demo").parsed_response
end
end
let(:static_list) { Hubspot::ContactList.all(static: true, count: 3).last }
... | 31.366412 | 170 | 0.660501 |
f83d9f175d9ef252a0da148fd15dfbc57756495f | 484 | require "caboose_rets/engine"
module CabooseRets
mattr_accessor :default_property_sort
@@default_property_sort = 'current_price DESC, mls'
mattr_accessor :use_hosted_images
@@use_hosted_images = true
mattr_accessor :media_base_url
@@media_base_url = ''
mattr_accessor :agents_base_url
@@agents... | 20.166667 | 53 | 0.731405 |
1148094680b6ef7cadba9463369030f865c1920f | 5,542 | 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.6/lib/concurrent-ruby"
$:.unshift "... | 79.171429 | 110 | 0.667088 |
e8e8c859fbea87856b7f6ff0b469fc22a2582004 | 1,101 | cask 'unity-ios-support-for-editor@2019.1.0a9' do
version '2019.1.0a9,0acd256790e8'
sha256 :no_check
url "https://download.unity3d.com/download_unity/0acd256790e8/MacEditorTargetInstaller/UnitySetup-iOS-Support-for-Editor-2019.1.0a9.pkg"
name 'iOS Build Support'
homepage 'https://unity3d.com/unity/'
pkg '... | 30.583333 | 138 | 0.71208 |
f706fc0cc9644a0613fa23f3d03ce126acf8ba69 | 2,140 | server 'd.trk.in.rs', user: 'orlovic', roles: %w[app web]
# server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
# server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_... | 37.54386 | 88 | 0.670561 |
91e3c40a4bcf8bf0bcd68d35b85047d5ff913c99 | 963 | # frozen_string_literal: true
describe Facts::Freebsd::Ssh do
describe '#call_the_resolver' do
subject(:fact) { Facts::Freebsd::Ssh.new }
let(:ssh) do
[Facter::Ssh.new(Facter::FingerPrint.new('test', 'test'), 'ecdsa', 'test', 'ecdsa')]
end
let(:value) do
{ 'ecdsa' => { 'fingerprints' =>
... | 29.181818 | 90 | 0.586708 |
391ae34663f1949d6c647e405da3a5822be453a7 | 6,099 | module WashOut
class Param
attr_accessor :raw_name
attr_accessor :name
attr_accessor :map
attr_accessor :type
attr_accessor :multiplied
attr_accessor :value
attr_accessor :source_class
attr_accessor :soap_config
# Defines a WSDL parameter with name +name+ and type specifier +type+... | 29.75122 | 124 | 0.58567 |
ff7faf8315fb447ffdabe68bd987e4d0042b1aee | 19,920 | # sequenceserver.rb
require 'sinatra/base'
require 'yaml'
require 'logger'
require 'fileutils'
require 'sequenceserver/helpers'
require 'sequenceserver/blast'
require 'sequenceserver/sequencehelpers'
require 'sequenceserver/sinatralikeloggerformatter'
require 'sequenceserver/customisation'
# Helper module - initializ... | 37.942857 | 171 | 0.638303 |
bb1a7656d7e1a756eb3cf8cd6e840e3acab2b2ef | 5,197 | # Packaging using Peter Bonivart's pkgutil program.
Puppet::Type.type(:package).provide :pkgutil, :parent => :sun, :source => :sun do
desc "Package management using Peter Bonivart's ``pkgutil`` command on Solaris."
pkgutil_bin = "pkgutil"
if FileTest.executable?("/opt/csw/bin/pkgutil")
pkgutil_bin = "/opt/cs... | 27.791444 | 117 | 0.602463 |
612674c1763a690d09cae07c9def7d1a420d76e2 | 2,922 | require 'spec_helper'
describe 'yum_cron' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) { facts }
let(:params) { {} }
it { is_expected.to create_class('yum_cron') }
it { is_expected.to contain_class('yum_cron::params') }
it { is_expected.to contain_class... | 28.647059 | 107 | 0.526352 |
1a8ab3a17e5ffd7381a74e76ca4f1bad67a6ca6d | 3,837 |
class FoldersController < ApplicationController
before_filter :login_required
before_filter :check_project
before_filter :browser_enabled
before_filter :get_folder, :only=>[:create_folder, :destroy, :display_contents,:remove_asset]
before_filter :get_folders,:only=>[:index,:move_asset_to,:create_folder]
b... | 25.243421 | 119 | 0.695074 |
61aa593bfaaf4ee5be80a4cbf3a60181048731f6 | 1,856 | module Rubysh
class Pipeline < BaseCommand
attr_accessor :pipeline
def initialize(pipeline)
raise Rubysh::Error::BaseError.new("Cannot create an empty pipeline") if pipeline.length == 0
@pipeline = pipeline
end
# sh semantics are that your exitstatus is that of the last in the
# pipe... | 26.140845 | 99 | 0.635776 |
1d9c16757929ef7fd0ae4f6168ea49baf3bd21aa | 624 | # frozen_string_literal: true
require "spec_helper"
describe Ruby64::ROM do
let(:memory) { described_class.new }
it "raises an error on write" do
expect { memory[15] = 20 }.to(
raise_error(Ruby64::Memory::ReadOnlyMemoryError)
)
end
describe ".load" do
subject(:basic) { described_class.load... | 21.517241 | 65 | 0.655449 |
87efde1a3419288f6eff9b9a36b8177e51604a64 | 3,711 | require 'spec_helper'
require 'cve_server/helper'
module HelperSpec
module_function
def cves
[
'CVE-2011-1529',
'CVE-2011-1530',
'CVE-2011-1624',
'CVE-2011-1625',
'CVE-2011-1640',
'CVE-2011-1737',
'CVE-2011-1738',
'CVE-2012-0814',
'cve-2013-2125',
'c... | 24.097403 | 60 | 0.600377 |
4a1e15a5a8e52eb2c79511545d5b5eb6cb8372a9 | 4,580 | require 'typhoeus'
require 'blinkr/cache'
require 'blinkr/http_utils'
require 'net/http'
require 'logger'
module Blinkr
class TyphoeusWrapper
include HttpUtils
attr_reader :count, :hydra
def initialize(config, context)
@config = config.validate
# Configure Typhoeus a bit
Typhoeus::Con... | 36.64 | 122 | 0.534279 |
ed1abcba8e787cde9a4f16633802a6c767dc1477 | 269 | describe SomeClass, '#some_method' do
it 'does something' do
something.should eq 'something'
end
end
describe SomeClass, '#other_method' do
it 'does something in one case' do
end
it 'does something else in other cases' do
end
# methods go here
end
| 16.8125 | 44 | 0.710037 |
1d097180d04d4069577b18dd27abe2233b781778 | 8,864 | require "reaper-man"
require "xmlsimple"
require "time"
module ReaperMan
class Generator
# Generator methods for yum
module Yum
# Version flag mappings
VERSION_FLAGS = {
"2" => "LT",
"4" => "GT",
"8" => "EQ",
"10" => "LE",
"12" => "GE",
}
# Lo... | 35.88664 | 120 | 0.456453 |
26a9f6e193c498a49b73424bf59ed998617e8836 | 848 | class SessionsController < ApplicationController
get '/signup' do
redirect_if_signed_in
erb :'sessions/signup'
end
post '/signup' do
user = User.new(params[:user])
if user.save
session[:user_id] = user.id
redirect "scripts"
else
redirect "/signup"
end
... | 22.315789 | 126 | 0.581368 |
01b4629b7a859bc4d57bfa9789b70b9edc775150 | 744 | require 'spec_helper'
describe "bootstrap::role::ciab" do
let(:node) { 'test.example.com' }
let(:facts) { {
:osfamily => 'RedHat',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '7.3.1611',
:operatingsystemmajrelease => '7',
:os_maj_release =>... | 29.76 | 58 | 0.450269 |
ff85b57a809c110e5f25025c69f7c5a8f32b20c0 | 2,824 | describe :uri_join, shared: true do
it "returns a URI object of the concatenation of a protocol and domain, and a path" do
@object.join("http://localhost/","main.rbx").should == URI.parse("http://localhost/main.rbx")
end
it "accepts URI objects" do
@object.join(URI("http://localhost/"),"main.rbx").should... | 49.54386 | 127 | 0.637394 |
0119a95dc5603070074658d3ae5fba05bb855813 | 258 | maintainer 'Wesleyan University'
maintainer_email 'software@wesleyan.edu'
license 'Apache 2.0'
description 'Manipulates system preferences'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
| 36.857143 | 72 | 0.713178 |
1cd78b58daaf7ba41bc875b968a1fb149923cd8a | 3,256 | # -*- coding: utf-8 -*-
#
# @file
# @brief
# @author ongaeshi
# @date 2013/02/16
require 'rubygems'
require 'ltsv'
require 'optparse'
require 'launchy'
module Ltsvr
class CLI
def self.execute(stdout, arguments=[])
options = {}
options[:keywords] = []
options[:ignore_keywords] = []
... | 23.257143 | 140 | 0.522113 |
61c43311d762fd03d60f3736432ad78d84dd6508 | 3,109 | module TranslationPanel
class RedisBackend < I18n::Backend::KeyValue
include I18n::Backend::Pluralization
attr_reader :store
def initialize(store)
@subtrees = false
@store = store
end
protected
def lookup(locale, key, scope = [], options = {})
key = normalize_fl... | 34.164835 | 101 | 0.60148 |
39e82510d0c93c6813bc1557a2bbed568cf3c616 | 867 | # Copyright 2015 Ooyala, Inc. All rights reserved.
#
# This file is licensed under the MIT License (the "License");
# you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
# http://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writ... | 34.68 | 71 | 0.763552 |
266bd7c048a5b5ec41e9b6a4c4bb78801a86f3c7 | 652 | class EventNoteAttachmentsController < ApplicationController
rescue_from Exceptions::EducatorNotAuthorized, with: :redirect_unauthorized!
before_action :authorize!
def authorize!
student = EventNoteAttachment.find(params[:id]).try(:event_note).try(:student)
raise Exceptions::EducatorNotAuthorized if stu... | 28.347826 | 94 | 0.768405 |
33d40f2dd7c171e738f8f0c825a1b7439ba4aff7 | 192 | class RemoveFrameDistanceFromVideos < ActiveRecord::Migration
def up
remove_column :videos, :frame_distance
end
def down
add_column :videos, :frame_distance, :integer
end
end
| 19.2 | 61 | 0.760417 |
014fd47423598b88558ac6414c383a0f067f3227 | 1,848 | # Copyright © 2011-2016 MUSC Foundation for Research Development
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list... | 51.333333 | 145 | 0.770563 |
d5aef4fd40be9a24cde247c8fd37e5985aec3d1e | 137 | class AddCustomDomainToConferences < ActiveRecord::Migration
def change
add_column :conferences, :custom_domain, :string
end
end
| 22.833333 | 60 | 0.79562 |
080fa6d1ec164150445ea88d7b1d4901ba7304a9 | 161 | # frozen_string_literal: true
require 'test_helper'
class PpdControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| 16.1 | 52 | 0.73913 |
7acde0ae1075d508df4afd7cff061be220c47286 | 70 | module Sprockets
module BlackCoffee
VERSION = '1.0.1'
end
end
| 11.666667 | 21 | 0.685714 |
1cd2ed284ffb0b79b5fa764f57bf1b2750d7c286 | 3,454 | template "onboard-be-config" do
path "#{ENV['JETTY_BASE']}/config/onboarding-be/onboarding_configuration.yaml"
source "configuration.yaml.erb"
owner "#{ENV['JETTY_USER']}"
group "#{ENV['JETTY_GROUP']}"
mode "0755"
variables({
:onboard_ip => node['ONBOARDING_BE_VIP'],
:... | 42.641975 | 92 | 0.611175 |
f70623e5d4b92b6a6187574ba61bb08045c6340d | 1,274 | # Copyright 2019-2020 Wingify Software Pvt. Ltd.
#
# 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 agre... | 36.4 | 87 | 0.702512 |
ffdd4f528d4e6659909cb6ee3b21ebf2aef6324d | 674 | module RailsPragmaticLogger
class JsonFormatter
def call(severity, timestamp, _progname, message)
output = to_hash(severity, timestamp, message)
if config&.pretty_print_json
JSON.pretty_generate(output) + "\n"
else
output.to_json + "\n"
end
end
protected
def t... | 21.741935 | 65 | 0.62908 |
4a7d873e97a7be6a2fabf87a2a3c823dce3809f3 | 2,029 | #! /usr/bin/env ruby
#
# check-bongo-endpoint.rb
#
# DESCRIPTION:
#
#
# OUTPUT:
# JSON
#
# PLATFORMS:
# Linux
#
# DEPENDENCIES:
# gem: sensu-plugin
# gem: rest-client
#
# USAGE:
# #YELLOW
#
# NOTES:
#
# LICENSE:
# Copyright (c) 2015,Yieldbot <devops@yieldbot.com>
# Released under the same terms as Sensu (... | 23.593023 | 114 | 0.645638 |
b979beaec5b6eca2fb70ad1a2c5ce535c7420a31 | 782 | # == Schema Information
#
# Table name: transactions
#
# id :integer not null, primary key
# debtor_id :integer
# creditor_id :integer
# box_id :integer
# connector_id :integer
# kWhs_used :decimal(, )
# price_per_kWh :decimal(, )
# amount :de... | 24.4375 | 59 | 0.592072 |
bbcc71bade746023fc25696fe0642514b2f6da37 | 3,139 | # frozen_string_literal: true
module QA
RSpec.describe 'Verify', :runner do
describe 'Pass dotenv variables to downstream via bridge' do
let(:executor) { "qa-runner-#{Faker::Alphanumeric.alphanumeric(number: 8)}" }
let(:upstream_var) { Faker::Alphanumeric.alphanumeric(number: 8) }
let(:group) {... | 29.895238 | 130 | 0.58044 |
08f1d6771403410fc20aec2817786f303a8e0f33 | 2,887 | require 'httparty'
require 'active_support/core_ext/hash'
require 'pry'
require 'pry-byebug'
require 'lazada_dino/api/product'
require 'lazada_dino/api/category'
require 'lazada_dino/api/feed'
require 'lazada_dino/api/image'
require 'lazada_dino/api/order'
require 'lazada_dino/api/response'
require 'lazada_dino/api/br... | 31.380435 | 97 | 0.65743 |
5d3c30aba02250ffe0c4110bd5625c02ae3dd8d5 | 1,449 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject,... | 35.341463 | 91 | 0.748792 |
62b893d0294e71ae67d375ce8c12d3c788bc010f | 3,902 | # encoding: UTF-8
#
# Copyright (c) 2010-2017 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 'gooddata'
describe 'Create project using GoodData client - blueprint', :vcr, :constraint =... | 36.12963 | 163 | 0.600205 |
624cf44d7883018a4985317302dd57d71053bb63 | 160 | # frozen_string_literal: true
module Hyrax
module Hirmeos
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
end
end
| 17.777778 | 48 | 0.7375 |
e2085309606ecd4b84eca0967af5a468ccf58fa2 | 1,041 | require 'test_helper'
class GamesControllerTest < ActionDispatch::IntegrationTest
setup do
@game = games(:one)
@puzzle = @game.puzzle
end
test 'should get index' do
get puzzle_games_url(@puzzle)
assert_response :success
end
test 'should create game' do
assert_difference('Game.count') do... | 23.133333 | 94 | 0.697406 |
d5beaf2608e64f997b31aa28cdfadfc98be871d9 | 763 | Pod::Spec.new do |s|
s.name = 'SVHTTPRequest'
s.version = '0.4'
s.license = 'MIT'
s.summary = 'Simple REST client for iOS and Mac.'
s.homepage = 'http://samvermette.com/310'
s.author = { 'Sam Vermette' => 'hello@samvermette.com' }
s.source = { :git => 'https://github.com/samvermette/SVHTTPReque... | 47.6875 | 306 | 0.697248 |
1c3dd324341f3ef1a91a0e9605a1b8ca6b7ace82 | 25,925 | # frozen_string_literal: true
# Copyright 2021 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... | 51.134122 | 155 | 0.539865 |
3955f2eeabc0ec08cae6ef758b1ad1b202123a33 | 303 | class CreateAuditingTables < ActiveRecord::Migration[7.0]
def change
create_table :audits1984_audits do |t|
t.integer :status, default: 0, null: false
t.text :notes
t.references :session, null: false
t.references :auditor, null: false
t.timestamps
end
end
end
| 23.307692 | 57 | 0.673267 |
18f4932907aacf65b4c1f6e663519e739b4cb63d | 25,439 | # frozen_string_literal: true
RSpec.shared_examples 'a class that supports relative positioning' do
let(:item1) { create_item }
let(:item2) { create_item }
let(:new_item) { create_item }
def create_item(params = {})
create(factory, params.merge(default_params))
end
def create_items_with_positions(pos... | 31.483911 | 127 | 0.688353 |
1d0da393dbd8f03cc1060477938be707ba64e7fb | 279 | # frozen_string_literal: true
class Grover
#
# Configuration of the options for Grover HTML to PDF conversion
#
class Configuration
attr_accessor :options, :meta_tag_prefix
def initialize
@options = {}
@meta_tag_prefix = 'grover-'
end
end
end
| 17.4375 | 66 | 0.688172 |
d520087b75b7b687180351766f730a210e70d293 | 407 | require 'rails/generators'
module ActiveFedora
class Config::FedoraGenerator < Rails::Generators::Base
source_root ::File.expand_path('../templates', __FILE__)
def generate
copy_file('fedora.yml', 'config/fedora.yml')
end
def fcrepo_wrapper_config
copy_file '.fcrepo_wrapper.yml'
c... | 23.941176 | 75 | 0.719902 |
610ce30635f4476a2837334024a35c981e03b7a5 | 863 | cask 'airtable' do
version '1.4.1'
sha256 '7056cbbc5cc1848ac42eff09adb5491f297c9c3ec89abbd122b55c56f003f4af'
url "https://static.airtable.com/download/macos/Airtable-#{version}.dmg"
appcast 'https://airtable.com/mac'
name 'Airtable'
homepage 'https://airtable.com/'
auto_updates true
app 'Airtable.app... | 33.192308 | 84 | 0.654693 |
184a189700dc26fd13cc9d420fe5deb362d52ead | 31,917 | # frozen_string_literal: true
require 'spec_helper'
require 'bolt/inventory'
require 'bolt/inventory/group'
require 'bolt/plugin'
require 'bolt_spec/config'
# This is largely internal and probably shouldn't be tested
describe Bolt::Inventory::Group2 do
include BoltSpec::Config
let(:data) { { 'name' => 'all' } }
... | 29.607607 | 117 | 0.486324 |
33bd5b4eb3d9ef0878ef6e2bd94b5ac6296a3a31 | 5,802 | require 'active_support/core_ext/hash'
module ActiveJob
# Raised when an exception is raised during job arguments deserialization.
#
# Wraps the original exception raised as +cause+.
class DeserializationError < StandardError
def initialize(e = nil) #:nodoc:
if e
ActiveSupport::Deprecation.wa... | 34.951807 | 147 | 0.667701 |
ac5bff14c8c914653925c5bafde5ab2e7548befe | 1,501 | # frozen_string_literal: true
# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------... | 27.796296 | 79 | 0.584943 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.