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 |
|---|---|---|---|---|---|
39c90e92045ae6a795ac3dd565708c12c177096d | 1,035 | module AsteriskMesh
class IAX
include Config
include NodeName
def friend_static(node)
<<~IAX
[#{node_name(node)}]
type=friend
host=#{node['host']}
context=#{CONTEXT_FROM_MESH}
IAX
end
def register_dynamic(node_from, node_to, password)
"register ... | 23 | 93 | 0.611594 |
b9001e540dd354817ba88da203ea039c184c44a3 | 2,013 | class TreeBuilderSmartproxyAffinity < TreeBuilder
has_kids_for Hash, [:x_get_tree_hash_kids]
has_kids_for MiqServer, [:x_get_server_kids]
def initialize(name, type, sandbox, build = true, data)
@data = data
super(name, type, sandbox, build)
end
private
def node_builder
TreeNodeBuilderSmartpro... | 31.453125 | 117 | 0.607054 |
ab5839dc6655c3d423bc12256799eb931b92d94b | 1,121 | # 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::V2018_11_01
module Models
#
# The error object.
#
class ErrorResponse
include MsRestAzure
# @re... | 23.354167 | 70 | 0.529884 |
4a3712c9c1d67f4ff575f92cd7af9620113f7f00 | 371 | # 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::Resources::Mgmt::V2018_06_01
module Models
#
# Defines values for ResourceIdentityType
#
module ResourceIdentityType
S... | 23.1875 | 70 | 0.730458 |
18a1396816291baff6fe0c3d2e43c989b049cb24 | 2,314 | # == Schema Information
#
# Table name: payment_settings
#
# id :integer not null, primary key
# active :boolean not null
# community_id :integer not null
# payment_gateway ... | 37.322581 | 103 | 0.579948 |
8774de0c5b7d0faa907654df83f0d061521dfe2f | 1,654 | class Websocketd < Formula
desc "WebSockets the Unix way"
homepage "http://websocketd.com"
url "https://github.com/joewalnes/websocketd/archive/v0.4.1.tar.gz"
sha256 "6b8fe0fad586d794e002340ee597059b2cfc734ba7579933263aef4743138fe5"
license "BSD-2-Clause"
bottle do
sha256 cellar: :any_skip_relocation, ... | 43.526316 | 123 | 0.759976 |
1d5abaf5bb496f7b7fb811b52fe7d0afefc7ed98 | 405 | cask :v1 => 'bartender' do
version :latest
sha256 :no_check
url 'http://www.macbartender.com/Demo/Bartender.zip'
appcast 'http://www.macbartender.com/updates/updates.php'
homepage 'http://www.macbartender.com/'
license :commercial
app 'Bartender.app'
postflight do
suppress_move_to_applications
... | 22.5 | 75 | 0.735802 |
62a015ee145c1b8efaf33eac30c8f4594e9460e1 | 2,847 | class PremiumNotificationsController < ApplicationController
load_and_authorize_resource :store
load_and_authorize_resource through: :store
before_filter :get_manageable
# GET /premium_notifications
def index
@premium_notifications = @store.premium_notifications
end
# GET /premium_notifications/1
... | 35.5875 | 231 | 0.731296 |
28f3bff5ef7f9e6826c16e4ec858d4ad0975dde9 | 12,302 | # == Schema Information
#
# Table name: bounties
#
# id :integer not null, primary key
# amount :decimal(10, 2) not null
# person_id :integer
# issue_id :integer not null
# status :string(12) default("active"), not null
# expires_at ... | 30.226044 | 176 | 0.671029 |
6232e4de8de1883639bc94175b0c77a53d3cfcd9 | 200 | module Kea
class Dhcp4Pool < KeaRecord
self.table_name = 'dhcp4_pool'
belongs_to :dhcp4_subnet, foreign_key: 'subnet_id', primary_key: 'subnet_id',
inverse_of: :dhcp4_pools
end
end
| 22.222222 | 81 | 0.725 |
03371c912a4bcbbb44c6846a8dd163d317d217c7 | 17,713 | # frozen_string_literal: false
require 'test/unit'
class TestLazyEnumerator < Test::Unit::TestCase
class Step
include Enumerable
attr_reader :current, :args
def initialize(enum)
@enum = enum
@current = nil
@args = nil
end
def each(*args)
@args = args
@enum.each do ... | 30.434708 | 449 | 0.589454 |
0816d3d433d504bb8fd4f4bd68fdca6ec9d5828d | 1,961 | class KubernetesCli < Formula
desc "Kubernetes command-line interface"
homepage "https://kubernetes.io/"
url "https://github.com/kubernetes/kubernetes.git",
:tag => "v1.6.0",
:revision => "fff5156092b56e6bd60fff75aad4dc9de6b6ef37"
head "https://github.com/kubernetes/kubernetes.git"
bottle do
... | 33.810345 | 92 | 0.703213 |
08e0484766f8780f16070fe162e9e4fb5b5935dc | 904 | module Metricstore
class Incrementer < Updater
def increment(key, delta, ttl=nil)
return if delta.zero?
update(key, delta, ttl)
end
protected
def prepare_data(delta)
delta
end
def consolidate_data(delta1, delta2)
delta1 + delta2
end
def handle_update(ke... | 22.04878 | 64 | 0.566372 |
0840403b9928bb77903c858f3e578648150c41b6 | 704 | # frozen_string_literal: true
require "motion"
module Motion
class Event
def self.from_raw(raw)
new(raw) if raw
end
attr_reader :raw
def initialize(raw)
@raw = raw.freeze
end
def type
raw["type"]
end
alias_method :name, :type
def details
raw.fetch("de... | 14.666667 | 57 | 0.599432 |
91b5bc51ea62e44f8ae878030093b7525a446525 | 533 | # encoding: utf-8
require 'spec_helper'
describe Algebra::Rename::Methods, '#rename' do
subject { object.rename(aliases) }
let(:described_class) { Relation }
let(:attribute) { Attribute::Integer.new(:id) }
let(:aliases) ... | 35.533333 | 87 | 0.493433 |
ed86853fdb1829848680963f3dd243892029ea81 | 840 | require 'test_helper'
class UsersIndexTest < ActionDispatch::IntegrationTest
def setup
@admin = users(:michael)
@non_admin = users(:archer)
end
test "index as admin including pagination and delete links" do
log_in_as(@admin)
get users_path
assert_template 'users/index'
assert_select 'di... | 24.705882 | 66 | 0.675 |
330ddbb05f571f1e1481b022c7116627400057eb | 155 | class AddIndexerApiBaseUrlToTezosChains < ActiveRecord::Migration[5.2]
def change
add_column :tezos_chains, :indexer_api_base_url, :string
end
end
| 25.833333 | 70 | 0.8 |
bfd96270f639ce0de29f33a451cf949a4347d698 | 1,504 | require "language/node"
class Autocode < Formula
desc "Code automation for every language, library and framework"
homepage "https://autocode.readme.io/"
url "https://registry.npmjs.org/autocode/-/autocode-1.3.1.tgz"
sha256 "952364766e645d4ddae30f9d6cc106fdb74d05afc4028066f75eeeb17c4b0247"
bottle do
cell... | 35.809524 | 107 | 0.757979 |
085e803c6c59ce0299f50a83a0f1a70b7553d5cf | 5,122 | require "abstract_unit"
class ViewLoadPathsTest < ActionController::TestCase
class TestController < ActionController::Base
def self.controller_path() "test" end
before_action :add_view_path, only: :hello_world_at_request_time
def hello_world() end
def hello_world_at_request_time() render(action: "h... | 29.606936 | 125 | 0.729988 |
bb202049ad8b83f096e8bf92ba3e3834fd74ac62 | 1,273 | require File.expand_path('../../../spec_helper', __FILE__)
require "stringio"
require File.expand_path('../shared/read', __FILE__)
describe "StringIO#sysread when passed length, buffer" do
it_behaves_like :stringio_read, :sysread
end
describe "StringIO#sysread when passed [length]" do
it_behaves_like :stringio_re... | 25.979592 | 63 | 0.724273 |
4abc221067f750601c9ffb1fd08a9db63eb5814a | 670 | module Puppet::Parser::Functions
Puppet::Parser::Functions.newfunction(:default_content,
:type => :rvalue,
:doc => <<-'ENDOFDOC'
Takes an optional content and an optional template name to calculate the actual
contents of a file.
Th... | 29.130435 | 81 | 0.637313 |
2175e0be45b69b957a50a970b56bbd2dc63ba45e | 286 | module BreadcrumbHelper
def breadcrumb_name(object, prop='name')
name =
if prop == 'name' && object.respond_to?(:full_name)
object.full_name
else
"#{object.class.model_name.human} #{object.public_send(prop)}"
end
name.truncate(40)
end
end
| 22 | 70 | 0.636364 |
0801f4abbbb3d348136fd79f1c0ff7e78f9aa3b8 | 85 | cask 'missing-name' do
version '1.2.3'
url 'http://localhost/something.dmg'
end
| 14.166667 | 38 | 0.682353 |
18d29c663dd1243cbe6a4cc52a2d21091f34bf31 | 701 | cask 'prince' do
version '12.5'
sha256 'd7940c2f60b1e9657db1deb1144b2496cc34c728f650c36b24d6885b964e9aed'
url "https://www.princexml.com/download/prince-#{version}-macosx.tar.gz"
appcast 'https://www.princexml.com/download/'
name 'Prince'
homepage 'https://www.princexml.com/'
# shim script (https://gith... | 33.380952 | 141 | 0.713267 |
39253e51b2f1d18c4bc55ade0433473cdd3fd4d4 | 513 | # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 46.636364 | 245 | 0.769981 |
4aa9175ceb6506da6445af7febbe097e7a302508 | 7,996 | =begin
#Argo Workflows API
#Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/
The version of the OpenAPI document: VERSION
Generated by: https://openapi-generator.tech
OpenAPI Ge... | 29.947566 | 206 | 0.617434 |
bbc2b48b8567e24813d0305c871df7a22d96b545 | 617 | # frozen_string_literal: true
class NotePolicy < BasePolicy
delegate { @subject.project }
delegate { @subject.noteable if DeclarativePolicy.has_policy?(@subject.noteable) }
condition(:is_author) { @user && @subject.author == @user }
condition(:is_noteable_author) { @user && @subject.noteable.author_id == @use... | 25.708333 | 85 | 0.711507 |
1aa4129380e93cf41ded24129f7f9ea61b6ba4c6 | 1,018 | module Telapi
# Wraps TelAPI Available Phone Number functionality
class AvailablePhoneNumber < Resource
class << self
# Returns a resource collection containing Telapi::AvailablePhoneNumber objects
# See http://www.telapi.com/docs/api/rest/available-phone-numbers/list/
#
# Required para... | 40.72 | 98 | 0.680747 |
f8b26155701c1054bef8e732ccc5b90cd9d2c705 | 1,995 | # Encoding: utf-8
#
# This is auto-generated code, changes will be overwritten.
#
# Copyright:: Copyright 2021, Google Inc. All Rights Reserved.
# License:: Licensed under the Apache License, Version 2.0.
#
# Code generated by AdsCommon library 1.0.3 on 2021-08-11 23:14:51.
require 'ads_common/savon_service'
require '... | 31.666667 | 83 | 0.762907 |
e85ccecc92b8331b9555a6ce7b0764ba163b7c19 | 1,637 | # frozen_string_literal: true
require "liquid"
require "jekyll_plugin_logger"
require_relative "jekyll_context_inspector/version"
module JekyllPlubinContextInspectorName
PLUGIN_NAME = "context_inspector"
end
class ContextInspector < Liquid::Tag
def render(context)
@logger = PluginMetaLogger.instance.new_logg... | 34.829787 | 143 | 0.718387 |
d566ed54d1ce412d16cec82e889b212e6cbf303d | 22,241 | # frozen_string_literal: true
require_relative "bootstrap_options"
module ComfyBootstrapForm
class FormBuilder < ActionView::Helpers::FormBuilder
FIELD_HELPERS = %w[
color_field date_field datetime_field email_field month_field
password_field phone_field range_field search_field text_area
tex... | 34.805947 | 118 | 0.639989 |
79a35dd8a67e2f5524cb3d6f02a4dde7bc7d6fa1 | 2,579 | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../dummy/config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort('The Rails environment is running in production mode!') if Rails.env.production?
r... | 46.053571 | 86 | 0.751454 |
f8a2302f99bb1e388be76afd5112bc523137e966 | 41 | module Rendering
VERSION = '0.1.0'
end
| 10.25 | 19 | 0.682927 |
088143d61bddf2889003f10cacf5923c8dd41ebe | 107 | class Class
def descendants
ObjectSpace.each_object(Class).select { |klass| klass < self }
end
end
| 17.833333 | 66 | 0.719626 |
f703e99f399b020c56164da23ccbebc17737cdc9 | 777 | module DockerRails
class Application
def version
'1.12.0'
end
def build_time
@build_time ||= ENV.fetch('COMMIT_TIME', Time.current).to_datetime
end
def alpine_release
`cat /etc/alpine-release 2>/dev/null`.chomp
end
def ruby_version
"#{RUBY_VERSION} patchlevel #{R... | 17.659091 | 72 | 0.661519 |
33e5d692ef7499bfc1af25c676183b9faab9d748 | 562 | require 'test_helper'
require 'reports/size'
module Reports
class SizeTest < ActiveSupport::TestCase
def setup()
@site = Site.create!({:name => 'Test', :url => 'http://example.com', :email_address => 'test@example.com', :verified => true})
@email = @site.emails.create!({:message => Mail::Message.new(... | 25.545455 | 132 | 0.622776 |
ac0bdc58608c10acafc6c615b22e30b2df887142 | 708 | require 'task_helper'
namespace :app do
def config
Rails.configuration.app
end
desc "Import downloaded NPM package names to our database as `pending`"
task :npm_file_import => :environment do |t|
data = JSON.parse File.read(config.npm.filename)
Task.new(data.size) do |progress|
data.each do... | 24.413793 | 73 | 0.632768 |
bbc3a01f45fde3b7c599a8ca41e8464fb49374ce | 3,361 | class VCAP::CloudController::Permissions
ROLES_FOR_ORG_READING ||= [
VCAP::CloudController::Membership::ORG_MANAGER,
VCAP::CloudController::Membership::ORG_AUDITOR,
VCAP::CloudController::Membership::ORG_MEMBER,
VCAP::CloudController::Membership::ORG_BILLING_MANAGER,
].freeze
ROLES_FOR_ORG_WRITIN... | 28.243697 | 108 | 0.747397 |
bf2c87caee4eed5b6ac266eeb40191fec49c1a92 | 1,930 | qc = QueryCategory.find_by(name: 'Life Cycle (Performance Restriction)')
# create period view
view_sql = <<-SQL
CREATE OR REPLACE VIEW track_most_recent_performance_restrictions_period_view AS
SELECT mrae.asset_event_id, mrae.base_transam_asset_id, IF(ae.period_length IS NULL, "Until Removed", "Set Length") AS p... | 35.740741 | 191 | 0.725389 |
ac418db11b3b096bbd73c86e47f607c5b6c0c9bb | 145 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_retrospective_session'
| 36.25 | 83 | 0.813793 |
6203164c1c81cfb6a9443bd86ffd314acc05f58d | 76,266 | # 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... | 43.630435 | 165 | 0.667952 |
91fa19d9ce81ca660a2f080dbc3d99c69d137a68 | 250 | class Band < ActiveRecord::Base
has_and_belongs_to_many(:venues)
validates_presence_of(:name)
before_save(:capitalize_name)
private
define_method(:capitalize_name) do
self.name=(name().split.map {|i| i.capitalize }.join(' '))
end
end
| 20.833333 | 62 | 0.736 |
21141d19693190fd7d680637fa8c7fd5d919aeb7 | 1,396 | class Trends::DupeFinder
def self.cronjob(date_in_week: 1.day.ago)
news_this_week = NewsItem.without_dupes.where(created_at: date_in_week.to_time.all_week)
new(news_this_week).run
end
def initialize(news_items)
@news_items = news_items
@already_processed = []
end
def run
if @news_items.i... | 27.92 | 113 | 0.663324 |
f7e1a0d3fb514033fbfb901bd116ac790ff0e300 | 1,427 | # frozen_string_literal: true
class DeviseCreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
## Recoverable
t.stri... | 31.021739 | 104 | 0.650315 |
6218b66d99205d399973b7a89926a5bbf35c4e1f | 305 | def while_loop(number)
i =0
numbers = []
while i < number
puts "At the top i is #{i}"
numbers.push(i)
i +=1
puts "Numbers now:", numbers
puts "At the bottom i is #{i}"
end
puts "The numbers:"
numbers.each {|num| puts num}
end
#while_loop(3)
#while_loop(6)
while_loop(2)
| 16.052632 | 34 | 0.603279 |
1a2cdeb5fc7dfbaf67a7ecb59c3fb21919808d53 | 1,583 | require 'spec_helper'
describe Puppet::Type.type(:ilb_servergroup).provider(:solaris) do
let(:params) do
{
:name => "sg1"
}
end
let(:resource) { Puppet::Type.type(:ilb_servergroup).new(params) }
let(:provider) { described_class.new(resource) }
before(:each) do
FileTest.stubs(:file?).with(... | 26.383333 | 80 | 0.622868 |
e2c8ffefd09d41479c3901717dab41d5acde5b4f | 2,206 | module Ci::DbConnectable
extend ActiveSupport::Concern
included do
end
# Dynamically sets the database connection.
def connect_to_ci_database(options={})
master_db = options[:master_db] || false
config = Rails.application.config_for(:configuration).symbolize_keys!
db_config = config[:ci_db_serve... | 36.766667 | 107 | 0.711242 |
bb2924c7cb63e25652f45126436d1b3b2cdcb573 | 431 | #require 'spec_helper'
#
#describe Majak::Autopilot::Motor do
# before do
# @motor = Majak::Autopilot::Motor.new
# end
#
# it "sets a pin to PWM mode"
# it "turns on the output pin for 3 seconds per degree of adjustment"
# it "turns in one direction for x time then turns on the motor in the opposite directon to... | 26.9375 | 108 | 0.696056 |
799b08de96d6cd9f71caa324360b3d824bf95ea7 | 289 | class CreateReviews < ActiveRecord::Migration[6.0]
def change
create_table :reviews do |t|
t.text :content
t.text :title
t.integer :rating
t.belongs_to :user, foreign_key: true
t.belongs_to :spot, foreign_key: true
t.timestamps
end
end
end
| 20.642857 | 50 | 0.650519 |
61756390a3a31abdbb6845ff0e2dcb2efad5903b | 536 | cask 'homespun-instant-access' do
version :latest
sha256 :no_check
# vault.platformpurple.com/static/installers/homespun_installer was verified as official when first introduced to the cask
url 'http://vault.platformpurple.com/static/installers/homespun_installer.zip'
name 'Homespun Instant Access'
homepag... | 35.733333 | 124 | 0.766791 |
875c9d62def0a46127267589fbef8aa67ffe858c | 380 | class SsnValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
unless valid_ssn?(record, attribute, value)
record.errors[attribute] << "#{value} is not a valid Social Security Number"
end
end
def self.kind() :custom end
def valid_ssn?(record, attribute, value)
... | 23.75 | 82 | 0.710526 |
e2bd01fb8541211191265fe55719e569b0afd202 | 824 | # frozen_string_literal: true
module Cocina
module FromFedora
class Descriptive
# Maps titles
class HydrusDefaultTitleBuilder
# @param [Nokogiri::XML::Element] resource_element mods or relatedItem element
# @param [Cocina::FromFedora::DataErrorNotifier] notifier
# @return [Has... | 31.692308 | 115 | 0.657767 |
0346b9fdb500c3f929346878a2b6208208a46ad4 | 7,386 | # frozen_string_literal: true
RSpec.describe TableStructure::Writer do
describe '#write' do
include_context 'questions'
include_context 'users'
let(:context) { { questions: questions } }
let(:array_items) { users }
let(:enumerator_items) do
::Enumerator.new { |y| array_items.each { |item... | 29.309524 | 92 | 0.567154 |
ac24b13940ee6960a061c882f576cb29d9563f93 | 167 | class AddAllowDecimalsToCustomFields < ActiveRecord::Migration[5.2]
def change
add_column :custom_fields, :allow_decimals, :boolean, :default => false
end
end
| 27.833333 | 75 | 0.772455 |
4a18eccc9d5ad1688e5ff298e89ab02907ddf36d | 97 | module API
module V1
class AttachmentsController < ApplicationController
end
end
end
| 13.857143 | 55 | 0.752577 |
083e2d65bed88494ac76c8d38160b210934e7ee9 | 248 | class CreateRumors < ActiveRecord::Migration[5.2]
def change
create_table :rumors do |t|
t.string :title
t.text :description
t.integer :confirmed_cases
t.integer :confirmed_deaths
t.timestamps
end
end
end
| 19.076923 | 49 | 0.665323 |
4ac8fda8b5a7baa271ebbb22ba39130f1783779a | 4,243 | # frozen_string_literal: true
# rubocop:disable Lint/SuppressedException
begin
require 'rspec/core/rake_task'
namespace :tests do
desc "Run all RSpec tests"
RSpec::Core::RakeTask.new(:spec)
desc "Run RSpec tests that do not require VM fixtures or a particular shell"
RSpec::Core::RakeTask.new(:uni... | 33.944 | 107 | 0.612774 |
036ee5e33274a774902321728e21b3e258d6d9c2 | 1,598 | # frozen_string_literal: true
RSpec.describe Lab42::DataClass do
describe "a data class with only positional params" do
subject { DataClass(:a, :b) }
let(:correct_instance) { subject.new(a: 1, b: 2) }
it "raises an argument error if a key is missing" do
expect{ subject.new(a: 1) }.to raise_error(A... | 31.333333 | 104 | 0.652065 |
f874adcc7cfe71b149a451ac7a6f8f02e9856c8b | 272 | class CreateDeposits < ActiveRecord::Migration[5.1]
def change
create_table :deposits do |t|
t.decimal :amount, precision: 10, scale: 2
t.date :deposit_date
t.belongs_to :wallet, index: true, foreign_key: true
t.timestamps
end
end
end
| 22.666667 | 58 | 0.672794 |
5da225f497a13dccceaa1028bf8b9e0822d75cbe | 1,709 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: google/ads/googleads/v2/services/change_status_service.proto for package 'Google.Ads.GoogleAds.V2.Services'
# Original file comments:
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 34.18 | 149 | 0.692803 |
084645dcbaeafd4b76ab7f666bc4ff658e50297e | 2,693 |
module LiveData
class User
IntegerPackCode = "I"
ReadTime = 25
attr :groups, true
attr :name, true
# Create a user object
def initialize( name = nil, channel = nil )
@name = name || self
@channel = channel
@read_time = ReadTime
... | 23.622807 | 71 | 0.473078 |
edd3f907c9356052e127a853e882d68e02635ce9 | 122 | require 'wsdl_mapper/runtime/s8r_base'
module WsdlMapper
module Runtime
class InputS8r < S8rBase
end
end
end
| 13.555556 | 38 | 0.745902 |
5d74286dc5c42222963d278b2b149f69be6046ae | 20,399 | # Copyright (c) 2009-2012 VMware, Inc.
module Bosh
module Cli
class Director
include VersionCalc
DIRECTOR_HTTP_ERROR_CODES = [400, 403, 500]
DEFAULT_MAX_POLLS = nil # Not limited
DEFAULT_POLL_INTERVAL = 1
API_TIMEOUT = 86400 * 3
CONNECT_TIMEOUT = 30
... | 32.175079 | 80 | 0.554782 |
ff070bce0f0e3630ab1bf3d5a3722be0939f5d46 | 12,195 | require 'spec_helper'
describe 'collection', type: :feature do
def create_collection(title, description)
visit '/dashboard'
first('#hydra-collection-add').click
expect(page).to have_content 'Create New Collection'
# Creator is a multi-value field, so it should have button to add more fields
expe... | 38.22884 | 123 | 0.678475 |
ab27d3ba3820cc8f58c277b518d89916ba0c0e0e | 1,639 | # 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.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 39.97561 | 86 | 0.736425 |
f8dedc2a44e0fee691e2e3e8b3ec10bedf73627b | 48 | class JwtAuthentication
VERSION = "0.1.1"
end
| 12 | 23 | 0.729167 |
f7b46ddc20b157a86c598fb68e20ec6d476db8e3 | 2,349 | # frozen_string_literal: true
module Primer
# Extend this module to test basic linter behavior. You must define the following methods:
#
# * `default_tag` - returns the default tag to be matched by the linter
# * `default_class` - returns the class to be matched by the linter. Return `nil` if no class is neces... | 34.544118 | 117 | 0.659855 |
6a832049213d454619f67866cea33b6f662709a4 | 151 | class AddPrimaryToPosition < ActiveRecord::Migration
def change
add_column :positions, :primary, :boolean, default: false, null: false
end
end
| 25.166667 | 74 | 0.761589 |
f7bc27e007d7f6be7676a85d29b6f47192acb82d | 4,426 | require 'jekyll'
require 'coveralls'
Coveralls.wear!
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.expand_path('../support', __FILE__) + '/**/*.rb']
.each { |f| require f }
RSpec.configure do |config|
config.include FixturesHelpers
con... | 30.951049 | 121 | 0.580886 |
03e4df472993ea7a8d24d479e506e9150abd4a83 | 125 | class AddDeletedAtToUser < ActiveRecord::Migration[4.2]
def change
add_column :users, :deleted_at, :datetime
end
end
| 20.833333 | 55 | 0.752 |
bff15c97f1541195910014e63978e86d46f24936 | 232 | describe command('chef-client -v') do
target_version = '13.10.0'
its('stdout') { should match "^Chef: #{target_version}" }
end
describe command('/opt/chef/embedded/bin/gem -v') do
its('stdout') { should cmp >= '2.6.11' }
end
| 25.777778 | 59 | 0.655172 |
39afe14122f783e7b9e5110f62aa5ff773230f2e | 974 | module Heartcheck
module Controllers
describe Essential do
subject(:controller) { described_class.new }
describe '#index' do
subject(:index) { controller.index }
let(:check_01) { { dummy1: { status: :ok }, time: 1100 } }
let(:check_02) { { dummy2: { status: :ok }, time: 100 }... | 28.647059 | 70 | 0.472279 |
abd06e4ce50803e61b75063cb3fdddbfe2d4b888 | 3,583 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::OperationsManagement::Mgmt::V2015_11_01_preview
module Models
#
# The container for solution.
#
class Solution
include MsRestAzure
... | 28.212598 | 77 | 0.456042 |
871d79412d1dbc8aba158b3147de35327638f060 | 1,762 | require 'helper'
class EphemeralBufferTest < Test::Unit::TestCase
def setup
Fluent::Test.setup
end
def test_configure_without_log_level
buf = Fluent::EphemeralBuffer.new
buf.configure({})
refute buf.instance_eval{ @log }.is_a?(Fluent::PluginLogger)
end
def test_configure_with_log_level
... | 25.911765 | 80 | 0.714529 |
38669344196f52eb5aaab38ce02589a5f8fcc9c4 | 889 | class NoticeMailer < ActionMailer::Base
default from: ENV['MAIL_SENDER']
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.notice_mailer.sendmail_update.subject
#
def sendmail_update(user, article)
@greeting = "Hi"
@user = user
@article = ar... | 21.682927 | 65 | 0.616423 |
2659d0efe56cd01ff71379e5af23af96d11a5f2c | 590 | # frozen_string_literal: true
require 'readymade/response'
module Readymade
class Action
class NonKeywordArgumentsError < StandardError; end
def self.call(*args, &block)
new(*args, &block).call
end
attr_reader :args, :data
def initialize(args = {})
raise NonKeywordArgumentsError i... | 19.032258 | 74 | 0.638983 |
083d5552551242665c6edf6e74213b63fcf535ff | 13,089 | describe ReviewResponseMap do
let(:team) { build(:assignment_team, id: 1, name: 'team no name', assignment: assignment, users: [student], parent_id: 1) }
let(:team1) { build(:assignment_team, id: 2, name: 'team has name', assignment: assignment, users: [student]) }
let(:review_response_map) { build(:review_respon... | 61.163551 | 161 | 0.734357 |
790f6fa21198cdd81d9cb1baa26ab3892f113412 | 186 | class SetSubscriptionStatusDefault < ActiveRecord::Migration[6.0]
def change
change_column :subscriptions, :status, :subscription_status, default: "pending", null: false
end
end
| 31 | 96 | 0.77957 |
f7e4a7070dad18435e5e030a923d69038c6ed2d9 | 106 | class RegistrationsController < Devise::RegistrationsController
clear_respond_to
respond_to :json
end
| 21.2 | 63 | 0.849057 |
7a3d19900ce51945c22baa14e09ef156866ea69b | 1,376 | require 'spec_helper'
require 'json'
describe Stackr::TemplateHelpers do
describe 'find_in_env_map' do
it 'returns a Fn::FindInMap fragment' do
expected = {
'Fn::FindInMap': [
'EnvironmentMap',
{
Ref: 'Environment'
},
'foo'
]
}
... | 25.481481 | 105 | 0.606105 |
6a3f1a06a89cd8bf67def2a8088084b5aad85cf3 | 3,183 | class Course < ActiveRecord::Base
attr_accessible :name, :code, :subject, :number, :description
has_many :prerequisite_relationships, :foreign_key => "prereq_for_id",
:class_name => "Prerequisite",
:dependent => :destroy
has_many :pre... | 28.168142 | 115 | 0.588439 |
6a7a94a88f76401326a490f0267a4fc77467cd23 | 43 | module FontAssets
VERSION = "0.1.11"
end
| 10.75 | 20 | 0.697674 |
28fe2e6f1908c48f0b76fb41959b7a00a1ee34dd | 338 | module MongoMetrics
class MetricsController < ApplicationController
respond_to :html, :json
respond_to :csv, only: :index
def index
@metrics = Metric.all
respond_with(@metrics)
end
def destroy
@metric = Metric.find(params[:id])
@metric.destroy
respond_with(@metric)
... | 18.777778 | 49 | 0.653846 |
ac5b9dac6cc7acc96b9b45d81e2bf114791ac515 | 395 | class PlainAccount < Account
EMAIL_REGEX = /([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})/i
include Mongoid::Document
include Mongoid::Timestamps
include ActiveModel::SecurePassword
attr_reader :password_confirmation
field :password_digest
has_secure_password
validates :email, presence: true, uniqueness: t... | 24.6875 | 119 | 0.696203 |
ac6ac03631cedf9c2b47f495e168f2e4c239182a | 720 | module LanguageTool
module Actions
class Check < Base
REQUIRED_PARAMETERS = %i(text language).freeze
OPTIONAL_PARAMETERS = %i(mother_tongue preferred_variants enabled_rules disabled_rules
enabled_categories disabled_categories enabled_only).freeze
PARAMETERS = (REQ... | 31.304348 | 92 | 0.672222 |
18de52c35cccc0be9e5c457fd73bae914b661a82 | 185 | require 'rails/engine'
module Babel
module Es6
module Rails
class Engine < ::Rails::Engine
config.app_generators.javascript_engine :es6
end
end
end
end
| 15.416667 | 52 | 0.664865 |
91dda9bada96284c80ede2050d5de5226319f195 | 396 | #
# Cookbook Name:: cpe_preferencesecurity
# Recipe:: default
#
# vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2
#
# Copyright (c) 2017-present, Pinterest, Inc.
# All rights reserved.
#
# This source code is licensed under the Apache 2.0 license found in the
# LICENSE file in the root directory of this... | 26.4 | 72 | 0.767677 |
03dd93aea61bbff7dea4d26c91d7f17e119699df | 295 | # frozen_string_literal: true
class ChangesetSerializer < ActiveModel::Serializer
root false
attributes :length_before, :length_after, :changes
def length_before
object.length_before
end
def length_after
object.length_after
end
def changes
object.changes
end
end
| 15.526316 | 52 | 0.759322 |
79ac4bab9b69f92ebbff2b888adf5932b708d5ef | 9,371 | require "rails_helper"
RSpec.describe Jobseekers::AlertMailer do
include DatesHelper
include OrganisationHelper
include ERB::Util
let(:body) { mail.body.raw_source }
let(:email) { "an@email.com" }
let(:frequency) { :daily }
let(:search_criteria) { { keyword: "English" } }
let(:subscription) do
sub... | 53.244318 | 138 | 0.683171 |
b970fde0d29375629d01a1226ed73a0c20c1711b | 957 | Pod::Spec.new do |s|
s.name = "AFHTTPSessionManager-AFUniqueGET"
s.version = "0.5.1"
s.summary = "Your GET request is in progress, better reuse it than create a new one, right?"
s.description = <<-DESC
This category of AFHTTPSessionManager adds the `uniqueGET` method, which is useful ... | 47.85 | 185 | 0.684431 |
21969e0807e0da93723b764146faae5ed7bec683 | 1,440 | module EwayRapid
module Message
module Convert
module Response
class DirectSettlementToSettlement
# @param [DirectSettlementSearchResponse] response
# @return [SettlementSearchResponse]
def do_convert(response)
settlement_search_response = SettlementSearchR... | 37.894737 | 97 | 0.655556 |
399e481971fc80aeed8feef63c2fd19e8da88c49 | 2,130 | require 'singleton'
require 'monitor'
require 'thread_safe'
module RablRails
class Library
include Singleton
UnknownFormat = Class.new(StandardError)
RENDERER_MAP = {
json: Renderers::JSON,
xml: Renderers::XML,
ruby: Renderers::Hash,
plist: Renderers::PLIST
}.freeze
... | 28.4 | 102 | 0.673239 |
4ac85c6fc3d7bf369b26d17c9ba3ddf696ca45b2 | 807 | Pod::Spec.new do |s|
s.name = "NUI"
s.version = "0.4.0"
s.summary = "Style iOS apps with a stylesheet, similar to CSS."
s.description = "NUI is a drop-in UI kit for iOS that lets you style UI elements using a stylesheet, similar to CSS. It lets you style an entire app in minutes."
s.homepag... | 47.470588 | 164 | 0.592317 |
391f84718e6f7c02b4d06b90dc82a17c765dd511 | 343 | class FinishTurnController < ApplicationController
FINISH_TURN_FAILED_ERROR = "Could not finish turn."
def create
@game = Game.find(params.require(:game_id))
finish_turn_result = FinishTurn.new(game: @game).call
if !finish_turn_result
flash[:errors] = [FINISH_TURN_FAILED_ERROR]
end
redir... | 24.5 | 57 | 0.731778 |
39cd46af7efeaa013fe8a6a474e6f6c2f7c527e4 | 6,556 | class Scaler::Listener::BoshScaler
class Condition
def self.load_by_definition(processors, deployment_name, job_name, options)
const_get(options['class'] + 'Condition').load(
processors,
deployment_name,
job_name,
options
)
end
class Base
attr_reader :t... | 26.329317 | 107 | 0.575351 |
bf569cae8993a0b10d5a321f19f8d3572b11af1d | 666 | require 'date'
require 'time'
class Rotation < Struct.new(:start, :name, :user_id)
def initialize(start, name, user_id)
super(Date.parse(start), name, user_id)
end
def start_date
self.start
end
def end_date
self.start + 7
end
def valid?(actual_schedule)
actual_user_id = actual_schedule... | 20.181818 | 59 | 0.705706 |
f867801e0e721832a6f6924f3910ce9e72dbabd5 | 1,133 | class WaylandProtocols < Formula
desc "Additional Wayland protocols"
homepage "https://wayland.freedesktop.org"
url "https://wayland.freedesktop.org/releases/wayland-protocols-1.23.tar.xz"
sha256 "6c0af1915f96f615927a6270d025bd973ff1c58e521e4ca1fc9abfc914633f76"
license "MIT"
livecheck do
url "https://... | 30.621622 | 121 | 0.658429 |
ac08ef76925a108751773f606ae83970209bc602 | 598 | # Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 37.375 | 74 | 0.759197 |
5d77ebb7b52b33da8474b57c4be36fc4f0517871 | 1,269 | #!/usr/bin/env ruby
# -------------------------------------------------------------------------- #
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License... | 57.681818 | 78 | 0.410559 |
2105bddb9ceadefaf4f41402a0cd7575d52bb33b | 2,830 | #
# Cookbook Name:: apt_test
# Recipe:: lwrps
#
# Copyright 2012, Chef Software, 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
#
# Un... | 35.822785 | 128 | 0.706714 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.