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 |
|---|---|---|---|---|---|
28713525b6abe5e6ad9c87f8c83cea11062be2e1 | 14,336 | # frozen_string_literal: true
require 'pathname'
require 'fileutils'
module Dry
class CLI
module Utils
# Files utilities
#
# @since 0.3.1
module Files # rubocop:disable Metrics/ModuleLength
# Creates an empty file for the given path.
# All the intermediate directories are... | 32.288288 | 181 | 0.547921 |
bbada9092345d7a7343d453ca1a7374b0eb617f6 | 160 | module AutotestNotification #:nodoc:
module VERSION #:nodoc:
MAJOR = 1
MINOR = 6
TINY = 0
STRING = [MAJOR, MINOR, TINY].join('.')
end
end
| 16 | 43 | 0.6 |
b96894a3aef2dd4a2ab97539ef393f899808a155 | 3,173 | require 'netaddr'
module VCAP::CloudController
class SecurityGroup < Sequel::Model
SECURITY_GROUP_NAME_REGEX = /\A[[:alnum:][:punct:][:print:]]+\Z/
MAX_RULES_CHAR_LENGTH = 2**24 - 1
plugin :serialization
import_attributes :name, :rules, :running_default, :staging_default, :space_guids
export_at... | 33.755319 | 90 | 0.630003 |
e864632d8c52004c615e67c86092206970c6999b | 299 | class CreateVolunteers < ActiveRecord::Migration[5.0]
def change
create_table :volunteers do |t|
t.string :name
t.string :phone
t.string :email
t.string :address
t.string :city
t.string :state
t.string :zip
t.timestamps
end
end
end
| 18.6875 | 53 | 0.602007 |
0890fbda59b419c192f2f8984528e27f23f986bb | 4,396 | require 'spec_helper'
require 'oily_png'
describe SnapshotComparer do
describe '#compare!' do
let(:snapshot_after) { build(:snapshot) }
let(:snapshot_before) { build(:snapshot) }
let(:snapshot_comparer) do
SnapshotComparer.new(snapshot_after, snapshot_before)
end
subject { snapshot_com... | 33.557252 | 81 | 0.660146 |
ac06cdc80f6e980e46958401f46c7afdb39884fa | 1,335 | class NewRelic::MetricParser::View < NewRelic::MetricParser
def is_view?; true; end
def is_render?
segments.last == "Rendering"
end
def is_compiler?
segments.last == "Compile"
end
def pie_chart_label
case segments.last
when "Rendering"
"#{file_name(segments[-2])} Template"
w... | 21.532258 | 88 | 0.619476 |
f7da90af5eb8bd5aaf22dbc17e25ff9c7e461d9f | 2,297 | class Cask::Container::Dmg < Cask::Container::Base
def self.me?(criteria)
criteria.imageinfo != ''
end
attr_reader :mounts
def initialize(*args)
super(*args)
@mounts = []
end
def extract
mount!
assert_mounts_found
@mounts.each do |mount|
@command.run('/usr/bin/ditto',
... | 31.465753 | 111 | 0.581628 |
7a4ff5d3783b961ce743f64e449497b77b61e992 | 170 | class AddUsernameToUsers < ActiveRecord::Migration[5.1]
def change
add_column :users, :username, :string
add_index :users, :username, :unique => true
end
end
| 24.285714 | 55 | 0.717647 |
edcf552ec41a4267bdb71ecacaed9ed993e1bab7 | 1,461 | # frozen_string_literal: true
require "#{ROOT_DIR}/lib/custom_facts/version"
require "#{ROOT_DIR}/lib/custom_facts/core/logging"
require "#{ROOT_DIR}/lib/custom_facts/core/legacy_facter"
require "#{ROOT_DIR}/lib/custom_facts/util/fact"
require "#{ROOT_DIR}/lib/custom_facts/util/collection"
require "#{ROOT_DIR}/lib/cus... | 50.37931 | 61 | 0.798768 |
7aa5801ddb271e69a76ec85fbd6d753807733f88 | 3,334 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 32.368932 | 102 | 0.629574 |
bba02a665e16ee38109dff6641a181de89063e11 | 183 | class CreateUser < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :username
t.string :email
t.string :password_digest
end
end
end
| 18.3 | 42 | 0.672131 |
1d4b780aa87c00b1f73e0109c807f96433199a63 | 809 | class Dhcping < Formula
desc "Perform a dhcp-request to check whether a dhcp-server is running"
homepage "http://www.mavetju.org/unix/general.php"
url "http://www.mavetju.org/download/dhcping-1.2.tar.gz"
mirror "https://mirrors.kernel.org/debian/pool/main/d/dhcping/dhcping_1.2.orig.tar.gz"
sha256 "32ef86959b0... | 40.45 | 95 | 0.771323 |
28a541a6c604abadb57fa101abcca79fe04c05ae | 4,729 | require "helper"
module Neovim
RSpec.describe LineRange do
let(:client) { Support.persistent_client }
let(:buffer) { client.current.buffer }
let(:line_range) { LineRange.new(buffer) }
before do
buffer.set_lines(0, -1, true, ["1", "2", "3", "4"])
end
describe "#each" do
it "yield... | 28.14881 | 63 | 0.525904 |
d5c6820f0a9b5f880342f5bdd8e5aeb524d7eae7 | 8,645 | # frozen_string_literal: true
require 'rspec/core/sandbox'
# We need a reporter for internal tests that's different from the reporter for
# external tests otherwise the results will be mixed up. We don't care about
# most reporting, but we do want to know if a test fails
class RaiseOnFailuresReporter < RSpec::Core::N... | 29.606164 | 96 | 0.638172 |
abae97d32e8b9d025e2faf9f6ca7dc856435d02d | 495 | Paperclip::Attachment.default_options[:storage] = :qiniu
Paperclip::Attachment.default_options[:qiniu_credentials] = {
:access_key => ENV['QINIU_ACCESS_KEY'] || raise("set env QINIU_ACCESS_KEY"),
:secret_key => ENV['QINIU_SECRET_KEY'] || raise("set env QINIU_SECRET_KEY")
}
Paperclip::Attachment.default_options[:buc... | 49.5 | 78 | 0.773737 |
1d49a16f3a6925df13c5f5618d5026a5299ce109 | 423 | class CreateUserLessonTests < ActiveRecord::Migration[5.0]
def change
create_table :user_lesson_tests do |t|
t.integer :user_id, null: false
t.integer :lesson_id, null: false
t.string :right_percent, null: false
t.timestamps
end
add_index :user_lesson_tests, :user_id
add_index ... | 32.538462 | 106 | 0.718676 |
f7330529d497ed949421192b1ac346adc9823479 | 3,281 | module SparkApi
module Authentication
module OAuth2Impl
class GrantTypeBase
GRANT_TYPES = [:authorization_code, :password, :refresh_token]
def self.create(client, provider, session=nil)
granter = nil
case provider.grant_type
when :authorization_code
... | 34.904255 | 118 | 0.574825 |
18c0c09113ff19d9fa53f902a4d267891f648540 | 616 | class ProductsController < ApplicationController
def index
products = Product.all
render json: products
end
def add_frame
links = Product.new.add_frame(params[:publicId], params[:size], params[:orientation])
render json: { link: links }
end
def add_print
l... | 23.692308 | 94 | 0.637987 |
edaa8053553992082a07d59d79520b5f919c3a41 | 3,716 | # frozen_string_literal: true
require_relative '../../../test_helper'
SingleCov.covered!
# needs Integration at the end for minitest-spec-rails
describe 'Warden::Strategies::DoorkeeperStrategy Integration' do
def perform_get(authorization)
get path, headers: {HTTP_AUTHORIZATION: authorization}
end
def erro... | 32.884956 | 110 | 0.718784 |
bb241dc15dbaf7077ebc6bcdf32a2759720d9ad6 | 526 | class CreateSubscriptionCountries < ActiveRecord::Migration
def self.up
create_table :subscription_countries do |t|
t.integer :subscription_id, :null => false
t.integer :country_id, :null => false
t.decimal :price, :null => false, :default => 0
t.decimal :price_over_threshold, :null => fal... | 29.222222 | 87 | 0.693916 |
f833ab238cadfe4af6b2a06763290b43eed7f84c | 1,803 | class LwtAuthenticationSystemGenerator < Rails::Generator::Base
#TODO: update classes of they exists?
#TODO: Add routes?
#TODO: Add tests
def manifest
record do |m|
m.directory File.join( *%w{ app controllers } )
m.directory File.join( *%w{ app models } )
m.directory File.join( *%w{ app v... | 60.1 | 141 | 0.681642 |
611a3e6e34593754cc05492742ac86e43d9e4a88 | 540 | cask 'simply-fortran' do
version '3.6.3116'
sha256 '9c3a9d94f76fdc55d724ed3f87e4798508665cddb730aeaf496b0c3b98bf6b65'
# download.approximatrix.com/simplyfortran was verified as official when first introduced to the cask
url "http://download.approximatrix.com/simplyfortran/#{version.major_minor}/simplyfortran-#... | 38.571429 | 107 | 0.77963 |
5d23037464318a349e316626d675c643e0c76402 | 1,082 | # frozen_string_literal: true
require 'elastic_apm/span_helpers'
module ElasticAPM
RSpec.describe SpanHelpers do
class Thing
include ElasticAPM::SpanHelpers
def do_the_thing
'ok'
end
span_method :do_the_thing
def self.do_all_things
'all ok'
end
span_cl... | 20.037037 | 66 | 0.631238 |
ab6d8d3774f5aec6ca365f6710d902ad01413cf7 | 2,382 | require 'rails_helper'
describe 'assignments/new.html.slim', type: :view do
let(:unassigned_case) { create :case }
let(:bg) { create :business_group }
let(:dir) { create :directorate, business_group: bg }
let!(:business_unit_1) { create :responding_team, directorate: dir }
... | 30.935065 | 92 | 0.68178 |
33549a4946ceecba58dd4a5a3e6190de4b0cdb5c | 1,814 | module Spec
module Mocks
class Mock
include Methods
# Creates a new mock with a +name+ (that will be used in error messages
# only) == Options:
# * <tt>:null_object</tt> - if true, the mock object acts as a forgiving
# null object allowing any message to be sent to it.
def i... | 31.824561 | 94 | 0.606395 |
21d4be7bfb947a12cbdecc70c3b7eb0c82c1c503 | 392 | require "chef/config"
require_relative "with_pattern"
module Cheffish
class ChefRunData
def initialize(config)
@local_servers = []
@current_chef_server = Cheffish.default_chef_server(config)
end
extend Cheffish::WithPattern
with :data_bag
with :environment
with :data_bag_item_enc... | 19.6 | 65 | 0.732143 |
1d36ff12892261cbc7e08c11f596c86a2d249312 | 2,713 | # frozen_string_literal: true
require 'stringio'
module API::V2
module Management
class JWTAuthenticationMiddleware < Grape::Middleware::Base
extend Memoist
mattr_accessor :security_configuration
def before
return if request.path == '/api/v2/management/swagger'
check_request_... | 28.861702 | 100 | 0.58017 |
bff4b8018df53eff06f3a1dee45197e64a98179d | 978 | # threes mode puzzles
class GameModes::ThreeController < ApplicationController
def index
render "game_modes/three"
end
# json endpoint for fetching puzzles on initial pageload
def puzzles
render json: {
# This uses the same puzzle pool as Haste mode
puzzles: HastePuzzle.random_level(100).... | 22.744186 | 85 | 0.686094 |
39ea9118adbb3fd7713eeb9d6621206b635e1c82 | 996 | #
# Copyright 2019 ThoughtWorks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 36.888889 | 220 | 0.764056 |
62cc2b3663fbf0e3fa3368a816c7c62278b0dadf | 37,997 | require File.expand_path("../ecloud/models/model", __FILE__)
require File.expand_path("../ecloud/models/collection", __FILE__)
require File.expand_path("../ecloud/errors", __FILE__)
module Fog
module Compute
class Ecloud < Fog::Service
API_URL = "https://services.enterprisecloud.terremark.com"
attr_... | 44.285548 | 190 | 0.447404 |
012ad4b5cd1796edd238a535da72b9d8dc96b50e | 590 | Pod::Spec.new do |s|
s.name = "DPAppDoctor"
s.version = "4.0.0"
s.ios.deployment_target = '8.0'
s.summary = "A delightful setting interface framework."
s.homepage = "https://github.com/xiayuqingfeng/DPAppDoctor"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "涂鸦" => "1... | 36.875 | 98 | 0.637288 |
39e256e182ddcf882896878498cdb20cbfe2643d | 153 | class AddLocationToProjects < ActiveRecord::Migration[6.0]
def change
add_column :projects, :location, :string, null: false, default: ""
end
end
| 25.5 | 70 | 0.732026 |
39172e7ab9e53501bbc6bfc1e0035f6765768bcd | 2,547 | #
# Author:: John Keiser (<jkeiser@opscode.com>)
# Author:: Ho-Sheng Hsiao (<hosh@opscode.com>)
# Copyright:: Copyright (c) 2012 Opscode, 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.
# ... | 31.060976 | 92 | 0.657244 |
017b6b629c675f71fde778571c7c3f5f5820f907 | 2,306 | require 'spec_helper'
describe Medie::Xml::Driver do
context "when looking up the handler" do
it "should accept pure application/xml" do
Medie::Xml::Driver.new.can_handle?("application/xml").should be_true
Medie::Xml::Driver.new.can_handle?("application/atom+xml").should be_true
Medie::Xm... | 33.911765 | 102 | 0.670859 |
03fe762b3fd618f52701ca56e0fe3be8bfba2928 | 1,685 | require "spec_helper"
describe Intercom::Company do
let(:client) { Intercom::Client.new(token: 'token') }
describe "when no response raises error" do
it "on find" do
client.expects(:get).with("/companies", {:company_id => "4"}).returns(nil)
_(proc { client.companies.find(:company_id => "4")}).must... | 37.444444 | 168 | 0.67181 |
f7d3d32a4a9a24eb79994f93d4b802ff0a01c9fe | 136 | require 'fog/core'
module Fog
module Glesys
extend Fog::Provider
service(:compute, 'glesys/compute', 'Compute')
end
end
| 11.333333 | 50 | 0.676471 |
61bc1da1406bbaea7c337aca7dbbea964f1aa77d | 491 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional ... | 40.916667 | 98 | 0.769857 |
ac724d302c88ab352e1260404d676d2662c043ec | 313 | # frozen_string_literal: true
require "test_helper"
class Folio::Console::Index::PositionButtonsCellTest < Folio::Console::CellTest
test "show" do
page = create(:folio_page)
html = cell("folio/console/index/position_buttons", page, as: :pages).(:show)
assert html.has_css?(".btn-group")
end
end
| 26.083333 | 81 | 0.71885 |
1de21ef39f66c543ea2e4d85b2499d1bd468f379 | 309 | require "eu_central_bank"
module Initializer
def self.configure_money_gem
I18n.config.available_locales = :en
I18n.locale = :en
Money.locale_backend = :i18n
Money.rounding_mode= BigDecimal::ROUND_HALF_UP
Money.default_bank = EuCentralBank.new
end
end
Initializer.configure_money_gem
| 22.071429 | 50 | 0.773463 |
1acd335a786d1dc3e7048899906cb5fac6189a58 | 2,177 | class Anagramizer
def anagram(word1, word2)
word1_compare = word1.downcase.split('').sort.delete_if{|x| x.match(/[^a-z]/i)}
word2_compare = word2.downcase.split('').sort.delete_if{|x| x.match(/[^a-z]/i)}
if (word1_compare.none? {|e| e.match(/[aeiou]/i)}) || (word2_compare.none? {|e| e.match(/[aeiou]/i)})
... | 36.283333 | 130 | 0.628388 |
bf47cd00cc50b1661c929de20a3720d6cff3c96b | 34 | module Less
class Bool; end
end
| 8.5 | 17 | 0.735294 |
1d0d72429d3890703b78cfb14992a3f6a33069d8 | 4,455 | module Hashie
module Extensions
# IndifferentAccess gives you the ability to not care
# whether your hash has string or symbol keys. Made famous
# in Rails for accessing query and POST parameters, this
# is a handy tool for making sure your hash has maximum
# utility.
#
# One unique featur... | 29.309211 | 118 | 0.601796 |
ffb2a4d2e803cf42b14cf1a8f923f7b0b512c1e9 | 349 | class CreateGroups < ActiveRecord::Migration[5.2]
def change
create_table :groups do |t|
t.string :name
t.boolean :visible
t.timestamps
end
add_index :groups, :name, unique: true
create_table :groups_users do |t|
t.integer :member_id, index: true
t.integer :group_id, i... | 19.388889 | 49 | 0.647564 |
bb5ffd1cc0d98ce3a1ae31bd6367358fab394aa6 | 1,492 | require_relative('../../puppet/property/netscaler_truthy')
Puppet::Type.newtype(:netscaler_responderglobal) do
@doc = 'Activates the specified responder policy for all requests sent to the NetScaler appliance.'
apply_to_device
ensurable
newparam(:name, :namevar => true) do
desc "Name of the responder pol... | 24.459016 | 135 | 0.723861 |
ed3834a76efdb29c9a4b30a7f310ff69a652e521 | 203 | module Disc
class Topic < DiscObject
root :post_stream
list :posts
def self.find(id)
response = Disc.request(:get, "/t/#{id}.json")
self.new(response[:body])
end
end
end
| 16.916667 | 52 | 0.610837 |
1155be2b6673d354140684cfac6de25488cbdbba | 433 | $:.unshift File.expand_path('..', __FILE__)
$:.unshift File.expand_path('../../lib', __FILE__)
require 'simplecov'
SimpleCov.start do
add_filter 'vendor'
end
require 'rspec'
require 'rack/test'
require 'webmock/rspec'
require 'omniauth'
require 'omniauth-brapp'
RSpec.configure do |config|
config.include WebMock::A... | 22.789474 | 67 | 0.741339 |
d50f0381bbbe6393f860cd8bd065935b25db58b8 | 3,756 | =begin
#Datadog API V1 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed ... | 28.454545 | 226 | 0.662673 |
1d16b826bee225b516e359b7b4da99f50c732298 | 6,790 | require 'test_helper'
class CountryTest < ActiveSupport::TestCase
test '.bounds returns the bounding box for the Country geometry' do
country = FactoryGirl.create(:country, bounding_box: 'POLYGON ((-1 0, 0 1, 1 2, 1 0, -1 0))')
assert_equal [[0, -1], [2, 1]], country.bounds
end
test '.without_geometry ... | 39.476744 | 105 | 0.723859 |
b98cde2df610d304b3ffd9db754ea15717b7ea26 | 651 | include_recipe 'download-setups-s3::auth_files'
directory node['download_setups_s3']['pro']['local_path'] do
recursive true
action :create
end
aws_s3_file node['download_setups_s3']['pro']['src_path'] do
bucket node['download_setups_s3']['bucket']
region node['download_setups_s3']['region']
remote_path node... | 29.590909 | 62 | 0.711214 |
5dc533ba23a7d5bec61069c91c206915c2b114ac | 1,952 | ##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/projects/Framework/
##
require 'msf/core'
class Metasploit3 < ... | 25.025641 | 148 | 0.599385 |
f82a3b01706bf286f36bf6d3f82c54c858da04e2 | 29 | module Admins::TopHelper
end
| 9.666667 | 24 | 0.827586 |
6aa03d52fdd3101b022f16ae44cd99b621784787 | 491 | require 'scorched'
require_relative './common'
class App < Scorched::Controller
get '/' do
render :index
end
controller '/artist/:id' do
before do
@artist = Artist[captures[:id]]
check_access(@artist)
end
get '/' do
render :artist
end
post '/' do
@artist.update(... | 14.441176 | 43 | 0.588595 |
ffc9ad81a596834a42491401b099ab0e99234248 | 1,235 | =begin
#Ory APIs
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
The version of the OpenAPI document: v0.0.1-alpha.30
Contact: support@ory.sh
Generated by: https://openapi-generator.tech
O... | 31.666667 | 177 | 0.74413 |
91a0db08d5ba778d88bcda7bd78ba64a9697add6 | 7,228 | # frozen_string_literal: true
module Gitlab
module BackgroundMigration
module ProjectNamespaces
# Back-fill project namespaces for projects that do not yet have a namespace.
#
# rubocop: disable Metrics/ClassLength
class BackfillProjectNamespaces
attr_accessor :project_ids, :sub_b... | 44.073171 | 185 | 0.653154 |
180db50bbfebc69f97190f43b0161359d3ffcee3 | 1,530 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_mailbox/engine"
require "action_text/en... | 32.553191 | 87 | 0.745098 |
182d154e531c2817f2a93051a3244623a0278eeb | 1,449 | module RSpec
module Matchers
module BuiltIn
class BeWithin
include MatchAliases
def initialize(delta)
@delta = delta
end
def matches?(actual)
@actual = actual
raise needs_expected unless defined? @expected
raise needs_subtractable... | 23.370968 | 111 | 0.541753 |
1a30c847846d4ba516d459fd807ccc725181631a | 1,475 | # Copyright 2011-2012 Rice University. Licensed under the Affero General Public
# License version 3 or later. See the COPYRIGHT file for details.
require 'test_helper'
class ConsentFormsControllerTest < ActionController::TestCase
setup do
@consent_form = consent_forms(:one)
end
test "should get index" do... | 27.830189 | 160 | 0.743729 |
ffb6da34200b4bbc3ef7a41f50175b280c0ccaee | 313 | require "afmotion"
unless defined?(Motion::Project::Config)
raise "This file must be required within a RubyMotion project Rakefile."
end
lib_dir_path = File.dirname(File.expand_path(__FILE__))
Motion::Project::App.setup do |app|
app.files.unshift(Dir.glob(File.join(lib_dir_path, "motion-giphy/*.rb")))
end
| 28.454545 | 75 | 0.763578 |
1820299a714bb4888edb41422185f51aa27efc6d | 328 | require './config/environment'
if defined?(ActiveRecord::Migrator) && ActiveRecord::Migrator.needs_migration?
raise 'Migrations are pending. Run `rake db:migrate` to resolve the issue.'
end
use Rack::MethodOverride
use Sass::Plugin::Rack
use UsersController
use RoomsController
use ItemsController
run ApplicationCo... | 25.230769 | 78 | 0.807927 |
ffe0cdf2e564438e76bfb2e9b7bd48ccd917d5c5 | 4,168 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Post
include Msf::Post::File
def initialize(info = {})
super(
update_info(
info,
'Name' => "Windows Manage Download and/... | 29.560284 | 120 | 0.595489 |
f7b01dde15ec5b5bcc00f60052355278775e7b60 | 7,894 | =begin
#Tatum API
## Authentication <!-- ReDoc-Inject: <security-definitions> -->
OpenAPI spec version: 3.9.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.31
=end
require 'date'
module Tatum
class FlowAccountKeys
# Index of the public key.
attr_accessor :... | 29.676692 | 200 | 0.611224 |
edf8e1841a990ad1f1cab997dc65737fb37860c6 | 600 | require "dry-transaction"
require "berg/transactions"
require "admin/container"
require "admin/import"
module Admin
class Transactions < Berg::Transactions
class StepAdapters < Dry::Transaction::StepAdapters
class Enqueue
include Admin::Import("enqueue")
def call(step, *args, input)
... | 21.428571 | 55 | 0.663333 |
6a5c7d2749d4bd2ef9bace45b4daa1a021df3aaf | 7,269 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Files::MultiService do
subject { described_class.new(project, user, commit_params) }
let(:project) { create(:project, :repository) }
let(:repository) { project.repository }
let(:user) { create(:user) }
let(:branch_name) { project.default_br... | 26.922222 | 131 | 0.615628 |
1d9c2261ea3747f4f37338a6a69e598f005e5383 | 3,737 | # encoding: utf-8
module Holidays
# This file is generated by the Ruby Holidays gem.
#
# Definitions loaded: data/is.yaml
#
# To use the definitions in this file, load it right after you load the
# Holiday gem:
#
# require 'holidays'
# require 'holidays/is'
#
# All the definitions are availab... | 55.776119 | 185 | 0.560075 |
e8db002d0b9e9225052996c910afa5e843967b43 | 1,169 | require 'test_helper'
class UsersControllerTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
@other_user = users(:archer)
end
test "should redirect index when not logged in" do
get users_path
assert_redirected_to login_url
end
test "should get new" do
get sig... | 24.87234 | 68 | 0.686912 |
bbb1bd3bc029973641505a698266323067a9254e | 2,534 | # Project 60. # plan.io 10270
# bundle exec rake export:death fname='AIDS_ANNUAL_2016_TEST.txt' original_filename="deaths/SUBSET MBIS_Deaths_Subset_2016_skip1.txt" klass=Export::AidsDeathsAnnual project_name='Annual ONS Deaths for HIV Surveillance' team_name='HIV and STI Department'
module Export
class AidsDeathsAnnu... | 43.689655 | 253 | 0.59708 |
39b16ab37451bfe3165364edbf9f2d3f6a1d406b | 3,062 | module Cms::Lib::Layout
def self.current_concept
concept = defined?(Page.current_item.concept) ? Page.current_item.concept : nil
concept ||= Page.current_node.inherited_concept
end
def self.inhertited_concepts
return [] unless current_concept
current_concept.ancestors.reverse
end
def self.in... | 34.404494 | 92 | 0.630634 |
e9ce9d6c0b859114d6a88fa6e18120b0dfd7286e | 877 | cask 'omnigraffle' do
if MacOS.version <= :snow_leopard
version '5.4.4'
sha256 '7bcc64093f46bd4808b1a4cb86cf90c0380a5c5ffffd55ce8f742712818558df'
url "http://www.omnigroup.com/ftp1/pub/software/MacOSX/10.6/OmniGraffle-#{version}.dmg"
elsif MacOS.version <= :mavericks
version '6.0.5'
sha256 'a2ef... | 36.541667 | 92 | 0.759407 |
01f041ca3b498cd3b61721359db998ec5368baa4 | 1,128 | #
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: AJ Christensen (<aj@chef.io>)
# Copyright:: Copyright 2009-2017, 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... | 27.512195 | 74 | 0.698582 |
f89e933c457ad319da8307e594795c67edb87734 | 96 | require File.dirname(__FILE__) + '/spec_helper'
describe Kafka do
before(:each) do
end
end | 13.714286 | 47 | 0.729167 |
182c38fca958f04480b4184acdae4bba94d3df9b | 196 | class ChangeServiceToText < ActiveRecord::Migration[4.1]
def change
change_column :casino_proxy_tickets, :service, :text
change_column :casino_service_tickets, :service, :text
end
end
| 28 | 58 | 0.77551 |
33d0fd098999fa7ad40d10fb36cf59610699c2aa | 274 | class Todos < Cask
version 'latest'
sha256 :no_check
url 'http://dbachrach.com/opensoft/downloads/apps/Todos.dmg'
appcast 'http://www.dbachrach.com/opensoft/appcasts/Todos.xml'
homepage 'http://dbachrach.com/opensoft/index.php?page=Todos'
link 'Todos.app'
end
| 24.909091 | 64 | 0.740876 |
ff96270b2eee892da9119e7dcda9af3e98a5f207 | 1,154 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rails_translation_manager/version'
Gem::Specification.new do |spec|
spec.name = "rails_translation_manager"
spec.version = RailsTranslationManager::VERSION
spec.authors ... | 36.0625 | 74 | 0.690641 |
e92f9db9b73b4dccf52dec73cf9ebde164331cd2 | 968 | require 'spec_helper'
describe "Subscription" do
context "as a user" do
before do
reset_spree_preferences do |config|
config.default_country_id = create(:country).id
end
create(:payment_method)
create(:free_shipping_method)
@product1 = create(:subscribable_product, name: 'Gi... | 31.225806 | 109 | 0.676653 |
4ac4676e740fce4fd41d77be7b3fe1882b50d837 | 840 | # encoding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "StringToPinyin" do
before :each do
@single_char = "名"
@multiple_chars = "中华人民共和国"
@nil_char = "a"
@punctuated = "你好! 你是中国人吗? <- that was mandarin"
end
it "should return pinyin for a single character i... | 30 | 93 | 0.694048 |
794fe55c4b0e5061b1b162ab1c96bde349c491fc | 73 | # frozen_string_literal: true
module ActionAuth
VERSION = "0.1.0"
end
| 12.166667 | 29 | 0.739726 |
bf4b0dc7497e886ae36a30d43421746a9f01dc4d | 252 | class AddFeatureIdToForemTopic < ActiveRecord::Migration
def change
add_column :forem_topics, :feature_id, :int
add_column :forem_topics, :area_id, :int
add_index :forem_topics, :feature_id
add_index :forem_topics, :area_id
end
end
| 28 | 56 | 0.757937 |
f78d2c2bee5ffcba77dfccfa8bfcc6bcf87790eb | 3,132 | # Encoding: utf-8
#
# This is auto-generated code, changes will be overwritten.
#
# Copyright:: Copyright 2021, Google Inc. All Rights Reserved.
# License:: Licensed under the Apache License, Version 2.0.
#
# Code generated by AdsCommon library 1.0.3 on 2021-05-07 00:48:53.
require 'ads_common/savon_service'
require '... | 28.216216 | 77 | 0.726373 |
ab44b33bab9a2eb501841b58e11dbbacfc9d44d5 | 4,638 | # A byte buffer.
module BSON
class ByteBuffer
attr_reader :order, :max_size
INT32_PACK = 'l<'.freeze
INT64_PACK = 'q<'.freeze
DOUBLE_PACK = 'E'.freeze
def initialize(initial_data="", max_size=DEFAULT_MAX_BSON_SIZE)
@str = case initial_data
when String then
if initial_dat... | 20.522124 | 94 | 0.53191 |
21146edf9c8b0f02c740448e1a93c2c85b36e565 | 2,793 | class Pulseaudio < Formula
desc "Sound system for POSIX OSes"
homepage "https://wiki.freedesktop.org/www/Software/PulseAudio/"
url "https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-14.0.tar.xz"
sha256 "a834775d9382b055504e5ee7625dc50768daac29329531deb6597bf05e06c261"
# The regex here avoid... | 29.09375 | 108 | 0.649839 |
28f06fc899e7a8a1564699456f7b1e86c80acdb9 | 819 | class SessionsController < ApplicationController
def new
end
def create
@user = User.find_by(email: params[:session][:email].downcase)
if @user && @user.authenticate(params[:session][:password])
if @user.activated?
# log user and redirect to show page
log_in @user
params[:... | 26.419355 | 79 | 0.632479 |
0125cc11f1f7870ae7f463c6fb02dc7445350a1c | 3,742 | # encoding: utf-8
module RailsBestPractices
module Prepares
# Remember controllers and controller methods
class ControllerPrepare < Core::Check
include Core::Check::Classable
include Core::Check::InheritedResourcesable
include Core::Check::Accessable
interesting_nodes :class, :var_ref... | 38.183673 | 142 | 0.635222 |
ab2c262fea70755ceff41f251a995876439a5c54 | 1,408 | # frozen_string_literal: true
class PremiumController < ApplicationController
before_action :authenticate_user!, except: [:index]
def create
price_id = Stripe::Price.list(active: true, recurring: {interval: "month"}).first.id
session = Stripe::Checkout::Session.create(
success_url: "#{success_premiu... | 31.288889 | 88 | 0.723722 |
bbf7d8a1b4721149a2385b006d72ad41b74f536f | 118 | class AddUserIdToReview < ActiveRecord::Migration
def change
add_column :reviews, :user_id, :integer
end
end
| 19.666667 | 49 | 0.754237 |
ab9a36a3a566de39517c716ace1a36b29f20ccf6 | 1,637 | # This file is part of Metasm, the Ruby assembly manipulation suite
# Copyright (C) 2006-2009 Yoann GUILLOT
#
# Licence is LGPL, see LICENCE in the top-level directory
require 'metasm/main'
module Metasm
class ARM < CPU
class Reg
class << self
attr_accessor :s_to_i, :i_to_s
end
@i_to_s =... | 21.539474 | 110 | 0.571778 |
5d31c9310ccd3ce794761efc942c7063200b6cba | 413 | Nyauth.configure do |config|
# Ruby2.3以前では、文字長が多い場合、それ以降の文字を切り捨てて動作してくれていたが、
# Ruby2.4以降では、ArgumentErrorを返すようになったため、32文字指定にする
encryption_secret = ENV['NYAUTH_ENCRYPTION_SECRET'] || 'rails6dd08eff1c2cf5aecb54cb1a97266817b58cc27f06be9e95918c06607d3950d623a4fd4c0c306d2216cdaf3f99871e21e0e975a5e64ef5cf286b68ed8d7379a... | 51.625 | 192 | 0.859564 |
fff271e64eaea4c4af4182391d23c99ca7a17f7f | 847 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "declarative_authorization"
s.version = "1.0.0.pre"
s.required_ruby_version = ">= 2.0.0"
s.authors = ["Steffen Bartsch"]
s.summary = "declarative_authorization is a Rails plugin for maintainable authorization based on readable authorization ru... | 47.055556 | 249 | 0.672963 |
e21dbb2d161da6a9e444c58e4d7676f1b8979a0a | 3,337 | require "addressable/uri"
require "uri"
require_relative "../common/colorize"
require_relative "../common/data"
require_relative "../common/format"
require_relative "../common/query"
# href='*.Z'
# href="*.Z"
# href=*.Z
PAGE_WITH_ARCHIVES_REGEXP = Regexp.new(
"
href[[:space:]]*=[[:space:]]*
(?:
'
... | 22.70068 | 94 | 0.622415 |
bf7cc06d6f5732cf10648cfc6102c196c8d774af | 1,066 | {
matrix_id: '784',
name: 'nemeth20',
group: 'Nemeth',
description: 'Newton-Schultz iteration, Z_k+1=Z_k+(1/2)*(I-(Z_k)^2)*Z_k. This is Z_20',
author: 'K. Nemeth',
editor: 'T. Davis',
date: '1999',
kind: 'subsequent theoretical/quantum chemistry problem',
problem_2D_or_3D: '0',
n... | 29.611111 | 91 | 0.64728 |
08105cd979cbc2d3a428204867e9324c87fdd410 | 807 | ENV['RACK_ENV'] = 'test'
require("bundler/setup")
Bundler.require(:default, :test)
set(:root, Dir.pwd())
require('capybara/rspec')
Capybara.app = Sinatra::Application
set(:show_exceptions, false)
require('./app')
Dir[File.dirname(__FILE__) + '/../lib/*.rb'].each { |file| require file }
RSpec.configure do |config|
... | 17.933333 | 73 | 0.645601 |
d53b8630089e43249de4dae114ef7e5a6d542fc7 | 48 | module CoinbaseCommerce
VERSION = "0.8.6"
end
| 12 | 23 | 0.729167 |
b94191dc4dd7d9d632c8d4040e0af0129eb8d512 | 2,114 | class Review < ApplicationRecord
default_scope { order(created_at: :desc) }
belongs_to :reviewee, class_name: "User"
belongs_to :reviewer, class_name: "User"
belongs_to :post
attr_accessor :activation_token
before_create :create_activation_digest
validates :reviewer_id, presence: true
validates :review... | 27.454545 | 137 | 0.722327 |
9145b238628cfbfeb2afa92226c7dc7659e19e43 | 83 | # desc "Explaining what the task does"
# task :sober do
# # Task goes here
# end
| 16.6 | 38 | 0.662651 |
7aeec4dc0aa292ca52ddd631d5a54be1e2f2691d | 1,001 | #!/usr/bin/ruby
require 'livejournal/database'
require 'livejournal/entry'
require 'test/unit'
class TC_Database < Test::Unit::TestCase
FILENAME = '/tmp/test.db'
def setup
@db = LiveJournal::Database.new(FILENAME, true)
end
def teardown
@db.close
File.delete FILENAME
end
def test_metas
... | 18.2 | 51 | 0.643357 |
21d768f7c91a9a1eeb4d7aa75250762c2002c144 | 93 | require 'simplecov'
SimpleCov.start do
add_filter 'spec'
add_group 'Libraries', 'lib'
end | 18.6 | 30 | 0.752688 |
bb208394e78914c8002d7141e7d8301077ad2a38 | 992 | # frozen_string_literal: true
require_relative '../spec_helper'
def suites
JSON.parse(File.read(File.expand_path('../suite.json', __FILE__).strip))
end
module Aws
module S3
describe Client do
suites.each_with_index do |suite, i|
it "produces correct url pattern with configuration #{i}" do
... | 30.060606 | 74 | 0.631048 |
1a7999ea6693bfc2d7a5327106af65d788caddc5 | 1,898 |
require "capybara_helper"
describe "Stations", type: :system do
it "overview page" do
station = FactoryBot.create :station, name: "Marilu", strategy: :radiobox
FactoryBot.create :track, station: station, track_info: FactoryBot.create(:track_info)
visit "/"
click_on "Stations"
expect(page).to h... | 31.633333 | 99 | 0.630664 |
87fbc932d63c5088296485f366a16c23f90bd4af | 1,271 | require 'spec_helper'
describe Immutable::Hash do
describe '#none?' do
context 'when empty' do
it 'with a block returns true' do
H.empty.none? {}.should == true
end
it 'with no block returns true' do
H.empty.none?.should == true
end
end
context 'when not empty' d... | 25.938776 | 95 | 0.497246 |
e2749ab1bc11c6b6cc70eda0347f2c5fc2aba9bf | 5,668 | # frozen_string_literal: true
require 'securerandom'
require 'spec_helper'
RSpec.describe Integrations::Datadog do
let_it_be(:project) { create(:project) }
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
let_it_be(:build) { create(:ci_build, project: project) }
let(:active) { true }
let(:dd... | 30.473118 | 145 | 0.642202 |
bfabbbbafb14c4684bb46d3d2cc39375e23bee46 | 594 | class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
#ユーザ一人につき、ダイアリーもひとつ。
has_many :diaries, dependent: :... | 31.263158 | 71 | 0.747475 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.