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 |
|---|---|---|---|---|---|
5d5c3d6e909776f7bf47105eff588cf5906316c3 | 350 | class RegistrationsController < Devise::RegistrationsController
private
def sign_up_params
params.require(:user).permit(:name, :username, :email, :password, :password_confirmation)
end
def acount_update_params
params.require(:user).permit(:name, :username, :email, :password, :password_confirmation,... | 26.923077 | 112 | 0.762857 |
79beb197d3f70ac1b4298f63c467491bf555e178 | 800 | describe 'Quickbooks::Service::VendorChange' do
let(:service) { construct_service :vendor_change }
it 'can query for vendors' do
xml = fixture('vendor_changes.xml')
model = Quickbooks::Model::VendorChange
stub_http_request(:get, service.url_for_query, %w[200 OK], xml)
vendors = service.query
e... | 32 | 102 | 0.72625 |
bbd1779fc876c3efbfcdea3d1ec9a3f2abfd33d6 | 1,786 | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
require "json"
package = JSON.parse(File.read(File.join(__dir__, "..", "..", "package.json")))
version = package['version']
source = { :gi... | 40.590909 | 143 | 0.641097 |
e97c415ffa71362efaa0390640dec1ce629512fc | 2,558 | # *******************************************************************************
# OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... | 50.156863 | 85 | 0.722048 |
6ae451f2d89afd492a17eb783e00de3b10b8636a | 1,172 | class Libdvdcss < Formula
desc "Access DVDs as block devices without the decryption"
homepage "https://www.videolan.org/developers/libdvdcss.html"
url "https://download.videolan.org/pub/videolan/libdvdcss/1.4.2/libdvdcss-1.4.2.tar.bz2"
sha256 "78c2ed77ec9c0d8fbed7bf7d3abc82068b8864be494cfad165821377ff3f2575"
... | 40.413793 | 93 | 0.769625 |
1866848bad97eea4b8b823c21747b1be97279a15 | 169 | # Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :goal do
category
amount 1000
period "Month"
end
end
| 16.9 | 68 | 0.727811 |
e232b094a8037799aef02f9e415349e0ac0f27de | 2,515 | class OrdersController < ApplicationController
skip_before_action :authenticate_user!
include CartBuilder
def confirm
set_order
set_address_variables
validate_confirm_render
end
def complete
set_order
redirect_url = Store::PayProvider.new(order: @order, provider: @ord... | 30.670732 | 147 | 0.716103 |
f717a6557cf8557414b46fb6effab53edbb688d5 | 134 | require "peatio/bsc/version"
require "pry-byebug"
require "peatio"
module Peatio
module bsc
# Your code goes here...
end
end
| 13.4 | 28 | 0.708955 |
0871c034da5727a8307a9491086d6922c5189397 | 1,835 | require 'spec_helper'
module RailsDuplicateKeyChecker
describe DuplicateKeysAnalyzer do
let(:duplicate_keys_analyzer) { described_class.new }
describe '#alter_table_statements' do
subject { duplicate_keys_analyzer.alter_table_statements }
let(:statements) { double(:statements) }
let(:drop... | 30.583333 | 76 | 0.66158 |
ed4123b17b6c91136d208e554d6974c3e0a837fe | 441 | require 'spec_helper'
describe Player do
context 'associations' do
it { should belong_to(:team) }
end
context 'validations' do
it { should validate_presence_of(:team) }
it { should validate_presence_of(:name) }
it { should validate_uniqueness_of(:name).scoped_to(:team_id) }
it { should v... | 22.05 | 76 | 0.709751 |
5ddb57cb6c684f3e2509b17c8233b2d03da1a114 | 14,910 | # -*- encoding: utf-8 -*-
class NdlStatistic < ActiveRecord::Base
has_many :ndl_stat_manifestations, :dependent => :destroy
has_many :ndl_stat_accepts, :dependent => :destroy
has_many :ndl_stat_checkouts, :dependent => :destroy
has_many :ndl_stat_accesses, :dependent => :destroy
attr_accessible :term_id
... | 39.97319 | 162 | 0.560899 |
d53c377e2f4ab7f5220c36197ad5227e877075f0 | 1,308 | class Gif2png < Formula
desc "Convert GIFs to PNGs"
homepage "http://www.catb.org/~esr/gif2png/"
url "http://www.catb.org/~esr/gif2png/gif2png-2.5.13.tar.gz"
sha256 "997275b20338e6cfe3bd4adb084f82627c34c856bc1d67c915c397cf55146924"
livecheck do
url :homepage
regex(/href=.*?gif2png[._-]v?(\d+(?:\.\d+)... | 40.875 | 123 | 0.75841 |
18ea4cd9b03bb055cf7c26648d9d22fa7b9796e2 | 1,372 | #! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'
describe 'any2array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'success' do
it 'should create an empty array' do
pp = <<-EOS
$input = ''
$output = any2array($input)
validate_array... | 27.44 | 100 | 0.581633 |
083b99d123260f8b330c802a0c44dea746985617 | 1,487 | # frozen_string_literal: true
require 'active_support/core_ext/module/anonymous'
module Rails
module GraphQL
module Helpers
# Helper module responsible for name stuff
module WithName
NAME_EXP = /GraphQL::(?:Type::\w+::|Directive::)?([:\w]+?)([A-Z][a-z]+)?\z/.freeze
# Here we define ... | 28.596154 | 90 | 0.600538 |
389de77aa322b1737ef2ba95fe8c3c41547aab3e | 571 | # frozen_string_literal: true
require "test_helper"
class ElementalStyleguideTest < ActiveSupport::TestCase
# rubocop:disable Style/WordArray
test "#page_names returns a hash of page names" do
assert_equal [
["01_home", "Home"],
["02_pages", "Pages", [
["01_page_one", "Page One"],
... | 25.954545 | 55 | 0.630473 |
87a61ffabe9352ba86e52aa2fdbcab2c95246614 | 97 | json.extract! program, :id, :created_at, :updated_at
json.url program_url(program, format: :json) | 48.5 | 52 | 0.773196 |
acafff148e26e930c0189c3f5202ab4eaa0f509e | 6,873 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Scanner
HttpFingerprint = { :pattern... | 35.427835 | 109 | 0.585188 |
e2a2b0e34b63c654bed0cabb70ba5d62dd9679f1 | 741 | $:.push File.expand_path("../lib", __FILE__)
require "consul/version"
Gem::Specification.new do |s|
s.name = 'consul'
s.version = Consul::VERSION
s.authors = ["Henning Koch"]
s.email = 'henning.koch@makandra.de'
s.homepage = 'https://github.com/makandra/consul'
s.summary = 'A scope-based authorization solu... | 33.681818 | 97 | 0.645074 |
91acd6c14c3409697576126213fd03b7ec917283 | 366 | name 'cleanup'
default_version '1.0.0'
skip_transitive_dependency_licensing true
license :project_license
build do
# strip shared object files related to gecode installs
command "strip #{install_dir}/embedded/lib/libgecode*.so.32.0"
# remove any test fixture pivotal keys to avoid user confusion
command "find ... | 28.153846 | 64 | 0.784153 |
e8bcde1fd566636d4d157396d8b400b3aee7ce30 | 10,497 | class Climate_calc
# generic climate data calculations
# :tmax is maximum temperature in degrees centigrade
# :tmin is minimum temperature in degrees centigrade
# :tprecip is total precipitation in millimeters
# :radiation is solar radiation at the top of the atmosphere
def Climate_calc.monthly2dailyinterps(monthlyDa... | 52.485 | 261 | 0.710584 |
1ddf7aa30c5a967026842c0c5b5e66f8f45fa1d4 | 650 | require 'tmpdir'
class TestConfigGenerator
attr_reader :config_manifest_path
def initialize
@config_manifest_path = Dir.mktmpdir
%w[cloud runtime cpi].each do |type|
FileUtils.touch(File.join(@config_manifest_path, "my-custom-#{type}-vars.yml"))
FileUtils.touch(File.join(@config_manifest_path,... | 34.210526 | 93 | 0.733846 |
61ce43ae2842ef585f64faecd84428c686080798 | 5,252 | # encoding: utf-8
require "securerandom"
require "csv"
class ServiceOrder < ActiveRecord::Base
attr_accessible :alipay_id, :alipay_pix, :cmobile, :cname, :price, :site_id,
:site_pix, :site_worker_id, :status, :tb_trade_id, :uid, :user_id,
:time_service,:memo,:time_pay
belongs_to :tb_trade
belongs... | 28.543478 | 107 | 0.664318 |
798379501d1d9f42784946d3bff6d53d865bd003 | 195 | class User < ApplicationRecord
validates :username, presence: true, length: { minimum: 5 }
validates :email, presence: true, length: { minimum: 10 }
validates :password, presence: true
end
| 32.5 | 61 | 0.728205 |
62164544d3c92e6cced924de75546244a03070b9 | 1,559 | module IIIF
##
# An response object for Image requests
class ImageResponse < Response
require 'iiif/image_response/parameter'
autoload :Region, 'iiif/image_response/region'
autoload :Size, 'iiif/image_response/size'
autoload :Rotation, 'iiif/image_response/rotation'
# @!attribute... | 27.350877 | 69 | 0.603592 |
1cde95e21a09f0ef944dffe0a630db903f37f8d5 | 71 | { :'id_ID' => { :i18n => { :plural => { :keys => nil, :rule => } } } } | 71 | 71 | 0.366197 |
acf91573f5293b1f797a009f97d76aeef82561d8 | 1,583 | # frozen_string_literal: true
require "application_system_test_case"
class IssuesTest < ApplicationSystemTestCase
setup do
@issue = issues(:one)
end
test "visiting the index" do
visit issues_url
assert_selector "h1", text: "Issues"
end
test "creating a Issue" do
visit issues_url
click_... | 26.383333 | 57 | 0.698673 |
189421451de05e3665560c930880e03129846bb2 | 1,058 | #!/usr/bin/env ruby
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
#
# This tool asks Google for the location of a given set of BSSIDs
#
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlin... | 27.842105 | 160 | 0.719282 |
18854c5b81f6418b6244cccad16cfb231836b9e7 | 1,185 | # frozen_string_literal: true
class MonographSearchBuilder < ::SearchBuilder
self.default_processor_chain += [:filter_by_members]
def filter_by_members(solr_parameters)
ids = if blacklight_params[:monograph_id]
# used for the facets "more" link and facet modal
asset_ids(blacklight_para... | 27.55814 | 133 | 0.652321 |
01bf2ad973989818f6b73ef7a2734383430a497d | 1,287 | # frozen_string_literal: true
class PluginSettingsForm
class << self
def add_accessor(*args)
@accessors ||= []
args.each do |accessor|
@accessors << accessor
attr_accessor accessor
end
end
def all_accessors
@accessors
end
end
include BaseForm
include Pl... | 20.758065 | 58 | 0.727273 |
28400c038a80cfa856381feecc11bfbd3325a9d9 | 43 | module MdolceP1Api
VERSION = "0.1.0"
end
| 10.75 | 19 | 0.697674 |
11016836e45c84aac7b02e2ebd26f45f3bd853f8 | 753 | cask "font-iosevka-ss16" do
version "10.3.2"
sha256 "a417033597f0a378dc0d809a06e51eeba8179ddf62c2954028cc2c6a3a4f3cec"
url "https://github.com/be5invis/Iosevka/releases/download/v#{version}/ttc-iosevka-ss16-#{version}.zip"
name "Iosevka SS16"
desc "Sans-serif, slab-serif, monospace and quasi‑proportional typ... | 30.12 | 105 | 0.747676 |
7aa46a2298d8b16d86a78286ef8adf75f6369731 | 1,230 | require_relative '../../spec_helper'
describe Cranium::DSL::DatabaseDefinition do
let(:database) { Cranium::DSL::DatabaseDefinition.new "name" }
describe "#name" do
it "should return the name of the database definition" do
expect(database.name).to eq("name")
end
end
describe "#connect_to" do... | 21.206897 | 76 | 0.652033 |
61497e1695f916bbec02b833cfae5f4d754845a2 | 8,224 | module CommandLine
class Option
attr_reader :name, :alias
attr_reader :parameter_count
attr_reader :default_value
# Rewrites a command line keyword by replacing the underscores with dashes
# <tt>sym</tt> The symbol to rewrite
def self.rewrite(sym)
sym.to_s.gsub(/_/, '-').to_sym
en... | 27.322259 | 147 | 0.637038 |
4a90053e40b6aab20d2cc2ac532831951942330f | 3,312 | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | 43.578947 | 155 | 0.649758 |
ac45b4852346fe7fe1b07f2b4940873342dc1af2 | 517 | require 'forwardable'
require 'singleton'
module HTTP
module MimeType
# Base encode/decode MIME type adapter
class Adapter
include Singleton
class << self
extend Forwardable
def_delegators :instance, :encode, :decode
end
%w[encode decode].each do |operation|
... | 20.68 | 72 | 0.601547 |
2151ee1f488a603bc7b4c6e079c1f2a726a089e5 | 2,319 | require 'spec_helper'
require 'find'
require 'zlib'
=begin
- Before any tests are run, read in the contents of a Gzipped compressed file containing a list of recordings
- and store the array to an instance variable
- To grab a source file:
ls /var/spool/asterisk/monitor | gzip -c | ssh deployer@test.host.com 'cat > ... | 28.280488 | 143 | 0.655886 |
62c3d17782f577da882683786bf4e48622d026bc | 20,891 | # frozen_string_literal: true
require "rails_helper"
require "controller_spec_helper"
require "order_detail_batch_update_shared_examples"
RSpec.describe FacilityOrdersController do
let(:account) { @account }
let(:facility) { @authable }
let(:facility_account) { @facility_account }
let(:product) { @product }
... | 35.348562 | 125 | 0.637643 |
ffbbed4e28d701884d31021b474ae43ec5ad99bb | 371 | # frozen_string_literal: true
module ShipmentCalculator
class Calculator
attr_reader :valid_transactions, :rules
def initialize(transactions, rules)
@valid_transactions = transactions.select(&:valid?)
@rules = rules
end
def basic_calculate
rules.each do |rule|
rule.new(val... | 19.526316 | 57 | 0.692722 |
1d13904114734dc26a94384ecb5498a123358bde | 2,683 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/vision/v1/product_search.proto
require 'google/protobuf'
require 'google/cloud/vision/v1/geometry_pb'
require 'google/cloud/vision/v1/product_search_service_pb'
require 'google/protobuf/timestamp_pb'
require 'google/api/annotations_pb'... | 48.781818 | 176 | 0.776742 |
d543dcd334d29d5ad68ada2d16348f94941a54d9 | 2,595 | require "test_helper"
class TopicTest < ActionDispatch::IntegrationTest
setup do
@topic_example = JSON.parse(
GovukContentSchemaTestHelpers::Examples.new.get(
"service_manual_topic",
"service_manual_topic",
),
)
end
test "it uses topic description as meta description" do
... | 33.701299 | 116 | 0.714451 |
6a760ea5364bf76b7dc3c8c9b1255258e241402e | 1,611 | #
# Be sure to run `pod lib lint LHTools.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 = 'LHTools'
... | 36.613636 | 101 | 0.627561 |
26b5a495c1b2ca44b836b6e91fde41c3a84d6d6e | 1,524 | require 'test_helper'
class UsersLoginTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
end
test "login with invalid information" do
get login_path
assert_template 'sessions/new'
post login_path, params: { session: { email: "", password: "" } }
assert_template 'sessio... | 28.222222 | 69 | 0.674541 |
1a4b8940ec3a7fddf8e09011e74dc5da51c45fb2 | 2,632 | require 'cases/helper_sqlserver'
require 'models/person'
require 'models/reader'
class PessimisticLockingTestSQLServer < ActiveRecord::TestCase
fixtures :people, :readers
before do
Person.columns
Reader.columns
end
it 'uses with updlock by default' do
assert_sql %r|SELECT \[people\]\.\* FROM \[p... | 28.923077 | 258 | 0.637158 |
2194e32949d49f2195691cc5f3f2cb5137bd859f | 40 | class Autoreload
VERSION = '1.0.0'
end | 13.333333 | 19 | 0.7 |
b9f3df8ddc97c6993d546a5482f8182f02b13428 | 16,138 | require 'test_helper'
require 'pry'
describe BrBoleto::Retorno::Cnab240::Unicred do
subject { BrBoleto::Retorno::Cnab240::Unicred.new(file) }
let(:file) { open_fixture('retorno/cnab240/padrao240.ret') }
it "Deve ler o código do banco" do
subject.codigo_banco.must_equal '756'
end
it "Deve carregar 5 pagament... | 65.072581 | 87 | 0.612467 |
7ad8e556770c8fbf8f8726aeed25df3733aaec87 | 90 | VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
VALID_PHONE_REGEX = /\A\+?\d+\z/
| 30 | 56 | 0.511111 |
bfa250711c5c1378a0e7926618da322cd161d407 | 181 | require 'active_merchant'
require 'active_merchant/billing/integrations/action_view_helper'
ActionView::Base.send(:include, ActiveMerchant::Billing::Integrations::ActionViewHelper)
| 45.25 | 88 | 0.856354 |
bb897dc859e2d693983c8404bc42a456f96ba27f | 2,723 | require 'test_helper'
require 'wsdl_mapper/dom/namespaces'
module DomTests
class NamespacesTest < WsdlMapperTesting::Test
include WsdlMapper::Dom
def test_storing_and_retrieving_namespaces
namespaces = Namespaces.new
namespaces.set(:ns1, 'http://example.org/foobar')
url = namespaces.get(... | 28.072165 | 111 | 0.661403 |
013dcc9d4902faae3c0eb2310e5af32498e2012e | 5,319 | # 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::Subscriptions::Mgmt::V2019_06_01
#
# A service client - single point of access to the REST API.
#
class SubscriptionClient < MsRestAzu... | 38.824818 | 154 | 0.690731 |
622688448eb411debad8ffbe94e6d634d2f319ef | 4,804 | module BioInterchange::TextMining
require 'rubygems'
require 'json'
class PubAnnosJSONReader < BioInterchange::TextMining::TMReader
# Register reader:
BioInterchange::Registry.register_reader(
'dbcls.catanns.json',
PubAnnosJSONReader,
[
'name',
'name_id',
'date',
[ Proc.new { ... | 27.930233 | 113 | 0.60637 |
b90be598503360f59af482a9a53849fb54692d71 | 1,593 | require_relative './handler.rb'
require_relative './place_handler.rb'
class PersonHandler < Handler
def initialize(args)
super
@property_mapping.merge!({
"name" => "preferred_name" ,
"givenName" => "forename" ,
"familyName" => "surname" ,
"gender" => "gender" ,
"birthDate" =>... | 24.890625 | 71 | 0.602637 |
ed37c64d11dfc54b1621016087023157904568e4 | 1,008 | require 'spec_helper'
module VhdlDoctest
describe Types do
describe ".parse" do
subject { Types.parse(string) }
describe 'std_logic' do
let(:string) { 'std_logic' }
it { should be_a Types::StdLogic }
end
describe 'std_logic_vector' do
let(:string) { 'std_logic_ve... | 25.2 | 55 | 0.59623 |
3969968229f3f37e4155efe845e6373ad259b238 | 3,312 | # frozen_string_literal: true
module PuppetEditorServices
class SimpleSTDIOServerConnection < SimpleServerConnectionBase
attr_accessor :simple_stdio_server
def initialize(simple_stdio_server)
@simple_stdio_server = simple_stdio_server
end
def send_data(data)
$editor_services_stdout.writ... | 32.792079 | 136 | 0.691425 |
624fb68b780b1cc4b0816a2363911f1fcf0724bb | 1,695 | # 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 `bin/rai... | 39.418605 | 86 | 0.733333 |
7911fc2b0817301a91f80d87d0ebaea0e602af57 | 416 | # frozen_string_literal: true
#
# spidy interface binding
#
class Spidy::DefinitionFile
attr_reader :path, :spidy
def self.open(filepath)
object = new(filepath)
object.eval_definition
object
end
# rubocop:disable Security/Eval
def eval_definition
@spidy = eval(File.read(path)) if path
end... | 15.407407 | 42 | 0.704327 |
1c88f5dcf4bec0f03ad9b1c21429df652311b0af | 1,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(*Rails.groups)
module Steward
class Application < Rails::Application
config.autoload_paths << Rails.root.join('lib'... | 40.241379 | 99 | 0.730934 |
1c8d2ca12d59c354f93ca8bd65235d089dcb14d5 | 175 | require_relative 'base'
class UserSubmission < BaseUserActivity
protected
def self.reddit_accessor(reddit_object, args)
reddit_object.get_submitted(args)
end
end
| 15.909091 | 47 | 0.794286 |
26bf8516ecb305b905cfc5d6be78f4a29a07a552 | 4,343 | require 'spec_helper'
describe OmniauthCallbacksController do
before do
facebook_provider
OmniauthCallbacksController.add_providers
@request.env["devise.mapping"] = Devise.mappings[:user]
end
let(:return_to){ nil }
let(:user){ FactoryGirl.create(:user, authorizations: [ FactoryGirl.create(:authori... | 31.471014 | 156 | 0.620309 |
ac0513a161cf90b9bb23b88543b4f9f0bec20a58 | 1,479 | require 'spec_helper'
module Sexpr::Grammar
describe Tagging, "tagging_module_for" do
include Tagging
module TaggingReference
module Node; end
module Not; end
module Lit; end
end
subject{ tagging_module_for(rulename) }
context 'when there is a tagging reference and a default t... | 20.541667 | 82 | 0.627451 |
08be0483a54d2c3b42e35975646c5be8138b60c5 | 248 | class CreateDistricts < ActiveRecord::Migration
def change
create_table :districts do |t|
t.string :name
t.boolean :active
t.references :city, index: true, foreign_key: true
t.timestamps null: false
end
end
end
| 20.666667 | 56 | 0.673387 |
f8453dc595e6985e61f9e1347cd8639db8a1b5db | 1,542 | require '_aws'
class AwsVpc < Inspec.resource(1)
name 'aws_vpc'
desc 'Verifies settings for AWS VPC'
example "
describe aws_vpc do
it { should be_default }
its('cidr_block') { should cmp '10.0.0.0/16' }
end
"
include AwsResourceMixin
def to_s
"VPC #{vpc_id}"
end
[:cidr_block,... | 22.028571 | 110 | 0.655642 |
e85de9896d4077ee3e99b0fc3c6a64d81da0f0fd | 297 | module Destatis
class State < Region
def inspect
"<#{self.class.name} #{gemeinde_name}>"
end
def regierungsbezirke
Regierungsbezirk.all.select { |i| i.state_id == state_id }
end
def kreise
Kreis.all.select { |i| i.state_id == state_id }
end
end
end
| 18.5625 | 64 | 0.622896 |
1a8ae2d99471e65d89bfb50d41ec9c921be21c9f | 758 | require 'telegram_bot'
require 'pp'
require 'logger'
require 'yaml'
require 'daemons'
require 'mysql'
require 'active_record'
env_file = File.join('config','local_env.yml')
YAML.load(File.open(env_file)).each do |key, value|
ENV[key.to_s] = value
end if File.exists?(env_file)
logger = Logger.new(STDOUT, Logger::DE... | 22.969697 | 73 | 0.728232 |
03b57dea51e4d4a9c8f83fa3d0ab8306ed19c3df | 2,711 | # Projects::TransferService class
#
# Used for transfer project to another namespace
#
# Ex.
# # Move projects to namespace with ID 17 by user
# Projects::TransferService.new(project, user, namespace_id: 17).execute
#
module Projects
class TransferService < BaseService
include Gitlab::ShellAdapter
class T... | 33.469136 | 118 | 0.69716 |
62234b7801339af74aa6d8a0babf0832ea9c41fc | 4,709 | module Ec2ex
class Ami
def initialize(core)
@core = core
end
def deregister_image(ami_name:, name:, older_than:)
images = if ami_name
search_images(ami_name)
else
get_old_images(name, older_than)
end
images.each do |image|
image_id = image[:image_id]... | 34.625 | 105 | 0.628796 |
28de23464394d05d9dbd64d602c6604d88b310d9 | 1,918 | require 'securerandom'
module Moonshot
describe Shell do
include ResourcesHelper
include described_class
let(:resources) do
Resources.new(
ilog: InteractiveLoggerProxy.new(log),
stack: double(Stack).as_null_object,
controller: instance_double(Moonshot::Controller).as_null_o... | 28.205882 | 78 | 0.622523 |
6281f49029deb75ed4f9cc5887dab267e1b64e1f | 1,020 | # -*- coding: utf-8 -*-
require "spec_helper"
describe "serialization" do
before :all do
class SpiraResource < Spira::Base
property :name, :predicate => RDF::Vocab::FOAF.givenName, :type => XSD.string
end
Spira.repository = RDF::Repository.new
end
it "should serialize a spira resource into it... | 28.333333 | 97 | 0.70098 |
030f986f7d8bd706b9d513558c8bcf4001bd2387 | 235 | # frozen_string_literal: true
module TruemailServer
module Controllers
module Healthcheck
class Show < TruemailServer::Controllers::Base
def call
respond_with(200)
end
end
end
end
end
| 16.785714 | 52 | 0.655319 |
ac39f5ea4d01096e776d0a7841ec271e37575079 | 1,103 | module KOSapiClient
module Resource
class CoursesBuilder < RequestBuilder
def detail(level = 1)
url_builder.set_query_param(:detail, level)
self
end
# Selects courses scheduled in the specified semester(s).
def sem(*semesters)
url_builder.set_query_param(:sem, sem... | 29.810811 | 88 | 0.646419 |
01bdca1928d33e925dde3df06e41223b1a2dbf62 | 1,992 | class Libsass < Formula
homepage "https://github.com/sass/libsass"
url "https://github.com/sass/libsass.git", :tag => "3.2.1", :revision => "e716caa918d86b3b8598e8ad639943fe6ec8e0ec"
head "https://github.com/sass/libsass.git"
bottle do
cellar :any
sha256 "1abc69ee4fff9ff1b355d3e5709c9a2d369d09ce559e901... | 36.888889 | 129 | 0.665161 |
f7c93c4f113a6092b0a2296b5413385b0bd4349f | 1,606 | #==============================================================================
# Watts
#
# @description: Module for providing functions to work with MassWeightScreen
# objects
# @author: Elisha Lai
# @version: 0.0.1 15/06/2015
#==============================================================================
# Mass we... | 31.490196 | 82 | 0.59589 |
62db8b75e1aa7b75e3f931b87ca7bbf5ad42bbcc | 1,477 | require 'optparse'
options = { :environment => (ENV['RAILS_ENV'] || "development").dup }
code_or_file = nil
ARGV.clone.options do |opts|
script_name = File.basename($0)
opts.banner = "Usage: #{$0} [options] ('Some.ruby(code)' or a filename)"
opts.separator ""
opts.on("-e", "--environment=name", String,
... | 30.142857 | 101 | 0.607989 |
18972a3f134f5165cdacc8eb00f5fa298f96cca5 | 553 | # frozen_string_literal: true
module Backup
module Syncer
module RSync
class Local < Base
def perform!
log!(:started)
create_dest_path!
run("#{rsync_command} #{paths_to_push} '#{dest_path}'")
log!(:finished)
end
private
# Expand pa... | 18.433333 | 65 | 0.562387 |
01e0b8dfece67681a935f2ee25b76741a316acce | 1,181 | $:.push File.expand_path("../lib", __FILE__)
require "capybara/webkit/version"
Gem::Specification.new do |s|
s.name = "capybara-webkit"
s.version = Capybara::Driver::Webkit::VERSION.dup
s.authors = ["thoughtbot", "Joe Ferris", "Matt Horan", "Matt Mongeau",
"Mike Burns", "Jason Morrison"]
... | 33.742857 | 73 | 0.680779 |
e2f54898fbe0ab9c9479dc1cc1ef889651c311b7 | 132 | require 'test_helper'
class DiscriminationTypeTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 16.5 | 54 | 0.727273 |
08544e024417841f904adb0da3f156e1c047bcda | 2,521 | # Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'spec_helper'
describe User do
before do
@aspect = alice.aspects.first
@aspect1 = alice.aspects.create(:name => 'other')
end
describe '#... | 32.320513 | 105 | 0.654899 |
b93aa7ef73ec96bb7d5ddd141336cb8b85c461b7 | 364 | class CreateProducts < ActiveRecord::Migration
def change
create_table :products do |t|
t.string :title
t.text :description
t.decimal :price
t.integer :size
t.boolean :spicy
t.boolean :veg
t.boolean :best_offer
t.string :image_path
t.string :small_image_path
... | 20.222222 | 46 | 0.648352 |
1ce071234ebacb7bf0a1f8d7c43a882c3561de64 | 241 | class CreateEllisActs < ActiveRecord::Migration
def change
create_table :ellis_acts do |t|
t.belongs_to :building
t.belongs_to :property_owner
t.string :filing_number
t.timestamps null: false
end
end
end
| 20.083333 | 47 | 0.697095 |
18ef7e90e6800f30a6befc841c48d944b2115e16 | 9,647 | # encoding: UTF-8
require 'spec_helper'
require 'yt/models/playlist'
describe Yt::Playlist, :device_app do
subject(:playlist) { Yt::Playlist.new id: id, auth: $account }
context 'given an existing playlist' do
let(:id) { 'PLSWYkYzOrPMT9pJG5St5G0WDalhRzGkU4' }
it 'returns valid metadata' do
expect(... | 39.536885 | 108 | 0.682077 |
61e7ece90d2462f24cf2b77d86a18d0bb24508f7 | 3,312 | module ActionController
module ConditionalGet
extend ActiveSupport::Concern
include RackDelegation
include Head
# Sets the etag, last_modified, or both on the response and renders a
# "304 Not Modified" response if the request is already fresh.
#
# Parameters:
# * <tt>:etag</tt>
... | 38.068966 | 166 | 0.652174 |
6a4d1c8895180c1a0d9906fa14daef47b6cd860a | 3,857 | require 'json'
require 'randexp'
require 'hashie'
require 'active_support/concern'
require 'digest/sha1'
module Attributor
require_relative 'attributor/dumpable'
require_relative 'attributor/exceptions'
require_relative 'attributor/attribute'
require_relative 'attributor/type'
require_relative 'attributor/... | 31.104839 | 130 | 0.745917 |
1d70eeca40c9ca4b1c156e974b5a7c72513171ea | 18,854 | =begin
#NSX-T Manager API
#VMware NSX-T Manager REST API
OpenAPI spec version: 2.5.1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.19
=end
require 'date'
module NSXT
class PortMirroringSession
# Link to this resource
attr_accessor :_self
# The ser... | 35.373358 | 508 | 0.649093 |
ab08e208963f1f7108073fe58d2d4c9bbe33e447 | 1,234 | require "spec_helper"
describe Lionactor::LocationAmenity do
before :each do
data = JSON.parse(MML)["location"]["_embedded"]["amenities"].first
@local = Lionactor::LocationAmenity.new(data, nil)
end
describe "via automatic methods" do
describe "#accessible" do
it "is true" do
expect(@l... | 24.196078 | 70 | 0.657212 |
91424f843c0c8e33792e7d1df49188c253d15895 | 786 | # frozen_string_literal: true
module CallCenter
module Clients
# Schema and validation rules for the {CallCenter::Operations::Clients::Create} operation
class ClientContract < CallCenter::Validation::ApplicationContract
# @!method call(opts)
# @param [Hash] opts the parameters to validate using... | 32.75 | 93 | 0.693384 |
7997363e8b51824c70ed853d575a27d79c8e4bf4 | 373 | # frozen_string_literal: true
module ClickUp
class ClickUpError < StandardError
attr_reader :message
def initialize(msg = nil)
@message = msg
end
def to_s
"#{message}"
end
end
class ParamRequiredError < ClickUpError
attr_reader :params
def initialize(msg, *params)
... | 15.541667 | 41 | 0.646113 |
39b2953995b3af3e7eb57c614d8791d6d8791857 | 3,974 | # frozen_string_literal: true
require "spec_helper"
require "dependabot/terraform/file_fetcher"
require_common_spec "file_fetchers/shared_examples_for_file_fetchers"
RSpec.describe Dependabot::Terraform::FileFetcher do
it_behaves_like "a dependency file fetcher"
let(:source) do
Dependabot::Source.new(
... | 30.569231 | 79 | 0.601409 |
e84748209e875cfd78062e16b6a24787ddb8b3ce | 1,171 | module Xpose
class Configuration
DEFAULT_VALUES = {
name: nil,
value: nil,
decorate: true,
decorator: :infer,
scope: :all
# source: :infer (:infer, :method, : .call : ...)
}.freeze
def initialize(**options)
@options = options
permit_options! unless options... | 23.42 | 78 | 0.63877 |
626757f13db9b1d8dc61eb8fde9d3716777abb38 | 5,250 | require "rails_helper"
RSpec.describe UpdateDocument, :with_stubbed_opensearch, :with_test_queue_adapter do
let(:investigation) { create(:allegation) }
let(:product) { create(:product_washing_machine) }
let(:business) { create(:business) }
let(:user) { create(:user) }
let(:parent) { product }
let(:old_tit... | 30.701754 | 123 | 0.601524 |
6221fb05779aae2b1537dafff34fceace8c085c5 | 1,164 | #
# Original knife-windows author:: Chirag Jog (<chirag@clogeny.com>)
# Copyright:: Copyright (c) 2013-2016 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# 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 ... | 31.459459 | 74 | 0.724227 |
ff485b087f81bfc4432b94441688df0ea1881d54 | 6,781 | # frozen_string_literal: true
module GraphQL
class Schema
# You can use the result of {GraphQL::Introspection::INTROSPECTION_QUERY}
# to make a schema. This schema is missing some important details like
# `resolve` functions, but it does include the full type system,
# so you can use it to validate qu... | 37.464088 | 111 | 0.545347 |
38acd0a4da3c71a49a734d8ee67927f0096aebc9 | 3,365 | # frozen_string_literal: true
# Bind on a specific TCP address. We won't bother using unix sockets because
# nginx will be running in a different Docker container.
bind "tcp://#{ENV.fetch('BIND_ON') { '0.0.0.0:3000' }}"
# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch('PIDFILE') { 'tmp/pids/puma.pid' }... | 46.09589 | 146 | 0.768499 |
28d358fe3a6df051ba1e612d6e55edb46f95a3af | 1,071 | # 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_08_01
module Models
#
# Reference to another subresource.
#
class SubResource
include MsRestAzur... | 22.787234 | 70 | 0.528478 |
ab54ba430eaba46686f5e8905f411c603f2d6147 | 1,687 | #--
# Copyright (C) 2006 Andrea Censi <andrea (at) rubyforge.org>
#
# This file is part of Maruku.
#
# Maruku is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | 26.359375 | 78 | 0.639597 |
33b896d6f5dd12e56a824cf800d4f46ed0d53237 | 786 | Pod::Spec.new do |s|
s.name = "Localytics-AMP"
s.version = "2.21.0"
s.summary = "Localytics AMP iOS SDK"
s.description = "Localytics analytics and marketing platform"
s.homepage = "http://www.localytics.com"
s.license = {
:type => 'Copyright',
:file => 'LICENSE'
}
s.... | 32.75 | 105 | 0.617048 |
ff1fe273d6d7442ab81e69d924fd62e527452b8e | 1,755 | # -*- encoding: utf-8 -*-
# stub: rails-html-sanitizer 1.0.2 ruby lib
Gem::Specification.new do |s|
s.name = "rails-html-sanitizer"
s.version = "1.0.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Rafael Mendo... | 39 | 105 | 0.638746 |
1d153b00632aa31e75a3b5bb218d2e47a43d1950 | 2,558 | # -*- coding: utf-8 -*-
#
# Copyright 2014 Roy Liu
#
# 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 ... | 28.422222 | 80 | 0.629007 |
08444f671567f16f0294fb9cf6e287e8060bac72 | 96 | class VisitorsController < ApplicationController
def about
render 'pages/about'
end
end
| 16 | 48 | 0.770833 |
181c9ac5c5ce6c929de036551b19424e29f510bc | 1,064 | require "./lib/active_record/session_store/version"
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'activerecord-session_store'
s.version = ActiveRecord::SessionStore::VERSION
s.summary = 'An Action Dispatch session store backed by an Active Record class.'
s.requir... | 34.322581 | 86 | 0.649436 |
79a568b3d5c660bd768979dee8ff2d4da1542aac | 993 | # frozen_string_literal: true
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "date_as_string/version"
Gem::Specification.new do |spec|
spec.name = "date_as_string"
spec.version = DateAsString::VERSION::STRING
spec.authors = ["Eric Sullivan"]... | 39.72 | 120 | 0.691843 |
1839d0bd69b57b69ae7bb2ef3f4aecf23bf1eeaf | 1,043 | require 'rails_helper'
require 'authorization/assertion/facebook'
RSpec.describe Authorization::Assertion::Facebook do
before do
stub_request(:get, %r{https://graph.facebook.com/v2.11/me\?.*})
.to_return(body: fixture('auth/facebook/self.json'))
stub_request(:get, %r{https://graph.facebook.com/v2.11/me... | 28.972222 | 77 | 0.682646 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.