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 |
|---|---|---|---|---|---|
87e34383bcf8264cfe5dc03b7aab19acb499eef8 | 1,458 | module Producer
module Core
class Remote
attr_reader :hostname
attr_writer :session
def initialize hostname
@hostname = hostname
end
def session
@session ||= begin
check_hostname!
Net::SSH.start(@hostname, user_name)
end
end
... | 21.441176 | 75 | 0.545267 |
e8aa96c150c7094ac97fed4c9a096f75e00ebb24 | 2,788 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | 38.191781 | 134 | 0.762912 |
01626ee715177bd81ab6f86dfde950d1562cc4c9 | 491 | module AmoCRM::Entities
# https://online.moysklad.ru/exchange/rest/ms/xml/Metadata/list
class EmbeddedEntityMetadata < Base
include CommonObject
tag 'embeddedEntityMetadata'
attribute :uniqueCode, Boolean
attribute :codeValueType, Integer
attribute :independentNameGene... | 25.842105 | 65 | 0.682281 |
bb428084b6f7b1c4750a172c5da89cd8163d85fa | 1,844 | # frozen_string_literal: true
RSpec.describe Rialto::Etl::Extractors::WebOfScience do
subject(:extractor) { described_class.new(options) }
let(:options) { {} }
describe '#initialize' do
context 'when given a client' do
let(:client) { double }
let(:options) { { client: client } }
it 'uses... | 26.342857 | 101 | 0.60846 |
085cb1337738fc43cb1be7ce815240497bf092e9 | 4,832 | require 'ransack/nodes'
require 'ransack/context'
Ransack::Adapters.object_mapper.require_search
require 'ransack/naming'
module Ransack
class Search
include Naming
attr_reader :base, :context
delegate :object, :klass, :to => :context
delegate :new_grouping, :new_condition,
:build_grou... | 25.839572 | 136 | 0.565811 |
4ae77abfeae55496e9fcf69eaaaf058a2b1a37c3 | 4,502 | require 'fog/clodo/core'
module Fog
module Compute
class Clodo < Fog::Service
requires :clodo_api_key, :clodo_username
recognizes :clodo_auth_url, :persistent
recognizes :clodo_auth_token, :clodo_management_url
model_path 'fog/clodo/models/compute'
model :image
collect... | 29.424837 | 99 | 0.553976 |
1d5af24b3d9fbb9bfa7a1ad1bd2172151c97d089 | 968 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe GitlabSchema.types['User'] do
specify { expect(described_class.graphql_name).to eq('User') }
specify { expect(described_class).to require_graphql_authorizations(:read_user) }
it 'has the expected fields' do
expected_fields = %w[
id
... | 22.511628 | 83 | 0.702479 |
28a2846e12f7ae5a0c20d961d3ad616bce75e497 | 340 | # frozen_string_literal: true
module TrainingAndSupportHelper
def guidance_question_header(user)
if user.is_an_nqt_plus_one_ect?
"Before you start, would you like a brief guide on how to get the best out of these materials?"
else
"Before you start, would you like a brief summary of the programme?... | 28.333333 | 101 | 0.744118 |
3939877bed2b57fc05a3c920dc5d82f11ab24ca6 | 4,974 | # frozen_string_literal: true
module Qyu
module Workers
# Qyu::Workers::Base
# A Worker is sitting on a queue, waiting for something.
# Qyu::Worker#work(queue_name)
#
# Worker lifecycle:
# - Start an infinte loop:
# while (true)
# - Fetch a message (Task) from its queu... | 33.38255 | 101 | 0.588661 |
bf8f6353d7989989545952754365a5b97afadac5 | 8,783 | require 'active_record'
require 'mdquery/dataset'
require 'mdquery/util'
require 'date'
require 'time'
module MDQuery
module Model
# casts which can be used to transform queried values
CASTS = {
:sym => lambda{|v| v.to_sym},
:int => lambda{|v| v.to_i},
:float => lambda{|v| v.to_f},
:... | 32.409594 | 318 | 0.64306 |
79bdff9ec2e5f7b8697b7978e020fe0072456052 | 3,571 | #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# 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, which is a fork ... | 34.336538 | 100 | 0.729208 |
794938d244e50d6ea2cb9d4629f94dc39d34e273 | 5,140 | # frozen_string_literal: true
module Bridgetown
module Paginate
#
# The main entry point into the generator, called by Bridgetown
# this function extracts all the necessary information from the Bridgetown
# end and passes it into the pagination logic. Additionally it also
# contains all site spec... | 39.236641 | 95 | 0.632296 |
e81e61ba69450f55a4f1335b523ebf9e1c8704e3 | 718 | require 'fog/openstack/models/collection'
require 'fog/openstack/network/models/port'
module Fog
module OpenStack
class Network
class Ports < Fog::OpenStack::Collection
attribute :filters
model Fog::OpenStack::Network::Port
def initialize(attributes)
self.filters ||= {}
... | 21.757576 | 61 | 0.587744 |
01958a56289c748d032e3a40a2bed4970358b4a5 | 3,046 | # coding: utf-8
module Serps
# Search Base Class
class Search
class NotFound < StandardError; end
class ServerError < StandardError; end
class AccessBlock < StandardError; end
AGENT = {
pc: 'Mozilla/5.0',
fp: 'DoCoMo/2.0 P903i(c100;TB;W24H12',
sp: 'Mozilla/5.0 (iPhone; CPU iPhone... | 22.902256 | 147 | 0.599475 |
bb0f608a1fb584fe65ff4b06b17ce12e2c8b7183 | 3,189 | # encoding: utf-8
require "logstash/devutils/rspec/spec_helper"
require "logstash/codecs/auto_flush"
require "logstash/codecs/multiline"
require_relative "../supports/helpers.rb"
describe "AutoFlush and AutoFlushUnset" do
before(:all) do
@thread_abort = Thread.abort_on_exception
Thread.abort_on_exception = t... | 28.221239 | 123 | 0.646284 |
7a9c6628f62f64bac4247a3fffbc939a24f8665e | 459 | cask "tikzit" do
version "2.1.5"
sha256 "a4e191e65462f46a2aa92ab08f136f4f799c2d43f062564bdff833c9b2fb3ce5"
# github.com/tikzit/tikzit/ was verified as official when first introduced to the cask
url "https://github.com/tikzit/tikzit/releases/download/v#{version}/tikzit-osx.dmg"
appcast "https://github.com/tik... | 30.6 | 88 | 0.751634 |
18d912739c0d277e501d6dd43a48e47713252625 | 2,183 | #!/usr/bin/env ruby
# frozen_string_literal: true
require 'pathname'
require 'set'
require_relative 'utils'
def read_asteroids
(Pathname(__dir__).parent / 'data' / 'day_10.txt').readlines.map(&:chomp)
end
def angle(p, q)
dx = p[0] - q[0]
dy = p[1] - q[1]
gcd = dy.gcd dx
return [dy, dx] if gcd.zero?
[d... | 22.27551 | 93 | 0.639487 |
6132b958ac531ff23fe33267bf598b40733a1eb8 | 1,502 | class Uriparser < Formula
desc "URI parsing library (strictly RFC 3986 compliant)"
homepage "https://uriparser.github.io/"
url "https://github.com/uriparser/uriparser/releases/download/uriparser-0.8.6/uriparser-0.8.6.tar.bz2"
sha256 "0709a7e572417db763f0356250d91686c19a64ab48e9da9f5a1e8055dc2a4a54"
bottle do... | 31.957447 | 104 | 0.675766 |
e891f25acada92ee31207219ed78368aa9cd6417 | 369 | name 'chef-server'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache 2.0'
description 'Installs and configures Chef Server'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.1.7'
supports 'centos'
supp... | 26.357143 | 73 | 0.666667 |
e8b043d8cf3037a9f02b404fb0e8481bf1c414fd | 2,385 | require 'pact/provider/print_missing_provider_states'
require 'rspec/core/formatters/documentation_formatter'
require 'pact/provider/help/prompt_text'
module Pact
module Provider
module RSpec
class Formatter2 < ::RSpec::Core::Formatters::DocumentationFormatter
class NilFormatter < ::RSpec::Core::F... | 31.381579 | 111 | 0.650734 |
7ae9fc981f84b3ed53cf6097116479a62f9d04cd | 9,257 | require 'helper'
describe ProbeDockRSpec::TestResult do
let(:project_options){ { category: 'A category', tags: %w(a b), tickets: %w(t1 t2) } }
let(:project_double){ double project_options }
let(:example_metadata){ { key: '123' } }
let(:example_double){ double description: 'should work', metadata: { probe_dock:... | 32.94306 | 110 | 0.635195 |
28f84079d12567447fc9a2c832f8f4559b9b17d0 | 77 | require 'test_helper'
class StarChartsHelperTest < ActionView::TestCase
end
| 15.4 | 49 | 0.831169 |
01768109c9aeea031f25da70df869ad2a5b0341d | 8,712 | test_name "the pluginsync functionality should sync app definitions, and they should be runnable afterwards"
#
# This test is intended to ensure that pluginsync syncs app definitions to the agents.
# Further, the apps should be runnable on the agent after the sync has occurred.
#
#####################################... | 36.759494 | 116 | 0.648416 |
266aa000ed1bb24fe46c022e078421d6d2f51c76 | 4,269 | # frozen_string_literal:true
require 'docker'
require 'em/pure_ruby'
require 'watir'
require 'tempfile'
require 'fileutils'
require 'forwardable'
# Can't use ActiveSupport::Autroload
# ThreadError: can't be called from trap context
require 'r2-oas/schema/analyzer'
require_relative 'base'
# Scope Rails
module R2OAS
... | 29.040816 | 93 | 0.625673 |
e8003aeeb8e429d7cacc89b3118a42e3f9a7bf3b | 3,986 | # encoding: utf-8
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups)
# If you want your assets lazily compiled in production, use this line
... | 46.894118 | 197 | 0.744104 |
1dec94531f7dfad84711c1f34d0c1c7c35b9e33a | 1,419 | class Libtiff < Formula
desc "TIFF library and utilities"
homepage "https://libtiff.gitlab.io/libtiff/"
url "https://download.osgeo.org/libtiff/tiff-4.1.0.tar.gz"
mirror "https://fossies.org/linux/misc/tiff-4.1.0.tar.gz"
sha256 "5d29f32517dadb6dbcd1255ea5bbc93a2b54b94fbf83653b4d65c7d6775b8634"
bottle do
... | 30.191489 | 93 | 0.663143 |
ff52a14ad017efa1cfedfbc5f328dfbbdddd7de1 | 2,521 |
Pod::Spec.new do |s|
s.name = "Google-Maps-iOS-Utils"
s.version = "4.1.0"
s.summary = "A utilities library for use with Google Maps SDK for iOS."
s.description = "
This library contains classes that are useful for a wide range of applications
using the... | 35.507042 | 114 | 0.614042 |
1d83f24512573f31cec2ff857f3ddb237654f7d7 | 999 | class PastCourtDate < ApplicationRecord
belongs_to :casa_case
# get reports associated with the case this belongs to before this court date but after the court date before this one
def associated_reports
prev = casa_case.past_court_dates.where("date < ?", date).order(:date).last
if prev
casa_case.c... | 27.75 | 120 | 0.67968 |
18b8daf4e1e7571e1a786e285b4224a74d7cf7fc | 325 | class ReactiveCachingWorker
include Sidekiq::Worker
include DedicatedSidekiqQueue
def perform(class_name, id, *args)
klass = begin
Kernel.const_get(class_name)
rescue NameError
nil
end
return unless klass
klass.find_by(id: id).try(:exclusively_update_reactive_cache!, *args)
end... | 20.3125 | 73 | 0.723077 |
6a6ee407e67b60b16fb2999b229a79ef01a89514 | 1,864 | module Geocoder
module Lookup
extend self
##
# Array of valid Lookup service names.
#
def all_services
street_services + ip_services
end
##
# Array of valid Lookup service names, excluding :test.
#
def all_services_except_test
all_services - [:test]
end
#... | 21.929412 | 81 | 0.558476 |
28cd6789851e905a26be28af46b75f9d1421dcb5 | 1,212 | # frozen_string_literal: true
require_relative '../buy_train'
module Engine
module Step
module G18CZ
class BuyTrain < BuyTrain
def buyable_train_variants(train, entity)
trains = super
return [] if trains.empty?
default_trains = trains.select { |item| @game.train_of_... | 29.560976 | 86 | 0.618812 |
e9396c0f00c94e20505de9008140c7f1ce82e187 | 4,994 | require 'spec_helper'
describe 'Vis::DataView', js: true do
it 'creates a DataView with a DataSet' do
expect_evaluate_ruby do
dataset = Vis::DataSet.new([{id: 1, name: 'foo'}, {id: 2, name: 'bar'}, {id: 3, name: 'pub'}])
dataview = Vis::DataView.new(dataset)
[dataview.is_a?(Vis::DataView), data... | 44.589286 | 105 | 0.598919 |
5d9d70879ad41e96f7f9ccdd071ed6a92266eb07 | 6,924 | =begin
#Ory Kratos API
#Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administa... | 31.472727 | 429 | 0.639804 |
bf1c6d49a0aaa97aa6ac17d21d2c43536f0a9b1b | 1,466 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'amsa-mason/version'
Gem::Specification.new do |spec|
spec.name = "amsa-mason"
spec.version = AmsaMason::VERSION
spec.authors = ["Alex Moore-Niemi"]
spec.email ... | 40.722222 | 104 | 0.680764 |
f7c3635339d2d5ccbd079651df79f2f5e558cba7 | 489 | class ReviewsController < ApplicationController
def create
@recipe = Recipe.find_by(id: params[:recipe_id])
review = current_user.reviews.build(review_params)
review.recipe = @recipe
if review.save
redirect_to recipe_path(review.recipe)
else
flash[:alert] = "Please like or comment to ... | 24.45 | 65 | 0.699387 |
ff32d25b1c7e11f863caa50c4c6f02c9af6d46ed | 1,613 | require 'ci/common'
def disk_version
ENV['FLAVOR_VERSION'] || 'latest'
end
namespace :ci do
namespace :disk do |flavor|
task before_install: ['ci:common:before_install']
task :install do
Rake::Task['ci:common:install'].invoke('disk')
# sample docker usage
# sh %(docker create -p XXX:YYY... | 26.016129 | 75 | 0.601984 |
4a9caddd4ad86beeb4df11ca16f32accc4cb3615 | 1,031 | # stdbuf support
module Stdbuf
VERSION = '0.0.0'
def self.stdbuf(env = ENV)
case RUBY_PLATFORM
when /netbsd/i
stdbuf_all = env['STDBUF']
{
'STDBUF0' => STDIN,
'STDBUF1' => STDOUT,
'STDBUF2' => STDERR,
}.each do |key, io|
value = env[key] || stdbuf_all
... | 21.479167 | 55 | 0.483026 |
d5319065ec99fb15487811c3e41627e4b016f6cd | 5,659 | # frozen_string_literal: true
require 'spree/preferences/configuration'
module Spree
class BackendConfiguration < Preferences::Configuration
preference :locale, :string, default: I18n.default_locale
ORDER_TABS ||= [:orders, :payments, :creditcard_payments,
:shipments, :c... | 36.044586 | 101 | 0.564234 |
39ede1442abf6c77e27aaa49da35922901d44ef1 | 31,217 | # frozen_string_literal: true
require "abstract_unit"
require "controller/fake_controllers"
require "rails/engine"
class SessionTest < ActiveSupport::TestCase
StubApp = lambda { |env|
[200, { "Content-Type" => "text/html", "Content-Length" => "13" }, ["Hello, World!"]]
}
def setup
@session = ActionDisp... | 27.216216 | 140 | 0.670788 |
ac963408913e3d8f97153c08bb1ebe7863f9996d | 1,740 | class ApigeeTool < ThorCli
namespace 'apigeetool'
default_task :listdeployments
no_commands do
def load_config
@username = ApigeeCli.configuration.username
@password = ApigeeCli.configuration.password
@org = ApigeeCli.configuration.org
@env = environment
end
end
des... | 31.071429 | 108 | 0.629885 |
4a1bc847577f984a8432a714e44e19ba38ddb978 | 1,967 | class AddMoreRepositoryColumnsToMatchGithub < ActiveRecord::Migration
def self.up
add_column :repositories, :name, :string
add_column :repositories, :owner, :string
add_column :repositories, :description, :string
add_column :repositories, :pushed_at, :datetime
add_column :repositori... | 49.175 | 89 | 0.689375 |
abe947ad6c658d8e15991aca6e297e3fb432d568 | 322 | class EligibilityRuleSet
include Mongoid::Document
include Mongoid::Timestamps
belongs_to :organization
has_and_belongs_to_many :eligibility_rules
has_many :calls
field :name, localize: true
def match?(position_application)
eligibility_rules.all? { |rule| rule.match? position_application }
end
en... | 21.466667 | 70 | 0.782609 |
1d9bc498620b6266f27c07afa846f164424fe250 | 5,468 | # 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::Storage::Mgmt::V2016_01_01
#
# A service client - single point of access to the REST API.
#
class StorageManagementClient < MsRestAzur... | 39.623188 | 154 | 0.696233 |
62731ac49172901b83cc540b7613b6c03d65cda8 | 1,077 | cask "jdownloader" do
version "45730"
sha256 :no_check
url "http://installer.jdownloader.org/clean/JD2Setup.dmg",
user_agent: :fake
name "JDownloader"
desc "Download manager"
homepage "https://jdownloader.org/"
livecheck do
url "https://svn.jdownloader.org/build.php"
regex(/Revision:.*?(\d... | 25.642857 | 97 | 0.578459 |
ed9eceadb23d806175519a068af6e0e1262b67ac | 208 | class RenameVideos < ActiveRecord::Migration
def change
# Story.all.each do |story|
# story.video_url = "http://vimeo.com/#{story.video_url.split('/')[-1]}"
# story.save
# end
end
end
| 23.111111 | 78 | 0.625 |
1c319b71bdf21fd8ae1d8edfc8595034902b287c | 672 | $LOAD_PATH.unshift File.expand_path('..', __FILE__)
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
if RUBY_VERSION >= '1.9'
require 'simplecov'
require 'coveralls'
SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
SimpleCov.start do
minimum_coverage... | 23.172414 | 95 | 0.736607 |
9152d5f2f77a5057c33daa08079ce35bd454dcbd | 5,329 | class Saltstack < Formula
desc "Dynamic infrastructure communication bus"
homepage "http://www.saltstack.org"
# please use sdists published as release downloads
# (URLs starting with https://github.com/saltstack/salt/releases/download)
# github tag archives will report wrong version number
# https://github.... | 38.338129 | 124 | 0.750235 |
0887fb29dbb3168bc9e09e212bd57d39cc3e6313 | 196 | require "spec_helper"
describe Sapwood do
it "has a version number" do
expect(Sapwood::VERSION).not_to be nil
end
it "does something useful" do
expect(false).to eq(true)
end
end
| 16.333333 | 42 | 0.704082 |
ff87d00f10965cedcb4e7df818f89aebd8ef93a7 | 8,086 | # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 38.688995 | 245 | 0.691813 |
bfa386a33c20c6d599f7973adf2224d15eb6bc2d | 494 | cask 'phoenix-slides' do
version '1.4.3'
sha256 'ef150da77dc578cfdaaf94fd7680d4b09107d3cdf217e71f7065eb02bf5be934'
# github.com/gobbledegook/creevey was verified as official when first introduced to the cask
url "https://github.com/gobbledegook/creevey/releases/download/v#{version}/phoenix-slides-#{version.no_... | 38 | 115 | 0.781377 |
ed3df26c89e18eebfe9c176805977315fb391027 | 3,280 | #
# Cookbook:: ruby_rbenv
# Resource:: ruby
#
# Author:: Fletcher Nichol <fnichol@nichol.ca>
# Author:: Dan Webb <dan.webb@damacus.io>
#
# Copyright:: 2011-2018, Fletcher Nichol
# Copyright:: 2017-2018, Dan Webb
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... | 36.853933 | 98 | 0.71189 |
7a05325478b672250a1dc63e588468dc6fa317d7 | 923 | class Rdate < Formula
desc "Set the system's date from a remote host"
homepage "https://www.aelius.com/njh/rdate/"
url "https://www.aelius.com/njh/rdate/rdate-1.5.tar.gz"
sha256 "6e800053eaac2b21ff4486ec42f0aca7214941c7e5fceedd593fa0be99b9227d"
bottle do
cellar :any_skip_relocation
revision 1
sha... | 34.185185 | 92 | 0.672806 |
f8cb456272ac6235c8795adfa1ef1960ba90a518 | 9,337 | require 'rails_helper'
describe GatheringResourceAuthorizer, type: :authorizer do
before :context do
@community = create(:community)
@campus = create(:campus, community: @community)
@gathering = create(:gathering, community: @community, campus: @campus)
@assistant = create(:member)
@leader = cr... | 25.099462 | 90 | 0.643247 |
8733657478bddadf37dc0c6ea01939b2398bef55 | 16,051 | class Php < Formula
desc "General-purpose scripting language"
homepage "https://www.php.net/"
# Should only be updated if the new version is announced on the homepage, https://www.php.net/
url "https://www.php.net/distributions/php-7.4.4.tar.xz"
sha256 "1873c4cefdd3df9a78dcffb2198bba5c2f0464f55c9c960720c84df4... | 31.721344 | 160 | 0.621644 |
1acebef6808c007d571423fcfbd97ed970776854 | 9,472 | require 'psych'
require 'mongoid'
require 'pathname'
require 'sinatra/activerecord'
path = Pathname.new(File.dirname(__FILE__)).realpath.parent
Mongoid.load!("#{path}/config/mongoid.yml", :production)
Dir["#{path}/models/*.rb"].each { |file| load file }
def staticify_wiki_drop(map_id, drop_pool_name)
response = ''... | 27.062857 | 235 | 0.434333 |
33a6beca8ec14702043ed0e9dafc9e0ba27ca37e | 112 | class ApplicationMailer < ActionMailer::Base
default from: "aurorairbnoreply@gmail.com"
layout 'mailer'
end
| 22.4 | 44 | 0.785714 |
4a850c1b2ec6a524d081cecf2c703a988d4d0239 | 182 | json.checkin do
json.start_time_utc = @checkin.checkin_at.to_i
json.start_time = @checkin.checkin_at
json.status @checkin.status
json.start_dtime @checkin.day.start_time
end
| 26 | 48 | 0.791209 |
1884bb0e4c8ec645807d5318edf43d02b8514d30 | 3,594 | require "yaml"
require "yqr/version"
begin
require "hashie"
rescue LoadError
# do nothing
end
module Yqr
@yaml = nil
@options = {debug: false, json: false, symborize: true, raw: false}
class << self
def yaml
@yaml
end
def options
@options
end
def load_yaml
if @option... | 19.856354 | 85 | 0.536171 |
1d2a16e3ee4904f7e38b437e99809475d3654a8a | 4,117 | require 'test_helper'
class RemoteNetworkMerchantsTest < Test::Unit::TestCase
def setup
@gateway = NetworkMerchantsGateway.new(fixtures(:network_merchants))
@amount = 100
@decline_amount = 1
@credit_card = credit_card('4111111111111111')
@check = check
@options = {
:order_id => '1',
... | 30.723881 | 94 | 0.731358 |
bb7820c1073611567378877f7470f3fe094ef1ad | 85 | json.array! @relationships, partial: 'relationships/relationship', as: :relationship
| 42.5 | 84 | 0.8 |
6a5b2debfeaad5428156070eb2cc460b07bc665e | 1,576 | module Web3
module Octo
class EthModule
include Web3::Octo::Utility
PREFIX = 'eth_'.freeze
def initialize web3_rpc
@web3_rpc = web3_rpc
end
def getBalance address, block = 'latest', convert_to_eth = true
wei = @web3_rpc.request("#{PREFIX}#{__method__}", [address,... | 27.649123 | 94 | 0.65165 |
394629d6354b39a8bff1a61d012fd353305b81a6 | 7,837 | # frozen_string_literal: true
require "helper"
describe "toys" do
it "prints general help" do
output = Toys::TestHelper.capture_toys.split("\n")
assert_equal("NAME", output[0])
assert_equal(" toys - Your personal command line tool", output[1])
end
it "prints toys version when passed --version fl... | 39.38191 | 99 | 0.594488 |
d5004d04037accad4e0ca9bf78d20730ad288450 | 351 | module MotdFormatter
class MarkdownErb
attr_reader :content, :title
def initialize(motd_file)
motd_file ||= MotdFile.new unless motd_file
@title = motd_file.title
@content = OodAppkit.markdown.render(ERB.new(motd_file.content).result)
end
def to_partial_path
"dashboard/mot... | 21.9375 | 77 | 0.695157 |
1887060534fbe527db959ad09d69870921bd23cb | 701 | module TicketEvolution
class Search < Endpoint
def list(params = {})
request(:GET, nil, params, &method(:build_for_search))
end
def build_for_search(response)
collection = TicketEvolution::Collection.new(
:total_entries => response.body['total_entries'],
:per_page => response.... | 29.208333 | 79 | 0.631954 |
03e8585170756689bc8ba46333f0b4f9ecf1cc8f | 42 | module BattleShip
VERSION = "0.1.0"
end
| 10.5 | 19 | 0.690476 |
1cff9e445bee537090d757e75c7a14f41c317a20 | 6,690 | #
# Author:: Adam Edwards <adamed@getchef.com>
# Copyright:: Copyright (c) 2014 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#... | 47.785714 | 804 | 0.715396 |
62483d29c069fae13518ed88aff8d091fc514d07 | 6,116 | require 'spec_helper'
class BaseTestController < ActionController::Base
def initialize(request = OpenStruct.new(parameters: {}))
super()
@_request = request
end
def current_account
nil
end
def oauth2_callback_url(options = {})
''
end
end
class SessionsController < BaseTestController
in... | 28.314815 | 210 | 0.623774 |
917d5567b84cf1a3e2ec93c1f90800fb5b956938 | 2,140 | require 'spec_helper'
ActiveRecord::Base::establish_connection(:adapter => "sqlite3", :dbfile => ":memory:", :database => "gemtest")
$stdout = StringIO.new
def setup_db
ActiveRecord::Base.logger
ActiveRecord::Schema.define(:version => 1) do
create_table :categories do |t|
t.column :root_id, :integer
... | 28.157895 | 141 | 0.689252 |
bfe03380bf44e395113b5cbc9c3b215bab48fcb4 | 352 | class DatabaseInfo
attr_reader :database, :name
def initialize(db:, env: ENV["etl_env"])
@env = env.to_sym
@configuration = Configuration.new(:connection).retrieve(db)[@env]
end
def self.define_criteria(name)
define_method(name) do
@configuration[name]
end
end
define_criteria :datab... | 19.555556 | 70 | 0.704545 |
91ebd849b3e0bff77c08b20cbc80067316464e80 | 293 | require 'twitter/base'
module Twitter
class Trend < Twitter::Base
attr_reader :events, :name, :promoted_content, :query, :url
# @param other [Twitter::Trend]
# @return [Boolean]
def ==(other)
super || attr_equal(:name, other) || attrs_equal(other)
end
end
end
| 19.533333 | 63 | 0.645051 |
e8030f1aec1fa54f6c3c5fd3988cb256c60906d3 | 151 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_action-cable-server_session'
| 37.75 | 89 | 0.807947 |
1a51879fb80415f5f129df360c383b1661c32f66 | 148 | require 'test_helper'
class FiatPublication::Test < ActiveSupport::TestCase
test "truth" do
assert_kind_of Module, FiatPublication
end
end
| 18.5 | 53 | 0.777027 |
edf9bfc68ed3b661dda24f8676b85b6a113499e7 | 7,020 | class Weboob < Formula
include Language::Python::Virtualenv
desc "Web Outside of Browsers"
homepage "http://weboob.org/"
url "https://symlink.me/attachments/download/342/weboob-1.2.tar.gz"
sha256 "1e3b7e35bd1e5d203e5d716be4a25e898aba6887b3c3b8341e3a0ce2ad8e87b0"
head "https://git.symlink.me/pub/weboob/stab... | 45.290323 | 154 | 0.795869 |
1d532dbe2fcc868861ac159fc38135658b571c16 | 1,779 | RSpec.describe Leaderboard, type: :service do
context "most and least scenic places" do
let(:most_scenic_place) { FactoryBot.create(:place) }
let(:least_scenic_place) { FactoryBot.create(:place) }
before do
FactoryBot.create_list(:vote, 3, place: most_scenic_place, rating: 10)
FactoryBot.crea... | 32.944444 | 95 | 0.657111 |
1a04f6d16c6095c6cd74b05886ffaae891d7b89f | 2,251 | # frozen_string_literal: true
require "test_helper"
class HTApprovalRequestTest < ActiveSupport::TestCase
def presenter(req)
HTApprovalRequestPresenter.new(req)
end
test "select for renewal checkbox" do
req = build(:ht_approval_request, :approved)
assert_match("checkbox", presenter(req).select_for_... | 28.493671 | 103 | 0.725455 |
6a4cae2d0032cdf63929b3a069e162a77a19e003 | 2,446 | require File.expand_path(File.join(File.dirname(__FILE__), '..', 'vclresource'))
Puppet::Type.type(:vcl_image).provide(:mysql, :parent => Puppet::Provider::Vclresource) do
def self.resourcetype
"image"
end
def self.maintbl
"image"
end
def self.columns
{
"image" => {
"name" ... | 35.449275 | 176 | 0.514718 |
334eeb3c5c14ad9e2ee776df8f10c223f1bb09df | 1,189 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/client_side_validations/formtastic/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Brian Cardarella"]
gem.email = ["bcardarella@gmail.com"]
gem.description = %q{Formtastic Plugin for ClientSideValidaitons}
gem.summar... | 39.633333 | 87 | 0.71741 |
e810e2bb60b466a53222faea31f5aa314baf3056 | 103 | class Rating < ActiveRecord4116::Base
belongs_to :comment
has_many :taggings, :as => :taggable
end
| 20.6 | 38 | 0.747573 |
28247952ba13b16781e228a6b1bc7da7555980f4 | 808 | module Rovi
class Api
include HTTParty
@@host = "http://api-music.rovicorp.com"
def initialize(api_key, api_secret)
@api_key, @api_secret = api_key, api_secret
@version = "v1.1"
@service_name = "data"
end
def get(function, function_request, params)
@ap... | 24.484848 | 87 | 0.621287 |
e80c7288e8aa964b6a559fb20751c155e4b9acc9 | 50 | require 'mkmf'
create_makefile('sample_gem_ext')
| 12.5 | 33 | 0.8 |
21c2d58de57b11c2e15a3f12445e3bf379cb55e2 | 1,285 | require 'rbbcc/clib'
module RbBCC
class SymbolCache
class << self
def caches
@caches ||= {}
end
def cache(pid)
pid = -1 if pid < 0 && pid != -1
caches[pid] ||= SymbolCache.new(pid)
caches[pid]
end
alias [] cache
def resolve_global(name)
... | 22.946429 | 74 | 0.59144 |
3906c598de7fc9d1e217edeb2f5912d390ccc12e | 300 | class String
def conv_to_valid
if ActiveSupport::Inflector.transliterate(self) == self
self
else
conved_chars = ActiveSupport::Inflector.transliterate(self)
self.chars.map.with_index { |c, i|
(c == conved_chars[i] ? c : " ")
}.join.strip
end
end
end
| 20 | 65 | 0.626667 |
33c12bceb96e565d7cd8b7e055e86eb32aa7c24f | 1,596 | require 'spec_helper'
require 'sqs_worker/worker_file_locator'
module SqsWorker
class Rails;end # we shouldn't refer to Rails root as the rest of SQS worker is not rails specific
describe WorkerFileLocator do
describe '.locate' do
let(:located_files) { described_class.locate }
before do
... | 29.555556 | 100 | 0.659148 |
e845969cd6cfcb03bf23cad122c7ef1831eac8cf | 1,402 | class EpisodesController < ApplicationController
load_and_authorize_resource :find_by => :param
def index
@tag = Tag.find(params[:tag_id]) if params[:tag_id]
if params[:search].blank?
@episodes = (@tag ? @tag.episodes : Episode).accessible_by(current_ability).recent
else
@episodes = Episode... | 22.983607 | 108 | 0.659772 |
bf8b3dbf19992201e7143a1cb9a4bab345503a09 | 165 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_verify-rp-environment-config-form_session'
| 41.25 | 103 | 0.812121 |
87a59c8a7d3104a6ff8ec95cfb98a84101e6cabf | 1,968 | # Copyright (c) 2009-2012 VMware, Inc.
require File.expand_path("../../spec_helper", __FILE__)
describe Bosh::Director::ValidationHelper do
before(:each) do
@helper = Object.new
@helper.extend(Bosh::Director::ValidationHelper)
end
it "should pass if required fields are present" do
@helper.safe_pro... | 32.262295 | 82 | 0.667175 |
6136262fb308deda03ef3519b1185108f5c89c5a | 161 | # frozen_string_literal: true
require 'rumanu/version'
require 'rumanu/helpers'
require 'rumanu/alphabets'
require 'rumanu/meaning'
require 'rumanu/numerology'
| 20.125 | 29 | 0.807453 |
f726846202916268fc7a5471ccbd3dcda2b1b0ed | 1,400 | # 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... | 33.333333 | 87 | 0.740714 |
0858eecf70f3a2c3a0cf0e665ba5912778929d22 | 1,611 | module Motion
module Rest
module Resource
module Attributes
module ClassMethods
def attributes(*attr_names)
@attributes ||= {}
attr_names.each do |name|
attribute(name)
end
@attributes
end
def attribute(nam... | 26.409836 | 93 | 0.517691 |
f80bc8575a71df8f36d76c5714fcb3be0053c4d4 | 26,914 | require 'spec_helper'
require 'rake'
describe Sys::SiteExportJob, dbscope: :example do
let(:site) { cms_site }
before do
SS::Sequence.create(_id: "cms_body_layouts_id", value: rand(0..999) * 1_000_000)
SS::Sequence.create(_id: "cms_editor_templates_id", value: rand(0..999) * 1_000_000)
SS::Sequence.cr... | 55.492784 | 130 | 0.660994 |
ed81ad884f5f1d7a304f12a3c349bb48cae683a5 | 841 | require File.dirname(__FILE__) + '/../../test_helper'
class EmailTest < Test::Unit::TestCase
def setup
@config = CONFIG[:services][:email]
@service = Snitch::Services::Email.new(@config)
end
test "should make the email's body the commit message" do
end
test "should set the To field to what's ... | 22.72973 | 73 | 0.687277 |
7977278259a1e03d9c60a6fd77888c22a4267a2f | 3,248 | class Apr < Formula
desc "Apache Portable Runtime library"
homepage "https://apr.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=apr/apr-1.7.0.tar.bz2"
mirror "https://archive.apache.org/dist/apr/apr-1.7.0.tar.bz2"
sha256 "e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea"
licens... | 40.098765 | 148 | 0.715209 |
edb7797e2fc1f1f004c1fa9b6eae4f463f75cb21 | 36 | module Rufo
VERSION = "0.0.3"
end
| 9 | 19 | 0.638889 |
08e8d688895986126c1c690db9ad7d5331f87212 | 3,163 | =begin
#Selling Partner API for Direct Fulfillment Orders
#The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data.
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.33
=end
# ... | 45.84058 | 128 | 0.818843 |
1ce78e3a46cb182c65a2c10906493e1336d44fc9 | 2,099 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks if usage of %() or %Q() matches configuration.
#
# @example EnforcedStyle: bare_percent (default)
# # bad
# %Q(He said: "#{greeting}")
# %q{She said: 'Hi'}
#
# # good
... | 26.56962 | 74 | 0.490233 |
1d540b0cad117bacbbbd2f9ffc50787dc180f9cb | 593 | Pod::Spec.new do |s|
s.name = "ZCRMailbox"
s.version = "0.1.3"
s.summary = "KVO Subscription inspired by FBKVOController and MAKVONotificationCenter"
s.homepage = "https://github.com/zradke/ZCRMailbox"
s.license = 'MIT'
s.author = { "Zach Radke" => "zach.radke@gmail.com" }... | 26.954545 | 98 | 0.612142 |
38bd32b848713e5861c098c6cb0308b3a9a8448f | 135 | class AddOrganizationToUsers < ActiveRecord::Migration
def change
add_column :users, :organization, :string, limit: 50
end
end
| 22.5 | 56 | 0.762963 |
edd6b4da69bd73dae730b63f7e0858a7b7fe8e8b | 6,932 | # 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::ContainerInstance::Mgmt::V2017_08_01_preview
module Models
#
# A container group.
#
class ContainerGroup < Resource
i... | 32.544601 | 79 | 0.453693 |
d584bf707a2367c0218120b8639f49002563b1e9 | 4,883 | RSpec.describe HrrRbSsh::Authentication::Method::Publickey::Context do
let(:username){ 'username' }
let(:algorithm){ double('algorithm') }
let(:session_id){ 'session id' }
let(:public_key_algorithm_name){ "supported" }
let(:public_key_blob){ "dummy" }
let(:message){
{
:'message number' ... | 32.553333 | 146 | 0.678272 |
918d839e37c9781ab357c016dcbf4b951be0f683 | 1,905 | require File.expand_path("lib/google/apis/servicedirectory_v1beta1/gem_version", __dir__)
Gem::Specification.new do |gem|
gem.name = "google-apis-servicedirectory_v1beta1"
gem.version = Google::Apis::ServicedirectoryV1beta1::GEM_VERSION
gem.authors = ["Google LLC"]
gem.email = "googleapis-packages@google.com"
... | 57.727273 | 150 | 0.729134 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.