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 |
|---|---|---|---|---|---|
79f3e22eb8a501387b5f39bafb6f05020b2f5486 | 1,275 | require 'spec_helper'
require 'active_model/form_object/validators/nested_validator'
describe ActiveModel::FormObject::Validators::NestedValidator do
subject { described_class.new(:attributes => {:foo => :bar}) }
let(:user) do
u = mock_model('User')
allow(u).to receive(:valid?)
u
end
let(:model_i... | 29.651163 | 92 | 0.671373 |
b9425ba7560faff28011857770fc95c8846377b4 | 250 | class CreateWorkHistories < ActiveRecord::Migration
def change
create_table :work_histories do |t|
t.integer :resume_id
t.string :company_name
t.date :from
t.date :until
t.timestamps null: false
end
end
end
| 19.230769 | 51 | 0.668 |
334237ddafa840ada0595d062c17107bdf66b75d | 89 | require 'capistrano-ssh-helpers/forward_agent'
require 'capistrano-ssh-helpers/git_host'
| 29.666667 | 46 | 0.842697 |
ab8d2d0358161c69869d003b6eea15e4b59a0273 | 197 | class CreateTweetsTable < ActiveRecord::Migration[6.0]
def change
create_table :tweets do |t|
t.text :content
t.integer :user_id
t.timestamps null: false
end
end
end
| 17.909091 | 54 | 0.664975 |
1cadf8fbd8db2e942b49adbebb96f4151113bc38 | 1,103 | module Geo::DefaultValueObject
def self.call
[{"description"=>"New York, NY, United States",
"place_id"=>"ChIJOwg_06VPwokRYv534QaPC8g",
"terms"=>
[{"offset"=>0, "value"=>"New York"},
{"offset"=>10, "value"=>"NY"},
{"offset"=>14, "value"=>"United States"}],
"types"=>["lo... | 39.392857 | 80 | 0.550317 |
87adb9444c85677e895786c755b1c7e0442d44e8 | 157 | require 'object_protocol'
require_relative 'protocols/logging'
require_relative 'protocols/parallel_requests'
require_relative 'protocols/critical_section'
| 26.166667 | 46 | 0.872611 |
f7a0ded6864ca2bc455c51c528d08e8ed8738f1b | 449 | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require 'timeout'
require "simplecov"
SimpleCov.start do
track_files '{lib}/**/*.rb'
add_filter "/test/"
end
require "minitest/autorun"
require "minitest/reporters"
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new(... | 23.631579 | 66 | 0.74833 |
f78e4ea7e157e18b16a9fe09d456d02acd196cdd | 122 | class AddCustomImageToUser < ActiveRecord::Migration
def change
add_column :users, :custom_image, :string
end
end
| 20.333333 | 52 | 0.770492 |
395ea05c665368636c7b6b5a103120e384187fbe | 731 | Sequel.migration do
up do
# consumer_id and provider_id are redundant by avoid making extra joins when creating views
rows = from(:verifications).select_group(
Sequel[:verifications][:consumer_id],
Sequel[:verifications][:pact_version_id],
Sequel[:verifications][:provider_id],
... | 38.473684 | 95 | 0.742818 |
184bf8b24a477bda06f46daa42bac4f4a1b03b9d | 5,340 | 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.132231 | 114 | 0.765543 |
d50cf684d89fb6a5b027718879eee99b472cd2d4 | 713 | class Jubjub::Pubsub::AffiliationCollection
attr_reader :jid, :node
include Jubjub::Helpers::Collection
def initialize(jid,node,connection)
@jid = Jubjub::Jid.new jid
@node = node
@connection = connection
end
def [](jid_num)
case jid_num
when Fixnum
list[jid_num]
when Jubjub:... | 22.28125 | 118 | 0.645161 |
08e726aab4dfa19d52220c026a65bd0a01eecc34 | 1,366 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.nic.org.uy/status_available.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
require 'w... | 22.393443 | 83 | 0.668375 |
1ca274ba86e3beaa087998a57fe6bca6f681ed3b | 3,050 | # 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 =>... | 27.477477 | 128 | 0.654098 |
26b215817313154946d72e43d968e3b0acc8427b | 1,339 | module LetsFreckle
# ClientResource should be extended by resource classes in order to gain
# access to HTTP methods.
module ClientResource
def get(resource, options = {})
get_single = options.delete(:single)
response = client.get do |request|
request.url relative_path_for(resource), opt... | 24.796296 | 91 | 0.64003 |
6a97e4d17881dc3812a50a9cfd269a9faa9feaff | 648 | require 'rails/generators'
module Pageflow
module Generators
class ErrorPagesGenerator < Rails::Generators::Base
desc 'Generate error pages.'
source_root File.expand_path('../templates', __FILE__)
def create_not_found
copy_file '404.html', 'public/pageflow/error_pages/404.html'
... | 23.142857 | 74 | 0.679012 |
336c094ca53ca38e896eb09695537971f790a037 | 454 | require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the OrdenRequestsHelper. For example:
#
# describe OrdenRequestsHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# ... | 28.375 | 71 | 0.720264 |
e95f4eb8c6b5e148702da83e0b31045c7dcf1249 | 2,528 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'metasploit/framework/credential_collection'
require 'metasploit/framework/login_scanner/octopusdeploy'
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remo... | 32.831169 | 108 | 0.671677 |
1de06dbe02af69864b9139408ba6a624df312df7 | 1,256 | {
matrix_id: '394',
name: 'cavity15',
group: 'DRIVCAV',
description: 'Driven Cavity 15 x 15, Reynolds number: 1000',
author: 'A. Chapman',
editor: 'A. Baggag, Y. Saad',
date: '1996',
kind: 'subsequent computational fluid dynamics problem',
problem_2D_or_3D: '1',
num_rows: '2597'... | 30.634146 | 133 | 0.65207 |
5d3bd584efdd9dc60f30aa87271a3f29bc160cd1 | 2,073 | test_name 'Windows ACL Module - Explicit Inheritance of "allow" Parent Permissions for Directory'
confine(:to, :platform => 'windows')
#Globals
rights = 'full'
perm_type = 'allow'
asset_type = 'dir'
child_inherit_type = 'true'
parent_name = 'temp'
target_name = "inherit_#{perm_type}_on_#{asset_type}"
target_child_na... | 22.78022 | 97 | 0.627593 |
1d558b1215fc94e73b00c22222ee3eba6a90da3d | 527 | FactoryGirl.define do
factory :base_user, class: User do
sequence(:email) { |_n| "email-#{srand}@test.com" }
password 'a password'
password_confirmation 'a password'
factory :user do
after(:create) { |user| user.remove_role(:admin) }
end
factory :admin do
after(:create) { |user| ... | 21.958333 | 58 | 0.628083 |
03bfcc9060de0e23c362b44b65b98cb902e10c74 | 2,316 | require 'test_helper'
class PasswordResetsTest < ActionDispatch::IntegrationTest
def setup
ActionMailer::Base.deliveries.clear
@user = users(:michael)
end
test "password resets" do
get new_password_reset_path
assert_template 'password_resets/new'
# Invalid email
post password_resets_pat... | 36.761905 | 81 | 0.667098 |
28af4e90efe050efd6cc2085bd55ccd492bf8fa9 | 325 | require 'webmock/rspec'
require 'pry'
if ENV['CODECLIMATE_REPO_TOKEN']
require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
end
if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start
end
require 'omnidesk_api'
WebMock.disable_net_connect!(allow: 'codeclimate.com')
RSpec.configure do |config|... | 16.25 | 54 | 0.775385 |
b9fa6fadc2ce240b037c72ab4c4aab5ad909e51c | 1,416 | class AndroidV1::QuizContentSerializer < ActiveModel::Serializer
attribute :id
attribute :priority
attribute :type
attribute :title
attribute :content
attribute :comments
attribute :choices, if: 'object.is_a?(MultipleChoiceQuestion)'
attribute :answer, unless: 'object.is_a?(Header)'
attribute :explan... | 22.125 | 94 | 0.626412 |
f881f823e8faf7d4462434c99b4f398a1ec7f1b8 | 281 | class TaxYear < ApplicationRecord
belongs_to :user
has_many :checks
has_many :employers, through: :checks
validates :year, uniqueness: {scope: :user_id}
def self.employer_gigs(tax_year, employer)
tax_year.checks.select do |check|
check.employer == employer
end
end
end
| 20.071429 | 46 | 0.765125 |
399f080042ef5d1067c368628c1477ea5442c9b5 | 1,467 | class Doxygen < Formula
desc "Generate documentation for several programming languages"
homepage "https://www.doxygen.nl/"
url "https://doxygen.nl/files/doxygen-1.9.4.src.tar.gz"
mirror "https://downloads.sourceforge.net/project/doxygen/rel-1.9.4/doxygen-1.9.4.src.tar.gz"
sha256 "a15e9cd8c0d02b7888bc8356eac20... | 29.34 | 115 | 0.682345 |
3918eb093d9c0e5b7403199fe00677e088393464 | 298 | require 'ffwd/event'
describe FFWD::Event do
it "should be possible to access key" do
expect(described_class.make(:key => :key).key).to eq(:key)
end
it "should be sparsely serializable through to_h" do
expect(described_class.make(:key => :key).to_h).to eq({:key => :key})
end
end
| 24.833333 | 73 | 0.684564 |
395fad28eb6dc9ad6d14ed2bfa9b131c9a6697c6 | 16,351 | require "set"
require_relative "thor/base"
class Bundler::Thor
class << self
# Allows for custom "Command" package naming.
#
# === Parameters
# name<String>
# options<Hash>
#
def package_name(name, _ = {})
@package_name = name.nil? || name == "" ? nil : name
end
# Sets the ... | 31.749515 | 123 | 0.637759 |
1a4c71bf17a2b4461068db957c3c67c18372cebb | 43 | module JlaViewTool
VERSION = "0.1.0"
end
| 10.75 | 19 | 0.697674 |
5dfd0884784bff1bd3c44c47e184d4c6f8a779d5 | 2,909 | require 'spec_helper'
module Taxger
describe Einkommensteuer do
it 'raises an error on unsupported years' do
expect{ Einkommensteuer.calculate(2009, 0) }.to raise_exception(Einkommensteuer::Error)
end
# Reference values taken from https://www.bmf-steuerrechner.de/ekst/
[
[2010, 5_000_0... | 38.276316 | 93 | 0.552424 |
875d9240a263950b28d2f9d221d95426dabde810 | 504 | module VCAP::CloudController
class AppDropletsListFetcher
def fetch(app_guid, pagination_options, message)
dataset = DropletModel.select_all(:v3_droplets).where(app_guid: app_guid)
filter(pagination_options, message, dataset)
end
private
def filter(pagination_options, message, dataset)
... | 26.526316 | 79 | 0.728175 |
33e60f7d375b60e3a52818f814d417c050661195 | 14,460 | # frozen_string_literal: true
# Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render inv... | 48.2 | 154 | 0.751729 |
bb0bbbbe7bca4910cab609dddbe3f87e50f417b1 | 713 | class Flashcard < ApplicationRecord
include PgSearch::Model
multisearchable against: [:title, :prompt, :answer], if: :search_visible?
validates :title, presence: true
validates :prompt, presence: true
validates :answer, presence: true
belongs_to :deck, counter_cache: true
has_many :attempts,
-> { or... | 19.805556 | 75 | 0.719495 |
613b288f537fa183595d6ce97bed35dfe311e682 | 3,043 | module ActiveRecord
class Base
def self.caches_via_mvcoffee(child, opts = {})
# This is a bunch of crazy metaprogramming!
# Ideally this will work now matter how they supply the child name.
# It could be a string or symbol, singular or plural.
# We normalize it to a plural string he... | 38.0375 | 86 | 0.64443 |
91e60e26f086ef60c93e773904761943aee172ff | 18,985 | require 'redmine/scm/adapters/abstract_adapter'
# XitoliteAdapter inherits from GitAdapter but some classes which are define directly in GitAdapter are not inherited
# (GitBranch, ScmCommandAborted and maybe others) so it raises NameError exception.
# To fix this I had to reimplement (copy/past) the whole GitAdapter c... | 33.132635 | 118 | 0.490176 |
f77b80738fcf94853dda624edb485488e0ca5724 | 1,589 | #
# Be sure to run `pod lib lint UHCategory.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'UHCategor... | 36.953488 | 101 | 0.636249 |
1c80f72c8bf20c89456ad8bfda9457963818f0ae | 599 | require 'test_helper'
module Elastic
module Test
class WatcherRestartTest < ::Test::Unit::TestCase
context "Watcher: Restart" do
subject { FakeClient.new }
should "perform correct request" do
subject.expects(:perform_request).with do |method, url, params, body|
asser... | 22.185185 | 79 | 0.604341 |
e90ef6a7562d96b7214b082ac70c88c406316dc7 | 2,862 | # EffectivePages Rails Engine
EffectivePages.setup do |config|
config.pages_table_name = :pages
config.menus_table_name = :menus
config.menu_items_table_name = :menu_items
# The directory where your page templates live
# Any files in this directory will be automatically available when
# creating/editting ... | 38.16 | 110 | 0.738644 |
e8decfcaa8e73eee6193c3bd3cfc74eb75e8c28a | 8,392 | require "os/linux/glibc"
class GccAT9 < Formula
desc "GNU compiler collection"
homepage "https://gcc.gnu.org/"
url "https://ftp.gnu.org/gnu/gcc/gcc-9.3.0/gcc-9.3.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-9.3.0/gcc-9.3.0.tar.xz"
sha256 "71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d... | 33.301587 | 115 | 0.640014 |
18955409b6333deaad34da8edfdb0a347a9eb772 | 333 | require File.expand_path('../../../../spec_helper', __FILE__)
require File.expand_path('../spec_helper', __FILE__)
require File.expand_path('../fixtures/server', __FILE__)
require File.expand_path('../shared/putbinaryfile', __FILE__)
describe "Net::FTP#putbinaryfile" do
it_behaves_like :net_ftp_putbinaryfile, :putbi... | 37 | 61 | 0.768769 |
26bf5287bd954092614c4073a8db24215353b33f | 443 | module Medicaid
class ContactMailingAddress < Step
step_attributes(
:street_address,
:street_address_2,
:city,
:zip,
)
validates :street_address,
presence: { message: "Make sure to provide a street address" }
validates :city,
presence: { message: "Make sure to pro... | 22.15 | 76 | 0.634312 |
1a497818db425ee99964b5eeeba1027e9980ed68 | 875 | require 'bio-ucsc'
describe "Bio::Ucsc::Hg19::WgEncodeUwAffyExonArrayHmvecdbladSimpleSignalRep1" do
describe "#find_by_interval" do
context "given range chr1:1-20,000" do
it "returns an array of records" do
Bio::Ucsc::Hg19::DBConnection.default
Bio::Ucsc::Hg19::DBConnection.connect
... | 35 | 102 | 0.675429 |
e8765c48119d4403f5aa8d5ec47e14b1decf144b | 383 | cask 'fbreader' do
version '0.99.5-alpha'
sha256 'c05e23d66942b49533e0eabc9d39e2062c9a11086369c31b417a1937ac5886f9'
url "http://fbreader.org/files/macos/FBReader%20#{version.gsub(/-/, '%20')}.dmg"
name 'FBReader'
homepage 'https://fbreader.org/content/macos'
license :gpl
app 'FBReader.app'
zap :delet... | 23.9375 | 82 | 0.642298 |
bfab36e3cb2954cc76a81758dc61da0bf391cd84 | 1,997 | class GoJsonnet < Formula
desc "Go implementation of configuration language for defining JSON data"
homepage "https://jsonnet.org/"
url "https://github.com/google/go-jsonnet/archive/v0.17.0.tar.gz"
sha256 "4fd04d0c9e38572ef388d28ea6b1ac151b8a9a5026ff94e3a68bdbc18c4db38a"
license "Apache-2.0"
head "https://g... | 36.309091 | 122 | 0.671507 |
26380ce2034ac0e2306a3344495dbf4c67ad1368 | 2,157 | require 'cocoapods-mtxx-bin/helpers'
module Pod
class Command
class Bin < Command
class Spec < Bin
class Create < Spec
self.summary = '创建二进制 spec'
self.description = <<-DESC
根据源码 podspec 文件,创建对应的二进制 podspec 文件.
DESC
def self.options
[... | 29.148649 | 127 | 0.51924 |
28011d64088ad414b11f29309e8cf9cbbc331229 | 824 | cask 'dynamodb-local' do
version :latest
sha256 :no_check
# s3-us-west-2.amazonaws.com/dynamodb-local was verified as official when first introduced to the cask
url 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz'
name 'Amazon DynamoDB Local'
homepage 'https://docs.aws.amazo... | 31.692308 | 104 | 0.705097 |
031bf5add2395a02a659e98a33ec15a3023119da | 236 | require_relative "./password_generator/version"
require_relative "./password_generator/cli"
require_relative "./password_generator/generator"
module PasswordGenerator
class Error < StandardError; end
# Your code goes here...
end
| 21.454545 | 49 | 0.800847 |
2842f43c128caa78029ffb6cf5165ba7218c0ab6 | 4,165 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'V1::Activities', type: :request do
describe 'GET /v1/activities' do
let(:headers) { xhr_header }
let(:params) do
{
start: 1.day.ago,
end: Time.zone.now
}
end
before do
login
get '/v1/activit... | 22.513514 | 72 | 0.606242 |
61b6a5c0a0c74e0abec6d56706b3e7897f77f501 | 3,672 | class BoostPython3 < Formula
desc "C++ library for C++/Python3 interoperability"
homepage "https://www.boost.org/"
url "https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.bz2"
mirror "https://dl.bintray.com/homebrew/mirror/boost_1_74_0.tar.bz2"
sha256 "83bfc1507731a0906e387fc28b7ef5417d591... | 37.469388 | 110 | 0.63317 |
4ac2d9c0d0c9d68d57c486b7bb0ea78a84c183f8 | 2,083 | # frozen_string_literal: true
module Bolt
class Plugin
class Task
def hooks
hook_descriptions.keys
end
def hook_descriptions
{
puppet_library: 'Run a task to install the Puppet agent package.',
resolve_reference: 'Run a task as a plugin.',
validate... | 28.534247 | 108 | 0.614498 |
ac73a65c9506537bc15f708375f473352dc7280c | 973 | require_relative './lib/DFS_player_rankings/version'
Gem::Specification.new do |s|
s.name = 'DFS-player-rankings'
s.version = DFSPlayerRankings::VERSION
s.date = '2017-09-19'
s.summary = "Top ranked DFS players in the world"
s.description = "Provides details on the top DFS players in th... | 44.227273 | 182 | 0.687564 |
bb004dfedd24762125ae33cef0b5164ad4318416 | 399 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Synapse::Mgmt::V2019_06_01_preview
module Models
#
# Defines values for QueryAggregationFunction
#
module QueryAggregationFunction
Min =... | 22.166667 | 70 | 0.674185 |
e8ffaf38842f77ab95fac0c472ada5307ce30c29 | 214,022 | # 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 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins/credentials_configuration.rb'
... | 42.506852 | 205 | 0.662441 |
1c833b6192bb016361d9272eecb9848867b01364 | 1,219 | # frozen_string_literal: true
# @api public
# @since 0.1.0
class MetaStruct::Graph::Node
require_relative 'node/uuid_generator'
require_relative 'node/factory'
class << self
# @option uuid [String, nil]
# @option labels [Array<String,Symbol>]
# @option properties [Hash<String|Symbol,Any>]
# @ret... | 22.163636 | 114 | 0.652994 |
e88f607bdee0981a0ae520a269694e7afa0baabb | 1,064 | # frozen_string_literal: true
require 'json_errors/config'
RSpec.describe JsonErrors do
it 'has a version number' do
expect(JsonErrors::VERSION).not_to be nil
end
describe '#config' do
it 'returns proper config object' do
expect(JsonErrors.config).to eq(JsonErrors::Config.instance)
end
end
... | 24.744186 | 66 | 0.666353 |
394c6fe45afcd203cfcdcf039adf46a4ef4bcc38 | 119 | require 'test_helper'
class OfferTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 14.875 | 41 | 0.697479 |
01c680169828d585b8eb0c8253f7a90aaeab4f93 | 1,177 | # Send chunks back based on chunk indexes requested (subject to distance/admin validation)
# indexes: array of chunk indexes
class BlocksRequestCommand < BaseCommand
data_fields :indexes
def execute
# TODO: Admin lockdown
benchmark = Benchmark.measure do
player.add_active_indexes indexes
chun... | 28.707317 | 112 | 0.699235 |
21279ce584d820a1ce9ef61593b8974fce149507 | 1,674 | #
# Be sure to run `pod lib lint LoginAndRegister.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'Lo... | 38.045455 | 109 | 0.64994 |
91009e4c32c4485d70866147c171f59e8de7c2c8 | 762 | # frozen_string_literal: true
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 Juno2
class Application < Rails::Application
# Initialize configuration defaults for... | 31.75 | 82 | 0.761155 |
2619bc686df5fdae0fa70b5fc71a57ec469915d7 | 977 | module SpecInfra
module Command
class Arch < Linux
def check_access_by_user(file, user, access)
"runuser -s /bin/sh -c \"test -#{access} #{file}\" #{user}"
end
def check_enabled(service, level)
level = "multi-user.target" if level == 3
"systemctl --plain list-dependencie... | 25.051282 | 92 | 0.574207 |
accb4d8c13603ef000415d98215873483229b919 | 407 | # 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::V2019_12_01
module Models
#
# Defines values for OperatingSystemStateTypes
#
module OperatingSystemStateTypes... | 23.941176 | 70 | 0.724816 |
28ba6aa07727206ff36c97bae198c98a9ee9e72d | 3,197 | class AzureStorageCpp < Formula
desc "Microsoft Azure Storage Client Library for C++"
homepage "https://azure.github.io/azure-storage-cpp"
url "https://github.com/Azure/azure-storage-cpp/archive/v6.1.0.tar.gz"
sha256 "a0b6107372125f756783bf6e5d57d24e2c8330a4941f4c72e8ddcf13c31618ed"
bottle do
cellar :any... | 35.921348 | 147 | 0.678136 |
d5fdaa9d13f0bfd529fbad03e218dff5e725ca1a | 5,552 | =begin
#SendinBlue API
#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/or... | 49.571429 | 839 | 0.726405 |
3855e8472189a53a8053244929c74dcfac408360 | 553 | require 'elpresidente/version'
require 'active_support/all'
require 'async/container'
require 'async/container/notify'
require 'async/semaphore'
require 'async/clock'
require 'async/barrier'
require 'async/http/internet'
require 'slack-ruby-client'
require 'async/redis'
require 'google_drive'
require 'nokogiri'
require... | 19.068966 | 40 | 0.77396 |
1ddd1cca02e7d1bcc3c3e72a233e195886672a94 | 2,542 | # frozen_string_literal: true
module Metanol
module Meta
class Base
ERR_FILTERS_WRONG_TYPE = 'The <filters> parameter must be an Array.'
ERR_FILTERS_WRONG_VALUE_TYPE =
'The <filters> parameter must include only string or symbol values.'
SUPPORTED_FILTERS = %i[html overspaces whitespaces... | 25.168317 | 100 | 0.602282 |
628f98efb1b1b265eb1acc83fdb0f3bb96537cd6 | 7,017 | class RemoveMigrationFeature < ActiveRecord::Migration[6.0]
class ServiceTemplate < ActiveRecord::Base
self.inheritance_column = :_type_disabled
end
class MiqRequest < ActiveRecord::Base
self.inheritance_column = :_type_disabled
end
class MiqRequestTask < ActiveRecord::Base
self.inheritance_colu... | 43.314815 | 150 | 0.727234 |
0194ac98cda24c51045fb96d98c125e51edd3f0b | 40 | module StaffBar
VERSION = '0.2.0'
end
| 10 | 19 | 0.675 |
e934c01e9321cd21ce159319331ebb7b0991b28f | 144 | def upgrade ta, td, a, d
a['use_dvr'] = ta['use_dvr']
return a, d
end
def downgrade ta, td, a, d
a.delete('use_dvr')
return a, d
end
| 12 | 30 | 0.604167 |
f8745ff636cd9325f96860921959969753f2b30f | 281 | Rails.application.routes.draw do
devise_for :users, controllers: { registrations: 'registrations' }
resources :tweeets, only: %i[new create index]
root 'tweeets#index'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
| 35.125 | 101 | 0.758007 |
bfc839c6386992a33e2d1e1b3ee14b247e5cf9a4 | 1,251 | # 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::ServiceFabric::V6_3_0_9
module Models
#
# Represents a safety check for the seed nodes being performed by service
# fabric befor... | 24.057692 | 77 | 0.565947 |
625aa20a48e9e6623c996224241f9a2ccf4d0961 | 289 | # frozen_string_literal: true
require "metanorma/document/basic_document/textelements/text_element"
module Metanorma; module Document; module BasicDocument
# Emphasised text. Corresponds to HTML `em`, `i`.
class EmphasisElement < TextElement
register_element
end
end; end; end
| 26.272727 | 69 | 0.788927 |
6222151c6c9a2702d0778d31efd677a6527c4a80 | 6,787 | class ManagerRefresh::InventoryCollectionDefault
class << self
def vms(extra_attributes = {})
attributes = {
:model_class => ::Vm,
:association => :vms,
:delete_method => :disconnect_inv,
:attributes_blacklist => [:genealog... | 33.433498 | 141 | 0.542655 |
62890148e69ed84ea8d689d9e79c510c32a24e90 | 1,310 | # frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = "beautiful-jekyll-theme"
spec.version = "5.0.0"
spec.authors = ["Dean Attali"]
spec.email = ["daattali@gmail.com"]
spec.summary = "Beautiful Jekyll is a ready-to-use Jekyll theme to help you create ... | 43.666667 | 219 | 0.678626 |
f8a02c6728f3485dea87104cceba28ef35e240d3 | 1,406 | # require 'pry'
class Cli
def menu
Brewfinder.new.breweries
running_loop
# puts "option 1: see a list of Breweries"
# #other options to be updated and created later.
# # puts "option 2: search a Brewery by Name"
# # puts "option 3: search a Brewer... | 27.038462 | 84 | 0.544808 |
2178b84dec06c04ec81011007c9a3adda7d6bedc | 133 | # frozen_string_literal: true
# Main module to encapsulate logic
module Envlogic
# Current version of gem
VERSION = '1.1.3'
end
| 16.625 | 34 | 0.744361 |
e273db70fea34dc1101e6141952c455737c53091 | 63 | class RtThing < ThingsRecord
self.table_name = 'ZTHING'
end
| 12.6 | 28 | 0.746032 |
bb94796dc35a588eb35b5bd1d6edb6fbb80488d0 | 5,216 | require 'spec_helper'
if defined?(ActionController) && defined?(Rails)
describe UsersController do
describe "rails setup" do
it 'should capture the CSV renderer provided by Rails' do
mock_users = [mock_model(User), mock_model(User)]
User.stub!(:all).and_return(mock_users)
mock_u... | 32.397516 | 167 | 0.567293 |
abc0ee6096d8ac211a947f10bcd35cec6a9670c1 | 1,026 | require 'spec_helper'
describe 'heat::wsgi::apache_api' do
shared_examples_for 'heat::wsgi::apache_api' do
context 'default parameters' do
it { is_expected.to contain_class('heat::wsgi::apache_api') }
it { is_expected.to contain_heat__wsgi__apache('api').with(
:port => 8004,
... | 25.65 | 67 | 0.521442 |
f84dc976903ee770fe036234112f284890e46fbf | 6,090 | # 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::V2019_12_01
module Models
#
# Parameters that define the operation to create a connection monitor.
#
class Co... | 33.278689 | 87 | 0.487356 |
337f0f433e3c5c247df4b7452af11c46a117e03b | 2,256 | require 'spec_helper'
RSpec.describe 'Service Broker API integration' do
describe 'v2.11' do
include VCAP::CloudController::BrokerApiHelper
let(:catalog) do
catalog = default_catalog(plan_updateable: true)
catalog[:services].first[:plans].first[:bindable] = plan_bindable
catalog[:services]... | 26.541176 | 116 | 0.648936 |
1c02412a3fcb57d65440adaa3d8c573c6993b220 | 100 | class ViewType < Enumeration
has_and_belongs_to_many :listings, foreign_key: "enumeration_id"
end
| 25 | 66 | 0.83 |
03fe4bed164c314dbc6ca4e17748acf509edc984 | 1,841 | # -*- encoding: utf-8 -*-
# stub: web-console 3.5.1 ruby lib
Gem::Specification.new do |s|
s.name = "web-console".freeze
s.version = "3.5.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Charlie S... | 43.833333 | 154 | 0.665399 |
b97e15e7a21ff79a9099260e4ec0421812cc0fa4 | 121,457 | # 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 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins/credentials_configuration.rb'
... | 47.667582 | 213 | 0.638234 |
335cafc3888bc0f1f3cc592b3bdbe956885f75c5 | 21 | require 'spec_helper' | 21 | 21 | 0.857143 |
33886d2a9e5913b0fd83e22e6dee168875071c42 | 180 | # frozen_string_literal: true
def plain_def_in_nested_dir
{
'env_file' => __FILE__,
'env_lineno' => __LINE__,
'real_file' => 'dir2/dir3/plain_def_in_dir.rb'
}
end
| 18 | 50 | 0.683333 |
f7b52360170f703fc565e6de7d31a92cd97d0436 | 757 | # typed: true
class NormalClass
def normal_method
end
def self.normal_static_method
end
class InnerClass
end
module InnerModule
end
end
module ANamespace
class ObviousChild
end
end
class ANamespace::ClassInNamespace
end
class Parent
end
module Mixin
end
module OtherMixin
end
class Child < Parent
... | 21.027778 | 94 | 0.698811 |
f775454b81bf519c601782a1095a69f90d13ef82 | 1,229 | require "berkshelf/api_client/remote_cookbook"
require "berkshelf/cached_cookbook"
module Berkshelf
# Shim to look like a Berkshelf::APIClient but for a chef repo folder.
#
# @since 6.1
class ChefRepoUniverse
def initialize(uri, **options)
@uri = uri
@path = options[:path]
@options = opti... | 25.604167 | 81 | 0.607811 |
e248cecf8195cdddb4cbfa25a1e1313ad0e4d1f4 | 175 | class DropTablePosition < ActiveRecord::Migration[5.2]
def change
remove_reference :users, :position, foreign_key: true, index: true
drop_table :positions
end
end
| 25 | 70 | 0.754286 |
e240275b50b5bed186633141b457fec0f57b18ac | 1,973 | #
# This class was auto-generated from the API references found at
# https://support.direct.ingenico.com/documentation/api/reference/
#
require 'ingenico/direct/sdk/data_object'
require 'ingenico/direct/sdk/domain/merchant_action'
require 'ingenico/direct/sdk/domain/payment_creation_output'
require 'ingenico/direct/sdk... | 41.104167 | 121 | 0.689812 |
2836a59db0ce5e650c7e0530ba3eac64d3349470 | 2,538 | require "spec_helper"
adapters = [
ExchangeRate::Storage::PStoreAdapter,
ExchangeRate::Storage::MemoryAdapter
]
adapters.each do |adapter_class|
RSpec.describe adapter_class do
let(:config) { ExchangeRate.config }
let(:data) { { date: '2014-02-02', code: 'PIE', rate: '3.14' } }
let(:adapter) { ... | 26.715789 | 75 | 0.579196 |
1cc504be218c881bcdc77d99911bcf5a6319b260 | 176 | # frozen_string_literal: true
require "expense_tracker/app/api"
shared_context "APIHelpers" do
include Rack::Test::Methods
def app
ExpenseTracker::API.new
end
end
| 14.666667 | 33 | 0.755682 |
ed1c77ce5f6f3440e5e864e1e0ab222d13845df3 | 2,207 | ##
# $Id$
##
##
# 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 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank ... | 23.731183 | 108 | 0.581785 |
ffb45a674ae4cf7afbf215c24a8c524f67df71b6 | 1,676 | # frozen_string_literal: true
class Category < ApplicationRecord
belongs_to(:parent,
class_name: 'Category',
inverse_of: :categories,
optional: true,
)
has_many(:categories, -> { order(:display_order, :name) },
class_name: 'Category',
foreign_key: :parent_id,
inverse_of: :parent
)
va... | 29.928571 | 85 | 0.640215 |
18972611aeea1face2fa3aeacf58e0b643e156b1 | 138 | require 'json'
require 'lib/writer/writer'
class JsonWriter < Writer
def write_result(result)
puts JSON.generate(result)
end
end
| 15.333333 | 30 | 0.746377 |
e8a56f4b4946fb111d6bb89f00fff2fa84aa6e55 | 4,565 | require 'any_view'
module Pancake
module Mixins
module Render
class ViewContext
# These are included as modules not for modularization, but because super can be called for the module versions
include ::Tilt::CompileSite
include ::AnyView::TiltBase
class << self
def... | 28.892405 | 119 | 0.551588 |
e22f4306d8e8ead6058915e5d4afef488599409c | 82 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "jnum_to_anum"
| 27.333333 | 58 | 0.743902 |
b90d92013cb42856d46c5b25498b9b086958d7f1 | 513 | cask "moonlight" do
version "3.0.0"
sha256 "bf3bd9739ce12191658ef688a0ed0f7777966b9e5d765012555d6a7a34011b78"
url "https://github.com/moonlight-stream/moonlight-qt/releases/download/v#{version}/Moonlight-#{version}.dmg",
verified: "github.com/moonlight-stream/moonlight-qt/"
appcast "https://github.com/mo... | 32.0625 | 112 | 0.752437 |
03c02aaf4695fd480f4e60a85f91e4ea29103697 | 3,990 | class Gnuplot < Formula
desc "Command-driven, interactive function plotting"
homepage "http://www.gnuplot.info/"
url "https://downloads.sourceforge.net/project/gnuplot/gnuplot/5.2.3/gnuplot-5.2.3.tar.gz"
sha256 "feb58c9358d9d129e00507f3b34d4b13c4caea3f004325c587f8caafe5dbe724"
bottle do
sha256 "9b72f49ce... | 33.529412 | 98 | 0.678446 |
0199daa5e71f0de7210ed929e59cf23472435c0c | 96 | class Type < ApplicationRecord
has_many :eventtypes
has_and_belongs_to_many :events
end
| 19.2 | 35 | 0.791667 |
b94bcd331a7fbcdd777e3951939de438e2af93a9 | 1,135 | module WebMock
module API
extend self
def stub_request(method, uri)
WebMock::StubRegistry.instance.register_request_stub(WebMock::RequestStub.new(method, uri))
end
alias_method :stub_http_request, :stub_request
def a_request(method, uri)
WebMock::RequestPattern.new(method, uri)
... | 35.46875 | 106 | 0.723348 |
bbc7a6d5381f7d21f4e7a4faaa1006a8cb8d5666 | 814 | namespace :deploy do
desc 'Update WordPress template root paths to point to the new release'
task :update_option_paths do
on roles(:app) do
within fetch(:release_path) do
if test :wp, :core, 'is-installed'
[:stylesheet_root, :template_root].each do |option|
# Only change the ... | 38.761905 | 103 | 0.605651 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.