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 |
|---|---|---|---|---|---|
e812a2e64601eb1abf07c7818359ea002930c0e9 | 2,189 | class Help2man < Formula
desc "Automatically generate simple man pages"
homepage "https://www.gnu.org/software/help2man/"
url "https://ftp.gnu.org/gnu/help2man/help2man-1.48.3.tar.xz"
mirror "https://ftpmirror.gnu.org/help2man/help2man-1.48.3.tar.xz"
sha256 "8361ff3c643fbd391064e97e5f54592ca28b880eaffbf566a68... | 37.101695 | 122 | 0.708543 |
e9518431b8bf89f422fd7b91852593e6376d9fd0 | 1,629 | require 'fileutils'
def spawn_peercast
# 新品の設定ファイルを使う。
FileUtils.cp "peercast.ini.master", "peercast-yt/peercast.ini"
# 起動。
if RUBY_PLATFORM =~ /msys/
cmdline = "./peercast.exe"
else
cmdline = "./peercast -i peercast.ini -P ."
end
Dir.chdir("peercast-yt")
pid = spawn cmdline
Dir.chdir("..")
... | 24.313433 | 91 | 0.600368 |
3369d1c85eab73f597e755ad7f4961e56051b4be | 7,502 | require File.dirname(__FILE__) + "/../../spec_helper"
describe Radiant::ExtensionLoader do
before :each do
$LOAD_PATH.stub!(:unshift)
@observer = mock("observer")
@configuration = mock("configuration")
@admin = mock("admin_ui")
@initializer = mock("initializer")
@initializer.stub!(:configura... | 40.994536 | 127 | 0.747267 |
38bea2ef83a7c592555493d39c47e91bc955fe93 | 2,448 | require 'spec_helper'
describe SolidusAvataxCertified::Address, :type => :model do
let(:address){ build(:address) }
let(:order) { build(:order_with_line_items, ship_address: address) }
before do
Spree::Avatax::Config.address_validation = true
end
let(:address_lines) { SolidusAvataxCertified::Address.ne... | 28.465116 | 87 | 0.699755 |
ac60a73e4e9ab888efea4bd655992b43c8208ef8 | 708 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe User do
let(:member) { users(:member) }
let(:admin) { users(:admin) }
context 'when users can be activated' do
it 'defaults to activated' do
expect(member).not_to be_deactivated
expect(member).to be_activated
end
end
c... | 22.125 | 44 | 0.690678 |
21ccf6cad659c19c4bf2e6baf2da9875014919d8 | 398 | class CreateCodesTickets < ActiveRecord::Migration
def self.up
create_table :codes_tickets, id: false do |t|
t.references :code
t.references :ticket
end
add_index :codes_tickets, [:code_id, :ticket_id], :unique => true
add_foreign_key :codes_tickets, :codes
add_foreign_key :codes_tic... | 22.111111 | 69 | 0.708543 |
e968e76a5f12799ed0f3c69f27fedce58c831c85 | 2,684 | require 'test_helper'
require 'net/dns/packet'
class PacketTest < Minitest::Test
def setup
@klass = Net::DNS::Packet
@domain = 'example.com'
end
def test_initialize
@record = @klass.new(@domain, Net::DNS::MX, Net::DNS::HS)
assert_instance_of @klass, @record
assert_instance_of N... | 55.916667 | 720 | 0.685917 |
9148b78c8ba13d1b55bbf6559c12c634a5a2e48e | 4,608 | #frozen_string_literal: false
require 'test_helper'
require 'stringio'
require 'tempfile'
class JSONCommonInterfaceTest < Test::Unit::TestCase
include JSON
def setup
@hash = {
'a' => 2,
'b' => 3.141,
'c' => 'c',
'd' => [ 1, "b", 3.14 ],
'e' => { 'foo' => 'bar' },
'g' => "\"... | 27.105882 | 219 | 0.639757 |
e2cba42351fe81cff0656da4c19b0f051fd6f327 | 2,737 | RSpec.describe 'admin/groups/users', type: :view do
context 'groups index page' do
let(:group) { FactoryBot.create(:group) }
let(:user_1) { FactoryBot.create(:user) }
let(:user_2) { FactoryBot.create(:user) }
let(:users) { double('users') }
let(:path_parameters) do
{
controller: 'adm... | 40.25 | 88 | 0.677384 |
7a5d691f880d3d9b0383f572248c347548d66e7c | 1,106 | # frozen_string_literal: true
require_relative '../core/lib/spree/core/version.rb'
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'solidus_frontend'
s.version = Spree.solidus_version
s.summary = 'Cart and storefront for the Solidus e-commerce project.'
s.descriptio... | 29.891892 | 75 | 0.669982 |
bb7d271cf03c0e21684635c72d0e505b2f077966 | 1,306 | motion_require 'version'
module AFMotion
class HTTP
def self.operation_manager
@operation_manager ||= begin
manager = AFHTTPRequestOperationManager.manager
configure_manager(manager)
manager
end
end
def self.configure_manager(manager)
manager.http!
end
end... | 24.185185 | 88 | 0.688361 |
26026cace489831fe55c8fd03d93a9eb2c4c8f3a | 2,676 | # Copyright (c) 2005 Trevor Squires
# Released under the MIT License. See the LICENSE file for more details.
module ActiveRecord
module VirtualEnumerations # :nodoc:
class << self
def define
raise ArgumentError, "#{self.name}: must pass a block to define()" unless block_given?
config = Act... | 38.782609 | 158 | 0.66293 |
91f0000ad11ddd91382b70f677bbed6c951ab4a4 | 7,416 | require "roo"
require "globalize"
module Shoppe
class Product < ActiveRecord::Base
self.table_name = 'shoppe_products'
# Add dependencies for products
require_dependency 'shoppe/product/product_attributes'
require_dependency 'shoppe/product/variants'
# Attachments for this product
has_many... | 34.493023 | 207 | 0.654666 |
1881d357ccb28339198eb40c078bc7141c782508 | 453 | # coding: UTF-8
module MarkdownUI
module Button
module Group
module Buttons
class Custom
def initialize(element, content)
@element = element
@content = content
end
def render
klass = "ui #{@element} buttons"
content = ... | 18.875 | 62 | 0.529801 |
01f09bc9af37f5dbdcbf4f4153a0d326f45c6a72 | 2,571 | # frozen_string_literal: true
# Cannon Mallory
# malloc3@uw.edu
#
# Methods to facilitate sample management within collections
module CollectionLocation
ALPHA26 = ('A'...'Z').to_a
# Gets the location string of a sample in a collection
#
# @param collection [Collection] the collection containing the sample
#... | 32.961538 | 79 | 0.713341 |
08cdb93096112444e4f8ff6d9f8c9a96816d0d58 | 69 | module FirmwareRegistryHelper
include_concern 'TextualSummary'
end
| 17.25 | 34 | 0.869565 |
792099c9beae59d142e1c266c7edba9c89a9b00f | 6,664 | # Cloud Foundry Java Buildpack
# Copyright 2013-2017 the original author or authors.
#
# 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
#
# Un... | 26.339921 | 110 | 0.642257 |
039d7d301b136d14b14fe5aa28fec70a658a1d21 | 5,824 | require 'rails_helper'
RSpec.describe ActiveAdmin::Scope do
describe "creating a scope" do
subject{ scope }
context "when just a scope method" do
let(:scope) { ActiveAdmin::Scope.new :published }
describe '#name' do
subject { super().name }
it { is_expected.to eq("Publishe... | 27.733333 | 102 | 0.588255 |
6a4745176cdc1c5b0ec067a48890068f2411ab49 | 149 | FactoryBot.define do
factory :event_import_result, class: EventImportResult do
association :event_import_file
association :event
end
end
| 21.285714 | 59 | 0.791946 |
269dd28144d69e3b208239777005e75b1bb86037 | 124 | module Stripe
module JavascriptHelper
def stripe_javascript_tag
render :partial => 'stripe/js'
end
end
end | 17.714286 | 36 | 0.709677 |
08311aebd6598c17b6aeb5a652501bd33354a429 | 2,875 | # 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::Network::Mgmt::V2020_08_01
module Models
#
# Response for ListVirtualRouterPeerings API service call.
#
class VirtualRouterP... | 28.75 | 80 | 0.540522 |
b9f9a0003a4d1c4b4a5c3d24a0a620dd1e5cd4c2 | 486 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
require 'resolv'
require 'mocha/setup'
class LoadTest < Minitest::Test
def test_loading_agent_when_disabled_does_not_resolv_addresses
::Reso... | 30.375 | 93 | 0.769547 |
ab581e8dd1a8d43c9071f129c648cce1281308ca | 937 | require 'cadence/metadata/activity'
describe Cadence::Metadata::Activity do
describe '#initialize' do
subject { described_class.new(args.to_h) }
let(:args) { Fabricate(:activity_metadata) }
it 'sets the attributes' do
expect(subject.domain).to eq(args.domain)
expect(subject.id).to eq(args.id... | 34.703704 | 65 | 0.709712 |
bf407c337216682ef642efa351b77ef47abf97c0 | 968 |
require 'logger'
# -------------------------------------------------------------------------------------------------
module Logging
def logger
@logger ||= Logging.logger_for( self.class.name )
end
# Use a hash class-ivar to cache a unique Logger per class:
@loggers = {}
class << self
def logger_... | 26.888889 | 104 | 0.47624 |
4a0276c86e446b842033d91477828c8fba7163b0 | 996 | class Igv < Formula
desc "Interactive Genomics Viewer"
homepage "https://www.broadinstitute.org/software/igv"
url "https://data.broadinstitute.org/igv/projects/downloads/2.8/IGV_2.8.8.zip"
sha256 "d9fb5ccf6f531a6f378c6640d7ccb5386c01ecec7a0ca29c64510fa4f0dc8b9a"
bottle :unneeded
depends_on "openjdk"
de... | 34.344828 | 118 | 0.705823 |
183bbdc3a9cc7c84fd322f4056f74aaf7490ece0 | 5,204 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your applica... | 44.862069 | 114 | 0.765949 |
626e0113a3a4012e5c0c956b2ac80fc5a7022ce2 | 617 | require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "aeroxmotion-react-native-async-json-file-storage"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = packag... | 30.85 | 128 | 0.615883 |
b913931941fbd725901bf845064d1acc8e5a86ef | 204 | class CreateStudentKlasses < ActiveRecord::Migration[5.0]
def change
create_table :student_klasses do |t|
t.integer :klass_id
t.integer :student_id
t.timestamps
end
end
end
| 18.545455 | 57 | 0.691176 |
28dbbdf50209165bbc745e96e81beabf4e5f3129 | 795 | require 'test_helper'
describe 'Lotus middleware integration' do
before do
@routes = Lotus::Router.new(namespace: Web::Controllers) do
get '/', to: 'home#index'
get '/dashboard', to: 'dashboard#index'
end
@app = Rack::MockRequest.new(@routes)
end
it 'action with middleware' do
... | 29.444444 | 76 | 0.686792 |
6a6bba2ee0bd61e683766c3b725cf648d8be9f30 | 585 | require "rubymc"
include Rubymc::MonteCarloSimulation
#define function to evaluate
def f(x)
-1.0 * x**2 + 1
end
#define simulation
experiment = Simulation.new do
iterations 50000
chains 4
sample { 2.0 * (Kernel.rand - 0.5) }
calculate {|x| f(x)}
end
#run Monte Carlo Simulation
results = experiment.run
#m... | 20.172414 | 86 | 0.731624 |
bbc16c268ef3b336c0fbf078be32c85c43b4673d | 968 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks that arrays are sliced with endless ranges instead of
# `ary[start..-1]` on Ruby 2.6+.
#
# @example
# # bad
# items[1..-1]
#
# # good
# items[1..]
class Slici... | 24.820513 | 77 | 0.58781 |
ed7377bce0bd6fe977b345f2312346883ef8cd9b | 4,773 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = GreatRanking
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::EXE
include Msf::Expl... | 30.401274 | 113 | 0.595014 |
01908cc41ee39dfdf4844bce1fd4457a14277a85 | 8,121 | =begin
#ORY Hydra
#Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
The version of the OpenAPI document: v1.10.5
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.1.1
=end
require 'date'
require 'time'
module OryHydraClient
class Logout... | 30.189591 | 207 | 0.620121 |
0138b442197c16849cd5383e7bb8841dada131e4 | 1,618 | # frozen_string_literal: true
require 'spec_helper'
describe EasyPost::Webhook do
describe '.create' do
it 'creates a webhook' do
webhook = described_class.create(
url: 'http://example.com',
)
expect(webhook).to be_an_instance_of(described_class)
expect(webhook.id).to match('hoo... | 26.096774 | 100 | 0.679852 |
61fb16c3b62bfe3227ea0757c4aa6cd9a3b933d5 | 1,132 | class HomeController < ApplicationController
before_filter :login_required, :only => :share
after_filter :store_location, :only => [:index, :privacy, :feedback, :share]
# caches_page :index, :privacy, :feedback, :error, :layout => false
# caches_action :share, :layout => false
def index
end
def privacy
... | 22.64 | 78 | 0.632509 |
7a5490943c55e25bc85aff8277506975be4e9a33 | 3,263 | # -*- encoding: utf-8 -*-
# stub: fog 0.7.2 ruby lib
Gem::Specification.new do |s|
s.name = "fog".freeze
s.version = "0.7.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["geemus (Wesley Beary)".fr... | 45.319444 | 112 | 0.619369 |
39105496e4287917f54efd34b422dd537c007253 | 419 | class CatsController < ApplicationController
def create
p 'THESE ARE THE PARAMS'
p params
p 'THESE ARE THE CAT PARAMS'
p cat_params
Cat.create!(cat_params)
redirect_to cats_url
end
def index
@cats = Cat.all
render :index
end
def new
render :new
end
def cat_params
... | 15.518519 | 88 | 0.661098 |
e8c9546f4240f41788084b37012718573ac91f90 | 15,535 | module Factories
class EnrollmentFactory
extend Acapi::Notifiers
def self.add_consumer_role(person:, new_ssn: nil, new_dob: nil, new_gender: nil, new_is_incarcerated:, new_is_applicant:,
new_is_state_resident:, new_citizen_status:)
[:new_is_incarcerated, :new_is_applican... | 37.076372 | 155 | 0.637657 |
f80f6a354c7f19d0e0c14b38de6959e4af9dbd63 | 2,108 | class ActionOfficersController < ApplicationController
before_action :authenticate_user!, PQUserFilter
def index
@action_officers =
ActionOfficer.all
.joins(:deputy_director => :division)
.order('lower(divisions.name)')
.order('lower(action_officers.name)')
update_page_title '... | 23.164835 | 69 | 0.681689 |
28d17eaa9b71cc36c0d70ceb5f13378b9d16cc47 | 963 | $LOAD_PATH.push(File.expand_path('../lib', __FILE__))
require 'puppetfile-resolver/version'
Gem::Specification.new do |spec|
spec.name = 'puppetfile-resolver'
spec.version = PuppetfileResolver::VERSION.dup
spec.authors = ['Glenn Sarti']
spec.email = ['glennsarti@users.noreply.github.com']
spec.license = 'Apa... | 40.125 | 132 | 0.713396 |
186ba6549608ca097df8f6b244beebfd9a71b303 | 5,527 | # frozen_string_literal: true
require "date"
require "dry/monads"
require "dry/matcher/result_matcher"
RSpec.describe "Dry::Matcher::ResultMatcher" do
extend Dry::Monads[:result, :try]
include Dry::Monads[:result, :try]
before { Object.send(:remove_const, :Operation) if defined? Operation }
def self.set_up_... | 33.49697 | 97 | 0.582775 |
2187fe0a3a8f6a97b7f727f3c8d60d9a100d0b68 | 127 | class RemoveFundSourcesAccountId < ActiveRecord::Migration
def change
remove_column :fund_sources, :account_id
end
end
| 21.166667 | 58 | 0.80315 |
1cf0f638984022fe849ee9ecb6a1a92f44f6277b | 6,615 | =begin
#Hydrogen Nucleus API
#The Hydrogen Nucleus API
OpenAPI spec version: 1.9.4
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.19
=end
require 'date'
module NucleusApi
# Ownership Object
class Ownership
# client_id
att... | 28.148936 | 107 | 0.615268 |
e82d9594564cbb40fad77c9579a943c739e40ff2 | 657 | #
# Cookbook Name:: jupyterhub-chef
# Recipe:: nodejs
#
# Copyright (c) 2016 The Authors, All Rights Reserved.
# install node
bash 'install_nodejs' do
code <<-EOF
curl --silent --location https://rpm.nodesource.com/setup_#{node['nodejs']['version']} | bash -
yum install -y nodejs
EOF
end
# install global ... | 23.464286 | 99 | 0.669711 |
61841487417e749ea9bcc7c0a954bb0124c0d72b | 1,049 | class BookingsController < ApplicationController
before_action :authenticate_user!
def new
@receipt = Receipt.new(phone: current_user.phone, street: current_user.street_address, city: current_user.city, state: current_user.state, zip: current_user.zip, report: current_user.self_report)
@events = Event.wher... | 33.83871 | 199 | 0.732126 |
110a33697041e6ce04dbe20dad9ef2e40fa91d1d | 1,286 | require 'spec_helper'
describe 'mistral::db::mysql' do
let :pre_condition do
[
'include mysql::server',
'include mistral::db::sync'
]
end
let :facts do
{ :osfamily => 'Debian' }
end
let :params do
{
'password' => 'fooboozoo_default_password',
}
end
describe ... | 20.412698 | 72 | 0.548989 |
bb6b1cf13db173e3a4b05db17f67eaa9ba2adbf5 | 1,016 | # typed: true
module Kuby
module CRDB
module DSL
module CRDB
module V1alpha1
class CrdbClusterSpecAffinityNodeAffinityRequiredDuringSchedulingIgnoredDuringExecutionNodeSelectorTermsMatchFields < ::KubeDSL::DSLObject
value_field :operator
value_field :values
... | 30.787879 | 148 | 0.602362 |
1a2d41558e5edd5a0b74c43069a448d5c9cb67d8 | 124 | class Admin::DocumentCollectionsController < Admin::EditionsController
def edition_class
DocumentCollection
end
end
| 20.666667 | 70 | 0.822581 |
5dcc57a85b12d785d20bd57fede26a76b3824718 | 6,853 | # frozen_string_literal: true
require "spec_helper"
# Must be top-level so it can be found by string
FieldSpecReturnType = GraphQL::ObjectType.define do
name "FieldReturn"
field :id, types.Int
field :source, types.String, hash_key: :source
end
describe GraphQL::Field do
it "accepts a proc as type" do
fie... | 29.161702 | 125 | 0.645411 |
284846b39480f782c354d8950cb44da5e86452c0 | 5,788 | =begin
#Kubernetes
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.2.3
=end
require 'date'
module Kubernetes
# DeploymentStrategy descr... | 28.94 | 107 | 0.626123 |
f8d65be39615af47de37dd7d559c7fe1c7c7c806 | 142 | class AddImageFilter < ActiveRecord::Migration[5.0]
def change
add_column :images, :filter, :integer, null: false, default: 0
end
end
| 23.666667 | 66 | 0.725352 |
1a60eda2e633ac1ec5542cdf4da6c278793cc9c2 | 3,480 | $:.unshift(File.dirname(__FILE__)) unless
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
require 'rubygems'
require 'mechanize'
module Mygist
class GistApi
class NotLoggedIn < StandardError; end
def initialize(username = nil, password = nil)
@username = ... | 32.830189 | 118 | 0.624425 |
4a1e9e1dc22ea967bede6683dad971219b48dccc | 2,142 | class Terraform < Formula
desc "Tool to build, change, and version infrastructure"
homepage "https://www.terraform.io/"
url "https://github.com/hashicorp/terraform/archive/v0.14.1.tar.gz"
sha256 "4a71bd647baa4c833bd8cb36cb8185cf29dcee59802870aebdbf1110eb7e6f36"
license "MPL-2.0"
head "https://github.com/has... | 30.6 | 96 | 0.656396 |
03eb2cccd71ee1e127a65be223d804477df8da46 | 9,163 | require_relative 'helper'
module FastlaneCore
class ToolCollector
# Learn more at https://docs.fastlane.tools/#metrics
# This is the original error reporting mechanism, which has always represented
# either controlled (UI.user_error!), or uncontrolled (UI.crash!, anything else)
# exceptions.
#
... | 30.042623 | 110 | 0.627196 |
5d9384307f4740608adbc3ba055e218f54d91193 | 993 | module ItunesSearch
class Search
attr_accessor :query, :media, :entity, :limit, :result_hash, :json, :search_type
alias :original_method_missing :method_missing
def initialize(search_type, query, media, entity, limit)
self.search_type = search_type
self.query = query
self.media =... | 29.205882 | 142 | 0.646526 |
5dcb3f0886bf5f5108e3e5c1d1696ce74a3970e8 | 3,554 | module SystemCheck
# Base class for Checks. You must inherit from here
# and implement the methods below when necessary
class BaseCheck
include ::SystemCheck::Helpers
# Define a custom term for when check passed
#
# @param [String] term used when check passed (default: 'yes')
def self.set_che... | 27.338462 | 92 | 0.670512 |
bbd61c76b8039d50c4867cee1403f62d1855c602 | 2,327 | module FHIR
# fhir/device_request_parameter.rb
class DeviceRequestParameter < BackboneElement
include Mongoid::Document
embeds_one :code, class_name: 'FHIR::CodeableConcept'
embeds_one :valueCodeableConcept, class_name: 'FHIR::CodeableConcept'
embeds_one :valueQuantity, class_name: 'FHIR::Qu... | 45.627451 | 155 | 0.658358 |
211e9dd7c73fc57ca58dca7948644864764ffc8c | 7,034 | ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'timeout'
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
R... | 28.593496 | 104 | 0.628092 |
26af5df7e373fd2754ba6e81a784bcde4e72f4fb | 5,439 | # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
require 'date'
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
module OCI
# CreateTransferApplianceDetails model.
class Dts::Models::CreateTransferApplianceDetails
# @return [OCI::Dts::Models::ShippingAddress... | 35.54902 | 189 | 0.686339 |
ed34430daae193902b2ca280d8c6821b94d871dd | 2,955 | require 'yaml'
class Herd
attr_reader :project, :extra_mongrel_options
def initialize(project=nil,extra_mongrel_options=nil)
@project = project
@extra_mongrel_options = extra_mongrel_options
end
def init
proj = config[project] ||= {}
proj['rails_dirs'] ||= []
proj['merbs'] ||= []
proj... | 21.569343 | 99 | 0.60643 |
aca3df8ca31781411d2b811ead052146d826d488 | 3,311 | require 'minitest/autorun'
require 'test_helper'
require 'contact_sport'
class OutlookReaderTest < MiniTest::Unit::TestCase
def test_iso_8859_1_commas
contacts = ContactSport.contacts fixture('iso_8859_1_commas.csv')
assert_equal 3, contacts.length
contact = contacts.shift
assert_equal 'Bruce',... | 44.146667 | 80 | 0.623075 |
6a7a47a9cfc1c64a85665a35086a45837cc90830 | 691 | class AddPaypalToEventConfigurations < ActiveRecord::Migration
class EventConfiguration < ActiveRecord::Base
end
def up
add_column :event_configurations, :paypal_account, :string
add_column :event_configurations, :paypal_test, :boolean, default: true, null: false
EventConfiguration.reset_column_info... | 34.55 | 106 | 0.768452 |
87b78b12f9935519fcb5a02afa036ea748957f6d | 566 | class CasaCaseContactType < ApplicationRecord
belongs_to :casa_case
belongs_to :contact_type
end
# == Schema Information
#
# Table name: casa_case_contact_types
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
#... | 26.952381 | 70 | 0.687279 |
6a4baf05d1663f8b27cb0614f5ffa6b58edc3684 | 23,288 | require File.join(File.dirname(File.expand_path(__FILE__)), 'spec_helper')
describe Rack::Unreloader do
it "should not reload files automatically if cooldown option is nil" do
ru(:cooldown => nil).call({}).must_equal [1]
update_app(code(2))
ru.call({}).must_equal [1]
@ru.reload!
ru.call({}).must_... | 45.131783 | 214 | 0.569005 |
79e73ca868bdc82691e0ea6e0093346acdc94aef | 777 | # frozen_string_literal: true
# the version, following semver
#
# Someone wanted to have documentation, so here goes...
#
# Please note that the version-string is not frozen. Although it of course is,
# because all strings in this file are frozen. That's what the magic comment
# at the top of the file does. :gasp:
#
#... | 37 | 79 | 0.752896 |
01bf3255a77dead1bd17da17b99b4098b55d71b1 | 3,914 | module GitDiffParser
# Parsed patch
class Patch
RANGE_INFORMATION_LINE = /^@@ .+\+(?<line_number>\d+),/
MODIFIED_LINE = /^\+(?!\+|\+)/
REMOVED_LINE = /^[-]/
NOT_REMOVED_LINE = /^[^-]/
NO_NEWLINE_MESSAGE = /^\\ No newline at end of file$/
attr_accessor :file, :body, :secure_hash
# @!attr... | 31.063492 | 119 | 0.596065 |
ac0c1e3a1cfa3eb397287f8df1185bae0f9a0b5d | 2,465 | # frozen_string_literal: true
require 'dry/types/primitive_inferrer'
RSpec.describe Dry::Types::PrimitiveInferrer, '#[]' do
subject(:inferrer) do
Dry::Types::PrimitiveInferrer.new
end
before { stub_const('Types', Dry.Types()) }
def type(*args)
args.map { |name| Dry::Types[name.to_s] }.reduce(:|)
e... | 27.388889 | 93 | 0.687627 |
bf0cf82683663c21225a4187d5879b5fa97c6ac8 | 649 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/say/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["rochefort"]
gem.email = ["teraswan@gmail.com"]
gem.summary = %q{extend Mac OSX say command}
gem.description = gem.summary
gem.homepage = "https://githu... | 36.055556 | 85 | 0.596302 |
1a42214c486ab0ee3d987f54faa292941da9796b | 1,188 | class Sakura < ActiveRecord::Base
belongs_to :place
# MIN = self.minimum(:full_on)
# MAX = self.maximum(:full_on)
# DIFF = MAX - MIN
# output laern_datas
# Example
# inputs_set, ouputs_sets = Sakura.laern_datas
def self.laern_datas
reasons = []
results = []
self.all.each do |sakura|
re... | 24.75 | 76 | 0.638047 |
616cfb6f01d5f97d1ca9ab24bc3064095aa90e6f | 133 | require 'sinatra'
require_relative '../check_server'
current_check.filenames.each { |filename| get( "/#{filename}" ) { filename } }
| 26.6 | 78 | 0.714286 |
87794c11bf96b5482d21a2a6de826ce04b468c6a | 72,674 | # frozen_string_literal: true
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | 36.722587 | 634 | 0.618763 |
e228b8218a1216eda24c1562dfa2d360ba8d35f6 | 2,094 | class Nghttp2 < Formula
desc "HTTP/2 C Library"
homepage "https://nghttp2.org/"
url "https://github.com/nghttp2/nghttp2/releases/download/v1.41.0/nghttp2-1.41.0.tar.xz"
sha256 "abc25b8dc601f5b3fefe084ce50fcbdc63e3385621bee0cbfa7b57f9ec3e67c2"
bottle do
sha256 "d81b96cf82189cd4049ff7fe400a4e5b05eed38029d3... | 29.914286 | 94 | 0.7149 |
fffd79343491b78e7481e6b96302cf7c8625a553 | 3,754 | require 'mspec-opal/formatters'
class OSpecFilter
def self.main
@main ||= self.new
end
def initialize
@filters = Set.new
@seen = Set.new
end
def register
if ENV['INVERT_RUNNING_MODE']
MSpec.register :include, self
else
MSpec.register :exclude, self
end
end
def ===(d... | 21.699422 | 183 | 0.626265 |
4a050aa240f0f1002f3c510cfe2fb54621a8a328 | 1,305 | require 'formula'
class ReattachToUserNamespace < Formula
homepage 'https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard'
url 'https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/archive/v2.3.tar.gz'
sha1 '830d329992b294c2673ed240ee3c7786e4e06308'
head 'https://github.com/ChrisJohnsen/tmux-MacOSX-pastebo... | 36.25 | 96 | 0.76092 |
f8738fe2d8a3437b152a5450b175999287a2ddcc | 437 | class AttachQueryResultsToSearch
def self.call(search)
new(search).call
end
def initialize(search)
@search = search
end
def call
search.results = SaveResultsFromQuery.call(query)
search.save!
end
private
attr_reader :search
def item_type
search.to_item_type
end
def query
... | 14.096774 | 53 | 0.704805 |
03feb05ea3646cd28099659febb310889b1e7b5a | 1,137 | require 'multi_json'
require 'active_support/json'
require 'active_support/core_ext/string'
require 'ostruct'
require 'awesome_print'
class Speaker
def initialize(first_name, last_name, email, about,
company, tags, registered)
@first_name = first_name
@last_name = last_name
@email = emai... | 30.72973 | 85 | 0.700967 |
d56b13ed32f8538afa7af70e6143574f9702b546 | 1,815 |
# This file is automatically generated by puppet-swagger-generator and
# any manual changes are likely to be clobbered when the files
# are regenerated.
require_relative '../../puppet_x/puppetlabs/swagger/fuzzy_compare'
Puppet::Type.newtype(:kubernetes_env_var_source) do
@doc = "EnvVarSource represents a source... | 24.2 | 227 | 0.624242 |
03ef9ab992eee10d67692a9e8ce29acca399a63a | 2,497 | module Circuitdata
class JsonValidator
class JsonSchemaErrorParser
class << self
def translate_all(errors)
errors.map(&method(:translate)).reject do |error|
error[:problem] == "pattern_mismatch" &&
error[:pattern] == "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{... | 39.015625 | 101 | 0.547457 |
18bcbe50156395ffed7bfbc3cd708534ee1412ac | 4,094 | require 'haml'
require 'haml2erb'
require 'guard/compat/plugin'
require 'guard/haml/notifier'
module Guard
class Haml < Plugin
def initialize(opts = {})
@patterns = []
opts = {
notifications: true,
default_ext: 'erb',
auto_append_file_ext: true,
help... | 27.85034 | 108 | 0.609917 |
9168c9ad801029524b3960b28c18abd6e1d5c8a7 | 16,268 | # frozen_string_literal: true
# Copyright 2020 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... | 49.446809 | 204 | 0.6664 |
f743ebc21b4a914b4ea45a11ba621f98fb2d6246 | 339 | class Client < ApplicationRecord
has_secure_password
has_one :account
validates :email, presence: true, uniqueness: true
validates :email, format: {with: URI::MailTo::EMAIL_REGEXP}
validates :password, length: {minimum: 6}, if: -> {new_record? || !password.nil?}
validates_presence_of :name, :email, :cpf, :... | 37.666667 | 83 | 0.740413 |
1a47cd970639219322febd25eb52fe6b2b9a51b9 | 2,019 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop check for uses of `Object#freeze` on immutable objects.
#
# NOTE: Regexp and Range literals are frozen objects since Ruby 3.0.
#
# @example
# # bad
# CONST = 1.freeze
#
# # ... | 28.842857 | 79 | 0.525012 |
e9bc749a1e7ae0eda3aeaa97f2b95054f7456387 | 557 | unified_mode true
property :add_type, Hash,
default: { 1 => 'text/html .shtml' },
description: ''
property :add_output_filter, Hash,
default: { 1 => 'INCLUDES .shtml' },
description: ''
action :create do
template ::File.join(apache_dir, 'mods-available', 'include.conf') do
s... | 22.28 | 71 | 0.662478 |
2179e6a09e1ecae98983897e1355738717360df7 | 2,789 | # -*- encoding: utf-8 -*-
#
module Brcobranca
module Boleto
class Banrisul < Base # Banrisul
validates_length_of :agencia, maximum: 4, message: 'deve ser menor ou igual a 4 dígitos.'
validates_length_of :conta_corrente, maximum: 8, message: 'deve ser menor ou igual a 8 dígitos.'
validates_length... | 32.811765 | 104 | 0.619218 |
6ad7db81ab71f0f568ed8a60b66ecfe0a892dadb | 1,327 | lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'stravid/fraction/version'
Gem::Specification.new do |spec|
spec.name = 'stravid-fraction'
spec.version = Stravid::Fraction::VERSION
spec.authors = ['David Strauß']
spec.email = [... | 41.46875 | 87 | 0.669932 |
217091c1dec27e4cdcfd4481cb85474a717274e8 | 1,286 | class BoostBuild < Formula
desc "C++ build system"
homepage "https://www.boost.org/build/"
url "https://github.com/boostorg/build/archive/2016.03.tar.gz"
sha256 "1e79253a6ce4cadb08ac1c05feaef241cbf789b65362ba8973e37c1d25a2fbe9"
head "https://github.com/boostorg/build.git"
bottle do
cellar :any_skip_re... | 33.842105 | 93 | 0.722395 |
116a5adf8e4184d8de95b5d1c0a462c755d37278 | 1,842 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Dor::Workflow::Response::Process do
let(:parent) { Dor::Workflow::Response::Workflow.new(xml: xml) }
subject(:instance) { parent.process_for_recent_version(name: 'start-assembly') }
describe '#pid' do
subject { instance.pid }
let(:xml)... | 23.615385 | 82 | 0.611835 |
f8732200d6aa93d693447541bec498e0d07d9ac1 | 2,934 | require "spec_helper"
describe 'Default URIs' do
before(:each) {Spira.repository = RDF::Repository.new}
context "classes with a base URI" do
before :all do
class ::BaseURITest < Spira::Base
configure :base_uri => "http://example.org/example"
property :name, :predicate => RDF::RDFS.labe... | 29.636364 | 101 | 0.653715 |
61f98ddb48aa622d0ddb109a6b1b97223becc828 | 647 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules ... | 43.133333 | 89 | 0.772798 |
d545899366e8ac92485d5ca8bad1b2875ff29cc3 | 393 | require 'engineyard-cloud-client/models/api_struct'
require 'engineyard-cloud-client/models/account'
require 'engineyard-cloud-client/models/keypair'
module EY
class CloudClient
class User < ApiStruct.new(:id, :name, :email)
def accounts
EY::CloudClient::Account.all(api)
end
def keypai... | 21.833333 | 51 | 0.689567 |
e2ea63893a45985e4d996b65696c9a13b268bec9 | 3,151 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe CommitEntity do
let(:signature_html) { 'TEST' }
let(:entity) do
described_class.new(commit, request: request)
end
let(:request) { double('request') }
let(:project) { create(:project, :repository) }
let(:commit) { project.commit }
s... | 27.640351 | 129 | 0.690574 |
7adc304d2ba3c913448db34d115a146d2ceba2ad | 2,265 | module SessionsHelper
# Logs in the given user
def log_in(user)
session[:user_id] = user.id
end
# Remembers a user in a persistent session
def remember(user)
user.remember
cookies.permanent.signed[:user_id] = user.id
cookies.permanent[:remember_token] = user.remember_token
end
# R... | 23.350515 | 73 | 0.663576 |
875c808c653f9bf81d731d5c956d599c073ea8ed | 1,261 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
# require "active_record/railtie"
# require "active_storage/engine"
require "action_controller/railtie"
# require "action_mailer/railtie"
require "action_view/railtie"
# require "action_c... | 35.027778 | 82 | 0.770817 |
e8e3987413481e6951f5012600e9de68cd90ea23 | 133 | require 'rails_helper'
RSpec.describe EvaluatorWorker, type: :worker do
pending "add some examples to (or delete) #{__FILE__}"
end
| 26.6 | 56 | 0.766917 |
b90c6e3b98bd047aa596f2192a0aec6747c100f1 | 2,586 | #!/usr/bin/env ruby
require 'optparse'
require 'sys/proctable'
include Sys
class CheckPuppet
VERSION = '0.1'
script_name = File.basename($0)
# default options
OPTIONS = {
:statefile => "/opt/puppetlabs/puppet/cache/state/state.yaml",
:process => "puppet",
:interval => 30,
}
OptionParser.... | 20.854839 | 155 | 0.583527 |
f8df1a61412de6ea0d4ae8b104c761b1529da30b | 8,115 | require 'puppet'
require 'facter'
require 'facterdb'
require 'json'
require 'mcollective'
# The purpose of this module is to simplify the Puppet
# module's RSpec tests by looping through all supported
# OS'es and their facts data which is received from the FacterDB.
module RspecPuppetFacts
# Use the provided options... | 36.227679 | 111 | 0.668022 |
39b337a0869d8dbb71d87f42bf6d14a77e02352b | 224 | class AddUuidToCurrencyAliases < ActiveRecord::Migration
def change
add_column :currency_aliases, :uuid, :uuid, null: false, default: 'uuid_generate_v4()'
add_index :currency_aliases, :uuid, unique: true
end
end
| 32 | 90 | 0.758929 |
03e34ffcec2bbdd5aa9dfd39ab337040790509e6 | 514 | cask 'papers' do
version '3.4.7,527'
sha256 'a3772fad2fc4c5c273b597e136d7ba07e9f19c88b401d481f760697beb70ebe4'
url "http://appcaster.papersapp.com/apps/mac/production/download/#{version.after_comma}/papers_#{version.before_comma.no_dots}_#{version.after_comma}.dmg"
appcast 'https://appcaster.papersapp.com/apps... | 39.538462 | 156 | 0.785992 |
113e96a58f6296eb50aa4352e2a15bed3a923fec | 3,193 | Puppet::Parser::Functions::newfunction(
:foreach,
:type => :rvalue,
:arity => 2,
:doc => <<-'ENDHEREDOC') do |args|
Applies a parameterized block to each element in a sequence of selected entries from the first
argument and returns the first argument.
This function takes two mandatory arguments: the first should... | 33.260417 | 155 | 0.674601 |
79e1eae1005f44429845bece3377dbf3de7b31e1 | 446 | require 'spec_helper'
require 'hamster/list'
describe Hamster::List do
describe "#to_list" do
[
[],
["A"],
["A", "B", "C"],
].each do |values|
describe "on #{values.inspect}" do
before do
@original = Hamster.list(*values)
@result = @original.to_list
... | 13.515152 | 43 | 0.508969 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.