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 |
|---|---|---|---|---|---|
bbd796481500436066b7a9986f82a3f35e610c78 | 116 | # typed: strict
class BClass
extend T::Sig
sig {returns(A::AClass)}
def get_a
A::AClass.new()
end
end
| 10.545455 | 26 | 0.62931 |
f7e5428903fbd36bd81df030a699117ef6e012b3 | 426 | # Adding clusterization (http://apidock.com/rails/Enumerable/group_by)
module Enumerable
# clumps adjacent elements together
# >> [2,2,2,3,3,4,2,2,1].cluster
# => [[2, 2, 2], [3, 3], [4], [2, 2], [1]]
def cluster
cluster = []
each do |element|
if cluster.last && cluster.last.last == element
... | 23.666667 | 70 | 0.58216 |
b97101ed0ca01e9b9f65a04f118d47a0c842fc66 | 2,167 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
module Backstage
class Application < Rails::Application
# Settings in config/environments/* ta... | 40.886792 | 119 | 0.702353 |
3381f089fee92f2d9ea5c3f5d5289214794d1dba | 1,514 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "php_serializer/version"
Gem::Specification.new do |spec|
spec.name = "php_serializer"
spec.version = PhpSerializer::VERSION
spec.authors = ["vijayrsv"]
spec.email ... | 39.842105 | 177 | 0.680317 |
ff3f67e28a20bada695bf4329caed17e0af3303e | 5,208 | class ElasticsearchAT68 < Formula
desc "Distributed search & analytics engine"
homepage "https://www.elastic.co/products/elasticsearch"
url "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.8.8.tar.gz"
sha256 "aa2d751ec449d70164338049e9596e77d6f6fed8ab47cd604663605031217364"
license "A... | 32.962025 | 108 | 0.631144 |
260ee3d86d289b21db69f133d03083fe70a1b11b | 65 | module Serverless
module Local
VERSION = "0.1.0"
end
end
| 10.833333 | 21 | 0.661538 |
08d887ec5c885a296a310cf7804b2f0f5b610450 | 303 | cask :v1 => 'macintosh-explorer' do
version :latest
sha256 :no_check
url 'http://www.ragesw.com/downloads/ragesw/mac_explorer_alt.dmg'
homepage 'http://www.ragesw.com/products/explorer.html'
license :unknown # todo: improve this machine-generated value
app 'Macintosh Explorer.app'
end
| 27.545455 | 67 | 0.742574 |
f76990b915e89bccd6498843e666f0fc87d56b86 | 21,920 | require 'molinillo'
require 'cocoapods/podfile'
module Pod
class NoSpecFoundError < Informative
def exit_status
@exit_status ||= 31
end
end
# The resolver is responsible of generating a list of specifications grouped
# by target for a given Podfile.
#
class Resolver
require 'cocoapods/re... | 37.66323 | 161 | 0.651962 |
2872e52153659adb16dcd921a1b44eae40cd42ce | 821 | module Byebug
#
# Show byebug settings.
#
class ShowCommand < Command
self.allow_in_control = true
def regexp
/^\s* show (?:\s+(?<setting>\w+))? \s*$/x
end
def execute
key = @match[:setting]
return puts(self.class.help) if key.nil?
full_key = Setting.find(key)
re... | 18.659091 | 79 | 0.559074 |
186f0c1bc9a0038579eb769d169ac64f6f2f39f9 | 612 | class Quote
@@quotes_all = []
attr_accessor :quote, :author, :categories
def initialize(quote)
@quote = quote
@@quotes_all << self
end
def self.all
@@quotes_all
end
def self.find_quote(quote)
@@quotes_all.select{|a| a quote == quote}
end
def self.s... | 17 | 46 | 0.593137 |
9167192434f06f99d8db56918b5f8447cc72e4ca | 259 | module Sensu
module Extension
class Fail < Mutator
def name
'fail'
end
def description
'fails to do anything'
end
def run(event, settings, &block)
block.call('fail', 2)
end
end
end
end
| 14.388889 | 38 | 0.540541 |
abdab3fc71b0a120f6a4a9cb8bbfbb0edb7c0be1 | 1,396 | #
# EDOS/src/REI/Character.rb
# by IceDragon
# dc 06/05/2013
# dm 11/05/2013
# vr 0.0.1
module REI
class CharacterBase
attr_accessor :unit
##
attr_accessor :face_name
attr_accessor :face_index
attr_accessor :face_hue
##
attr_accessor :character_name
attr_accessor :character_ind... | 18.368421 | 52 | 0.643983 |
01b096ad109e3204bd0f5e9345349f4062237989 | 3,056 | require 'spec_helper_acceptance'
# Ensure time synchronization is in use - Section 2.2.1.1
describe package('ntp') do
it { should be_installed }
end
describe package('chrony') do
it { should be_installed }
end
# Ensure ntp is configured - Section 2.2.1.2
describe file('/etc/ntp.conf') do
it { should be_f... | 24.845528 | 84 | 0.692736 |
87f2dbbcc8ff4cfd6568142e6f8cac59466733f2 | 112 | puts "Enter Voltage: "
u = gets.to_i
puts "Enter Resistance: "
r = gets.to_i
i = u/r
puts "I = #{i.to_s}" | 18.666667 | 26 | 0.589286 |
d5cddc41881154541c0f9ce7434e9a2361b58efb | 84 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'cagnut_toolbox'
| 28 | 58 | 0.75 |
1aa7f6dcba0a8c3b54d9aec60318fa869df32914 | 407 | # coding: utf-8
class ONIX::Series < ONIX::Element
xml_name "Series"
onix_composite :series_identifiers, ONIX::SeriesIdentifier
xml_accessor :title_of_series, :from => "TitleOfSeries"
onix_composite :titles, ONIX::Title
onix_composite :contributors, ONIX::Contributor
xml_accessor :number_within_series, :fr... | 33.916667 | 67 | 0.773956 |
5d018f51499222c4dfab4f0d7a73613e4aeb3724 | 915 | # https://github.com/wildbit/postmark-gem
module Mailkick
class Service
class Postmark < Mailkick::Service
REASONS_MAP = {
"SpamNotification" => "spam",
"SpamComplaint" => "spam",
"Unsubscribe" => "unsubscribe",
}
def initialize(options = {})
@client = ::Postmar... | 21.785714 | 89 | 0.555191 |
611c5cc4e9afe7f91e3009cf6d777a6ea1f2e4ad | 384 | require 'spec_helper'
RSpec.describe Graphiti::Util::FieldParams do
describe '.parse' do
it 'collects and normalizes the payload' do
parsed = described_class.parse({
'authors' => 'first_name,last_name',
'books' => 'title'
})
expect(parsed).to eq({
authors: [:first_name, ... | 22.588235 | 47 | 0.596354 |
4adbf936370dc22cd5d30dabd179b2fe7932c0d6 | 873 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = 'EXStoreReview'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s... | 34.92 | 188 | 0.594502 |
acda98f4de81dac9e9d00bdd93f3edf8ad2e1d89 | 4,517 | require 'faraday'
class FetchMembersJob < ApplicationJob
HOST = "https://data.parliament.scot"
TIMEOUT = 5
ENDPOINTS = {
constituencies: "/api/Constituencies",
constituency_elections: "/api/MemberElectionConstituencyStatuses",
member_parties: "/api/MemberParties",
members: "/api/Members",
pa... | 26.727811 | 123 | 0.654859 |
ac8f20feff051652ac0d25a82e366dcacfaa8d85 | 20,021 | $:.unshift File.expand_path('../vendor', __FILE__)
require 'thor'
require 'thor/actions'
require 'rubygems/config_file'
# Work around a RubyGems bug
Gem.configuration
module Bundler
class CLI < Thor
include Thor::Actions
def initialize(*)
super
use_shell = options["no-color"] ? Thor::Shell::Bas... | 40.52834 | 154 | 0.631637 |
7a4856285045f75e118c45ce1f1d01d25487a527 | 5,299 | # encoding: UTF-8
module Texas
module Template
module Helper
#
# Basic helper methods for finding files and template handling
#
module Base
def default_search_paths
[
__path__,
path_with_templates_basename,
build_path,
b... | 31.921687 | 117 | 0.519909 |
01ad38e94debc259e234377a41e3f40093a2542a | 77 | json.users @users do |user|
json.partial! 'v1/users/model', user: user
end
| 19.25 | 44 | 0.701299 |
038d1cf2bfd610e28a075e39f494bcf878b023f3 | 1,660 | #
# Be sure to run `pod lib lint SNDataBinding.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'SNDat... | 37.727273 | 110 | 0.643373 |
878f746a9bd020728c247bd980b02dcf49b6a649 | 280 | class AddHabtmReviewersToCollection < ActiveRecord::Migration[6.0]
def change
remove_column :collections, :reviewers, :string
create_join_table :collections, :users, table_name: :reviewers do |t|
t.index [:collection_id, :user_id], unique: true
end
end
end
| 28 | 73 | 0.732143 |
e87ef3d89dabc63b057cbe1b4bf52ae32cae0d33 | 2,271 | class NodeAT10 < Formula
desc "Platform built on V8 to build network applications"
homepage "https://nodejs.org/"
url "https://nodejs.org/dist/v10.15.0/node-v10.15.0.tar.gz"
sha256 "dbe467e3dabb6854fcb0cd96e04082268cb1e313ce97a4b7100b2ed152b0a0ab"
bottle do
cellar :any
sha256 "5a411a2295f6040438ad96a... | 36.629032 | 113 | 0.692206 |
4ac45058ed27a5181276ab2888d731550739c5f1 | 1,672 | #
# Be sure to run `pod lib lint ImoDynamicTableView.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
... | 42.871795 | 270 | 0.664474 |
91459b014e0143572055d6486c9af9ad67009f6e | 4,783 | require 'test_helper'
module ActiveModel
class Serializer
module Adapter
class PolymorphicTest < ActiveSupport::TestCase
setup do
@employee = Employee.new(id: 42, name: 'Zoop Zoopler', email: 'zoop@example.com')
@picture = @employee.pictures.new(id: 1, title: 'headshot-1.jpg')
... | 27.80814 | 107 | 0.400794 |
38cfcac1e6be319bffa9d6dca15895b70103e139 | 1,452 | # frozen_string_literal: true
module RailsWorkflow
# Default error builder. Can be changed in configuration.
# Manages errors building
class ErrorBuilder
attr_accessor :exception, :context
def self.handle(exception, context)
new(exception, context).handle
end
def initialize(exception, con... | 25.034483 | 70 | 0.666667 |
ff206a4358ddafcd08af515f8f0700af9d710e3e | 56 | Rails.application.routes.draw do
get 'dummy/show'
end
| 14 | 32 | 0.767857 |
1a1a690a58c6eb816d1f5d482e8e50b7a624c31b | 49,709 | module ActiveShipping
class UPS < Carrier
self.retry_safe = true
self.ssl_version = :TLSv1_2
cattr_accessor :default_options
cattr_reader :name
@@name = "UPS"
TEST_URL = 'https://wwwcie.ups.com'
LIVE_URL = 'https://onlinetools.ups.com'
RESOURCES = {
:rates => 'ups.app/xml/Rate... | 40.912757 | 209 | 0.63395 |
91281854b73c9f3cf04621dbf0abb0c9f50137b1 | 25 | require 'middleman-gdpr'
| 12.5 | 24 | 0.8 |
790be685fcbb98003ccd7923f04b4bfe09379201 | 1,254 | RSpec.describe Api::V2::Measures::MeasureConditionComponentSerializer do
let(:measure_condition_component) do
create(
:measure_condition_component,
duty_expression_id: duty_expression.duty_expression_id,
duty_amount: 10.0,
monetary_unit_code: 'foo',
measurement_unit_code: 'bar',
... | 30.585366 | 81 | 0.6874 |
e26e1b490a63c5936b256ab7c811063786db8bc9 | 28,786 | # frozen_string_literal: true
require "cases/helper"
require "models/topic" # For booleans
require "models/pirate" # For timestamps
require "models/parrot"
require "models/person" # For optimistic locking
require "models/aircraft"
require "models/numeric_data"
class DirtyTest < ActiveRecord::TestCase
include... | 30.986006 | 100 | 0.72365 |
380bf45a6c160aa20fde4a1fdb327919d91f0056 | 171 | module Spree
class PriceSerializer < Spree::BaseSerializer
attributes :amount, :price, :display_amount, :display_price, :currency
belongs_to :variant
end
end
| 21.375 | 74 | 0.754386 |
e9f6727f483fe3202e9e468aaae92fdd3fd73c25 | 2,589 | require "rails_helper"
RSpec.describe "POST /builds" do
let(:payload) do
File.read("spec/support/fixtures/pull_request_opened_event.json")
end
let(:parsed_payload) { JSON.parse(payload) }
let(:repo_name) { parsed_payload["repository"]["full_name"] }
let(:repo_id) { parsed_payload["repository"]["id"] }
... | 33.192308 | 79 | 0.629587 |
11137b578d8d3b30a0f843288666db6498251862 | 1,164 | require 'test_helper'
class StudentsControllerTest < ActionController::TestCase
setup do
@student = students(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:students)
end
test "should get new" do
get :new
assert_response :success
en... | 23.28 | 121 | 0.702749 |
ffe08e8ea12727d8e9ef7fd1c8c9ad8337bcc861 | 1,953 | module Ruby
module HL7
class OBR < Segment
weight 89 # obr.weight-1
has_children [:OBX]
add_field :set_id, :idx => 1
add_field :placer_order_number, :idx => 2
add_field :filler_order_number, :idx => 3
add_field :universal_service_id, :idx => 4
add_field :priority
... | 33.672414 | 89 | 0.736303 |
214f604c794204547bfc8828245ec6815075c35a | 676 | # Supported extra options:
#
class Vorbis < StandardCMakeDep
def initialize(args)
super('Vorbis', 'vorbis', args)
self.HandleStandardCMakeOptions
@RepoURL ||= 'https://github.com/xiph/vorbis.git'
end
def DoClone
runSystemSafe('git', 'clone', @RepoURL) == 0
end
def DoUpdate
standardGitU... | 17.333333 | 53 | 0.590237 |
e2cd6049757404a4f24ff48a23a6c8a111f95a7f | 1,757 | #!/usr/bin/env ruby
require 'tk'
require 'tkextlib/vu/charts'
#######################################
Tk.root.geometry('+30+30')
delay = 2000
c = TkCanvas.new.pack
begin
st = Tk::Vu::TkcSticker.new(c, 0, 0, 10, 10)
rescue
Tk.messageBox(:type=>'ok', :title=>"No sticker Item",
:message=>"This b... | 21.168675 | 85 | 0.611269 |
1cdabf7f6b77c2799896ad65aff5894d6f83a6e4 | 543 | Pod::Spec.new do |s|
s.name = 'xcbeautify'
s.version = '0.10.1'
s.summary = 'A little beautifier tool for xcodebuild'
s.homepage = 'https://github.com/thii/xcbeautify'
s.source = { :http => "#{s.homepage}/releases/download/#{s.version}/xcbeautify-#{s.version}-universal-ap... | 38.785714 | 131 | 0.594843 |
1a42d32b61d04146e2f607a0a61a1fb3627f9c59 | 991 | class Meteorlog::DSL::Context::MetricFilter
include Meteorlog::DSL::Validator
include Meteorlog::TemplateHelper
attr_reader :result
def initialize(name, log_group_name, &block)
@error_identifier = "LogGroup `#{log_group_name}` > MetricFilter `#{name}`"
@result = OpenStruct.new(
:filter_name => n... | 26.078947 | 79 | 0.685166 |
6a0b36afcb09593fe0177aa524beac083830dbd3 | 981 | require "rails_helper"
RSpec.describe ItemsController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/items").to route_to("items#index")
end
it "routes to #new" do
expect(:get => "/items/new").to route_to("items#new")
end
it "routes to #show" do
... | 25.153846 | 76 | 0.574924 |
f746479fc8ac7d428f37135669e2cc5afb495583 | 3,808 | require 'spec'
require 'fileutils'
require 'roo'
require 'rasta/extensions/roo_extensions'
require 'rasta/spreadsheet'
require 'rasta/fixture/metrics'
module Rasta
class ClassLoader
def initialize(path)
@fixture_path = path
end
# Load the files in the fixture path and
# track whic... | 32.827586 | 154 | 0.676471 |
bb3eeb0faebcefa8f315e86a11c8c5fc8c396cd7 | 13,018 | =begin
#Xero Payroll NZ
#This is the Xero Payroll API for orgs in the NZ region.
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'time'
require 'date'
module XeroRuby::PayrollNz
require 'bigdecimal'
class SalaryAndWage
# Xero unique identifi... | 33.638243 | 212 | 0.647872 |
7936645a584b1ca2bc3de4eec0382742e3fc65fc | 2,183 | # frozen_string_literal: true
module Epics
class UpdateService < Epics::BaseService
EPIC_DATE_FIELDS = %I[
start_date_fixed
start_date_is_fixed
due_date_fixed
due_date_is_fixed
].freeze
def execute(epic)
# start_date and end_date columns are no longer writable by users beca... | 30.319444 | 130 | 0.722858 |
035951c892ef1d3e1c13f3175c367351e687ca7e | 248 | require 'rails_helper'
describe SalesforceService do
subject { described_class.call }
it 'initializes and authenticate salesforce client' do
expect_any_instance_of(Restforce::Data::Client).to receive(:authenticate!)
subject
end
end
| 22.545455 | 78 | 0.778226 |
ace13c355ec1ea094babaa66a91f256af04c3023 | 4,573 | module Contentful
# All errors raised by the contentful gem are either instances of Contentful::Error
# or inherit from Contentful::Error
class Error < StandardError
attr_reader :response
def initialize(response)
@response = response
super best_available_message
end
# Shortcut for cr... | 22.307317 | 93 | 0.654931 |
abf0c0e7667eb74d9bbfbd55a2a62f235a2e5c5a | 341 | # == Schema Information
#
# Table name: questionnaires
#
# id :integer not null, primary key
# name :string
# position :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Questionnaire < ApplicationRecord
has_many :event_instances
has_many ... | 21.3125 | 53 | 0.659824 |
6ad47be6088231abbe5d3f57007e0ab338eb40d0 | 308 | # frozen_string_literal: true
module CobraCommander
module Output
# Prints a list of components' names sorted alphabetically
class FlatList
def initialize(components)
@components = components
end
def to_s
@components.map(&:name).sort
end
end
end
end
| 18.117647 | 62 | 0.662338 |
7a7979c056d8a2814406a862b80ef5bc82e49ca4 | 237 | class CreateCrFormatKinds < ActiveRecord::Migration[4.2]
def change
create_table :cr_format_kinds do |t|
t.string :name, null: false
t.string :abbr
t.string :note
t.timestamps null: false
end
end
end
| 19.75 | 56 | 0.662447 |
080f0ede8d65913ed91fa670334ce647184d82c1 | 284 | require 'open-uri'
require 'net/http'
require 'json'
require 'pry'
require_relative "../lib/spell"
require_relative "../lib/cli"
require_relative "../lib/get_spell"
require_relative "../lib/dnd_project.rb"
require_relative "../lib/level_list.rb"
require_relative "../lib/school.rb"
| 21.846154 | 40 | 0.75 |
bb437b0f914d05c1641d82131cb7c4daf546350a | 5,387 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# Checks for `if` and `unless` statements that would fit on one line if
# written as modifier `if`/`unless`. The cop also checks for modifier
# `if`/`unless` lines that exceed the maximum line length.
#
# The maxim... | 32.065476 | 100 | 0.593651 |
7a263f344958a9c35dee73ba00c3bed7df82e6e8 | 2,295 | # encoding:utf-8
module Inspec
class Test
attr_accessor :qualifier, :matcher, :expectation, :skip, :negated, :variables
include RubyHelper
def initialize
@qualifier = []
@negated = false
@variables = []
end
def negate!
@negated = !@negated
end
def to_ruby
... | 26.079545 | 104 | 0.548584 |
01c8a64e024491ae31ac3a8783dad6544789225d | 1,732 | # This fork contains macOS patches.
# Original project: https://github.com/roysjosh/xbee-comm
class XbeeComm < Formula
desc "XBee communication libraries and utilities"
homepage "https://github.com/guyzmo/xbee-comm"
url "https://github.com/guyzmo/xbee-comm/archive/v1.5.tar.gz"
sha256 "c474d22feae5d9c05b3ec167b... | 43.3 | 95 | 0.779446 |
f7a3e9797be213a1b2850de05771bd5a0c7d3715 | 738 | require 'optparse'
module Grog
class Options
attr_accessor :number_of_commits_to_show, :show_datetimes
def self.parse(argv)
Options.new(argv)
end
def initialize(argv)
@opts = OptionParser.new
@number_of_commits_to_show = 10
@opts.on("-n=N", "number of commits to show", Inte... | 23.806452 | 103 | 0.611111 |
91e4d1e55b185821923aad8fcfcce1dc27378084 | 1,640 | # typed: false
# frozen_string_literal: true
module Homebrew
module API
# Helper functions for using the versions JSON API.
#
# @api private
module Versions
class << self
extend T::Sig
def formulae
# The result is cached by Homebrew::API.fetch
Homebrew::API.... | 27.333333 | 78 | 0.577439 |
ab9277ef43b71a714868aa427b4a05d259d90c91 | 1,249 | module LolSoap
# Turns an XML node into a hash data structure. Works out which elements
# are supposed to be collections based on the type information.
class HashBuilder
attr_reader :node, :type
def initialize(node, type)
@node = node
@type = type
end
def output
if node.first_e... | 21.534483 | 80 | 0.560448 |
39640c978b4ebbae4958175b2d9c895f9f768727 | 2,493 | # 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... | 40.868852 | 95 | 0.723225 |
d5804e6be31e0ce7e54fcca0f669e3fe1b0d760e | 13,879 | # frozen_string_literal: true
module RailsBestPractices
module Core
# A Check class that takes charge of checking the sexp.
class Check < CodeAnalyzer::Checker
ALL_FILES = /.*/.freeze
CONTROLLER_FILES = /app\/(controllers|cells)\/.*\.rb$/.freeze
MIGRATION_FILES = /db\/migrate\/.*\.rb$/.free... | 32.503513 | 129 | 0.559118 |
18b7e71b9de9ea614bbbf53c66a336f7680c4566 | 252 | require 'test_helper'
class A1agregatorModuleTest < Test::Unit::TestCase
include ActiveMerchant::Billing::Integrations
def test_notification_method
assert_instance_of A1agregator::Notification, A1agregator.notification('name=cody')
end
end
| 25.2 | 87 | 0.813492 |
18be4a64cc71c4a53b5041c9565a783bb34edd11 | 871 | module Spree
class PaymentMethod::Pagseguro < PaymentMethod
preference :email, :string
preference :token, :string
def payment_profiles_supported?
false
end
def supports?(source)
true
end
def provider_class
Billing::Pagseguro
end
def provider
provider_cla... | 15.836364 | 61 | 0.609644 |
7a8cace8cbd6496115b42a31ff71f0de71e4fba3 | 1,142 | class Api::V1::ExercisesController < ApplicationController
before_action :set_exercise, only: [:show, :update, :destroy]
# GET /exercises
def index
@exercises = Exercise.all
render json: ExerciseSerializer.new(@exercises)
end
# GET /exercises/1
def show
render json: @exercise
end
# POST ... | 21.961538 | 73 | 0.687391 |
1d3661c4b9742631639a6127404a7c291ba04855 | 152 | module Furnace::AVM2::ABC
class AS3ReturnVoid < FunctionReturnOpcode
instruction 0x47
ast_type :return
consume 0
produce 0
end
end | 15.2 | 44 | 0.717105 |
f8508a758372ea98886228b8616141e1e28bff54 | 523 | Gem::Specification.new do |s|
s.name = 'meta_proto_object'
s.version = '0.0.1'
s.date = '2013-9-26'
s.summary = "Extends Ruby's Object, Array, and Hash Classes with Magic"
s.description = "Extends Ruby's Object, Array, and Hash Classes with Monkey Patching & Metaprogramming"
s.authors ... | 40.230769 | 105 | 0.638623 |
ed7169ce10662f6714c65f3a22066c7f5c84f98b | 934 | require 'rails_helper'
require_relative '../../../support/api/v1/request'
require_relative '../../../support/api/v1/endpoints/create'
require_relative '../../../support/api/v1/endpoints/destroy'
RSpec.describe Api::V1::UserFollowshipsController, type: :controller do
include_context "authenticate requests using valid... | 31.133333 | 108 | 0.684154 |
219b37875ca5a311cf7dd52bb1f7141dcae3a2f5 | 567 | class SupportPolicy < ApplicationPolicy
def readable?
user.is_support? || user.is_computacenter?
end
def editable?
user.is_support?
end
alias_method :index?, :readable?
alias_method :show?, :readable?
alias_method :schools?, :readable?
alias_method :technical_support?, :editable?
alias_metho... | 24.652174 | 46 | 0.726631 |
034d2fecbc614227cc4f8e6d5c2dd2d3fe1761f8 | 47 | module ExtensionLister
VERSION = '0.2.5'
end
| 11.75 | 22 | 0.723404 |
1d087b8c6261253907ef64275d25180df8b23997 | 21,784 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Api::V1::KeywordsController, type: :controller do
describe 'GET#index' do
context 'given access token' do
it 'returns ok status code' do
user = Fabricate(:user)
application = Fabricate(:application)
access_token = ... | 40.117864 | 152 | 0.642123 |
1cdeff5a11b1e95578a24f85448149b2e74628ff | 57 | require 'spec_helper'
describe VideosController do
end
| 9.5 | 28 | 0.824561 |
26098100353371973e8d156648f4244b1c8ca60b | 1,773 | # frozen_string_literal: true
require 'forwardable'
require 'fileutils'
require 'digest'
require 'sys/filesystem'
require 'files/version'
module Files
# delegate class methods
extend SingleForwardable
extend Sys
class << self
# list of file basenames in specified dir
def filenames dir
Dir[File... | 24.625 | 66 | 0.670051 |
d5092bc0ffe68909d9215ee5289436bb1ec5febe | 1,125 | # Rep Recalculator
# Recalculates the reputation score for one user, specified by the ID given in the first command line argument.
def get_setting(name)
begin
return SiteSetting.find_by_name(name).value
rescue
return nil
end
end
qu = get_setting('QuestionUpVoteRep').to_i
qd = get_setting('QuestionDownVo... | 28.125 | 111 | 0.682667 |
5d07838234045d61bf9c6ea6fb65f3c71ce8ad31 | 649 | module Morpho
module Formatters
module StandardError
class << self
def call(message, backtrace, options, env, original_exception)
if message.is_a?(String)
result = {
message: message,
errors: [
{ field_name: 'base', messages: [ messag... | 24.037037 | 70 | 0.511556 |
91cc6b271a5f9169a8c4ae78b69f71249fc52ace | 1,839 | # frozen_string_literal: true
FactoryBot.define do
factory :event_type, class: "Renalware::Events::Type" do
initialize_with do
Renalware::Events::Type.find_or_create_by(
name: name,
category: category
)
end
category factory: :event_category
name { "Test" }
factory :a... | 25.901408 | 68 | 0.654704 |
793959fbddd5a0e58b65ef6f34d9a7bfcf8122b7 | 6,192 | # 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::Hdinsight::Mgmt::V2018_06_01_preview
#
# A service client - single point of access to the REST API.
#
class HDInsightManagementClient ... | 38.222222 | 154 | 0.698482 |
e856e14ca9d143f9d40458d658c77448036ede25 | 43 | class PaymentType < ActiveRecord::Base
end
| 14.333333 | 38 | 0.813953 |
e8d79d22ea797daa77cdd41d1e5c09ec59023307 | 105 | require 'rubygems'
require 'bundler/setup'
# our gem
require 'db_clone'
RSpec.configure do |config|
end | 13.125 | 27 | 0.761905 |
26142dc8dc925f60d3ce71b8d37d11e73e7f14a8 | 1,766 | module Neography
class Rest
module NodePaths
include Neography::Rest::Helpers
def get_path(from, to, relationships, depth = 1, algorithm = "shortestPath")
options = path_options(to, relationships, depth, algorithm)
@connection.post("/node/%{id}/path" % {:id => get_id(from)}, optio... | 35.32 | 125 | 0.582673 |
1c5209ef21b9b16cae7f1ce1bf0cffc9e139411d | 1,974 | class YelpTools < Formula
desc "Tools that help create and edit Mallard or DocBook documentation"
homepage "https://github.com/GNOME/yelp-tools"
url "https://download.gnome.org/sources/yelp-tools/3.32/yelp-tools-3.32.1.tar.xz"
sha256 "99a7c312a5fcb427870dc198af02801eb0f8ea63317e20110fc0303eb44636e3"
bottle d... | 35.25 | 93 | 0.677812 |
e8429bac3bb609d0cd1412496ca933dd1005ac1c | 12,543 | # frozen_string_literal: true
# Selenium specific implementation of the Capybara::Driver::Node API
require 'capybara/selenium/extensions/find'
require 'capybara/selenium/extensions/scroll'
class Capybara::Selenium::Node < Capybara::Driver::Node
include Capybara::Selenium::Find
include Capybara::Selenium::Scroll
... | 27.208243 | 150 | 0.657259 |
33a1c88e33c126e35a4f61efe5a0dff55f704274 | 2,568 | class Spinach::Features::Dashboard < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedProject
include SharedIssuable
step 'I should see "New Project" link' do
expect(page).to have_link "New project"
end
step 'I should see "Shop" project link' do
expect(page).t... | 30.571429 | 101 | 0.706386 |
1a9cddb7f7bd3557334f3293f798edf291f61c5d | 1,395 | module Caboose
module LogicParser
# This module holds our recursive descent parser that take a logic string
# the logic string is tested by the enclosing Handler class' #check method
# Include this module in your Handler class.
# recursively processes an permission string and returns true or f... | 29.0625 | 110 | 0.560573 |
38c30247a6ae63101e3fb608be4aa11169a8b34a | 1,808 | # frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'
require 'rspec'
require 'rspec/its'
require 'mongoid'
require 'mongoid/relations_dirty_tracking'
Mongo::Logger.logger.level = 2
Mongoid.configure do |config|
config.logger.level = 2
config.connect_to('mongoid_relations_dirty_tracking_test')... | 25.464789 | 82 | 0.798119 |
f724c69fa59d070db095c8cc8eca066afc06fbaa | 221 | module TZInfo
module Definitions
module America
module Coral_Harbour
include TimezoneDefinition
linked_timezone 'America/Coral_Harbour', 'America/Atikokan'
end
end
end
end
| 18.416667 | 67 | 0.669683 |
f725ac7b6817b9875b888f2e495876427fc9bd67 | 929 | # encoding: utf-8
Gem::Specification.new do |s|
s.name = 'gherkin'
s.version = '4.1.0'
s.authors = ["Gáspár Nagy", "Aslak Hellesøy", "Steve Tooke"]
s.description = 'Gherkin parser'
s.summary = "gherkin-#{s.version}"
s.email = 'cukes@googlegroups.com'
s.homepage = "https://githu... | 34.407407 | 89 | 0.612487 |
1a940475bb07e26d88706067701ab3b67a203b7b | 2,247 | class Lha < Formula
desc "Utility for creating and opening lzh archives"
homepage "https://lha.osdn.jp/"
# Canonical: https://osdn.net/dl/lha/lha-1.14i-ac20050924p1.tar.gz
url "https://dotsrc.dl.osdn.net/osdn/lha/22231/lha-1.14i-ac20050924p1.tar.gz"
version "1.14i-ac20050924p1"
sha256 "b5261e9f98538816aa9e6... | 39.421053 | 95 | 0.696039 |
082c98c0104364c9d40ced441e4e8c49e74b434f | 64,621 | # frozen_string_literal: true
require 'carrierwave/orm/activerecord'
class User < ApplicationRecord
extend Gitlab::ConfigHelper
include Gitlab::ConfigHelper
include Gitlab::SQL::Pattern
include AfterCommitQueue
include Avatarable
include Referable
include Sortable
include CaseSensitivity
include To... | 33.292633 | 214 | 0.728556 |
797e0dc8d80ae608b4fe9b423c7cc51ad9641c20 | 154 | require 'test_helper'
class Api::V1::UserSchedulesControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 19.25 | 76 | 0.74026 |
3334f5dfd945684b5395df9243331fb1d07cca54 | 697 |
class VerizonApi::Api
include HTTParty
require 'yaml'
require 'json'
# Here, we bring in all our subordinate classes
require 'verizon_api/waf'
headers 'Host' => 'api.edgecast.com', 'Accept' => 'Application/JSON', 'Content-Type' => 'Application/JSON'
format :json
MEDIA_TYPES = {:flash_media_streaming... | 31.681818 | 132 | 0.715925 |
21e54dd25378ebbe96cd5c7862e985746e2af296 | 933 | cask 'lando' do
version '3.0.0-rc.15'
sha256 '0b5864e764cb1437423790cbd1e3c05bdd46a042ae34f51ff209ee9bcd21a4ba'
# github.com/lando/lando was verified as official when first introduced to the cask
url "https://github.com/lando/lando/releases/download/v#{version}/lando-v#{version}.dmg"
appcast 'https://github.... | 32.172414 | 90 | 0.566988 |
036aec1768cf40b7f5910fcfffd53133fd0de0f1 | 190 | module Features
def sign_in_as(user)
visit("/")
click_on t("application.header.sign_in")
fill_form_and_submit(:session, email: user.email, password: user.password)
end
end
| 19 | 78 | 0.715789 |
33480b05570070151595e4a858c55b5db65c971d | 283 | # frozen_string_literal: true
module Types
PhotoType = GraphQL::ObjectType.define do
name "PhotoType"
description "Photo associated with sound"
field :id, !types.ID
field :file_name, !types.String
field :user, !UserType
field :sound, !SoundType
end
end
| 20.214286 | 45 | 0.70318 |
18d143716abd3842fc3bef76ecaadf110d80fb59 | 1,580 | # encoding: utf-8
include SecQuery
require 'spec_helper'
describe SecQuery::SecURI do
describe '#browse_edgar_uri' do
it 'builds a default /browse-edgar/ url' do
uri = SecQuery::SecURI.browse_edgar_uri
expect(uri.to_s).to eq('https://www.sec.gov/cgi-bin/browse-edgar')
end
it 'builds a defau... | 31.6 | 78 | 0.660127 |
01b8c0456bb1170ae976d63a9798fa63066b05f5 | 221 |
id = ARGV.first
out = []
$stdin.each_line do |line|
out << id + ' ' + line.strip unless /BATCH/ =~ line
if /BATCH/ =~ line or out.size >= 8
out.each {|line| puts line}
out = []
$stdout.flush
end
end
| 14.733333 | 53 | 0.556561 |
03d3fe71ec810ad63b754581a9e6fabc2dbeb0d1 | 807 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.nic.coop/property_status_multiple.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
requ... | 26.9 | 116 | 0.739777 |
ac25d47fa63d61a2487387cbf1162e542ce565dd | 2,043 | require File.join(File.dirname(__FILE__), "helper")
HUMAN_ID = 'human@googlewave.com'
ROBOT_ID = 'robot@appspot.com'
URL = 'http://googlewave.com'
describe Rave::Models::User do
it_should_behave_like "Component id()"
it_should_behave_like "Component initialize()"
describe "robot?()" do
it "should return ... | 26.881579 | 71 | 0.631914 |
6aa2325c8918462f89df5ad3859797af9a432f7c | 1,203 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'redcli/version'
Gem::Specification.new do |spec|
spec.name = "redcli"
spec.version = Redcli::VERSION
spec.authors = ["Kavinder Dhaliwal"]
spec.email = ["kavin... | 37.59375 | 74 | 0.65586 |
f84fdc99f58e880b72244d3fc052e4ab68316185 | 4,439 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your applica... | 44.39 | 114 | 0.766614 |
335c4f980a3346b3940bbe0ce64874c6f471f793 | 936 | require 'test_helper'
class MaintainersControllerTest < ActionDispatch::IntegrationTest
setup do
@maintainer = maintainers(:one)
end
test "should get index" do
get maintainers_url, as: :json
assert_response :success
end
test "should create maintainer" do
assert_difference('Maintainer.count'... | 24 | 106 | 0.711538 |
87577fc3a97341262da04592df38aae71a896614 | 216 | # frozen_string_literal: true
# We need to have a policy for StudentTableRow model which is used in some views. The policy should be the same as the
# one for student
class StudentTableRowPolicy < StudentPolicy
end
| 30.857143 | 118 | 0.800926 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.