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 |
|---|---|---|---|---|---|
6a4bd508f05c09bb7cdd83e9defa4dee39b7ce50 | 8,040 | #!/usr/bin/env ruby
require 'active_support/inflector'
module Flapjack
module Gateways
class JSONAPI < Sinatra::Base
module Helpers
module Resources
ISO8601_PAT = "(?:[1-9][0-9]*)?[0-9]{4}-" \
"(?:1[0-2]|0[1-9])-" \
"(?:3[0-1]|0[1-9]|[1-2]... | 35.418502 | 120 | 0.465174 |
bbaa0784ef24f71d4e61182f4a013a3f9f29c316 | 331 | require 'spec_helper'
describe "One-liner should syntax" do
subject { 42 }
describe "should" do
it { should == 42 }
it { should_not == 43 }
end
describe "is_expected" do
it { is_expected.to eq(42) }
it { is_expected.to_not eq(43) }
end
describe "expect" do
it { expect(42).to eq(42) }... | 16.55 | 37 | 0.616314 |
0366259d677031431c61b80bf45fa2618731a078 | 485 | # frozen_string_literal: true
module Facts
module Freebsd
module Memory
module Swap
class Used
FACT_NAME = 'memory.swap.used'
def call_the_resolver
fact_value = Facter::Resolvers::Freebsd::SwapMemory.resolve(:used_bytes)
fact_value = Facter::FactsUtils::... | 23.095238 | 94 | 0.643299 |
bb45380c4346222f39f5034e587dc3bb645494d9 | 1,165 | # Load libkv adapter and plugins and add libkv 'extension' to the catalog
# instance, if it is not present
#
# @author https://github.com/simp/pupmod-simp-libkv/graphs/contributors
#
Puppet::Functions.create_function(:'libkv::support::load') do
# @return [Nil]
# @raise LoadError if libkv adapter software fails to ... | 30.657895 | 99 | 0.654077 |
01588e428906d60558ffcb6c48d4b13ea7cb99ab | 1,148 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v6/resources/payments_account.proto
require 'google/protobuf'
require 'google/api/field_behavior_pb'
require 'google/api/resource_pb'
require 'google/api/annotations_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
... | 33.764706 | 146 | 0.748258 |
2690d58fe2a37c8587368ee6976efadfcaedea76 | 139 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_raceday_session'
| 34.75 | 77 | 0.805755 |
01e042e2e92ee453a2a0a5156635f7d7da6b205d | 1,284 | # quietube
# by chetan sarva <cs@pixelcop.net> 2009-11-24
#
# posts shortened quietube version of youtube links with optional title
require '0lib_rbot'
require 'shorturl'
class QuietubePlugin < Plugin
include PluginLib
Config.register Config::BooleanValue.new("quietube.display_title",
:default => false,
... | 24.692308 | 71 | 0.553738 |
26ecd8ceeace8395eb1db3835155fe969674eb1a | 2,992 | # 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... | 32.521739 | 86 | 0.677139 |
2102f1dbfb14c65c20355f0c86ecae56c16b2a55 | 2,354 | # frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don... | 35.134328 | 87 | 0.763381 |
332d7639ee64a704dc4a51b6456a58ad6c3c116d | 2,051 | RSpec.describe Mutant::Reporter::CLI::Printer::EnvProgress do
setup_shared_context
let(:reportable) { env_result }
describe '.call' do
context 'without progress' do
with(:subject_a_result) { { mutation_results: [] } }
it_reports <<-'STR'
Mutant configuration:
Matcher: #<... | 27.346667 | 61 | 0.450512 |
212756637a4b5a4b17576b96f82e342876aa8fa6 | 180 | module ARuby
class Config
class ARubyConfig < Base
Config.configures :aruby, self
attr_accessor :log_output
attr_accessor :debug_enabled
end
end
end
| 16.363636 | 36 | 0.694444 |
5de6f8e868e75a8a4bacd1225e5a1a8354c0adfb | 861 | ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
class ActiveSupport::TestCase
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all... | 26.090909 | 82 | 0.659698 |
031d246d997232f02d324494b18deaea523cf296 | 10,008 | # ==========================================
# CMock Project - Automatic Mock Generation for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
require File.expand_path(File.dir... | 49.058824 | 161 | 0.666167 |
ffab46bf270fbe66e60b868940aa9679ebef897f | 957 | cask "app-fair" do
version "0.8.53"
sha256 "e97179eaafe761341f6a80525cca20384defcf4fbbc58ae2c480a7d1972d2a51"
url "https://github.com/App-Fair/App/releases/download/#{version}/App-Fair-macOS.zip",
verified: "github.com/App-Fair/App/"
name "App Fair"
desc "Catalog of free and commercial native desktop a... | 34.178571 | 88 | 0.703239 |
4a0cc8c536259c9373b27c3237ce344a922de01e | 170 | module IshBlog
class ApplicationController < ActionController::Base
def current_ability
@current_ability ||= IshBlog::Ability.new(current_user)
end
end
end
| 21.25 | 59 | 0.764706 |
38d7c804384fdf2f3d52cbb25360a533761504e3 | 1,824 | unless ENV["HOMEBREW_BREW_FILE"]
raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!"
end
# Path to `bin/brew` main executable in HOMEBREW_PREFIX
HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"])
# Where we link under
HOMEBREW_PREFIX = Pathname.new(ENV["HOMEBREW_PREFIX"])
# Where ... | 35.764706 | 92 | 0.795504 |
b90f5eae9163da1e6af7debb8cef87211f747fc3 | 1,344 | =begin
#Selling Partner API for Direct Fulfillment Shipping
#The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.33
=... | 32.780488 | 133 | 0.798363 |
d5c151e589587094b1db3b8d3d4f4d7693ba07a0 | 2,133 | # 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... | 33.328125 | 86 | 0.72105 |
f7294f86a006cdd3b4a6debd22a3530aa7006745 | 793 | require_relative 'helper'
require_relative '../lib/day'
class TestDay < Minitest::Test
def test_initializing_a_day_saves_values
d = Day.new(05, 2015)
assert_equal 05, d.month
assert_equal 2015, d.year
end
def test_initializing_a_month_starting_on_sunday
d = Day.new(01, 2012)
assert_equal 1,... | 19.825 | 53 | 0.7314 |
edfc48c3bc9417586f1170d4baf0984a0a0326c7 | 126 | class CreateUser < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name
end
end
end
| 15.75 | 42 | 0.674603 |
1aff0937b5d35a0551b8e6ed133d4df2df8163f4 | 3,028 | module Provide
module Services
class Tourguide < Provide::ApiClient
def initialize(scheme = 'http', host, token)
@scheme = scheme
@host = host
@token = token
end
def directions(from_latitude, from_longitude, to_latitude, to_longitude, waypoints = nil, departure = 'now',... | 28.838095 | 132 | 0.560106 |
2686600fc617022f6f8d7e73eba61e9268da13e5 | 1,731 | # Basic implementation of a tagged logger that matches the API of
# ActiveSupport::TaggedLogging.
require 'logger'
module Kafka
class TaggedLogger < SimpleDelegator
%i(debug info warn error fatal).each do |method|
define_method method do |msg_or_progname, &block|
if block_given?
super(m... | 22.480519 | 82 | 0.629694 |
6ab67f5fea535ecfeafc4de5234ac2167c968ff6 | 576 | # frozen_string_literal: true
# == Schema Information
#
# Table name: absences
#
# id :integer not null, primary key
# lesson_id :integer not null
# student_id :integer not null
#
# Indexes
#
# index_absences_on_lesson_id (lesson_id)
# index_absences_on_student_id (student_i... | 19.862069 | 53 | 0.668403 |
1d165f43ecdf5166841f689c0f430a13566d172e | 9,495 | require "schema_to_scaffold"
module SchemaToScaffold
class CLI
TABLE_OPTIONS = "\nOptions are:\n4 for table 4; (4..6) for table 4 to 6; [4,6] for tables 4 and 6; * for all Tables"
def self.start(*args)
## Argument conditions
opts = parse_arguments(args)
if opts[:help]
puts Help.me... | 37.529644 | 187 | 0.609584 |
6ac87150e259bc6ecc12deeba0298bdf1b5bcfd5 | 231 | class PostIndexSerializer < ActiveModel::Serializer
attributes :id, :track, :artists, :image, :preview, :description, :likes
has_many :comments, serializer: CommentsIndexSerializer
def likes
object.likes.count
end
end
| 25.666667 | 74 | 0.761905 |
6a4872e8a80b64c2ef1d7a7f90654798b96c78ee | 104 | module Stache
class Helper < Stache::Mustache::View
def url
h.stache_path
end
end
end
| 13 | 39 | 0.653846 |
6183c0030ccf6f89ffae4d08aafc3d6de73966f8 | 3,488 | #==============================================================================
# Vehicle Ports
# Version: 1.0.0
# Author: modern algebra (rmrk.net)
# Date: 29 December 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script allows you to s... | 46.506667 | 92 | 0.490539 |
abe5c88487724b22d194cc3a01dff2bb747e1f08 | 1,809 | # frozen_string_literal: true
#
# Copyright:: 2019, Chef Software Inc.
# Author:: Tim Smith (<tsmith@chef.io>)
#
# 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/licens... | 35.470588 | 210 | 0.650083 |
ffd4db07730c64e60248224564468da36d1a52da | 1,831 | # 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... | 38.145833 | 86 | 0.732387 |
38a9afd53d2d9d536b89566bca774c9fdc69f0d7 | 5,394 | # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 31 | 82 | 0.605858 |
03e3cf0512edd8ce2e10a53351cd56beac939358 | 511 | class ApplicationController < ActionController::Base
helper_method :current_user
def home
require_login
if current_user && !(current_user.username.present?)
current_user.username = current_user.email
end
end
def welcome
redirect_to home_path if user_signed_in?
end... | 21.291667 | 74 | 0.657534 |
6a5e547f1f49927490583e0f2f7f30f5fe68ac59 | 1,034 | # frozen_string_literal: true
# Copyright 2021 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... | 28.722222 | 74 | 0.731141 |
28518139164321129036b450fc464732a2d699a7 | 1,152 | class MovieTags < ActiveRecord::Migration
def self.up
# drop old tag tables
drop_table :tags
drop_table :taggings
create_table :categories do |t|
# parent tag
t.column :category_id, :int
end
create_table :movie_user_categories do |t|
t.column :category_id, :integer
... | 26.181818 | 72 | 0.638021 |
f893aaa18a0afc9acf9ea0a5afb9157fc7b8b937 | 591 | require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "leopard-react-native"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors ... | 28.142857 | 97 | 0.592217 |
1d5899ccc171c389f94fbee5437653a99f84b8be | 161 | class CreateActivities < ActiveRecord::Migration[5.2]
def change
create_table :activities do |t|
t.string :name
t.timestamps
end
end
end
| 17.888889 | 53 | 0.677019 |
1dbc4cc95ecb68382596f553aa5ea0ec4bfe86f2 | 832 | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
# Maintain your gem's version:
require 'workarea/authorize_cim/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = 'workarea-authorize_cim'
s.version = Workarea::AuthorizeCi... | 29.714286 | 79 | 0.698317 |
ac17b8c930f884be2757cc02c3f00527554f0bd2 | 3,662 | require "factory_girl_rails"
require "webmock/rspec"
require 'simplecov'
# Report to CodeClimate test coverage tool.
SimpleCov.start
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 yo... | 40.688889 | 133 | 0.708356 |
4a70326c973c0e44c949ed4d02d7f1c7912d2191 | 158 | class Pattern < ActiveRecord::Base
belongs_to :user
has_many :needles
has_many :yarns
has_many :comments
validates_presence_of :name, :content
end
| 17.555556 | 39 | 0.765823 |
7a525f37b61037982c654366c746187780048cb3 | 38 | module Exonio
VERSION = "0.5.4"
end
| 9.5 | 19 | 0.657895 |
e2a70e47a7ac7c0834ee2e527351b5f51b599937 | 29 | # typed: true
if /wat/; end
| 7.25 | 13 | 0.586207 |
2158440d1ec2411f3b86e6af71acb5c30940f2ad | 234 | require File.expand_path('../../../../spec_helper', __FILE__)
require 'thread'
require File.expand_path('../../shared/queue/empty', __FILE__)
describe "Thread::Queue#empty?" do
it_behaves_like :queue_empty?, :empty?, Queue.new
end
| 29.25 | 62 | 0.717949 |
61a114d1b57a08e56b12f7b58c39d999fe4f64d1 | 364 | class Sparkle < Cask
version '1.8.0'
sha256 '882f2e414d2d8a3e776f9a9888cbfcb744df88f3b061325c2aad3c965af5ac1a'
url "https://github.com/sparkle-project/Sparkle/releases/download/#{version}/Sparkle-#{version}.tar.bz2"
appcast 'http://sparkle-project.org/files/sparkletestcast.xml'
homepage 'http://sparkle-proje... | 33.090909 | 106 | 0.771978 |
3919bbb14a5d006fae1fdd1bde82fb3d74614c95 | 364 | Rails.application.routes.draw do
root to: 'application#home'
resources :arrangements do
resources :orders, only: [:new, :index, :show, :create]
end
resources :users
get '/login', :to => 'sessions#new'
post '/sessions', :to => 'sessions#create'
get '/logout', :to => 'sessions#destroy'
get '/aut... | 24.266667 | 59 | 0.656593 |
181bbeb99b2578ce7112822453bd93a719188a20 | 1,264 | module Ingenico::Connect::SDK
# Indicates that a payout is declined by the Ingenico ePayments platform or one of its downstream partners/acquirers.
class DeclinedPayoutException < DeclinedTransactionException
# Create a new DeclinedPayoutException.
# @see ApiException#initialize
def initialize(status_... | 28.088889 | 119 | 0.655854 |
bfa0f7c54c6cb3ed2e63b9162f6d0abdd7a1fa84 | 1,699 | # 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_04_01
module Models
#
# Common error details representation.
#
class ErrorDetails
include MsRest... | 24.623188 | 70 | 0.486168 |
4ab550505549a9cd3a98590901a7c012edb3013c | 1,211 | require 'helper'
class AddOutputTest < Test::Unit::TestCase
def setup
Fluent::Test.setup
end
CONFIG = %[
add_tag_prefix pre_hoge
<pair>
hoge moge
hogehoge mogemoge
</pair>
]
CONFIG_UU = %[
uuid true
<pair>
hoge moge
hogehoge mogemoge
</pair>
]
def c... | 17.550725 | 78 | 0.593724 |
1a21d7a8778031e5eb7f9a0b3daf0af19af04a02 | 428 | # frozen_string_literal: true
namespace :jira_connect do
# This is so we can have a named route helper for the base URL
root to: proc { [404, {}, ['']] }, as: 'base'
get 'app_descriptor' => 'app_descriptor#show'
get :users, to: 'users#show'
namespace :events do
post 'installed'
post 'uninstalled'
... | 23.777778 | 64 | 0.670561 |
1cf11d1b68393e3feb5b1101dddbdf3117193171 | 498 | # frozen_string_literal: true
class FiggyEventProcessor
attr_reader :event
def initialize(event)
@event = event
end
delegate :process, to: :processor
private
def event_type
event["event"]
end
def processor
case event_type
when "CREATED"
CreateProcessor.new(event)... | 16.6 | 35 | 0.634538 |
1c84b6c31b5a8518e68275dabc7878fa3c59ebe2 | 248 | require 'spec_helper'
def app
ApplicationApi
end
describe UsersApi do
include Rack::Test::Methods
describe 'e.g. GET, POST, PUT, etc.' do
it 'needs tests to be written!' do
pending('write tests for UsersApi!')
end
end
end
| 14.588235 | 42 | 0.677419 |
e8a105bf0b2c5ff79da1dda9b37f6410827a8856 | 749 | # frozen_string_literal: true
module Renalware
module UKRDC
module Outgoing
module Rendering
class LabOrders < Rendering::Base
pattr_initialize [:patient!]
def xml
lab_orders_element
end
private
def lab_orders_element
crea... | 24.16129 | 93 | 0.59012 |
bf6db1e17f50f31b86d2709ff01d4df37f1313cf | 969 | # 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... | 42.130435 | 86 | 0.768834 |
1100b5f1b9d060232a453ce022f10e64b8e7fc50 | 74 | require 'ruby_box'
module RubyBox
class Error < StandardError
end
end | 12.333333 | 29 | 0.77027 |
624425fb6e031d8ae88a38de678b3560c653e538 | 127 | require 'rails_helper'
RSpec.describe Bartender, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
| 21.166667 | 56 | 0.748031 |
1da3dde62201cccb5117e8fad30a29e952b8b69f | 2,181 | module Calculators
class DependantAllowanceCalculator
def self.call(dependant)
new(dependant).call
end
def initialize(dependant)
@dependant = dependant
end
def call
return child_under_15_allowance if under_15_years_old?
return child_under_16_allowance if under_16_years_o... | 25.964286 | 99 | 0.74553 |
ed00009928dfa656d6560d4435c7dc7ea8fb6e01 | 1,388 |
Pod::Spec.new do |s|
s.name = "UITableView+FDTemplateLayoutCell"
s.version = "1.6"
s.summary = "Template auto layout cell for automatically UITableViewCell height calculate, cache and precache"
s.description = "Template auto layout cell for automatically UITableViewCell height calculate, cac... | 63.090909 | 238 | 0.505043 |
2195642e7329c41f802fb5257facca1f5ca30ba0 | 1,697 | require 'spec_helper'
require 'pawnee/base'
# NOTE: These are designed to run in order on vagrant
describe "user actions" do
before do
@base = Pawnee::Base.new
@base.destination_connection = VagrantManager.connect
end
def user_exists?(login)
_, _, exit_code, _ = @base.exec("id -u #{login}", :with... | 29.77193 | 136 | 0.645256 |
bf41654ab2ed51ddafb2b60f15061fd64a436176 | 7,983 | require 'test_helper'
class RemoteGlobalCollectTest < Test::Unit::TestCase
def setup
@gateway = GlobalCollectGateway.new(fixtures(:global_collect))
@amount = 100
@credit_card = credit_card('4567350000427977')
@declined_card = credit_card('5424180279791732')
@accepted_amount = 4005
@rejected_... | 31.678571 | 97 | 0.712013 |
1a7eb769b8201a37538ca8771c990e0f4b5a033e | 366 | module ApplicationHelper
def controller?(*controller)
controller.include?(params[:controller])
end
def action?(*action)
action.include?(params[:action])
end
def nav_link(link_text, link_path)
class_name = current_page?(link_path) ? 'active' : ''
content_tag(:li, :class => class_name) do
lin... | 17.428571 | 55 | 0.696721 |
ac012ac79967cd597e8d5d35aebafd44b34e39b5 | 536 | ENV['RACK_ENV'] = 'test'
require("bundler/setup")
Bundler.require(:default, :test)
Dir[File.dirname(__FILE__) + '/../lib/*.rb'].each { |file| require file }
require("bundler/setup")
Bundler.require(:default, :test)
set(:root, Dir.pwd())
require('capybara/rspec')
Capybara.app = Sinatra::Application
set(:show_excepti... | 19.851852 | 73 | 0.660448 |
ab429ccee2ec0313185c6130f3bd9a73909a2fa7 | 3,182 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject,... | 36.574713 | 104 | 0.694846 |
180956d8bf2b25495d6142249e2a9a96d7e77033 | 427 | cask :v1 => 'bootxchanger' do
version '2.0'
sha256 'cfb05680ab6a7d0b1793a33135dd15562a7b5fd59bb1ebf3ad6067c2c9fad6c1'
url "http://namedfork.net/_media/bootxchanger_#{version}.dmg"
appcast 'http://swupdate.namedfork.net/bootxchanger.xml',
:sha256 => 'afbae3b2a378ebb18f1668c062ba48436e956cad840fcc86cba... | 32.846154 | 87 | 0.772834 |
6a9f6793ef909a6889959832bd0b7548c13f3541 | 3,597 | require 'spec_helper'
require 'pp'
# I have to do a bunch of shenanigans to get the stuff to load in order ot test
# require_relative '../../../stash_engine/app/serializers/stash_engine/serializer_mixin'
SERIAL_PATH = StashEngine::Engine.root.join('app/serializers/stash_engine')
$LOAD_PATH.unshift(SERIAL_PATH)
requir... | 47.96 | 135 | 0.674173 |
6226301142125bd6bcac84847a6f9ad5c0694a15 | 1,661 | require 'spec_helper'
require 'albacore/plink'
describe PLink, 'when executing a command over plink' do
before :each do
@cmd = PLink.new
@cmd.extend(SystemPatch)
@cmd.extend(FailPatch)
@cmd.command ="C:\\plink.exe"
@cmd.host = "testhost"
end
it "should attempt to execute plink.exe" do
@... | 26.365079 | 78 | 0.695364 |
edf07e4e5ace75a07464bf40658e0319b729426f | 1,502 | =begin
#Fatture in Cloud API v2 - API Reference
#Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol.
The vers... | 30.653061 | 261 | 0.745672 |
4a87b0f37ff7551a2b904bfdb23bbf54b5fb4ba1 | 1,970 | Sequel.migration do
up do
alter_table :apps_routes do
# mysql requires foreign key to be dropped before index
drop_foreign_key [:app_id], name: :fk_apps_routes_app_id
drop_foreign_key [:route_id], name: :fk_apps_routes_route_id
drop_index [:app_id, :route_id], name: :ar_app_id_route_id_in... | 31.269841 | 89 | 0.688325 |
bf4d652692fa48d52fbcafcb5d8c464e61e720ca | 13,996 | Given(/^Multiple Conversion Employers for (.*) exist with active and renewing plan years$/) do |named_person|
person = people[named_person]
secondary_organization = FactoryGirl.create :organization, legal_name: person[:mlegal_name],
dba: person[:mdba],
... | 50.164875 | 221 | 0.639183 |
f860ec18178c6f20fe6637e221c57b35aca4ad6e | 21,593 | #
# 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, software
# distributed under ... | 42.091618 | 464 | 0.60339 |
ff27efd9520daa2a01884cb508e3d32489b0431d | 1,669 | class DefectPresenter < SimpleDelegator
delegate :contractor_name, to: :scheme
delegate :contractor_email_address, to: :scheme
delegate :name, to: :priority, prefix: :priority
def reporting_officer
'Hackney New Build team'
end
def address
communal? ? communal_area.location : property.address
end... | 21.960526 | 86 | 0.698622 |
e2a401d0c87ef6441c2ca0bb1bbe6dc4696b8a11 | 923 | module RubyLint
module Template
##
# Class used for storing variables for an ERB template without polluting
# the namespace of the code that uses the template.
#
class Scope
##
# @param [Hash] variables
#
def initialize(variables = {})
variables.each do |name, value... | 24.289474 | 78 | 0.561213 |
18881dbbd159013d5bd4f574b3199b9b088c07c3 | 1,635 | module Codebreaker
class Game
HINTS = 3
CODE_SIZE = 4
ATTEMPTS = 5
RANGE_NUMBER = 1..6
attr_accessor :secret_code, :user_code
def initialize
@secret_code = secret_code
@user_code = user_code
@hint = HINTS
end
def new_game
start
input_user_cod... | 18.166667 | 79 | 0.542508 |
38ba06c08420c05bc2928c5b5b2e120f7b0bde04 | 2,096 | require 'spec_helper'
require 'ddtrace/contrib/sucker_punch/integration'
RSpec.describe Datadog::Contrib::SuckerPunch::Integration do
extend ConfigurationHelpers
let(:integration) { described_class.new(:sucker_punch) }
describe '.version' do
subject(:version) { described_class.version }
context 'when... | 30.376812 | 108 | 0.701813 |
265fa499eb2bb5528f0682ba17e9e56b90bdbd25 | 49,727 | require 'test/unit'
require 'pp'
require_relative 'envutil'
$m0 = Module.nesting
class TestModule < Test::Unit::TestCase
def _wrap_assertion
yield
end
def assert_method_defined?(klass, mid, message="")
message = build_message(message, "#{klass}\##{mid} expected to be defined.")
_wrap_assertion do
... | 25.203751 | 125 | 0.635289 |
388057ae079e683e476bb0970288d9de9d752b0f | 870 | Уведомления о недобросовестных интернет-магазинах будут распространяться среди москвичей.
В Москве выйдет уведомление о том, как избежать стать жертвой интернет-магазина.
Об этом сообщил Роспотребнадзор, пишет М24.
Сообщается, что эксперты агентства готовят уведомление, которое поможет гражданам правильно выбрать интер... | 87 | 167 | 0.83908 |
1a6352831981974f577212b4aa05733eaa402bb7 | 175 | require 'models_data'
class UploadModels < UploadCsvFile
def initialize_data(path)
@data = ModelsData.new(
path, @csv_upload.user, encoding(path)
)
end
end
| 17.5 | 44 | 0.702857 |
2860f751b3aa4edbe713624f8c1310abccc92a17 | 551 | class DropNotifications < ActiveRecord::Migration[4.2]
def up
drop_table :notifications
end
def down
create_table :notifications do |t|
t.string :title, null: false
t.text :body, null: false
t.string :state, default: 'draft', null: false
t.integer :comments_count, default... | 26.238095 | 57 | 0.631579 |
1af8e485d540822c75c76a40e91a0abf37a9c6c1 | 2,815 | class User < ApplicationRecord
has_many :microposts, dependent: :destroy
attr_accessor :remember_token, :activation_token, :reset_token
before_save :downcase_email
before_create :create_activation_digest
validates :name, presence: true, length: { maximum: 50 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[... | 29.020619 | 78 | 0.702309 |
ac6a9b11d97be9b02a0b31b04b5a8e3e237b7ef4 | 91 | json.extract! @web_config, :id, :directory, :scan_interval, :old, :created_at, :updated_at
| 45.5 | 90 | 0.747253 |
6a9089bccf47d9a752281313390df2590c7e6867 | 3,894 | require "active_support"
require "mechanize"
require 'openssl'
class EveGate
class Mail
attr_accessor :receipient, :subject, :read
#attr_writer :body, :sender, :to
def initialize(mail, agent)
@read = mail.children[2].children[1].attributes['alt'].text == 'Read'
@sender = mail.children[4... | 29.059701 | 126 | 0.616846 |
268858ccac8971e285db6a3a9ecdf7a1183ff53c | 780 | require 'minitest/spec'
describe_recipe 'apache2::mod_python' do
include MiniTest::Chef::Resources
include MiniTest::Chef::Assertions
before :all do
@prefix = case node[:platform_family]
when 'rhel'
node[:apache][:dir]
when "debian"
".."
... | 26 | 81 | 0.620513 |
bf80b29a1d6bf568d21ec15ec9d00343dc4af43d | 886 | require 'spec_helper'
describe ManualPayment do
before do
@pay = described_class.new
end
describe "when a registrant has been added" do
let(:registrant) { FactoryBot.create(:competitor) }
let(:expense_item) { FactoryBot.create :expense_item, cost: 10.00, tax: 2.00 }
let!(:registrant_expense_item... | 28.580645 | 130 | 0.702032 |
1a11c7563771e31acd6ca5bd335dbfeef974533f | 240 | class Gallery < Actor
has_many :locations, :as => :addressable
has_many :exhibitions, :as => :organizer
has_many :transactions, :as => :recipient
has_many :transactions, :as => :supplier
validates_presence_of :name
end | 26.666667 | 45 | 0.691667 |
6289230e20c1066065bbb1908162f6fc8e9df4c6 | 968 | describe SwitchmanInstJobs::Delayed::MessageSending do
shared_examples_for 'batch jobs sharding' do
it 'should keep track of the current shard on child jobs' do
project.shard.activate do
::Delayed::Batch.serial_batch do
expect(
'string'.delay(ignore_transaction: true).size
... | 28.470588 | 77 | 0.658058 |
1c393bf45bf6e49cb5dca5238cfd0f0b63a37202 | 428 | cask 'gearsystem' do
version '3.0.2'
sha256 '23559909818aaa99f8e1d87cc944583bd9ffaa8ad77a1e2f6a284a465700ee4f'
url "https://github.com/drhelius/Gearsystem/releases/download/gearsystem-#{version}/Gearsystem-#{version}-macOS.zip"
appcast 'https://github.com/drhelius/Gearsystem/releases.atom'
name 'Gearsystem'
... | 35.666667 | 118 | 0.78271 |
87904845a96b8dd481c9d1428959312e81f8ab55 | 213 | class CreateComments < ActiveRecord::Migration[5.2]
def change
create_table :comments do |t|
t.string :content
t.integer :league_id
t.integer :team_id
t.timestamps
end
end
end
| 17.75 | 51 | 0.657277 |
334528e3dd3df9e4b1d2c5c4ec20ab5c4b7fd9dd | 3,465 | require 'metasm'
require 'erb'
require 'metasploit/framework/compiler/utils'
require 'metasploit/framework/compiler/headers/windows'
require 'metasploit/framework/obfuscation/crandomizer'
module Metasploit
module Framework
module Compiler
class Windows
# Returns the binary of a compiled source.
... | 37.663043 | 110 | 0.627417 |
6af64610b4df7f21f2acae843ac943c41cc6b9bf | 1,167 | cask 'rider' do
version '2020.1.0,201.6668.197'
sha256 '18ec5af9491654c159cae1386748d7653c5e9e596db30a58222acec2730c9d27'
url "https://download.jetbrains.com/rider/JetBrains.Rider-#{version.before_comma}.dmg"
appcast 'https://data.services.jetbrains.com/products/releases?code=RD&latest=true&type=release'
nam... | 43.222222 | 250 | 0.685518 |
876f1aa3cf7d4068d76e6de1ccc0f586c7ac9035 | 878 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 41.809524 | 74 | 0.771071 |
ffc28ff527ee7861685294e9ec41a2dc07e631cb | 171 | class Article < ApplicationRecord
has_many :comments, dependent: :destroy
validates :title, presence: true, length: {minimum: 3}
validates :text, presence: true
end
| 28.5 | 56 | 0.754386 |
e86a95f285ef581961c8bb3fc1311f80294042f2 | 914 | class UserController < ApplicationController
get '/signup' do
erb :"users/signup"
end
post '/signup' do
user = User.new(params)
if user.save
session[:user_id] = user.id
redirect to('/users')
else
flash[:message] = user.errors.full_messages.to_sentence
redirect to('/sign... | 19.446809 | 69 | 0.615974 |
ab0c3039356a35afce2eecf8fe378917f9c1493a | 3,566 | ##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# / /
require 'spec_helper.rb'
describe 'UserChannel' do
it "can read" do
@holodeck.mock(Twilio::Response.new(500, ''))
expect {
@client.ip_messaging.v2.services('ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa') ... | 38.76087 | 191 | 0.586371 |
bf43e1c432c535ea5ef60d5edbc319aad2a815b2 | 1,675 | require 'aws-sdk-resources'
module Prpr
module Action
module CodeDeploy
class Deploy < Base
def call
if name = deployment_group_name(event)
deployment = create_deployment(name, deploy_commit)
Prpr::Publisher::Adapter::Base.broadcast message(deployment)
en... | 26.171875 | 72 | 0.545075 |
f7f39f485e29f23d83ab8c06e4666335d39ab838 | 240 | module Ebay # :nodoc:
module Types # :nodoc:
class VeROReportPacketStatusCode
extend Enumerable
extend Enumeration
Received = 'Received'
InProcess = 'InProcess'
Processed = 'Processed'
end
end
end
| 18.461538 | 36 | 0.65 |
ed44bdd00f7e6f97fb8c2c8d6e965518e4353d13 | 8,129 | Rails.application.routes.draw do
if Rails.env.development?
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
end
post "/graphql", to: "graphql#execute"
devise_for :users, only: %i[sessions omniauth_callbacks], controllers: { sessions: 'users/sessions', omniauth_callbacks: 'users/omn... | 33.870833 | 151 | 0.670808 |
332d3b6f77e2947b163439df0f7e6aca3540dc87 | 75 | module MyCustomHelper
def quote
quote =[]
quote[0] = ""
end
end | 12.5 | 21 | 0.6 |
f7f45b87921f330a88b6bb65dc8b6dc1e8e63f0e | 35,427 | # 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... | 53.840426 | 168 | 0.556017 |
bb074195f9aef751f361747ba0bd06efa8dc7cfe | 285 | class AddIndicesToMemberships < ActiveRecord::Migration
self.disable_ddl_transaction!
def up
execute "CREATE INDEX CONCURRENTLY index_memberships_on_user_id ON memberships(user_id)"
end
def down
execute "DROP INDEX CONCURRENTLY index_memberships_on_user_id"
end
end | 25.909091 | 92 | 0.810526 |
1d8923f4552e7b9abc3db25c08f620a9bd7343df | 263 | require 'uri'
module Mondo
module Utils
extend self
# String Helpers
def camelize(str)
str.split('_').map(&:capitalize).join
end
def underscore(str)
str.gsub(/(.)([A-Z])/) { "#{$1}_#{$2.downcase}" }.downcase
end
end
end
| 15.470588 | 64 | 0.574144 |
01bba50a18fbc97e74145d02b698c3b8e3776623 | 1,223 | Pod::Spec.new do |s|
s.name = "BraintreeVisaCheckout"
s.version = "6.0.0"
s.summary = "Braintree Visa Checkout component for use with the Braintree iOS SDK"
s.description = <<-DESC
Braintree is a full-stack payments platform for developers
... | 45.296296 | 121 | 0.638594 |
e9ac18c5f6ad7bb2915debaf654dddfe9374d3a2 | 147 | # Be sure to restart your server when you modify this file.
PoweredBy::Application.config.session_store :cookie_store, key: '_powered-by_session'
| 36.75 | 85 | 0.802721 |
33a3bc4a311b529fd8e8b1b0d7ea1e98eba8b629 | 2,734 | # Authentication wrapper around other Totem::Settings.
module Totem
module Core
module Support
class Authentication
attr_reader :totem_settings
# Should always use the public methods to access these instance variables.
# Listing the instance variables used to provide easily access ... | 34.175 | 122 | 0.68654 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.