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 |
|---|---|---|---|---|---|
ffe09e63aee5faf69d286ba3a3414aa63851fe2a | 811 | Pod::Spec.new do |s|
s.name = "Localytics-AMP"
s.version = "2.21.0"
s.summary = "Localytics AMP iOS SDK"
s.description = "Localytics analytics and marketing platform"
s.homepage = "http://www.localytics.com"
s.license = {
:type => 'Copyright',
:file => 'LICENSE'
}
s.... | 32.44 | 105 | 0.620222 |
1c7de6c904619f5a95ca27f96a67198b086f69fe | 881 | require "rails_helper"
describe "error handling" do
let(:configuration) { StripeModelCallbacks::Configuration.current }
let!(:stripe_coupon) { create :stripe_coupon, stripe_id: "some-coupon" }
let!(:stripe_customer) { create :stripe_customer, stripe_id: "cus_CGNFgjPGtHlvXI" }
after do
configuration.instan... | 30.37931 | 117 | 0.728717 |
ab4852f2c46764cac7aa8df91909d224c0931ab4 | 3,930 | require 'spec_helper'
class TransactionMailer; end
describe UserService::API::Users do
include UserService::API::Users
include EmailSpec::Helpers
include EmailSpec::Matchers
PERSON_HASH = {
given_name: "Raymond",
family_name: "Xperiment",
email: "Ray@example.com",
password: "test",
loca... | 36.388889 | 117 | 0.71374 |
87dd93cafa73c83882aea0ffd69adc22e872a1d4 | 929 | test_name "should remove directory, but force required"
tag 'audit:high',
'audit:refactor', # Use block style `test_name`
'audit:acceptance'
agents.each do |agent|
target = agent.tmpdir("delete-dir")
step "clean up the system before we begin"
on agent, "rm -rf #{target} ; mkdir -p #{target}"
step "... | 34.407407 | 102 | 0.692142 |
91cc94e662b9c4390a41f74bfedcd7b576a664d6 | 1,687 | # frozen_string_literal: true
describe Travis::Logs::ContentDecoder do
subject { described_class }
context 'when base64-encoded' do
let(:ascii_entry) do
{
'log' => Base64.strict_encode64('hello to the world'),
'encoding' => 'base64'
}
end
let(:bytemess_entry) do
{
... | 24.1 | 75 | 0.61885 |
d5437eb02b1c79ebe4d97659878d7e295e09a5c9 | 320 | require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/fixtures/classes'
describe "Kernel#select" do
it "is a private method" do
Kernel.private_instance_methods.should include("select")
end
end
describe "Kernel.select" do
it "needs to be reviewed for spec completeness"
end
| 24.615385 | 60 | 0.74375 |
7ae1fb84d9d803ff624db06dba141452f83f77ff | 4,799 | require 'ebay/types/country_details'
require 'ebay/types/currency_details'
require 'ebay/types/dispatch_time_max_details'
require 'ebay/types/payment_option_details'
require 'ebay/types/region_details'
require 'ebay/types/shipping_location_details'
require 'ebay/types/shipping_service_details'
require 'ebay/types/site_... | 73.830769 | 132 | 0.754949 |
d5681feca5b07a18725b10e6cc38f8ade5a57078 | 3,052 | module Zuck
# Including this module does three things:
#
# 1. Lets you use `x[:foo]` to access keys of the
# underlying Hash
# 2. Lets you use `x[:foo] = :bar` to set values in
# the underlying Hash
# 3. Lets you define which keys are to be expected in
# the underlying hash. These keys w... | 22.947368 | 73 | 0.569463 |
ff8c123d6b4daae780f29a8efcf9117c4e40a4d4 | 4,733 | class Container < ApplicationRecord
before_create :set_default_values
# Setup transient attributes for your model (attr_accessor)
# e.g.
# attr_accessor :temp
enum statuses: {
pending: 'PENDING',
scheduled: 'SCHEDULED',
provisioned: 'PROVISIONED',
provision_error: 'PROVISION_ERROR',
boots... | 27.517442 | 111 | 0.706951 |
61c3e5bc739e8ce1fdcc74e81117385d8083c571 | 521 | module Sightengine
module Api
module Responses
module Nudity
def self.included(base)
base.class_eval do
attr_accessor :nudity
end
end
def raw_nudity?(min_prob = 0.9)
nudity["raw"].to_f >= min_prob.to_f
end
def partial_nudity... | 20.84 | 49 | 0.539347 |
4ac79f80c90c23f0baae878636c4061c6a8eace0 | 1,489 | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | 37.225 | 95 | 0.748153 |
ab65a344cb9fa6b8b1bc266c6261582201ba980f | 107 | # frozen_string_literal: true
class DbDateCertainty < ActiveRecord::Base
belongs_to :db_single_date
end
| 17.833333 | 42 | 0.82243 |
62f43e52dbf89a3f0115ba84ab8dae881cb007ab | 278 | # frozen_string_literal: true
module Dry
module Slack
module Blocks
class Image < Block
attribute? :type, Types.type_string(0, 'image')
attribute :image_url, Types::UrlString
attribute :alt_text, Types::AltString
end
end
end
end
| 19.857143 | 55 | 0.654676 |
ac2614db08f0c0095864fde0d3cf3d5fbc84dbba | 597 | module DumpMailerWorker
extend ActiveSupport::Concern
included do
set_callback :dump, :after, :send_email
end
def send_email
return unless emails.present?
mailer.perform_async(@project.id, media_get_url, emails)
end
def mailer
"#{dump_target.singularize}_data_mailer_worker".camelize.const... | 20.586207 | 72 | 0.711893 |
bfa00f3dab53643abf397f67eb2e7ed948a7705c | 3,117 | RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description`... | 44.528571 | 129 | 0.735002 |
bba4ee88e1f3fb0e94a3d5e6dbd47622ac8db5cb | 361 | # frozen_string_literal: true
require_relative '../span'
module Polites
class Span::Link < Span
attr_reader :url, :title
def initialize(children = [], url:, title: nil)
super(children)
@url = url
@title = title
end
def eql?(other)
super &&
url == other.url &&
... | 16.409091 | 51 | 0.578947 |
037a8b20394b932c87425c7b13c0309a4c9bb23d | 3,485 | module CustomLandingPage
module LinkResolver
class LinkResolvingError < StandardError; end
class PathResolver
def initialize(paths)
@_paths = paths
end
def call(type, id, _)
path = @_paths[id]
if path.nil?
raise LinkResolvingError.new("Couldn't find path... | 24.542254 | 102 | 0.550359 |
01330e086a081efd561d27557761a89c9fb78c81 | 5,584 | =begin
#Hydrogen Integration API
#The Hydrogen Integration API
OpenAPI spec version: 1.3.1
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.21
=end
require 'date'
module IntegrationApi
class AccountingInvoiceResponseVO
attr_acces... | 27.92 | 107 | 0.612285 |
21bd2a23ef44b140a5b09ba21158ad716f0f64db | 897 | class Mutations::MergeUsers < Mutations::BaseMutation
field :user, Types::UserType, null: false
argument :user_ids, [Integer], required: true
argument :winning_user_id, Integer, required: true
argument :winning_user_con_profiles, [Types::WinningUserConProfileInputType], required: true
define_authorization_c... | 33.222222 | 94 | 0.758082 |
03d8c6b404701127ebf9e4a0fcfed85fd8d11491 | 1,932 | # Cookbook Name:: abiquo
# Recipe:: install_rabbitmq
#
# Copyright 2014, Abiquo
#
# 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 r... | 33.894737 | 98 | 0.72619 |
625a831c5bd423aedc90b6320573f43d02c3073b | 4,090 | #
# ServerEngine
#
# Copyright (C) 2012-2013 Sadayuki Furuhashi
#
# 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 re... | 30.984848 | 110 | 0.600733 |
3834acfdb1422a709cdb2928177e0ecade90b89d | 43 | module EncryptedId
VERSION = '1.1.1'
end
| 10.75 | 19 | 0.697674 |
389218324c696bed8458c7faaf9dc8c93e211d5f | 876 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
require 'fileutils'
module Multiverse
# <ruby_agent>/test/multiverse
#
ROOT = File.expand_path '../..', __FILE__
# append <ruby_agent>/test/multiverse... | 25.764706 | 80 | 0.729452 |
e803a20c5197ae8e8b5ec8df1fb66f5b9625e1c7 | 548 | # == Schema Information
#
# Table name: transactions
#
# id :integer(4) not null, primary key
# type :string(255)
# batch_id :integer(4)
# created_at :datetime
# updated_at :datetime
#
class ReturnMerchandiseComplete < Transaction
def self.new_complete_rma(transacting_user, total_cost, at =... | 28.842105 | 135 | 0.737226 |
7a5bbb8b9cf2fde0d7f9edf4452ab54fdeadc226 | 4,121 | ENV["RAILS_ENV"] ||= 'test'
require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rspec/rails'
Dir[File.expand_path('../../spec/support/*.rb', __FILE__)].each { |file| require file }
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/ex... | 45.788889 | 92 | 0.735016 |
5d4c302c433f350db137947b8886c9fdfc4fd437 | 3,609 | # == Schema Information
#
# Table name: trackers
#
# id :integer not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# remote_id :integer
# url :string not null
# name ... | 37.206186 | 110 | 0.585481 |
edbd15b0cb31ad6e1d6f6b5736e321b1e256e966 | 98 | module Certmeister
module DynamoDB
VERSION = '0.1.2' unless defined?(VERSION)
end
end
| 9.8 | 46 | 0.683673 |
e819ac509ab51ddc5f269df3727bdd6bb10d2a9c | 743 | # frozen_string_literal: true
require 'bundler/setup'
require 'webmock/rspec'
# require 'json-schema'
# require_relative "support/have_attributes_matcher"
require 'simplecov'
if RSpec.configuration.files_to_run.size > 1
SimpleCov.start do
track_files 'lib/**/*.rb'
add_filter '/lib/komtet/version.rb' # alrea... | 24.766667 | 93 | 0.745626 |
11616e763f0e8048b798d9092abc44b0c6db90b2 | 1,637 | require 'rails_helper'
describe "GET 'nearby'" do
before :each do
@loc = create(:location)
@nearby = create(:nearby_loc)
create(:far_loc)
end
it 'is paginated' do
get api_location_nearby_url(
@loc, page: 2, per_page: 1, radius: 5
)
expect(json.first['name']).to eq('Belmont Farmers ... | 26.836066 | 70 | 0.67135 |
03f4fd10ec660507180b87c6702fe3f1cbfbba33 | 3,361 | module OpenVZ
#
# This code is completely borrowed from marionette-collective.
#
# Wrapper around systemu that handles executing of system commands
# in a way that makes stdout, stderr and status available. Supports
# timeouts and sets a default sane environment.
#
# s = Shell.new("da... | 36.532609 | 111 | 0.489438 |
1cbe927db0b16328fd22858a72c01c9f11c9519c | 909 | require 'test_helper'
class ArtistUrlsControllerTest < ActionDispatch::IntegrationTest
context "The artist urls controller" do
setup do
@artist = create(:artist, name: "bkub", url_string: "-http://bkub.com")
@banned = create(:artist, name: "danbo", is_banned: true, url_string: "https://danbooru.donma... | 33.666667 | 105 | 0.663366 |
117cb345beab49015263ecc386a7cd3f38f27163 | 583 | require 'spec_helper'
describe Puppet::Type.type(:eselect) do
describe "when validating attributes" do
params = [:name]
properties = [:set]
params.each do |param|
it "should have the #{param} param" do
described_class.attrtype(param).should == :param
end
end
properties.... | 22.423077 | 62 | 0.653516 |
edfd02cf6b93c5d98096c4d00506cbd4d3568d53 | 1,556 | RSpec.describe "Integration Test: Archiving Using In Batches From Rails 6" do
subject(:archive) do
Tartarus::ArchiveModelWithTenant.new(registry: registry).archive(User, "Partition_1")
end
let(:registry) { Tartarus::Registry.new }
let(:archivable_item) do
Tartarus::ArchivableItem.new.tap do |item|
... | 30.509804 | 108 | 0.659383 |
87e301b67ddb4062e9a5826c1b9b7f3861e3447a | 811 | class Jflex < Formula
desc "Lexical analyzer generator for Java, written in Java"
homepage "https://jflex.de/"
url "https://jflex.de/release/jflex-1.8.2.tar.gz"
sha256 "a1e0d25e341d01de6b93ec32b45562905e69d06598113934b74f76b1be7927ab"
bottle :unneeded
depends_on "openjdk"
def install
pkgshare.insta... | 31.192308 | 93 | 0.685573 |
91b0381345f15606188ec1b40a6c6d47629ba064 | 1,207 | class Darcs < Formula
desc "Distributed version control system that tracks changes, via Haskell"
homepage "http://darcs.net/"
url "https://hackage.haskell.org/package/darcs-2.14.3/darcs-2.14.3.tar.gz"
sha256 "240f2c0bbd4a019428d87ed89db3aeaebebd2019f835b08680a59ac5eb673e78"
bottle do
cellar :any_skip_rel... | 33.527778 | 93 | 0.714996 |
ac65f0a18124a44e2da1835e7e2efacaddb58937 | 2,985 | # frozen_string_literal: true
require 'dry/monads'
require 'dry/monads/do'
module Operations
module People
class CreateOrUpdate
include Dry::Monads[:result, :do]
PersonCandidate = Struct.new(:ssn, :dob, :first_name, :last_name)
def call(params:)
person_values = yield validate(params)... | 30.151515 | 118 | 0.644891 |
e2cdadfcaf2ef08a1062cb5e97a84f9486ff83fe | 269 | require "trailblazer/rails/version"
module Trailblazer
module Rails
end
end
require "reform/rails"
require "trailblazer/rails/controller"
require "trailblazer/rails/cell"
require "trailblazer/rails/form"
require "trailblazer/rails/railtie"
require "trailblazer"
| 17.933333 | 38 | 0.806691 |
21cf6fb92b183dc9f11edb84dd5c9610a89136f5 | 2,947 | class GpCategory::Content::Setting < Cms::ContentSetting
set_config :list_style,
name: "#{GpArticle::Doc.model_name.human}表示形式",
form_type: :text_area,
upper_text: '<a href="#" class="show_dialog">置き換えテキストを確認する</a>',
default_value: '@title_link@(@publish_date@ @group@)'
set_config :date_style,
n... | 35.939024 | 105 | 0.680353 |
f86be95adcf17f125bb01291630c47c70e038944 | 2,734 | # Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 39.623188 | 75 | 0.603146 |
ed8047f85bc24b93828a16255493fabb6ebc9ce8 | 410 | module RecurlyLegacyGem
# Recurly Documentation: https://dev.recurly.com/docs/list-accounts-shipping-address
class ShippingAddress < Resource
define_attribute_methods %w(
id
address1
address2
first_name
last_name
city
state
zip
country
phone
nick... | 17.826087 | 86 | 0.634146 |
f8592c641f7bdaad4b6a6a9006aeeeb2ad7af873 | 15,145 | module RbsRails
module ActiveRecord
def self.generatable?(klass)
return false if klass.abstract_class?
klass.connection.table_exists?(klass.table_name)
end
def self.class_to_rbs(klass, dependencies: [])
Generator.new(klass, dependencies: dependencies).generate
end
class Gener... | 32.430407 | 121 | 0.546913 |
bfcca93d60945fc112774d9f986085ba2926ff1d | 1,606 | cask 'racket' do
version '6.10'
sha256 '1b9813c53bb55cc443f794e607f6bbfb14d734ceb02fa1e264c9f9e790f2b676'
url "https://mirror.racket-lang.org/installers/#{version}/racket-#{version}-x86_64-macosx.dmg"
appcast 'https://download.racket-lang.org/all-versions.html',
checkpoint: 'fd8e1ab40210ae188f13986e6... | 45.885714 | 96 | 0.709215 |
2112f72fdeaa5c7513caae71dac7359110e0ece3 | 226 | class Time
def api(time = Time.now)
# Time.now.utc.iso8601
# Time.now.utc.to_datetime.rfc3339(9)
# DateTime.parse(Time.now.utc.to_s).rfc3339(9)
time.utc.to_datetime.rfc3339(9).gsub(/\+00:00$/, 'Z')
end
end
| 25.111111 | 57 | 0.654867 |
33b3ed1fd45ed8c63bce5a53c71c01f70dad50fa | 339 | RSpec.configure do |config|
# config.before(:suite) do
# DatabaseCleaner.clean_with :truncation, except: %w(ar_internal_metadata)
# end
# config.before do
# DatabaseCleaner.strategy = :transaction
# end
# config.before do
# DatabaseCleaner.start
# end
# config.after do
# DatabaseCleaner... | 18.833333 | 78 | 0.687316 |
1c098ff3294f3859409079a7dd971989345b2761 | 10,298 | # 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 'aws-sdk-core/waiters'
module Aws::SageMaker
module Waiters
class EndpointDeleted
# @para... | 29.677233 | 74 | 0.494853 |
1d9f65b90a25a3e27d52d0490f822c595c8cb393 | 1,770 | require 'test_helper'
class OrganizationsControllerTest < ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers
setup do
sign_in users(:admin)
@organization = organizations(:org1)
end
test "should get index" do
get organizations_url
assert_response :success
end
test ... | 24.246575 | 96 | 0.728249 |
216cfdb9a008083ddd340216dc605f429054cf49 | 1,536 | $:.unshift File.join(File.dirname(__FILE__),"..","lib")
require 'test/unit'
require 'rgen/array_extensions'
class ArrayExtensionsTest < Test::Unit::TestCase
def test_element_methods
c = Struct.new("SomeClass",:name,:age)
a = []
a << c.new('MyName',33)
a << c.new('YourName',22)
assert_equal ["My... | 23.630769 | 69 | 0.636719 |
ace68d83957910cfa4bb5e617f0f4929be7bb465 | 838 | Capistrano::Configuration.instance(true).load do
namespace :redis do
desc "Install the latest release of Redis"
task :install, roles: :app do
run "#{sudo} add-apt-repository -y ppa:chris-lea/redis-server"
run "#{sudo} apt-get -y update"
run "#{sudo} apt-get -y install redis-server"
end
... | 28.896552 | 68 | 0.626492 |
e98f22f01fa7fda21187e5368f8bdaca9f9d4bc0 | 4,117 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks for uses of `and` and `or`, and suggests using `&&` and
# `||` instead. It can be configured to check only in conditions or in
# all contexts.
#
# @example EnforcedStyle: always
# # bad
... | 28.992958 | 80 | 0.569832 |
ff634f04324df977ec22e0a076bba1f4e1ae0073 | 178 | module Prpr
module Handler
class CodeDeploy < Base
handle Event::Push do
Action::CodeDeploy::Deploy.new(event).call
end
end
end
end
| 17.8 | 52 | 0.589888 |
ff10ad8963a1cfe699486913aa43808eaf8002a4 | 544 | class CreateArtists < ActiveRecord::Migration[5.2]
def up
end
def down
end
def change
create_table :artists do |t|
create_table :artists do |t|
t.string :name
t.string :genre
t.integer :age
t.string :hometown
... | 20.148148 | 63 | 0.558824 |
d55228e8cf00e5af822fc07a4f79fb95b5e1be72 | 661 | class ProcessDeployCommits
def process
return if ENV['DISABLE_PROCESS_DEPLOY_COMMITS'] == 'true'
puts "[gci] #{DateTime.now.utc.iso8601} Clockwork ProcessDeployCommits Started Running"
deploys = Deploy.all
deploy_commit_count = 0
deploys.each do |deploy|
sha = DeployedShaScraper.new.scrape(d... | 34.789474 | 96 | 0.711044 |
613c1145e47c7c8e7d09f4a5dcb7d93fc3bc7c44 | 669 | cask 'sqlpro-studio' do
version '1.0.320'
sha256 '2ccc078818cd2c6b0157c7743532d72ef31323bdf986320f603115161801b84f'
# d3fwkemdw8spx3.cloudfront.net/studio was verified as official when first introduced to the cask
url "https://d3fwkemdw8spx3.cloudfront.net/studio/SQLProStudio.#{version}.app.zip"
name 'SQLPro... | 39.352941 | 163 | 0.7429 |
38e9b9d0e0f34003dee0b9a3fdb686c26408aa80 | 336 | require 'chartjs/chart_helpers'
module Chartjs
class Engine < Rails::Engine
initializer 'chartjs.chart_helpers' do
if ::Chartjs.no_conflict
ActionView::Base.send :include, Chartjs::ChartHelpers::Explicit
else
ActionView::Base.send :include, Chartjs::ChartHelpers::Implicit
end
... | 24 | 71 | 0.699405 |
084eb82e438aeda14defe05630383cd27d8011e4 | 500 | # typed: false
# Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wr... | 31.25 | 96 | 0.782 |
6aa5e32eddbc432af97141de17511dd4be9d0f71 | 5,958 | module LLVM
module Script
# Converts an object into a LLVM::Value. A hint can be specified to ensure that the value is
# of a given kind or type.
#
# <b>Conversion Table</b>
#
# Ruby | LLVM | Possible Kinds | Possible Types ... | 47.664 | 125 | 0.560759 |
18a819452491e277d37f6d627379943da42ab23d | 2,293 | require "test/unit"
require "mime"
class TestMessage < Test::Unit::TestCase #:nodoc:
include Mime
def test_message_1
message = Message.new(
CompositeContent.new(
"mixed",
"boundary",
PlainContent.textual("Lorem ipsum dolor sit amet, ..."),
AdvancedContent.new(
... | 28.6625 | 69 | 0.657654 |
28cff183a0d1120eae82cf472fdddd086f28ef86 | 168 | # typed: strict
# frozen_string_literal: true
require 'test_helper'
class LocatorTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.272727 | 43 | 0.720238 |
4a1d146b459635f07f50730787c4dd068a3c5ae9 | 1,986 | require 'dotenv/format_error'
module Dotenv
class Environment < Hash
LINE = /
\A
(?:export\s+)? # optional export
([\w\.]+) # key
(?:\s*=\s*|:\s+?) # separator
( # optional value begin
'(?:\'|[^'])*' # single quoted value
| ... | 25.792208 | 83 | 0.430514 |
8735022e221920deafffba161991f2ecb4d4a5fa | 9,471 | #
# Copyright (c) 2015-2016, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of c... | 33 | 80 | 0.636997 |
3924964b75ad72aac8776eef7deb03d949be73b7 | 26,071 | # encoding: UTF-8
require 'support/ruby_interpreter'
require 'yaml'
require 'vcr/structs'
require 'vcr/errors'
require 'zlib'
require 'stringio'
require 'support/limited_uri'
require 'support/configuration_stubbing'
RSpec.shared_examples_for "a header normalizer" do
let(:instance) do
with_headers('Some_Header'... | 34.854278 | 154 | 0.595528 |
083071a324160a31dd40fc9d9da1b393036b4304 | 578 | module ApplicationHelper
# display error message
def error_helper(object)
content_tag(:h2, "Oops:", id: "error_explanation")
end
#create a list of errors for the object being created
def error_list(object)
content_tag(:ul, :class => "error msgs") do
object.errors.full_messages.each do |msg|
... | 25.130435 | 65 | 0.66436 |
2899aa22557e6cec06e959a72491734c5501ef51 | 469 | cask 'hstracker' do
version '1.5.3'
sha256 'ab816511bfa84de56be93f250c264cb2131197e8bd2e0259a71776eb8dbd5ac3'
# github.com/HearthSim/HSTracker was verified as official when first introduced to the cask
url "https://github.com/HearthSim/HSTracker/releases/download/#{version}/HSTracker.app.zip"
appcast 'https:... | 36.076923 | 93 | 0.784648 |
0130d216c75572fa81a4f36a5c885cbe507b2ac3 | 337 | cask 'camunda-modeler' do
version '1.4.0'
sha256 '7b7c46e198283fa10377f774cc4e93c6f843f91a8f9b0a44c718b4a4626ba4a1'
url "https://camunda.org/release/camunda-modeler/#{version}/camunda-modeler-#{version}-darwin-x64.tar.gz"
name 'Camunda Modeler'
homepage 'https://camunda.org/'
app 'camunda-modeler/Camunda ... | 30.636364 | 107 | 0.768546 |
18b5d72b3174954a9d566d947c1a0a444b6cf6fc | 10,182 | =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 'uri'
module NucleusApi
class BulkApi
attr_accessor :api_client
def initiali... | 40.086614 | 160 | 0.683166 |
61fc5e6ac5ebcef7f03a20252bd6e6196e730195 | 419 | require 'test_helper'
class SiteLayoutTest < ActionDispatch::IntegrationTest
test "layout links" do
get root_path
assert_template 'static_pages/home'
assert_select "a[href=?]", home_path, count: 2
assert_select "a[href=?]", help_path
assert_select "a[href=?]", about_path
assert_select "a[href... | 27.933333 | 54 | 0.71599 |
6acb075290cddab31a3619f88e547eb2d58d36ab | 30 | module MinhaPaginasHelper
end
| 10 | 25 | 0.9 |
e88885dfc7fbcabb294cb55d5de5175949ef2c8f | 17,936 | # 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... | 48.085791 | 126 | 0.536574 |
1a2e82839f00f1ca9f0ab42d91b23e6b2a57e737 | 3,539 | require 'socket'
require 'io/console/size'
require_relative 'config'
require_relative 'version'
# $VERBOSE = true
module DEBUGGER__
class CommandLineOptionError < Exception; end
class Client
begin
require 'readline'
def readline
Readline.readline("\n(rdb) ", true)
end
rescue Lo... | 21.065476 | 80 | 0.52755 |
1cc2217f2de15277b20779ea0cbc27365e9f4c9e | 1,334 | require 'tmpdir'
require 'digest/md5'
require 'cocaine'
module Cryptopro
class Base
CERTIFICATE_FILE_NAME = "certificate.cer"
CERTIFICATE_LINE_LENGTH = 64
def self.create_temp_dir
uniq_name = Digest::MD5.hexdigest("#{rand(1_000_000)}#{Time.now}")
full_name = "#{Dir.tmpdir}/cryptcp/#{uniq_nam... | 33.35 | 112 | 0.697151 |
6a7aceb9aef53c0faa4333f4087ddb6474bf2050 | 74 | # frozen_string_literal: true
module ProjectHome
VERSION = '0.3.0'
end
| 12.333333 | 29 | 0.743243 |
ffc428c99a3d30cbd9e6bdc7a31b9ec8212e21f6 | 326 | require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
## Luxembourg
class LUTest < Phonie::TestCase
def test_local
parse_test('+352 2422 1234', '352', '2422', '1234', "Luxembourg", false)
end
def test_mobile
parse_test('+352 671 123456', '352', '671', '123456', "Luxembourg", true)
en... | 25.076923 | 77 | 0.668712 |
9111cd6cf239f660a0358fc2377132ce7ad241d8 | 6,369 | require 'spec_helper'
require 'ruby_event_store'
module RailsEventStore
RSpec.describe AsyncDispatcher do
class CustomScheduler
def call(klass, serialized_event)
klass.new.perform_async(serialized_event)
end
def async_handler?(klass)
not_async_class = [CallableHandler, NotCalla... | 35.780899 | 125 | 0.700738 |
016f9bba7c266c3c736b7c10fa51ff51ce1a8dc0 | 702 | require('sinatra')
require('sinatra/reloader')
also_reload('lib/**/*.rb')
require('./lib/team')
require('./lib/member')
get('/') do
@teams = Team.all()
erb(:index)
end
post('/team_added') do
name = params.fetch('name')
@team = Team.new(:name => name)
@team.save()
erb(:success_team)
end
get('/teams/:id')... | 21.272727 | 74 | 0.655271 |
7afbd0a65faade51f862a89e0534e03ec3a655f9 | 258 | module Locomotive
module Regexps
SUBDOMAIN = /^[a-z][a-z0-9_-]*[a-z0-9]{1}$/
DOMAIN = /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,}(:[0-9]{1,5})?(\/.*)?$/ix
URL = /((http|https|ftp):\/)?\/\S*/
end
end
| 21.5 | 94 | 0.372093 |
e2d36d76549e7e32bb4d87323fa645d91ce399a5 | 2,763 | # frozen_string_literal: true
require "rails/application_controller"
class Rails::MailersController < Rails::ApplicationController # :nodoc:
prepend_view_path ActionDispatch::DebugExceptions::RESCUES_TEMPLATE_PATH
before_action :require_local!, unless: :show_previews?
before_action :find_preview, :set_locale, ... | 28.193878 | 128 | 0.648208 |
383038446974c1c065636fb2452cd4e7431f6258 | 280 | ##
# Admin User model
class AdminUser < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable,
:recoverable, :rememberable, :trackable, :validatable
end
| 31.111111 | 62 | 0.75 |
8725a9f978a3b637d3cb85914c2fc88d5e1fa948 | 207 | require 'rails_helper'
require 'support/devise'
require 'support/content_controller_example'
RSpec.describe UniversesController, type: :controller do
it_behaves_like 'a controller for a content item'
end
| 25.875 | 56 | 0.826087 |
e841612b8cfef4112873d2e843002fbc39a77270 | 166 | class AddCategoryToHangout < ActiveRecord::Migration[4.2]
def change
add_column :hangouts, :uid, :string
add_column :hangouts, :category, :string
end
end
| 23.714286 | 57 | 0.73494 |
d57b8aeda789e393e11b8fe1e96e8b953ab6715d | 15,038 | # 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
#
# ExpressRouteLinks
#
class ExpressRouteLinks
include MsRestAzure
#
# Creates and initialize... | 43.715116 | 186 | 0.707474 |
212e4534d653e460afac04e7c73e91af20485244 | 4,367 | require 'uri'
require 'awesome_spawn'
module MiqCockpit
class WS
DEFAULT_PORT = 9002
# Used when the cockpit-ws worker is not enabled
COCKPIT_PUBLIC_PORT = 9090
MIQ_REDIRECT_URL = "/dashboard/cockpit_redirect".freeze
COCKPIT_WS_PATH = '/usr/libexec/cockpit-ws'.freeze
COCKPIT_SSH_PATH = '/us... | 26.628049 | 99 | 0.630639 |
f823fdd17af7a3b50e53f2a2101e9e45f250e859 | 1,389 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... | 36.552632 | 86 | 0.741541 |
621f88c907537720c04ed30eada89eb9f5f1c026 | 1,101 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'componentize/version'
Gem::Specification.new do |spec|
spec.name = "componentize"
spec.version = Componentize::VERSION
spec.authors = ["Kyle Shevlin"]
spec.email ... | 45.875 | 121 | 0.669391 |
ff8d1b6b1c64f15603f9ccb8b67d7118d8edebc2 | 269 | class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :username
t.string :email
t.string :password_digest
t.boolean :public, :default => false #user can choose to keep reviews private
end
end
end
| 24.454545 | 83 | 0.680297 |
bb7f8bb323d18850331296248e4edbf596d241e4 | 759 | class ApiUser
include HTTParty
base_uri "http://127.0.0.1:5000/"
headers "Content-Type" => "application/json"
def self.create(user)
post("/cadastro", body: user.to_json)
end
def self.auth(user)
post("/login", body: user.to_json)
end
def self.logout(token)
post("/logout", :headers => { "Au... | 24.483871 | 97 | 0.653491 |
33096510c1eec5ad6a6b7f932d77e5d75125ef65 | 624 | module Fog
module Identity
class OpenStack
class Real
def delete_user(user_id)
request(
:expects => [200, 204],
:method => 'DELETE',
:path => "users/#{user_id}"
)
end
end
class Mock
def delete_user(user_id)
... | 21.517241 | 74 | 0.495192 |
0348b0f78aa80575831ffbcbbed2b0a343d6aaeb | 665 | module Spree
class ItemRefund
module StateMachine
extend ActiveSupport::Concern
included do
state_machine initial: :new do
event :renew do
transition from: :prepared, to: :new
end
event :prepare do
transition from: :new, to: :prepared
... | 24.62963 | 70 | 0.589474 |
ab0ef1f62cde38dfca7a88649cc5b85aacca1dfb | 1,305 | # Redmine Messenger plugin for Redmine
class CreateMessengerSettings < ActiveRecord::Migration
def change
create_table :messenger_settings do |t|
t.references :project, null: false, index: true
t.string :messenger_url
t.string :messenger_icon
t.string :messenger_channel
t.string :me... | 43.5 | 69 | 0.704981 |
bf579884e7611e10b40da981b2c829637efd7b68 | 58 | ActiveSupport.halt_callback_chains_on_return_false = false | 58 | 58 | 0.931034 |
386aea6c23a53d19548e13579029b23b7ab65ed9 | 830 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Tracking::Docs::Renderer do
describe 'contents' do
let(:dictionary_path) { described_class::DICTIONARY_PATH }
let(:items) { Gitlab::Tracking::EventDefinition.definitions.first(10).to_h }
it 'generates dictionary for given items'... | 34.583333 | 92 | 0.708434 |
39d02c1d26b42c8b0c0a0a67f033a2c1169e489a | 71,653 | # frozen_string_literal: true
# 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... | 44.257566 | 235 | 0.657572 |
acd0fb818deb6a7e4d7e6410062df2247473d598 | 2,113 | #
# This file is used to configure the Omnibus projects in this repo. It contains
# some minimal configuration examples for working with Omnibus. For a full list
# of configurable options, please see the documentation for +omnibus/config.rb+.
#
# Build internally
# ------------------------------
# By default, Omnibus ... | 36.431034 | 132 | 0.644108 |
61d9810e5f86291c2677455ac9a9c20f7630d7a4 | 234 | class RemoveLeaderboardPrivaryFromUsersTable < ActiveRecord::Migration
def self.up
remove_column :users, :leaderboard_privacy
end
def self.down
add_column :users, :leaderboard_privacy, :boolean, default: false
end
end
| 23.4 | 70 | 0.782051 |
e8c027b7e6dfc12bafc786863ec7f2221c720550 | 753 | require 'test_helper'
class RoutesTest < ActionController::TestCase
test 'map new user invitation' do
assert_recognizes({:controller => 'devise/invitations', :action => 'new'}, {:path => 'users/invitation/new', :method => :get})
end
test 'map create user invitation' do
assert_recognizes({:controller =>... | 35.857143 | 130 | 0.681275 |
d5d9c27cdc043848b46b8ccfd69225b585aab442 | 6,167 | # encoding: UTF-8
def should_support_mysql_import_functionality
# Forcefully disable strict mode for this session.
ActiveRecord::Base.connection.execute "set sql_mode=''"
describe "#import with :on_duplicate_key_update option (mysql specific functionality)" do
extend ActiveSupport::TestCase::MySQLAssertions
... | 41.668919 | 137 | 0.693368 |
26626a90f50cda39e3985ac90b26b04e49cce50e | 11,874 | # Copyright 2018 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 applicable law or agreed to in writing, ... | 44.30597 | 135 | 0.615294 |
acc893b985b28415259a3b8376bba0422f807e9e | 765 | require "pipelines/version"
require "pipelines/exec"
require "psych"
module Pipelines
# Your code goes here...
def self.build
Exec.new(parse_["build"])
end
def self.parse_
parse("project/simple.yml")
end
def self.parse(file)
project = Psych.load_file(file)
end
class Pipeline
def init... | 18.214286 | 64 | 0.628758 |
288240b55c012767c1c48e8aa96acaf88dc632c4 | 569 | require "spec_helper"
feature "Update a location's languages", :vcr do
background do
login_admin
end
xscenario "with empty description" do
visit_test_location
fill_in "description", with: ""
click_button "Save changes"
expect(page).to have_content "Please enter a description"
end
xscena... | 24.73913 | 69 | 0.731107 |
e2e3b0d162947358f1a13f6165f50f14a37d9602 | 897 | require_relative '../lib/lib'
require 'json'
def analyze(name:, text_content: text)
storage = Language::Storage.new
document = Language::Document.new(text_content: text_content)
hash = storage.read(name: name) || { name: name, text: text_content }
%w[analyze_sentiment].each do |method| # analyze_entities anal... | 35.88 | 88 | 0.719064 |
62ae99bc865226cd9ef680d8f1ebbd5dae6e67af | 47 | module Refinery
module PagesHelper
end
end
| 9.4 | 20 | 0.787234 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.