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 |
|---|---|---|---|---|---|
919f906d9ac1c8ffff017c6e32815bc300bd8404 | 170 | # frozen_string_literal: true
lib = File.expand_path('../../lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'nonnative'
require 'konfig'
| 21.25 | 55 | 0.741176 |
bf1e3e70d8902d98889e4316de558181b0efa415 | 716 | # Allows Writing of 100.to_money for +Numeric+ types
# 100.to_money => #<Money @pence=10000>
# 100.37.to_money => #<Money @pence=10037>
class Numeric
def to_money
Money.new(self * 100)
end
end
# Allows Writing of '100'.to_money for +String+ types
# Excess characters will be discarded
# '100'.to_money => ... | 26.518519 | 66 | 0.625698 |
d531fc03296777397385f52891718b93f577fd41 | 1,726 | #Markdown
set :markdown_engine, :redcarpet
#Livereload
activate :livereload
###
# Compass
###
# Susy grids in Compass
# First: gem install compass-susy-plugin
# require 'susy'
# Change Compass configuration
# compass_config do |config|
# config.output_style = :compact
# end
###
# Page options, layouts, aliases ... | 19.613636 | 76 | 0.709733 |
2615286be4d30679b5172d78a4e7169a9d6d588e | 2,967 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Configure 'rails notes' to inspect Cucumber files
config.annotations.register_directories('features')
config.annotations.register_extensions('feature') { |tag| /#\s*(#{tag}):?\s*(.*)$/ }
# Settings specified here will take precede... | 36.62963 | 87 | 0.766768 |
185f38267efb9196b9f347ae9c517e63ed55517b | 780 | module Auth::Concerns::Work::InformConcern
extend ActiveSupport::Concern
included do
## what does this do really ?
field :who_and_when_to_inform, type: Hash
field :inform_on_actions, type: Array, default: []
after_update do |document|
document.inform if document.inform_on_actions.include? "after_u... | 25.16129 | 74 | 0.74359 |
f8150f703060eff07a9477203d2657d6e1f20a9b | 869 | module Spree
class Calculator::FlatPercentTaxonTotal < Calculator
preference :flat_percent, :decimal, :default => 0
preference :taxon, :string, :default => ''
# attr_accessible :preferred_flat_percent, :preferred_taxon
def self.description
I18n.t(:flat_percent_taxon)
end
def compu... | 28.966667 | 80 | 0.659379 |
bb854f9cc506b1573a212b1292d2eee591b85bc6 | 2,702 | require 'test_helper'
class PasswordResetsTest < ActionDispatch::IntegrationTest
def setup
ActionMailer::Base.deliveries.clear
@user = users(:danny)
end
test "password resets" do
get new_password_reset_path
assert_template 'password_resets/new'
# Invalid email
post password_resets_path, pa... | 34.202532 | 71 | 0.707994 |
f7b4b8dba92809df15a3214ffc3164fbed618dea | 7,557 | # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
require 'date'
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
module OCI
# Details for creating a database home.
#
# **Warning:** Oracle recommends that you avoid using any confidential information when you su... | 37.226601 | 157 | 0.684531 |
26f9a31b8e30aacd2c8280edba4f77b62ef6a5a8 | 2,263 | # 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::Compute::Mgmt::V2017_12_01
module Models
#
# Describes a virtual machines scale set IP Configuration's PublicIPAddress
# configu... | 31 | 93 | 0.582413 |
d5f1c21facce4e3a4d82f477d5103454cdb56641 | 998 | # Rails: ne zaboraviti u config/environments/production.rb postaviti config.assets.compile=true
module JRubyCipango
module Factory
['org.jruby.rack.DefaultRackApplicationFactory',
'org.jruby.rack.SharedRackApplicationFactory',
'org.jruby.rack.RackServletContextListener',
'org.jruby.rack.rails.Ra... | 27.722222 | 95 | 0.680361 |
e877acbfe53d94cf3291e7bce3ab48e2eb3d514a | 2,664 | RSpec.describe BBK::App::Handler do
subject { described_class.new }
let(:default) { proc {|*args| args } }
let(:match_rule) { [:meta, { headers: { type: 'test' } }] }
it 'with default block' do
subj = described_class.new(&default)
expect(subj.instance_variable_get('@default').call(1, 2, 3)).to eq [1,... | 27.463918 | 80 | 0.641517 |
11323c932775fa533f1f02edb91fd4daf82eb904 | 4,776 | # encoding: utf-8
require 'spec_helper'
require 'set'
describe Bugsnag::Helpers do
describe "trim_if_needed" do
it "preserves bool types" do
value = Bugsnag::Helpers.trim_if_needed([1, 3, true, "NO", "2", false])
expect(value[2]).to be_a(TrueClass)
expect(value[5]).to be_a(FalseClass)
end
... | 36.181818 | 98 | 0.551298 |
3951fc54a15e287c89347fa73d28e418f53b85aa | 358 | cask 'retro-virtual-machine' do
version '1.0.1'
sha256 '2144c713889780fcc1b4f9e994f4466514f9434974c942406f966145adaf899d'
url "http://www.retrovirtualmachine.org/release/Retro%20Virtual%20Machine%20v#{version}.dmg"
name 'Retro Virtual Machine'
homepage 'http://www.retrovirtualmachine.org'
license :gratis
... | 29.833333 | 94 | 0.784916 |
385bee812d2506075dccacefb0733f5fe9649c21 | 757 | cask 'xee' do
version '3.5.3,45:1504018134'
sha256 '756719157ae7d9cd3a0153ca80b48b71a239691d3ff8aa0061fd529a825d7926'
# devmate.com/cx.c3.Xee3 was verified as official when first introduced to the cask
url "https://dl.devmate.com/cx.c3.Xee3/#{version.after_comma.before_colon}/#{version.after_colon}/Xee-#{versi... | 34.409091 | 144 | 0.677675 |
1dff24b674aa2c36d6ec5a068d270701339e902e | 116 | class Schedule < ApplicationRecord
validates :category, presence: true
validates :post_time, presence: true
end
| 23.2 | 38 | 0.793103 |
d580e4f571fee8ecfeca892ce4cfa86c02ac0643 | 2,574 | require 'fluent/output'
require_relative 'barito_timber'
require_relative 'barito_client_trail'
require_relative 'barito_transport'
module Fluent
class BaritoBatchK8sOutput < BufferedOutput
PLUGIN_NAME = 'barito_batch_k8s'
Fluent::Plugin.register_output(PLUGIN_NAME, self)
config_param :application_sec... | 27.382979 | 87 | 0.638306 |
1a64d14dc8a889eef08201ab3589757dbba54994 | 232 | module Contacts
class Homepage < ActiveRecord::Base
belongs_to :contact, dependent: :destroy
validates :homepagetype, length: { in: 1..30 }, presence: true
validates :url, presence: true, uniqueness: true
end
end
| 21.090909 | 66 | 0.706897 |
08b9082d2df624d07d78e478221f5f8353928794 | 2,318 | # frozen_string_literal: true
require "forwardable"
module Wordword
class Command
extend Forwardable
def_delegators :command, :run
# Execute this command
#
# @api public
def execute(*)
raise(
NotImplementedError,
"#{self.class}##{__method__} must be implemented",
... | 18.693548 | 58 | 0.581104 |
1c38f903d56f2652653de20dd0961c2f063e7eea | 139 | require_relative '../../../spec_helper'
describe "Process::GID.re_exchangeable?" do
it "needs to be reviewed for spec completeness"
end
| 23.166667 | 49 | 0.741007 |
18a12f53231b854a3140252bb241fc26077dd31b | 210 | require 'rails_helper'
field_name = field_name_from __FILE__
type = type_from __FILE__
describe field_name do
it_behaves_like \
"#{type} partial", field_name,
value: IPAddr.new('192.168.2.0/24')
end
| 21 | 39 | 0.742857 |
1dd761a1bb3d6dc27197132e6cf1a4bc0c6a9a51 | 309 | require 'mina'
require 'rake'
class RakeScope
include Rake::DSL if Rake.const_defined?(:DSL)
include Mina::Helpers
end
def rake(&blk)
if block_given?
@scope ||= RakeScope.new
@scope.instance_eval &blk
end
@scope
end
def root(*a)
File.join File.expand_path('../../', __FILE__), *a
end
| 14.714286 | 52 | 0.673139 |
4a177067a695a05bd944afb5cd3601a035de6999 | 3,753 | require 'test_helper'
class CustomTypeCaster
def self.cast(*)
:mock
end
end
JsonOrgApiClient::Schema.register custom: CustomTypeCaster
class SchemaResource < TestResource
property :a, type: :string, default: 'foo'
property :b, type: :boolean, default: false
property :c
property :d, type: :integer
en... | 24.529412 | 92 | 0.705036 |
6184ad7bb32687210d9a0bfcdc7afa1825e1841a | 121 | require 'test_helper'
class UniUserTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.125 | 43 | 0.702479 |
39f0ed22dec5917d482296f775c29676a126f7fb | 572 | require File.expand_path('../helper', __FILE__)
class HipChatTest < Service::TestCase
def setup
@stubs = Faraday::Adapter::Test::Stubs.new
end
def test_push
@stubs.post "/v1/webhooks/github" do |env|
assert_match /(^|\&)payload=%7B%22a%22%3A1%7D($|\&)/, env[:body]
assert_match "auth_token=a"... | 22 | 70 | 0.596154 |
1a96a86359fe364da74c00238c7bb8aa059defc2 | 3,877 | # Creates dot type plots
class Rubyplot::Dot < Rubyplot::Artist
def draw
@geometry.has_left_labels = true
super
return unless @geometry.has_data
# Setup spacing.
spacing_factor = 1.0
@items_width = @graph_height / @geometry.column_count.to_f
@item_width = @items_width * spacing_factor / @... | 36.575472 | 121 | 0.600464 |
bfd4ce41e91935a69999f82f3c466e83176e11b2 | 2,457 | namespace :cartodb do
# This rake retrieves all sync tables that should get synchronized, and puts the synchronization tasks at Resque
# NOTE: This version does not mark the tables as "enqueued", should be done if planning to run multiple instances
desc 'Runs the sync tables process'
task :sync_tables, [:force_... | 35.608696 | 115 | 0.627595 |
2670e7c255167c8f114a58d3f5ab886266c76efa | 45 | class PublicProfile < ActiveRecord::Base
end | 15 | 40 | 0.822222 |
e9a8362fcc7191c2f90223ac9ec3bb97945c6747 | 1,036 | module Elasticsearch
module XPack
module API
module MachineLearning
module Actions
# TODO: Description
#
# @option arguments [String] :datafeed_id The ID of the datafeed to delete (*Required*)
# @option arguments [Boolean] :force True if the datafeed should b... | 34.533333 | 105 | 0.612934 |
61a62976a2b1cf91c5605490329d9aac29d91d77 | 2,475 | require './util/debug'
# Uniforms:
# Data (variables) that are not vertex specific for a model.
#
# Uniforms
# have a variable name inside the shader code (gpu)
# have a location id in cpu space
#
# Looking up the location id from the variable name is expensive.
# So this class caches the location id after the ... | 30.182927 | 92 | 0.724444 |
e871b9c6f14a4f3f3f0e768e7b8414960e4ec2dd | 623 | module PragmaticSegmenter
module Languages
class English
class Process < PragmaticSegmenter::Process
end
class Cleaner < PragmaticSegmenter::Cleaner
def clean
super
clean_quotations(@clean_text)
end
private
def clean_quotations(txt)
... | 18.323529 | 76 | 0.585875 |
bfd0df1e53d96183f720b525aa2fa817864352d7 | 601 | require 'active_support/all'
require 'decent_exposure'
require 'decent_decoration'
require 'action_controller'
require 'action_dispatch'
require 'active_model'
module Rails
class App
def env_config; {} end
def routes
@routes ||= ActionDispatch::Routing::RouteSet.new.tap do |routes|
routes.dr... | 18.78125 | 71 | 0.687188 |
798bcd5c4a7c5667706802fcc3652b8908422b98 | 941 | class Hysteresis < ArduinoPlugin
# jdbarnhart
# 20080728
#
#
# purpose
#
# add hysteresis to analog readings, typically sensors or potentiometers
#
# use
# two steps
#
# one
# declare :device => :sensor
# example:
# input_pin 1, :as => :sensor_one, :device => :sensor
#
# two
# instead of:
# my_... | 18.096154 | 79 | 0.573858 |
61bf200a8a1242a581381e929ac7ce3d7a91c157 | 2,138 | # Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
ENV["RAILS_ENV"] ||= 'test'
require File.join(File.dirname(__FILE__), '..', 'config', 'environment') unless defined?(Rails)
require 'helper_methods'
require 'rs... | 24.860465 | 95 | 0.727315 |
088b1abcc4f0a41e3e18751b9cbf74e38dc84adb | 133 | class AddDescriptionToGalleries < ActiveRecord::Migration[5.1]
def change
add_column :galleries, :description, :text
end
end
| 22.166667 | 62 | 0.766917 |
01dfcb066421450db32f08da754827d481bea280 | 528 | # 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
require_relative '../../aws-sdk-core/spec/shared_spec_helper'
$:.unshift(File.expand_path('../../lib', __FILE__... | 31.058824 | 74 | 0.723485 |
5dfbdf4278b20466c2101723cc9971f9a3631de0 | 74 | # frozen_string_literal: true
module Extensions::FormForWithResource; end
| 24.666667 | 43 | 0.851351 |
9100960940d6eb54f5292130820ad22a9704068d | 142 | class AddDurationToIntervals < ActiveRecord::Migration[5.1]
def change
add_column :intervals, :duration, :integer, default: 0
end
end
| 23.666667 | 59 | 0.753521 |
08129012a201f5964d895dda55ad043cd033b998 | 1,984 | require "puppet/parameter/boolean"
# Autogenic core type
Puppet::Type.newtype(:azure_resource_group) do
@doc = "Resource group information."
ensurable
validate do
required_properties = [
:location,
:parameters,
]
required_properties.each do |property|
# We check for both places s... | 23.619048 | 159 | 0.660282 |
085467a8258f5e8c01c19f4d69c00eed99ae183c | 77 | require 'test_helper'
class MyHeywatchHelperTest < ActionView::TestCase
end
| 15.4 | 49 | 0.831169 |
38d45a336f8f18b5b4e7cc08b9b7edb9b9827067 | 455 | #
# Cookbook Name:: jbpm
# Recipe:: default
#
# The attribute evaluates to either
# oracle_wrapper or oracle-xe_wrapper
#
# Set by jbpm recipe in rdk_provision
if ::File.exists?("/etc/oratab")
include_recipe "#{node[:jbpm][:oracle_cookbook]}::env_vars"
else
include_recipe "#{node[:jbpm][:oracle_cookbook]}"
end
i... | 22.75 | 61 | 0.753846 |
e8c2b6c879bdfb01c7b49ceaa911c4604735a1a4 | 668 | 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 SimpleQrCodeRails
class Application < Rails::Application
# Initialize configuration defaults for originally generat... | 33.4 | 82 | 0.767964 |
18aa41146f194912481889cdf905a5f94e21f050 | 2,078 | # 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::AlertsManagement::Mgmt::V2019_03_01
module Models
#
# Properties of the operation
#
class OperationDisplay
include Ms... | 25.975 | 70 | 0.492782 |
2113ba9f3640d098702f75a9a2d5585c5672cae6 | 2,175 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 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, which is a fork of ... | 36.25 | 91 | 0.738851 |
acd84ad210f477bd26455f523d83d71dc54b96ec | 408 | require 'test_helper'
class LikesControllerTest < ActionController::TestCase
test "should get like" do
get :like
assert_response :success
end
test "should get unlike" do
get :unlike
assert_response :success
end
test "should get create" do
get :create
assert_response :success
end
... | 16.32 | 54 | 0.703431 |
26e1b31a568cc89684028e95251c5b11100302ce | 300 | module Hamming
class << self
def compute(first, second)
raise ArgumentError if first.length != second.length
first.chars.zip(second.chars).reduce(0) do |diff, pair|
pair.first == pair.last ? diff : diff + 1
end
end
end
end
module BookKeeping
VERSION = 3
end
| 18.75 | 61 | 0.643333 |
e2d29de26deb67c6b69e173c3c505cee8076dc57 | 59,388 | require 'rails_helper'
feature 'Submission review overlay', js: true do
include UserSpecHelper
include MarkdownEditorHelper
include NotificationHelper
include SubmissionsHelper
include DevelopersNotificationsHelper
include ConfigHelper
let(:school) { create :school, :current }
let(:course) { create :c... | 33.159129 | 135 | 0.65195 |
ed88f855ac6e590cfbdc5568f020c8d25b8a5433 | 16,789 | #
# Fluentd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 30.69287 | 203 | 0.575019 |
5da6f7e93eb8aadeeee6d305ac8a940ed27a1dd1 | 896 | # Player representation.
require_relative './entity.rb'
class Shark < Entity
def initialize(game)
@game = game
super()
@name = :shark
@width = 100
@height = 20
@y = rand(game.height() * 0.66) + (game.height() * 0.33) - @height
@x = -width + (rand(2) * (game.width + @width))
if @x > 0 then @dire... | 21.853659 | 75 | 0.53125 |
919bf0ddfbf7952e00668b0e149d59c8e230244c | 233 | class CreateRepositories < ActiveRecord::Migration
def change
create_table :repositories, id: :uuid do |t|
t.string :name
t.string :deb_host
t.string :homepage
t.timestamps null: false
end
end
end
| 21.181818 | 50 | 0.669528 |
6ab2a6fb4a7d20ac83f968357c753e7a79b3ae77 | 942 | RSpec.describe BankOcr::Parser do
ZEROS = File.read 'spec/fixtures/zeros.txt'
ONES = File.read 'spec/fixtures/ones.txt'
ONE_THROUGH_NINE = File.read 'spec/fixtures/one_through_nine.txt'
THREE_CODES = File.read 'spec/fixtures/three_codes.txt'
describe '#parse' do
it 'takes a row of zeros' do
result ... | 28.545455 | 67 | 0.575372 |
262346c8d582658e869ea3f22450ab7763707c07 | 316 | class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.text :content
t.integer :commentable_id
t.string :commentable_type
t.timestamps null: false
end
add_index :comments, :commentable_type
add_index :comments, :commentable_id
end
end
| 21.066667 | 46 | 0.702532 |
ff575acdb187ada4292d5de0d8a1ec7f7c2bd9e1 | 526 | cask "royal-tsx" do
version "4.3.3.1000"
sha256 "9e8c3b6f5f211b06bbc6e49e9e396a98bdc7cdb0c4973b5b29da1ae786cc8b3d"
# https://royaltsx-v4.royalapplications.com/ was verified as official when first introduced to the cask
url "https://royaltsx-v4.royalapplications.com/updates/royaltsx_#{version}.dmg"
appcast "h... | 35.066667 | 105 | 0.777567 |
f805ef9ad43d32e98b6bd83576dd31842f52244c | 873 | module Collective::Collectors
class PGBouncer < Collective::Collector
requires :pg
collect do
group 'pgbouncer' do |group|
instrument group, 'stats'
instrument group, 'pools'
end
end
private
def instrument(group, thing)
group.group thing do |group|
instru... | 20.785714 | 70 | 0.601375 |
6abc4a1d97ddddb23600f831505f0f229b127f48 | 1,364 | require 'r10k'
require 'log4r'
require 'log4r/configurator'
module R10K::Logging
include Log4r
LOG_LEVELS = %w{DEBUG2 DEBUG1 DEBUG INFO NOTICE WARN ERROR FATAL}
def logger_name
self.class.to_s
end
def logger
unless @logger
@logger = Log4r::Logger.new(self.logger_name)
@logger.add R10... | 18.684932 | 76 | 0.599707 |
26cade9575d3c7d44f10ed45c8a5cfa6c2b847a5 | 1,050 | class Mpg123 < Formula
desc "MP3 player for Linux and UNIX"
homepage "https://www.mpg123.de/"
url "https://downloads.sourceforge.net/project/mpg123/mpg123/1.26.2/mpg123-1.26.2.tar.bz2"
sha256 "00f7bf7ea64fcec2c9d07751d6ad8849343ee09c282ea3b0d5dd486e886e2ff3"
bottle do
sha256 "29e4e2b5e306f94d2ce0e900f841... | 31.818182 | 93 | 0.726667 |
0153c2490d4db8c85d57038216a24c6274c2d8f1 | 833 | # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
#
# 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... | 36.217391 | 85 | 0.758703 |
871febe3fc8377c3c53a75dc3ddf1a67949eafd5 | 2,249 | module VCAP::CloudController
class AppVersion < Sequel::Model
many_to_one :app
many_to_one :droplet
export_attributes :app_guid, :version_guid, :version_count, :description, :instances, :memory
import_attributes :app_guid, :version_guid, :version_count, :description, :instances, :memory
def vali... | 28.468354 | 217 | 0.66474 |
389eab263aac24bbd11906cd217f045f93016b0d | 1,800 | module Cryptoexchange::Exchanges
module Xcoex
module Services
class Market < Cryptoexchange::Services::Market
class << self
def supports_individual_ticker_query?
false
end
end
def fetch
output = super(ticker_url)
adapt_all(output)
... | 31.578947 | 81 | 0.546111 |
394b6862e93a692a009698932f3b07e01c9507e6 | 279 | require 'rails_helper'
RSpec.describe "StockLevelAdjustments", type: :request do
describe "GET /stock_level_adjustments" do
it "works! (now write some real specs)" do
get stock_level_adjustments_path
expect(response).to have_http_status(200)
end
end
end
| 25.363636 | 57 | 0.741935 |
215a2ec9bde326a0999757df1fa5f2686750eb2c | 86 | Rails.application.routes.draw do
resources :instruments
resources :orchestras
end
| 17.2 | 32 | 0.813953 |
edc184ab5149d88bc56c31492013d96c10caab00 | 99,788 | require 'rails_helper'
require 'aasm/rspec'
require "#{BenefitSponsors::Engine.root}/spec/shared_contexts/benefit_market.rb"
require "#{BenefitSponsors::Engine.root}/spec/shared_contexts/benefit_application.rb"
RSpec.describe HbxEnrollment, type: :model, dbclean: :after_each do
describe HbxEnrollment, dbclean: :aro... | 44.808262 | 296 | 0.6889 |
f8f1a04ecc2fe85720635441ca3dd8f577aa2e4a | 13,088 | class InitSchema < ActiveRecord::Migration[5.1]
def up
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "uuid-ossp"
enable_extension "fuzzystrmatch"
enable_extension "pg_trgm"
create_table "aid_stations", id: :serial, for... | 41.417722 | 135 | 0.66412 |
bffffd24e7f53382d79b11d593d9d1dab5cab94e | 225 | require "vagrant"
module VagrantPlugins
module Terraform
module Errors
class VagrantTerraformError < Vagrant::Errors::VagrantError
error_namespace("vagrant_terraform.errors")
end
end
end
end
| 17.307692 | 65 | 0.72 |
4ae7f1dddab543e8cdc35a581434845b9f6e4693 | 207 | require "rake/testtask"
desc "Test"
Rake::TestTask.new(:test) do |t|
# t.libs << "tests"
# t.libs << "lib"
t.warning = false
t.test_files = FileList[File.expand_path("./**/tests/**/*.test.rb")]
end
| 20.7 | 70 | 0.618357 |
e963e90f538d901a8834c2e51fe2bf56c8b01012 | 5,565 | require 'fabricio/models/organization'
require 'fabricio/services/organization_service'
require 'fabricio/services/app_service'
require 'fabricio/services/build_service'
require 'fabricio/services/version_service'
require 'fabricio/authorization/authorization_client'
require 'fabricio/authorization/session'
require 'fa... | 43.139535 | 185 | 0.716262 |
085b21d34510296032f1b7c18343f853a0df68c3 | 37 | class Refine
VERSION = "0.3.4"
end
| 9.25 | 19 | 0.648649 |
1c69d48c48c7cdacef32c7dda7b9ce4558b07a3b | 10,686 | # frozen_string_literal: true
module Hyrax
class FileSetPresenter
include TitlePresenter
include CitableLinkPresenter
include EmbedCodePresenter
include OpenUrlPresenter
include ModelProxy
include PresentsAttributes
include CharacterizationBehavior
include WithEvents
include Featu... | 33.709779 | 137 | 0.667509 |
e853b52c5376ace80812fb0dddd7cbd61529cd76 | 3,690 | RSpec.describe Sisense::API::Client do
SUPPORTED_HTTP_VERBS = %i[get post put patch delete].freeze
context 'constants' do
describe 'VERB_MAP' do
it('is defined') { expect(described_class.const_defined?('VERB_MAP')).to eq true }
it { expect(described_class::VERB_MAP.keys).to match_array(SUPPORTED_HT... | 32.654867 | 126 | 0.664228 |
ed1f3bd21fb776a0225d3a6d31293d44b3298278 | 283 | require 'pushbullet_api/api_handler'
require 'pushbullet_api/version'
require 'pushbullet_api/user'
require 'pushbullet_api/chat'
require 'pushbullet_api/device'
require 'pushbullet_api/push'
require 'pushbullet_api/subscription'
module PushbulletApi
# Your code goes here...
end
| 23.583333 | 37 | 0.823322 |
f8c048563cfb8472f0009bf36018aa66eda83bba | 3,621 | class Ruster::Node
include Ruster::Util
attr :addr
attr :id
attr :flags
attr :master_id
attr :ping_epoch
attr :pong_epoch
attr :config_epoch
attr :state
attr :slots
attr :migrating
attr :importing
attr :friends
def initialize(addr)
@addr = addr
end
def client
@client ||= Redic... | 20.930636 | 129 | 0.599282 |
e84b9073040adb04fdc2e3732a5098d6797502ab | 1,295 | # frozen_string_literal: true
# An abstract class for rest resources
# Rest resources should not be initialized directly. They should be created by methods
# on Varanus
class Varanus::RestResource
# :nodoc:
def initialize varanus
@varanus = varanus
end
private
def check_result result
body = result... | 22.719298 | 87 | 0.666409 |
d525990506252d3b9068391729c84904d725d19d | 499 | # frozen_string_literal: true
module TestSites
# Wrapper for files in ./data.
class DataFile
def self.path(data_dir_relative_path)
DataFile.new(data_dir_relative_path).to_s
end
def initialize(filename)
@data_file = File.join(data_dir, filename)
end
def file
@data_file
en... | 15.59375 | 48 | 0.591182 |
e8b5049b08c5bd4aa837d2e8439823538da25a28 | 2,660 | require 'validators/qrda_cat3_validator'
class C2Task < Task
# C2 = Import and Calculate
# - Ability to Import Cat 1
# - Calculate every CQM
# - (implied) ability to export cat 3 (in order to be able to prove it)
#
# Also, if the parent product test includes a C3 Task,
# do that validation here
def ... | 40.30303 | 137 | 0.615789 |
5de9dadcf9bb78ed96192427f0bb64b06e857818 | 6,464 | require "csv"
require "net/http"
require "aws-sdk-s3"
require "geocoder"
desc "Import postcode geolocation data"
task :import_postcode_cleanup do
db = ActiveRecord::Base.connection
db.drop_table :postcode_geolocation_tmp, if_exists: true
db.drop_table :postcode_geolocation_legacy, if_exists: true
puts "[#{Ti... | 30.635071 | 138 | 0.733756 |
1d35176ed4496ebb0ad34e3150aee3999d839b2f | 817 | # encoding: UTF-8
# frozen_string_literal: true
module API
module V2
module Management
module Entities
class Market < ::API::V2::Entities::Market
expose(
:position,
documentation: {
type: Integer,
desc: 'Market position.'
}
... | 20.948718 | 60 | 0.4541 |
1a03c5be11abe53d040d9f43f754bf21484bac49 | 887 | module RediSearch
class ReindexBatchesJob < ActiveJob::Base
queue_as { RediSearch.queue_name }
def perform(klass, start, finish, batch_size)
klass = klass.constantize
start = start.to_i
finish = finish.to_i
batch_size = batch_size.to_i
batches_relation = nil
if Ac... | 28.612903 | 151 | 0.668546 |
61d742342063e34e9d7f03597592c9355786ce9a | 2,241 | require 'spec_helper'
describe Coursewareable::ResponsesController do
let(:assignment) { Fabricate('coursewareable/assignment') }
let(:classroom) { assignment.classroom }
let(:lecture) { assignment.lecture }
let(:user) { Fabricate(:confirmed_user) }
describe 'GET new' do
context 'being logged in as a u... | 28.730769 | 77 | 0.605533 |
1d7f94805a6816010798eb77a2d33f0f1d3fb1d5 | 77 | # frozen_string_literal: true
module CatarseScripts
VERSION = '0.1.0'
end
| 12.833333 | 29 | 0.753247 |
386bf183a1033510382fcdc9c2662eee3c66c23a | 38 | module RAMF
VERSION = "0.0.1.a1"
end | 12.666667 | 22 | 0.657895 |
b998f90429913cfb4c8b830249ceb8107fa9f80e | 3,544 | require "test_helper"
require "fileutils"
require "tempfile"
class Bundleup::CLITest < Minitest::Test
include OutputHelpers
def test_it_works_with_a_sample_project # rubocop:disable Minitest/MultipleAssertions
stdout = within_copy_of_sample_project do
capturing_plain_output(stdin: "n\n") do
with... | 34.407767 | 109 | 0.657167 |
ffc36dbf6e91c4c6c4438ba987c02a986fdc9141 | 5,811 | # encoding: utf-8
#
=begin
-----------------
Benchmark: PostgreSQL 9.x Security Technical Implementation Guide
Status: Accepted
This Security Technical Implementation Guide is published as a tool to improve
the security of Department of Defense (DoD) information systems. The
requirements are derived from the National ... | 38.483444 | 81 | 0.749785 |
ab8158670543505c97baf13dbdd0066d2f446516 | 603 | module UserDecorator
def select_document
[
['Cedula de Ciudadania', 'Cedula de Ciudadania'],
['Tarjeta de Identidad', 'Tarjeta de Identidad'],
['Cédula de Extranjeria', 'Cedula de Extranjeria'],
['Pasaporte', 'Pasaporte'],
['Menor Sin Identificación', 'Menor Sin Identificación'],
... | 35.470588 | 109 | 0.658375 |
e2c7a017302e3bd75feb20c59e21e05ff2740ad2 | 60 | # encoding: utf-8
module MarchHare
VERSION = "3.0.0"
end
| 10 | 19 | 0.666667 |
ab6926533fd92dd8d0bc2c9d18541d6c20d17ef3 | 152 | worker_processes 2
preload_app true
# listen "127.0.0.1:8080"
listen "/tmp/unicorn.sock"
stderr_path "/tmp/unicorn.log"
stdout_path "/tmp/unicorn.log"
| 19 | 30 | 0.763158 |
87aa655f35f48ddf964206fb318abb8a663e51f9 | 1,147 | Pod::Spec.new do |s|
s.name = 'Helpshift'
s.version = '3.1.1'
s.summary = 'Customer service helpdesk for mobile applications.'
s.license = { :type => 'Commercial', :text => 'See http://www.helpshift.com/terms/' }
s.homepage = 'http://www.helpshift.... | 63.722222 | 148 | 0.58762 |
4a49242d965bb91e5e8715fd9f9f66d9a737cd59 | 1,312 | require_relative '../spec_helper'
require 'stringio'
describe Raygun do
let(:failsafe_logger) { FakeLogger.new }
describe '#track_exception' do
context 'send in background' do
before do
Raygun.setup do |c|
c.send_in_background = true
c.api_url = 'http://example.api'
... | 25.72549 | 99 | 0.641006 |
e2ba81eb0d22f52a1fef362e28b24b67a0a4efcd | 1,193 | require_relative '../../../spec_helper'
ruby_version_is ''...'3.0' do
require 'rexml/document'
describe "REXML::Element#delete_attribute" do
before :each do
@e = REXML::Element.new("Person")
@attr = REXML::Attribute.new("name", "Sean")
@e.add_attribute(@attr)
end
it "deletes an attr... | 27.744186 | 70 | 0.644593 |
330170e34275cde6b7836356318ebb1a8af91d07 | 2,106 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Web::Mgmt::V2018_02_01
module Models
#
# Virtual IP mapping.
#
class VirtualIPMapping
include MsRestAzure
# @return [String] Vir... | 26.658228 | 70 | 0.498101 |
e2b2de51901a497fee5cd8b2f228d0b168e68ae4 | 129 | class ChangeTypeColumnName < ActiveRecord::Migration[5.0]
def change
rename_column :surveys, :type, :survey_type
end
end
| 21.5 | 57 | 0.75969 |
0340c3b0d73027100b8b6ab8b7e2302c272bafbe | 1,219 | class PonyStable < Formula
desc "Dependency manager for the Pony language"
homepage "https://github.com/ponylang/pony-stable"
url "https://github.com/ponylang/pony-stable/archive/0.2.2.tar.gz"
sha256 "8fca5f0f600e695d648200a7492c5d8cea82581f4e4e138f0bb621911d9e4c13"
license "BSD-2-Clause"
head "https://gith... | 33.861111 | 93 | 0.726825 |
bb08f8734fb2e5740078442f93670223d738ff8c | 3,758 | require 'spec_helper'
require 'beaker/host'
class ClassPEClientToolsMixedWithPatterns
include Beaker::DSL::InstallUtils::PEClientTools
include Beaker::DSL::Patterns
end
describe ClassPEClientToolsMixedWithPatterns do
describe "#install_pe_client_tools_on" do
let(:hosts) do
make_hosts({:platform => platf... | 49.447368 | 265 | 0.637307 |
f863766c1a3aba19ef587251de4579b79d2eaa4f | 3,856 | require_relative '../../spec_helper'
require_relative 'fixtures/classes'
describe "Class.new with a block given" do
it "yields the new class as self in the block" do
self_in_block = nil
klass = Class.new do
self_in_block = self
end
self_in_block.should equal klass
end
it "uses the given bl... | 24.717949 | 80 | 0.634336 |
1d2f84ac149a23de3f88291d16d8af77ed382bd4 | 1,596 | require 'rails_helper'
RSpec.describe NfgUi::Bootstrap::Utilities::Collapsible do
# Button is collapsible
let(:button) { FactoryBot.create(:bootstrap_button, **options, as: button_wrapper_el) }
let(:button_wrapper_el) { :button }
let(:options) { { collapse: collapse } }
let(:collapse) { tested_collapse }
l... | 28.5 | 89 | 0.670426 |
79986cb72f547372a1cfd7374d0beca00b914a4b | 385 | # $RoughId: extconf.rb,v 1.4 2001/08/14 19:54:51 knu Exp $
# $Id: extconf.rb 25189 2009-10-02 12:04:37Z akr $
require "mkmf"
$defs << "-DHAVE_CONFIG_H"
$INCFLAGS << " -I$(srcdir)/.."
$objs = [
"sha2.#{$OBJEXT}",
"sha2init.#{$OBJEXT}",
]
have_header("sys/cdefs.h")
$preload = %w[digest]
if have_type("uint64_t",... | 18.333333 | 58 | 0.620779 |
ed585d8ab61b4518e7e06e618c03519d70efe5d7 | 1,881 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::DataMigration::Mgmt::V2018_03_31_preview
module Models
#
# Output for the task that migrates on-prem SQL Server databases to Azure
# SQL Database
... | 30.33871 | 98 | 0.629452 |
084d347e600c77eca917430d1f3f0676449930f1 | 7,241 | =begin
#BillForward REST API
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file e... | 38.515957 | 530 | 0.728905 |
f788f0d92b0ffb8cff39f4fd27274905a76dea63 | 371 | require 'spec_helper'
describe YARD::Cov::Config, '#output=' do
subject { config.output = output }
let(:config) { described_class.new }
let(:path) { 'tmp/*.rb' }
before { config.output = path }
context 'output' do
subject { config.output }
it { should be_a(YARD::Cov::ReportOutput) }
... | 19.526316 | 47 | 0.606469 |
383c3538baefeb6715d35d46e6ce43a45fe45d12 | 3,224 | class BillingAddressInfo
attr_accessor :address1, :address2, :city, :company, :country, :email, :fax, :first_name, :last_name, :phone, :state, :zip
# :internal => :external
def self.attribute_map
{
:address1 => :address1, :address2 => :address2, :city => :city, :company => :company, :country => :country,... | 36.636364 | 246 | 0.60701 |
bf1f0a15b2c576ac2b8150095afd9b7edc49b87d | 8,049 | #
# Copyright 2011 Red Hat, 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... | 33.5375 | 174 | 0.662567 |
5d97d7122cf5e8f5654184a201185621dd1d96b7 | 124 | class AddContainerToPeople < ActiveRecord::Migration
def change
add_column :people, :container_id, :integer
end
end
| 20.666667 | 52 | 0.774194 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.