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 |
|---|---|---|---|---|---|
e285082b64b82573b8546528fcd1f4a8a1fb78bf | 869 | # frozen_string_literal: true
require 'feedjira'
require 'sanitize'
require_relative '../provider'
# Provider for Trello.
class Trello < Provider
STATUS_FEED_URL = 'https://trello.status.atlassian.com/history.atom'
def initialize
super
@icon = 'trello'
@name = 'Trello'
end
def latest_update
... | 28.966667 | 107 | 0.660529 |
5d0f17985c99ac621c3a81f59828ae6b778c487e | 90 | # desc "Explaining what the task does"
# task :tabler_rails do
# # Task goes here
# end
| 18 | 38 | 0.688889 |
e8fc67acf0549463260eabff39146af11735b8f7 | 189 | require 'spec_helper'
require 'lib/gitlab/cycle_analytics/shared_stage_spec'
describe Gitlab::CycleAnalytics::CodeStage do
let(:stage_name) { :code }
it_behaves_like 'base stage'
end
| 21 | 54 | 0.78836 |
e840f1d4870351dd3a8bcf578379da06f4f4c253 | 8,509 | require 'zlib'
require 'rack/request'
require 'rack/response'
require 'rack/utils'
require 'time'
class GitHttp
class App
SERVICES = [
["POST", 'service_rpc', "(.*?)/git-upload-pack$", 'upload-pack'],
["POST", 'service_rpc', "(.*?)/git-receive-pack$", 'receive-pack'],
["GET", 'ge... | 26.757862 | 88 | 0.548126 |
f786081e9ae02146de97b4fb045e7fecc49dd22d | 8,584 | require 'forwardable'
module Laser
module Cutter
module Notching
class Shift < Struct.new(:delta, :direction, :dim_index)
def next_point_after point
p = point.clone
shift = []
shift[dim_index] = delta * direction
shift[(dim_index + 1) % 2] = 0
p.plus... | 36.52766 | 129 | 0.598905 |
619669cf85dc3da1adc9c44568493c73fea46b3e | 89 | class TaskKeyResult < ActiveRecord::Base
belongs_to :task
belongs_to :key_result
end
| 17.8 | 40 | 0.797753 |
e956f8b7d1522415dec6c7ac20df96caadba6bb0 | 949 | # frozen_string_literal: true
class FastIgnore
class RuleGroup
def initialize(patterns, allow)
@matchers = Array(patterns).flat_map { |x| x.build_matchers(allow: allow) }.compact
@allow = allow
@allowed_recursive = { ::FastIgnore::Candidate.root.key => true }.compare_by_identity
end
de... | 22.069767 | 91 | 0.636459 |
33105ea073566074eaea868d71e9b5f90751407a | 1,559 | module Arroyo
class Reader
def initialize(stream)
@stream = stream
end
# Public: Read at most `length` bytes from the stream, blocking only if it has no data immediately
# available. If the stream has any data available, this method does not block.
#
# length - the maximum number of byt... | 28.345455 | 102 | 0.634381 |
b9fe937b206e3115c6768c88c4b5439649a9e04f | 2,907 | # rubocop:disable all
# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in producti... | 44.045455 | 86 | 0.75129 |
b9719a54577fff141a6b3f79e16a169a246dfe27 | 483 | cask :v1 => 'vagrant' do
version '1.7.2'
sha256 '78d02afada2f066368bd0ce1883f900f89b6dc20f860463ce125e7cb295e347c'
# bintray.com is the official download host per the vendor homepage
url "https://dl.bintray.com/mitchellh/vagrant/vagrant_#{version}.dmg"
name 'Vagrant'
homepage 'http://www.vagrantup.com'
l... | 30.1875 | 78 | 0.701863 |
18c34f6abd973719700be36d27239ba5df51caad | 708 | require "minitest_helper"
module Hermod
module Validators
describe RegularExpression do
subject do
RegularExpression.new(/\A[A-Z]{2} [0-9]{6} [A-D]\z/x)
end
it "allows values that match the pattern" do
subject.valid?("AB123456C", {}).must_equal true
end
it "allows ... | 27.230769 | 88 | 0.60452 |
18c2515396c0ced4cd706cb70fad7263f62deae0 | 5,706 | RSpec.describe StackMaster::Config do
subject(:loaded_config) { StackMaster::Config.load!('spec/fixtures/stack_master.yml') }
let(:base_dir) { File.expand_path('spec/fixtures') }
let(:myapp_vpc_definition) {
StackMaster::StackDefinition.new(
region: 'us-east-1',
region_alias: 'production',
s... | 34.581818 | 199 | 0.597967 |
115539460c51037bbbec69ac7c48778b49e5a0cc | 127 | class RemoveEstateFromBlocks < ActiveRecord::Migration[4.2]
def change
remove_column :blocks, :estate, :string
end
end
| 21.166667 | 59 | 0.755906 |
e9cf154942f7a72197a32996b42309db696d4a3c | 1,114 | Gem::Specification.new do |s|
s.name = %q{factory_girl_rails}
s.version = '4.2.1'
s.authors = ["Joe Ferris"]
s.email = %q{jferris@thoughtbot.com}
s.homepage = "http://github.com/thoughtbot/factory_girl_rails"
s.summary = %q{factory_girl_rails provides integration between
fact... | 41.259259 | 87 | 0.670557 |
bbee10a67aae436e006b12ad09ab659f06237b21 | 224 | class AddHomeButtonHomingToWebAppConfigs < ActiveRecord::Migration[5.1]
def change
add_column :web_app_configs,
:home_button_homing,
:boolean,
default: false
end
end
| 22.4 | 71 | 0.620536 |
8713f882babbc6bc30931efca4ea87b350dc8752 | 409 | class MoveTwitterToUser < ActiveRecord::Migration[6.0]
def change
add_column :users, :twitter_username, :string
Player.where.not(twitter_username: [nil, '']).each do |player|
next if player.user_id.nil?
User.where(
id: player.user_id
).update_all(
twitter_username: player['tw... | 27.266667 | 66 | 0.672372 |
1c65ff5e42c366ef8c1f32df30001cd83703033b | 140 | FactoryBot.define do
factory :context_option_value, class: Spree::ContextOptionValue do
option_value {create(:option_value)}
end
end | 28 | 68 | 0.792857 |
d5b7772742988332a1e95538881e73ac1e800dc7 | 3,933 | module CoronavirusContentItemHelper
CORONAVIRUS_TAXON_PATH = "/coronavirus-taxons".freeze
def coronavirus_landing_page_content_item
load_content_item("coronavirus_landing_page.json")
end
def load_content_item(file_name)
json = File.read(
Rails.root.join("spec/fixtures/content_store/", file_name)... | 28.092857 | 117 | 0.720315 |
5d931e9245e4e649fdc78a3de9d2a0ce311db598 | 296 | # set @scammable before using these shared examples
describe 'Scammable with scams not loaded', :shared => true do
it 'should not attempt to save scams on save' do
@scammable.scam_names.each do |scam_name|
@scammable.should_not_receive(scam_name)
end
@scammable.save
end
end | 32.888889 | 62 | 0.736486 |
010ed5c4995c4d575662976db871faf2a1968a93 | 1,108 | module Itest5ch
class BoardListPage
include HttpMethods
BOARDS_URL = "http://itest.5ch.net/".freeze
# Get all boards
#
# @return [Hash<String, Array<Itest5ch::Board>>] key: category name, value: boards
def all
doc = Hpricot(get_html(BOARDS_URL))
doc.search("//div[@id='bbsmenu']/... | 28.410256 | 97 | 0.601986 |
21409356e00a8046af87c6ba45531d5a199f39a5 | 4,114 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... | 32.393701 | 103 | 0.739183 |
39300b5e8f02dfcdaff084867bdadfc20954d0b8 | 1,349 | class FavoritesController < ApplicationController
before_action :redirect_if_not_logged_in, only: [:index, :new, :create, :show, :edit, :update, :destroy]
before_action :set_favorite, only: [:show, :update, :edit, :destroy]
def new
@favorite = Favorite.new
end
def create
@favorite =... | 22.864407 | 108 | 0.599703 |
39454099e2d8099c6e4696565986065915485318 | 9,082 | # coding: utf-8
module Fastlane
module Actions
module SharedValues
end
class UpdateProjectProvisioningAction < Action
ROOT_CERTIFICATE_URL = "https://www.apple.com/appleca/AppleIncRootCertificate.cer"
def self.run(params)
UI.message("You’re updating provisioning profiles directly in ... | 51.897143 | 172 | 0.580929 |
113f8f95c579a0da7db090804f622801b819b1cb | 306 | class AddUserIdFieldToProducts < ActiveRecord::Migration
def up
add_column :spree_products, :user_id, :integer, :default => 0, :null => false
add_index "spree_products", ["user_id"], :name => "index_spree_orders_on_user_id"
end
def down
remove_column :spree_products, :user_id
end
end
| 27.818182 | 85 | 0.728758 |
0301a959a60c9be4ee19068ba5894148508acee8 | 4,093 | class Offlineimap < Formula
desc "Synchronizes emails between two repositories"
homepage "https://www.offlineimap.org/"
url "https://files.pythonhosted.org/packages/09/12/73db8d38fea8ec3536cbccb8286b46b426639aff7e166840fa5e68e889e2/offlineimap-7.3.4.tar.gz"
sha256 "5dbd7167b8729d87caa50bed63562868b6634b888348d9... | 37.550459 | 140 | 0.696555 |
7ab78b3a15fe3bea8a630c0dff03ccd848a86eef | 244 | class AddTransactionIdToSpreePaypalExpressCheckouts < SolidusSupport::Migration[4.2]
def change
add_column :spree_paypal_express_checkouts, :transaction_id, :string
add_index :spree_paypal_express_checkouts, :transaction_id
end
end
| 34.857143 | 84 | 0.831967 |
62ca14eb9983e3c00460cdc82748469972670330 | 451 | class AddPaymentStatusToOrderItem < ActiveRecord::Migration
class OrderItem < ActiveRecord::Base
has_one :order
end
class Order < ActiveRecord::Base
has_many :order_items
end
def up
add_column :order_items, :payment_status, :string, default: 'unpaid'
Order.all.each do |o|
o.order_item... | 20.5 | 72 | 0.727273 |
bf96439602f73fe3cabd00a9f42cdfda3a138b62 | 3,444 | # frozen_string_literal: true
require File.join(File.expand_path('../../../../test', __dir__), 'test_helper')
module MesscadaApp
class TestCartonVerification < MiniTestWithHooks
include Crossbeams::Responses
include CartonFactory
include PalletFactory
include ProductionApp::ProductionRunFactory
... | 40.046512 | 140 | 0.769454 |
391438327a3dd1004ddbc072d298961ec3abb21c | 570 | require 'rails_helper'
RSpec.describe Value, type: :model do
let!(:plan) {FactoryBot.create(:plan)}
context "Validation tests" do
it "Requires plan_id" do
value_test = Value.new(name: "ReallyNotNormalName").save
expect(value_test).to eq(false)
end
it "Requires name" do
value_test = ... | 24.782609 | 77 | 0.673684 |
bb415e2f620cca65a74a8d83cb34fadf7be677d5 | 723 | Pod::Spec.new do |s|
s.name = "Nimble"
s.version = "0.2.0"
s.summary = "A Matcher Framework for Swift and Objective-C"
s.description = <<-DESC
Use Nimble to express the expected outcomes of Swift or Objective-C expressions. Inspired by Cedar.
DESC
s.hom... | 40.166667 | 118 | 0.578147 |
acf0d59c6ab7d84549dbf1e7adf4b828659090bb | 264 | #
# Load ECS assets into RedisGraph
#
# Each method returns an array of Cypher queries
#
class AWSLoader::ECS < GraphDbLoader
def cluster
node = 'AWS_ECS_CLUSTER'
q = []
# cluster node
q.push(_upsert({ node: node, id: @name }))
q
end
end
| 15.529412 | 48 | 0.643939 |
1c5a5fb7f6db635174eeda475f73ace630cdd843 | 1,669 | require "language/node"
class GenerateJsonSchema < Formula
desc "Generate a JSON Schema from Sample JSON"
homepage "https://github.com/Nijikokun/generate-schema"
url "https://registry.npmjs.org/generate-schema/-/generate-schema-2.6.0.tgz"
sha256 "1ddbf91aab2d649108308d1de7af782d9270a086919edb706f48d0216d51374a... | 34.770833 | 94 | 0.682445 |
18a3bd320b59ab76df4798cd638f5f1d439610d4 | 494 | class P4merge < Cask
url 'http://filehost.perforce.com/perforce/r13.4/bin.macosx106x86_64/P4V.dmg'
homepage 'http://www.perforce.com/product/components/perforce-visual-merge-and-diff-tools'
version '2013.4'
sha256 '0e1d193a353226b5452ec4a309bccf222f8fc973661a1e575a8b7f2359db123c'
link 'p4merge.app'
caveats ... | 41.166667 | 99 | 0.771255 |
bb9b32ba324159f8ee398119d21382b0d1192ece | 702 | class GitCredentialManager < Formula
desc "Stores credentials for Git on Visual Studio Online (VSO)"
homepage "https://java.visualstudio.com/Docs/tools/intro"
url "https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux/releases/download/git-credential-manager-1.2.0/git-credential-manager-1.2.0.jar"... | 35.1 | 157 | 0.760684 |
61c387a2d3f9640a80395d90e371644a9c73cdab | 313 | class CreateTwitterAccounts < ActiveRecord::Migration
def change
create_table :twitter_accounts do |t|
t.string :name_en
t.string :consumer_key
t.string :consumer_secret
t.string :access_token_key
t.string :access_token_secret
t.timestamps null: false
end
end
end
| 22.357143 | 53 | 0.702875 |
1d5527f8b579d1aa812a875ebbdd282da3b4e661 | 42 | require 'hemify/rails'
module Hemify
end
| 8.4 | 22 | 0.785714 |
016691f54925ac4780de138a8d9c1de8cb02566e | 1,051 | class Libmpdclient < Formula
desc "Library for MPD in the C, C++, and Objective-C languages"
homepage "https://www.musicpd.org/libs/libmpdclient/"
url "https://www.musicpd.org/download/libmpdclient/2/libmpdclient-2.14.tar.xz"
sha256 "0a84e2791bfe3077cf22ee1784c805d5bb550803dffe56a39aa3690a38061372"
revision 1... | 38.925926 | 93 | 0.755471 |
e86c4c0f8bae2b2e1cb3f2b764db615f580647cb | 160 | if Assignment.table_exists?
Assignment.all.each do |ass|
if ass.status == 'open' and ass.deadline < Time.now
ass.set_deadline_job
end
end
end
| 20 | 55 | 0.6875 |
ab4d124dac2bf3ef1c4d4edc83e7bc3f46863851 | 949 | # frozen_string_literal: true
require 'geocoder/lookups/base'
require 'geocoder/results/abstract_api'
module Geocoder
module Lookup
class AbstractApi < Base
def name
'Abstract API'
end
def required_api_key_parts
['api_key']
end
def supported_protocols
[:ht... | 20.630435 | 99 | 0.562698 |
7ad867f944c6c4016c5e310ed4f6487a65ff4d08 | 1,119 | module Cryptoexchange::Exchanges
module Coingi
module Services
class Trades < Cryptoexchange::Services::Market
def fetch(market_pair)
output = super(ticker_url(market_pair))
adapt(output, market_pair)
end
def ticker_url(market_pair)
base = market_pair... | 31.971429 | 107 | 0.546917 |
f7e0007873f8d2a8c655813abed7aab454641721 | 2,266 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Kernel#p" do
before :all do
@rs_f, @rs_b, @rs_c = $/, $\, $,
end
after :each do
$/, $\, $, = @rs_f, @rs_b, @rs_c
end
it "is a private method" do
Kernel.should have_priv... | 28.325 | 105 | 0.617387 |
b9e7894e5c98f3d6e00fd38f41dbf9df7be8e5a7 | 721 | module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module OID # :nodoc:
class DateTime < Type::DateTime # :nodoc:
include Infinity
def cast_value(value)
if value.is_a?(::String)
case value
when 'infinity' then ::Float::INFINIT... | 25.75 | 75 | 0.471567 |
bbae384d7a117bdc3c5e7095ffcdc4c5d9a093e5 | 549 | shared_examples_for 'will be skipped for this record' do |message|
it message.to_s do
view_context = setup_view_context_with_sandbox({})
button = described_class.new(view_context, {}, {'record' => @record}, {})
expect(button.visible?).to be_falsey
end
end
shared_examples_for 'will not be skipped for th... | 34.3125 | 77 | 0.71949 |
87eae6fbd5224d1b8df4020c951b4a5d506588cc | 8,862 | describe "ls" do
describe "bug #1407" do
it "behaves as usual when a method of the same name exists." do
expect(
pry_eval("def ls; 5; end", "ls")
).to match(/self\.methods: /)
pry_eval("undef ls")
end
end
describe "below ceiling" do
it "should stop before Object by default" ... | 35.306773 | 139 | 0.633604 |
f74fb12e428fa85011b5e52823dff35ccb736705 | 5,855 | # frozen_string_literal: true
require 'rubygems/command'
require 'rubygems/remote_fetcher'
require 'rubygems/spec_fetcher'
require 'rubygems/local_remote_options'
class Gem::Commands::SourcesCommand < Gem::Command
include Gem::LocalRemoteOptions
def initialize
require 'fileutils'
super 'sources',
... | 25.792952 | 138 | 0.67105 |
18af154c6b8660cbbd81b9485dc9527bf4141627 | 3,145 | require File.dirname(__FILE__) + "/spec_helper"
require 'httperf_result_parser'
require 'httperf_result'
SAMPLE_HTTPERF_OUTPUT = <<-EOS
Maximum connect burst length: 1
Total: connections 100 requests 99 replies 98 test-duration 10.082 s
Connection rate: 9.9 conn/s (100.8 ms/conn, <=3 concurrent connections)
Connect... | 26.428571 | 75 | 0.63434 |
2141171edecc8bbdec7c666e09f6af5b0cc2627a | 105 | class AddScoresValueIndex < ActiveRecord::Migration
def change
add_index :scores, :value
end
end
| 17.5 | 51 | 0.761905 |
d56c0a664bfd28068f040426fdcba8e8c563cac6 | 9,551 | require_relative '../../spec_helper'
require 'bigdecimal'
describe "BigDecimal" do
it "is not defined unless it is required" do
ruby_exe('puts Object.const_defined?(:BigDecimal)').should == "false\n"
end
end
describe "Kernel#BigDecimal" do
it "creates a new object of class BigDecimal" do
BigDecimal("3.... | 32.376271 | 253 | 0.653439 |
8788409ed86c9ed708169de8644d784e22f33204 | 9,133 | # RFM provides easy access to FileMaker Pro data. With it, Ruby scripts can
# perform finds, read records and fields, update data, and perform scripts using
# a simple ruby-like syntax.
#
# Author:: Geoff Coffey (mailto:gwcoffey@gmail.com)
# Copyright:: Copyright (c) 2007 Six Fried Rice, LLC and Mufaddal Khumri
# L... | 39.366379 | 93 | 0.717398 |
ff796f770135c804645b674bdc361481f42cc364 | 4,053 | require 'spec_helper'
describe Spree::Price, :type => :model do
describe '#amount=' do
let(:price) { Spree::Price.new }
let(:amount) { '3,0A0' }
before do
price.amount = amount
end
it 'is expected to equal to localized number' do
expect(price.amount).to eq(Spree::LocalizedNumber.par... | 31.418605 | 124 | 0.657538 |
01ad12523d1e584897eeeb5a920e095e2459a495 | 864 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require File.expand_path('../shared/clone', __FILE__)
describe "Array#dup" do
it_behaves_like :array_clone, :dup # FIX: no, clone and dup are not alike
it "does not copy frozen status from the orig... | 27 | 75 | 0.666667 |
080ab00d225c450c2275e17c157b81fea261e0b0 | 453 | # == Schema Information
#
# Table name: mentions
#
# id :integer not null, primary key
# mentioner_type :string(255)
# mentioner_id :string(255)
# mentionable_type :string(255)
# mentionable_id :integer
# created_at :datetime
#
# Indexes
#
# fk_mentionables (mentionable_id,m... | 22.65 | 59 | 0.684327 |
114b3ab5ee67cf7eac3811dde5395054f930e974 | 3,866 | module SiteAnalyzer
require 'robotstxt'
require 'open-uri'
require 'timeout'
# Create site object with all scans
class Site
attr_reader :main_url, :pages, :pages_for_scan, :max_pages, :scanned_pages
def initialize(url, max_pages = 10, use_robot_txt = false)
Stringex::Localization.default_locale ... | 28.426471 | 121 | 0.600879 |
9198605260b2194ffb5b70ce1d77df967c78032d | 4,271 | #-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 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 ChiliProj... | 30.29078 | 125 | 0.662374 |
1a9705116c94148d3ecc89259c9313fb9ebb85ba | 3,200 | class IgnitionGui4 < Formula
desc "Common libraries for robotics applications. GUI Library"
homepage "https://github.com/ignitionrobotics/ign-gui"
url "https://github.com/ignitionrobotics/ign-gui/archive/5d1428a3c90302daa73d5b94c14618fb4c25f7d4.tar.gz"
version "3.999.999~0~20200721~5d1428"
sha256 "12a6e69a90f... | 30.47619 | 107 | 0.635938 |
bb9739da5c2acd1904f04683ea734188306076cd | 1,902 | require 'coding_dojo_2'
describe Potter do
it "costs nothing for an empty basket" do
subject.calculate([]).should == 0
end
it "should cost 8 for 1 book" do
subject.calculate([1]).should == 8
subject.calculate([2]).should == 8
subject.calculate([3]).should == 8
subject.calculate([4]).should =... | 30.190476 | 92 | 0.57939 |
013038c772060b2351ec2f62c1300d3141d58319 | 148 | class AddRecommendedToRatings < ActiveRecord::Migration[5.2]
def change
add_column :ratings, :recommended, :boolean, default: false
end
end
| 24.666667 | 63 | 0.763514 |
d5ca72977ceda748541f1dba40beea6031895268 | 6,217 | # frozen_string_literal: true
require 'beaker-rspec/spec_helper'
require 'beaker-rspec/helpers/serverspec'
require 'beaker/puppet_install_helper'
require 'rspec/retry'
begin
require 'pry'
rescue LoadError # rubocop:disable Lint/HandleExceptions for optional loading
end
# This method allows a block to be passed in ... | 36.145349 | 146 | 0.695673 |
1da69659375a034bda490cf23f3dc708920b00b0 | 879 | # frozen_string_literal: true
module Stupidedi
module Versions
module FunctionalGroups
module FiftyTen
module SegmentDefs
s = Schema
e = ElementDefs
r = ElementReqs
HLH = s::SegmentDef.build(:HLH, "Health Information",
"To provide health informat... | 31.392857 | 72 | 0.59727 |
ab081b278991a156c9dc16167ec838bed5318ffb | 179 | class AddLastSeenIpAddressToEnhancedSecurityTokens < ActiveRecord::Migration
def change
add_column :users_enhanced_security_tokens, :last_seen_ip_address, :string
end
end
| 29.833333 | 78 | 0.843575 |
18227156f4e8404b612526fd02f600e196a072e0 | 6,960 | require "spec_helper"
require "parallel_tests/rspec/runner"
describe ParallelTests::RSpec::Runner do
test_tests_in_groups(ParallelTests::RSpec::Runner, 'spec', '_spec.rb')
describe :run_tests do
before do
File.stub!(:file?).with('script/spec').and_return false
File.stub!(:file?).with('spec/spec.op... | 34.455446 | 134 | 0.648276 |
611b572d82cd0197cdfcdf56290c1f034b51cf7b | 288 | # frozen_string_literal: true
require 'test_helper'
class ViewRenderingTest < ActionDispatch::IntegrationTest
setup do
$view_engine_rendered = false
end
test 'views in inactive engines are never be rendered' do
visit '/greeting'
refute $view_engine_rendered
end
end
| 20.571429 | 59 | 0.763889 |
4ae275d8e5052439faccedc3092e7a76e5df0091 | 955 | # -*- encoding: utf-8 -*-
# stub: ethon 0.11.0 ruby lib
Gem::Specification.new do |s|
s.name = "ethon"
s.version = "0.11.0"
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Hans Hasselberg"]
s.date = "2017-1... | 28.939394 | 109 | 0.641885 |
0307a49528ad8cd5084776ba284c0a03f8e7fc00 | 1,829 | class Flutter < Formula
require 'json'
desc "Homebrew shell for Flutter"
homepage "https://flutter.io"
stable do
url "https://github.com/flutter/flutter.git", :branch => "stable"
version "stable"
end
devel do
url "https://github.com/flutter/flutter.git", :branch => "master"
version "dev"
... | 27.298507 | 109 | 0.662657 |
110e817fd58322823355cb6dd4b2e0f4c484b43c | 1,029 | describe ManageIQ::Providers::Google::CloudManager::Vm do
context "#is_available?" do
let(:ems) { FactoryBot.create(:ems_google) }
let(:vm) { FactoryBot.create(:vm_google, :ext_management_system => ems) }
let(:power_state_on) { "running" }
let(:power_state_s... | 30.264706 | 96 | 0.626822 |
18b4275b3acfc2481d0659da131dca40c463057c | 7,687 | =begin
#Hydrogen Atom API
#The Hydrogen Atom API
OpenAPI spec version: 1.7.0
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.14
=end
require 'date'
module NucleusApi
# Questionnaire Object
class Questionnaire
attr_accessor :cr... | 27.851449 | 120 | 0.614284 |
012763f5de07d238df117d49dca96f5be97b0edc | 396 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :phone do
number '650 851-1210'
number_type 'voice'
extension '200'
end
factory :phone_with_extra_whitespace, class: Phone do
country_prefix '33 '
number '650 851-1210 '
department ' Infor... | 22 | 68 | 0.699495 |
5d16268f82a773d4f166a35b11a85817c3b8f8a8 | 15,178 | # frozen_string_literal: true
require_relative "../spec_helper"
describe SpartanAPM::Persistence do
def sample_stats(app, action, additional_stats)
stats = []
(1..100).each do |value|
measure = SpartanAPM::Measure.new(app, action)
stats << measure
additional_stats.keys.each do |name|
... | 47.579937 | 156 | 0.640598 |
01c2d5b37e292cd34f477a0cb8556069f8212ca1 | 279 | class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end
| 39.857143 | 71 | 0.763441 |
acd975e688c30a1b17b7947bef83c7946bc67b48 | 246 | # { a => b, c => d }
# ==>
# rb2py.OrderedDict(((a: b), (c: d)))
class HashNode
def real_gen
$pygen.call('OrderedDict', 'rb2py') {
# Make tuple around whole values
$pygen.paren {
gen_children
}
}
end
end
| 17.571429 | 41 | 0.51626 |
33f703ad703b110f11cd3d4288683f837d791427 | 7,350 | module EffectiveResourcesHelper
# effective_bootstrap
def effective_submit(form, options = {}, &block)
actions = (controller.respond_to?(:effective_resource) ? controller.class : find_effective_resource).submits
actions = actions.select { |k, v| v[:default] != true } if options.delete(:defaults) == false
... | 44.817073 | 191 | 0.700272 |
bf7e3263fb8d3c7e5c6ac3084d4aba218226c38e | 72 | module BookReleasesCliApp
end
require_relative '../config/environment'
| 14.4 | 40 | 0.833333 |
ffd69e045b07b2b01c744c93124b5166894fe563 | 480 | require 'spec_helper'
describe Plink::IntuitAccountToRemoveRecord do
it { should allow_mass_assignment_of(:intuit_account_id) }
it { should allow_mass_assignment_of(:users_institution_id) }
it { should allow_mass_assignment_of(:user_id) }
let(:valid_params) {
{
intuit_account_id: 3,
users_inst... | 24 | 79 | 0.7375 |
38d2ef14ab5bec985c4fbe0fac021b7026b64c0e | 1,589 | # -*- encoding: utf-8 -*-
# stub: html-pipeline 2.12.2 ruby lib
Gem::Specification.new do |s|
s.name = "html-pipeline"
s.version = "2.12.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Ryan Tomayko", "Jerry Ch... | 42.945946 | 312 | 0.637508 |
e8ea79efcfb6e8fc95e6c674b96f0012b6ce2aed | 29,797 | require 'shared/all_success_return_values'
shared_examples_for "connection" do
before :each do
ensure_node(zk, path, data)
end
after :each do
ensure_node(zk, path, data)
end
after :all do
logger.warn "running shared examples after :all"
with_open_zk(connection_string) do |z|
rm_rf(z... | 28.405148 | 173 | 0.58224 |
21d234a50c442fd2e0f3289bcf7245baf8310dfa | 1,787 | class UsersController < ApplicationController
def add_routine
current_user.routines << Routine.find(params[:user_id])
current_user.save
redirect_to user_path(current_user)
end
def show
@user = current_user
end
def routines
@routines = Routine.order_my_routines(current_user)
render '... | 22.061728 | 93 | 0.663123 |
6ade159ef3744e6476aae4bf21434f4804b4ddf9 | 1,376 | # 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... | 28.081633 | 78 | 0.65189 |
f86b31764a039170edbab003cd159e1466c0caf6 | 535 | module Babeltrace2
BT_LOGGING_LEVEL_TRACE = 1
private_constant :BT_LOGGING_LEVEL_TRACE
BT_LOGGING_LEVEL_DEBUG = 2
private_constant :BT_LOGGING_LEVEL_DEBUG
BT_LOGGING_LEVEL_INFO = 3
private_constant :BT_LOGGING_LEVEL_INFO
BT_LOGGING_LEVEL_WARNING = 4
private_constant :BT_LOGGING_LEVEL_WARNING
BT_LOGGI... | 26.75 | 44 | 0.841121 |
3395b06767c65bbdd396d9f7d3b9d66fdbb1d974 | 360 | cask 'openkey' do
version '1.2.3'
sha256 '803e1f96232b40740a43c235748dea6ac292473b777b4b4bcb7ba8198af416fb'
url "https://github.com/tuyenvm/OpenKey/releases/download/v#{version}/OpenKey#{version}.dmg"
appcast 'https://github.com/tuyenvm/OpenKey/releases.atom'
name 'OpenKey'
homepage 'https://github.com/tuy... | 30 | 94 | 0.763889 |
08b664de2d75b4dc1a90d15c0620a359a8c1b66b | 199 | class API::V1::SizesController < ApiController
# GET /sizes
def index
sizes = Size.select("id, name, icon, volume").all.where(published: true)
render json: sizes, status: 200
end
end
| 19.9 | 76 | 0.683417 |
6a48db5a5da37a5eda5c7b411c1309814efe94e9 | 3,675 | require 'json'
class Product
attr_accessor :name
attr_accessor :price
attr_accessor :on_stock
def initialize (name, price, on_stock)
@name = name
@price = price
@on_stock = on_stock
end
def Add_Attribute(attr, value)
self.class.class_eval { attr_accessor attr }
send("#{... | 20.646067 | 72 | 0.557551 |
6239e2b992ba8728eefff0c22c1c698ad5efdc21 | 2,852 | # frozen_string_literal: true
require 'time'
RSpec.describe MiniTarball::HeaderWriter do
describe "#write" do
let(:io) { StringIO.new.binmode }
subject { MiniTarball::HeaderWriter.new(io) }
let!(:default_options) do
{
mode: 0644,
mtime: Time.parse("2021-02-15T20:11:34Z"),
... | 37.526316 | 111 | 0.686536 |
395bb73a5b45acdb8708b67bec8e9e4be3598209 | 4,685 | # frozen_string_literal: true
##
# Report Sidekiq::Stats to prometheus on a defined interval
#
# Global Metrics reporting requires Sidekiq::Enterprise as it uses the leader
# election functionality to ensure that the global metrics are only reported by
# one worker.
#
# @see https://github.com/mperham/sidekiq/wiki/Ent... | 30.032051 | 148 | 0.690928 |
6a41e10c4e8dd60de36a7ebd39ba5755a8afa666 | 5,499 | =begin
#DocuSign REST API
#The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.13-SNAPSHOT
=e... | 29.25 | 123 | 0.629023 |
6a399bf6c9b321e15605d0b5d5c37eeec0c97767 | 94 | module StatusPage
class Engine < ::Rails::Engine
isolate_namespace StatusPage
end
end
| 15.666667 | 32 | 0.755319 |
bb52c8f49e33d5bc16846c6e794312e3cbf91ad1 | 355 | require 'heroku-true-relic'
module HerokuTrueRelic
class Rails2
def self.add_middleware
if defined?(::Rails.configuration) && ::Rails.configuration.respond_to?(:middleware)
::Rails.configuration.middleware.insert_after 'Rack::Lock', HerokuTrueRelic::QueueTimeLogger
end
end
end
end
Hero... | 25.357143 | 100 | 0.746479 |
1c5db19d3bc2c85eec89d8d25aa816c53f6a1ad6 | 294 | # frozen_string_literal: true
require 'dry-struct'
module LoveLetterApplication
module Results
module Nodes
class CardPlayedNode < Dry::Struct
attribute :player_id, ::Types::Strict::Integer
attribute :card_id, ::Types::Strict::Integer
end
end
end
end
| 18.375 | 54 | 0.687075 |
ac65c34b0d24ab5f527f6047a894f4a7534913f4 | 6,053 | # frozen_string_literal: true
require "bundler/settings"
RSpec.describe Bundler::Env do
let(:git_proxy_stub) { Bundler::Source::Git::GitProxy.new(nil, nil, nil) }
describe "#report" do
it "prints the environment" do
out = described_class.report
expect(out).to include("Environment")
expect(... | 28.551887 | 95 | 0.589295 |
387791bad1979389b4630d85f5273b5b51bfc1b3 | 69 | json.extract! @news, :id, :title, :content, :created_at, :updated_at
| 34.5 | 68 | 0.710145 |
f74c5b60f987e782438f85cee14be1d2fd79bda7 | 15,607 | require 'fastercsv'
class SubmissionsController < ApplicationController
include SubmissionsHelper
before_filter :authorize_only_for_admin, :except => [:populate_file_manager, :browse,
:index, :file_manager, :update_files,
:download, :populate_submissions_table, :collect_and_begin_grading,
:manually_colle... | 37.973236 | 223 | 0.689691 |
f7d96a2518647d62036efe034fdc29c84031bdd1 | 117 | module Api
class PxeImagesController < BaseController
include Subcollections::CustomizationTemplates
end
end
| 19.5 | 50 | 0.820513 |
1ae5ef62cbe7ac77e18e38f219602f93a02d613f | 594 | Pod::Spec.new do |s|
s.name = "GCMFormTableView"
s.version = "0.2.5"
s.summary = "Form building framework."
s.homepage = "https://github.com/gamechanger/GCMFormTableView"
s.author = { "Jerry Hsu" => "jerry.hsu@gamechanger.io" }
s.source = { :git => "https://github.com/gamec... | 42.428571 | 101 | 0.619529 |
38d83b11d16a42b45d562fdff38d3012f059231a | 702 | require_relative 'template_creator'
require_relative 'pdf_config_creator'
module Bookbinder
module Subnav
class SubnavGeneratorFactory
def initialize(fs, output_locations)
@fs = fs
@output_locations = output_locations
end
def produce(json_generator)
SubnavGenerator.new(... | 23.4 | 99 | 0.709402 |
627e9cd2546ea09ff4b0b7081ea5a1c81961487d | 3,126 | require 'xmlrpc/client'
require 'cipisek/response'
require 'cipisek/response/client_get'
require 'cipisek/response/campaigns_list'
require 'cipisek/response/groups_list'
require 'cipisek/response/groups_stats'
require 'cipisek/response/keywords_list'
require 'cipisek/response/keywords_stats'
# :(
XMLRPC::Config.module... | 34.351648 | 165 | 0.683621 |
62d412de8c6ad6244b1dffae2909df2f8b37492f | 51,757 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 60.534503 | 195 | 0.668798 |
bb3c66cbb609290f0c0a214bf5e6186929ebaf58 | 312 | ENV['SINATRA_ENV'] ||= "development"
require 'bundler/setup'
Bundler.require(:default, ENV['SINATRA_ENV'])
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => "db/#{ENV['SINATRA_ENV']}.sqlite"
)
require 'date'
require './app/controllers/application_controller'
require_all 'app'
| 20.8 | 50 | 0.727564 |
5d55834093fb271c6644ae6f7338228d7731e38b | 4,585 | require 'nokogiri'
module DocxTemplater
class TemplateProcessor
attr_reader :data, :escape_html, :skip_unmatched
# data is expected to be a hash of symbols => string or arrays of hashes.
def initialize(data, escape_html = true, skip_unmatched: false)
@data = data
@escape_html = escape_html
... | 34.473684 | 211 | 0.606761 |
38028a742efb831ab2f6d46af11ce00d6f3967d7 | 20,541 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'azure_event_grid'
module Azure::EventGrid::Profiles::Latest
module Models
ContainerRegistryArtifactEventTarget = Azure::EventGrid... | 53.215026 | 168 | 0.810671 |
4a7da896bd75c8268066f591a0bc5a83fbdd6c89 | 17,302 | # frozen_string_literal: true
class Encoding
class CompatibilityError < StandardError; end
def initialize(name)
@name = name
end
ASCII_8BIT = new('ASCII-8BIT')
BINARY = ASCII_8BIT
US_ASCII = new('US-ASCII')
ASCII = US_ASCII
EUC_JP = new('EUC-JP')
IBM437 = new('IBM437')
ISO_8859_1 = new('ISO-8... | 21.873578 | 114 | 0.623049 |
5d79951be3abe365fa8500aef3b45152a0d6080e | 1,424 | # frozen_string_literal: true
# A PitchClassSet represents a pitch-class set or pitch collection.
# See also: PitchSet, PitchClass
class HeadMusic::PitchClassSet
attr_reader :pitch_classes
delegate :empty?, to: :pitch_classes
alias empty_set? empty?
def initialize(identifiers)
@pitch_classes = identifier... | 16.752941 | 101 | 0.686798 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.