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
e8d370188d8e64332251a6dbe30109337b307728
1,735
class ApplicationController < ActionController::API rescue_from(ActionController::UnpermittedParameters) do |pme| render json: { error: { unknown_parameters: pme.params } }, status: :bad_request end def cost_validations params.permit(:origin, :destination, :weight) errors = [] param...
59.827586
139
0.680692
5d386a52683d58c6e89f22c3129fd042fc7e3e34
2,255
module YARD::Cov # A base class for an ordered set class OrderedSet include Concord.new(:entries, :index), Enumerable # Returns the OrderedSet instance # # @param [Array] entries # optional entries # # @return [YARD::Cov::OrderedSet] # the ordered set instance # # @api p...
19.439655
60
0.552106
61d42f1c18208689f04f89bc5e12d091d81510fd
2,531
# frozen_string_literal: true require 'rails_helper' # rubocop: disable Metrics/BlockLength RSpec.describe '/item', type: :request do let(:user) { create :user } let(:item) { create :item, user: user } let(:valid_attributes) { attributes_for :item, user: user } let(:invalid_attributes) { attributes_for :inva...
30.130952
86
0.602924
38a882a65987000127d3dafdaae416c394decce2
2,645
# 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.cira.ca/status_available.expected # # and regenerate the tests with the following rake task # # $ rake spec:generate # require 'spec_helper' require 'whoi...
24.266055
253
0.671078
edd117bfc4c2d1e97dca40b16777d62a16ff8f40
492
class RubocopWrapper def initialize(working_directory) @working_directory = working_directory end def analyze_code Dir.chdir(@working_directory) do command = ['rubocop'] command.concat(['--format', 'json', '--out', json_file_path, '--force-exclusion']) passed = system(*command) O...
24.6
88
0.689024
6a469a316cfad26c37ddd14792f5842b2ca766ff
1,114
require 'rails_helper' feature "User edits his account" do given(:user) { create(:user) } before do sign_in user visit user_settings_path(user) end scenario "with invalid informations" do fill_in 'Username', with: '' click_on 'Update' expect(page).to have_content "Username can't be...
27.85
79
0.701077
3882f2f64072fc16a7c366e0e8e2eb308984ffc3
3,362
require "language/go" class Terraform < Formula desc "Tool to build, change, and version infrastructure" homepage "https://www.terraform.io/" url "https://github.com/hashicorp/terraform/archive/v0.9.11.tar.gz" sha256 "400fbf7c65a5f4b599d1b3d20db8ad9d45930a80ce3abf14aa7ed56eac22b3fb" head "https://github.com/...
31.420561
98
0.672219
b993ae9d95a7847382973c88cd94ffbf083db894
1,576
require 'test_helper' class UsersSignupTest < ActionDispatch::IntegrationTest def setup ActionMailer::Base.deliveries.clear end test "invalid signup information" do get signup_path assert_no_difference 'User.count' do post users_path, params: { user: { name: "", ...
32.833333
78
0.60533
01b63fdb824f70a4fa24fe5791789be00c603922
987
require 'current_api_client' module SweepTrashedCollections extend CurrentApiClient def self.sweep_now act_as_system_user do Collection.unscoped. where('delete_at is not null and delete_at < statement_timestamp()'). destroy_all Collection.unscoped. where('is_trashed = false...
25.973684
77
0.656535
ac8d74afc25ff750becab8aac6cd95d08a284821
628
require "rails_helper" RSpec.describe ForumsController, :type => :controller do describe "GET #index" do it "responds successfully with an HTTP 200 status code" do get :index expect(response).to be_success expect(response).to have_http_status(200) end it "renders the forums template" d...
25.12
77
0.667197
7abc5790a62ab88fe57c39e8368a6169adb63ba1
137
# frozen_string_literal: true # typed: strict class AbstractClassPackage < PackageSpec export AbstractClassPackage::AbstractClass end
19.571429
44
0.832117
189b983f30f4ac5391dc5ce15946d1e5a5241376
1,698
class ReferentialCloning < ApplicationModel include AASM belongs_to :source_referential, class_name: 'Referential' belongs_to :target_referential, class_name: 'Referential' after_commit :clone, on: :create def clone enqueue_job :clone_with_status! end def clone_with_status! run! clone! s...
23.260274
117
0.689046
33e6e6ec1d4966734283d0b3f6fd911042e13ed6
887
class Apktool < Formula desc "Tool for reverse engineering 3rd party, closed, binary Android apps" homepage "https://github.com/iBotPeaches/Apktool" url "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.3.2.jar", :using => :nounzip sha256 "648dba910d49365d78665f7060935802f4187d5529064e16caf34eee06c...
34.115385
109
0.738444
e91c5bb4d6b0e1df2b0c20e764a80a6eaa58bb81
483
module Giphy class Artist def self.build_batch_from(array) array.map { |artist| new(artist) } end def initialize(hash) @hash = hash end def username hash.fetch('username') end def avatar URI(hash.fetch('avatar')) end def website URI(hash.fetch('web...
13.416667
40
0.573499
381b16a042dcd23b3c3262c52b69a472da6005f6
529
module Pantograph module Actions class DebugAction < Action def self.run(params) puts("Lane Context".green) puts(Actions.lane_context) end def self.description 'Print out an overview of the lane context values' end def self.is_supported?(platform) tr...
16.030303
58
0.548204
b95f00967381c42a2dd34388661b3153a04beeba
1,479
require 'open-uri' module Deliver # Verifies, the user runs the latest version of this gem class UpdateChecker # This method will check if the latest version is installed and show a warning if that's not the case def self.verify_latest_version if self.update_available? v = fetch_latest ...
33.613636
105
0.580798
7ac2982c33361b54aa6069dda4c9f6f1075a173e
7,135
require 'test_helper' module Steem class ApiTest < Steem::Test METHOD_NAMES_1_ARG = %i(get_account_votes get_block get_block_header get_blog_authors get_comment_discussions_by_payout get_conversion_requests get_discussions_by_active get_discussions_by_blog get_discussions_by_cashout get_d...
37.356021
118
0.676524
624ddc991cd6a5eab9a1c56e3f0b931ef9a3e954
1,357
class Job::Service::Runner def initialize @lock = Mutex.new @condition = ConditionVariable.new @stop = false end def run name = Job::Service.config.name Job::Service.advertise(name) rescue_with(ensure_p: ->{ Job::Service.unadvertise(name) }) do service_loop end end def shu...
18.847222
93
0.622697
265a387653aa30bd0d303e008e21f4d09b369a70
18,583
=begin #OpenAPI Petstore #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.1.0-SNAPSHOT =en...
36.224172
164
0.660442
6129dff29fa2b16c893be03213ab19b3130cc574
141
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_lol_stats_session'
35.25
79
0.808511
3967a7d538441f329f30fa964f9e6897c3d05fc9
4,322
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::Ftp include Msf::Exploit::Remote::TcpServer include Msf::Exploit::EXE ...
27.883871
100
0.613142
38efe77829ef342770333f7ae3e222a3b5d971c7
1,904
class Character < ActiveRecord::Base mount_uploader :picture, PictureUploader belongs_to :player validates :name, presence: true #, uniqueness: true validates :picture, presence: true validates :player_id, presence: true before_save :calculate_parameters! BaseParameter = 10 ScaleFactor = 100 AgeN...
24.727273
67
0.659139
f715896df9e655889a067fb6ee826a76e50e6868
395
require "bundler/setup" require "ruby_tiger_graph_client" require "rspec" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patc...
24.6875
66
0.762025
6aa4f5fcc605a3afa9eeb582baed47f8365438d8
188
# frozen_string_literal: true component 'rubygem-rubocop' do |pkg, _settings, _platform| pkg.version '0.76.0' instance_eval File.read('build/vanagon/components/_base-rubygem.rb') end
26.857143
70
0.771277
26f20de3c736c82df4c025cdff1b3235bcc6913d
113
class RenamePeopleToUsers < ActiveRecord::Migration[5.1] def change rename_table :people, :users end end
18.833333
56
0.752212
e9ed0493c21766dd0f2a1b26afaa7da3bcefd6f8
10,222
# frozen_string_literal: true require 'spec_helper' RSpec.describe EventCreateService do let(:service) { described_class.new } let_it_be(:user, reload: true) { create :user } let_it_be(:project) { create(:project) } describe 'Issues' do describe '#open_issue' do let(:issue) { create(:issue) } ...
30.975758
115
0.651438
bf22801e532b7cbb47346a97b11a200e37d248ed
117
module LittleBird class ParameterError < Exception include LittleBirdErrors attr_reader :response end end
19.5
34
0.786325
f72d21a6240d542c465b5d711fc85cce46855a2e
71
# frozen_string_literal: true module Assemblr VERSION = '0.2.0' end
11.833333
29
0.732394
6abe945de1ec99b012728412fd38d48f6f1b941e
1,115
# frozen_string_literal: true # # == OptionalModules namespace # module OptionalModules # # == AnalyticableConcern # module Analyticable extend ActiveSupport::Concern included do analytical modules: [:google], disable_if: proc { |controller| !controller.should...
23.723404
190
0.652018
91b88e9e615e7e79a21e6677628059e8515e9ae5
5,350
# frozen_string_literal: true # A Ruby implementation of Joshua Bloch's # [typesafe enum pattern](http://www.oracle.com/technetwork/java/page1-139488.html#replaceenums) module TypesafeEnum # Base class for typesafe enum classes. class Base include Comparable class << self include Enumerable #...
29.722222
126
0.629533
2820caa0b85c60e75258e36c22c75c9273f89cbc
2,379
# # Author:: Adam Jacob (<adam@chef.io>) # Copyright:: Copyright (c) 2008-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 a copy of the License at # # ...
33.041667
111
0.698193
e8bbd2b8542aa01f73ee7e1a43f1c977bc93c6f6
4,396
module ISO3166; end class ISO3166::Country Codes = YAML.load_file(File.join(File.dirname(__FILE__), '..', 'data', 'countries.yaml')) Translations = YAML.load_file(File.join(File.dirname(__FILE__), '..', 'cache', 'translations.yaml')) Data = {} Codes.each do |alpha2| Data[alpha2] = YAML.load_file(File.join(...
23.015707
140
0.641037
ff0dbd27123306f6af08bf4dc10229323ef693ed
6,346
=begin #SendinBlue API #SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/or...
32.377551
839
0.616451
b9c8d48a55de0fa9392da583e35ba1ba741c0431
148
module Stevenson class Error < StandardError def initialize(message, cause = nil) super(message) @cause = cause end end end
16.444444
40
0.655405
6a4a1d51bee96f25be33966fe82e794cbf2ec1f2
718
module Blog module TagsHelper #Number of sizes defined in the css NUMBER_OF_LABEL_SIZES = 5 def tag_url(tag) "#{blog_root_path}/tags/#{URI.encode(tag.name.mb_chars.to_s.downcase)}" end def label_for_tag(tag, min, max) "label-size-#{size_for_tag(tag, min, max)}" end def size...
23.933333
117
0.655989
1c0034755b09f2fc3c8bdbd7923380e20af4407a
11,412
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2014 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject, which is a fork of ...
31.438017
119
0.525499
61633636ddd19ec071ea0301f8b9788ff0a6f47b
67
json.partial! 'topics/nesting', collection: @collection, as: :topic
67
67
0.761194
b98b550f47a694ff5227228a3ffcdf4e3feb6816
1,109
class IosWebkitDebugProxy < Formula desc "DevTools proxy for iOS devices" homepage "https://github.com/google/ios-webkit-debug-proxy" url "https://github.com/google/ios-webkit-debug-proxy/archive/v1.8.5.tar.gz" sha256 "5d3f71609b908910249a1bcdcb20c5e94f0cbea6418dc9f1d36ec2f41bed80a7" head "https://github.com/...
33.606061
93
0.750225
5d5d7f5d74efa911b13d2c0b7a686f40a335f7ae
194
require File.dirname(__FILE__) + '/../test_helper' class ServiceLearningPositionTest < ActiveSupport::TestCase # Replace this with your real tests. def test_truth assert true end end
21.555556
59
0.757732
e8803b9285a110a0cb7e5a6cdec85faf2fa47c3f
9,128
# frozen_string_literal: true RSpec.describe RuboCop::Cop::Style::RaiseArgs, :config do context 'when enforced style is compact' do let(:cop_config) { { 'EnforcedStyle' => 'compact' } } context 'with a raise with 2 args' do it 'reports an offense' do expect_offense(<<~RUBY) raise Run...
28
105
0.537686
28079c2f4465877e02a2a7376e82d1123fa861e1
1,972
# Airbrake is an online tool that provides robust exception tracking in your Rails # applications. In doing so, it allows you to easily review errors, tie an error # to an individual piece of code, and trace the cause back to recent # changes. Airbrake enables for easy categorization, searching, and prioritization # of...
48.097561
82
0.770791
1c27d9353ebfb2506587c78d9a881bf704e21ab9
466
class AddOverrideAccessToUsers < ActiveRecord::Migration def up add_column :users, :override_access, :boolean say_with_time "Migrating Marli Exception Status." do User.class_eval { serialize :user_attributes } User.all.each do |user| user.update_attribute :override_access, user.user_attri...
29.125
120
0.736052
260b97067a33a9501e0d075b60294c740e3f946b
607
describe 'transformer_bson', proxy: :Transformer do moneta_build do Moneta.build do use :Transformer, key: :bson, value: :bson adapter :Memory end end moneta_loader do |value| if ::BSON::VERSION >= '4.0.0' ::BSON::Document.from_bson(::BSON::ByteBuffer.new(value))['v'] else ...
25.291667
80
0.69687
f8da7f04fddc6bc9ad04c61fb8d657609a54065c
83
Rails.application.config.session_store :active_record_store, key: "_my_app_session"
83
83
0.86747
4a078b782ae9f4564f0107c9c2faa887c1771b34
968
#!/usr/local/bin/ruby if $0 == __FILE__ Dir.chdir File.dirname(__FILE__)+'/../' $:.unshift File.expand_path('../lib/') end require 'rio' require 'tc/testcase' class TC_sub < Test::RIO::TestCase @@once = false def self.once @@once = true rio('a').rmtree.mkpath rio('b').rmtree.mkpath make_lines_f...
20.595745
41
0.553719
26ffee466bb82857772c437d4349d83d96eb8574
1,606
# -*- encoding: utf-8 -*- # stub: jekyll-avatar 0.7.0 ruby lib Gem::Specification.new do |s| s.name = "jekyll-avatar".freeze s.version = "0.7.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Ben B...
40.15
112
0.660648
61fddea9180c684927a480c041b23ecd605cf177
5,904
require "spec_helper" RSpec.describe Celluloid::IO::UNIXSocket, library: :IO do if RUBY_PLATFORM == "java" before(:each) do pending "jRuby support" fail "Avoid potential deadlock under jRuby" end end let(:payload) { "ohai" } let(:example_port) { assign_port } let(:logger) { Specs::FakeLo...
28.941176
101
0.631944
38aad206a3944f4a81b6b2ced653d18af0dea4cd
700
require 'minitest_helper' describe "#create_network" do let(:connection) do VCR.use_cassette('open_connection') do VCR.use_cassette('get_all_hosts') do Fog::Compute.new(:provider => 'XenServer', :xenserver_url => '192.168.10.2', :xenserver_username ...
26.923077
60
0.605714
e8b3adf7be26edabaec43f7e6013abc316a29161
94
##% f: () -> Proc<^(Fixnum,Fixnum),Fixnum> def f(); Proc.new {|x,y| x+y} end f.call(2,3)+4
13.428571
42
0.521277
61d5f000ed457fd829bb81c125a40dbe8bcdcab7
343
cask "pomotroid" do version "0.13.0" sha256 "fab1a8598490db267639609b42312a8947ee2de075164935d0eba60c57790788" url "https://github.com/Splode/pomotroid/releases/download/v#{version}/pomotroid-#{version}-macos.dmg" name "Pomotroid" desc "Timer application" homepage "https://github.com/Splode/pomotroid" a...
28.583333
104
0.769679
399ec8d4a64ef47d7dde9b9f2887ffc25fba7706
755
platform "el-4-x86_64" do |plat| plat.servicedir "/etc/rc.d/init.d" plat.defaultdir "/etc/sysconfig" plat.servicetype "sysv" plat.tar "/opt/pl-build-tools/bin/tar" plat.provision_with "echo '[build-tools]\nname=build-tools\ngpgcheck=0\nbaseurl=http://enterprise.delivery.puppetlabs.net/build-tools/el/4/$basea...
68.636364
478
0.764238
9137e0b52002c4508b6505f90688ee9f35347c4b
10,187
require File.expand_path('test_helper', File.dirname(__FILE__)) require 'bigdecimal' require 'test/app_test_methods' class RubotoGenTest < Test::Unit::TestCase include AppTestMethods def setup generate_app end def teardown cleanup_app end def test_gitignore_is_included_in_new_project Dir.chd...
36.252669
163
0.669284
91efa0080e8bd162d791bd7cec9a938f4c1fcd97
3,621
require 'logger' module Support module DummyExample class Dummy < Dynflow::Action def run; end end class SkippableDummy < Dummy def rescue_strategy_for_self Dynflow::Action::Rescue::Skip end end class MySerializer < Dynflow::Serializers::Noop def serialize(arg) ...
22.773585
85
0.545153
61e55ce6a46dd7df8fec50b3acf8ed22f30e9030
8,193
module RegistrationControllerHelper def org_member_step(registration) return { org_member: (registration.data || {})['is_org_member'] } end def org_member_review_data(registration) return { type: :bool, value: org_member_step(registration)[:org_member] } end def org_member_...
29.577617
199
0.646894
ace4c2cfa414b7dcb6077503db6d845f11e35d14
2,442
module CouchRest module Model module CoreExtensions module TimeParsing # Attemtps to parse a time string in ISO8601 format. # If no match is found, the standard time parse will be used. # # Times, unless provided with a time zone, are assumed to be in # UTC. ...
31.714286
135
0.564701
18ba79a8f96e3cf3769be2df010a6202a41d108e
14,417
# encoding: utf-8 require 'active_support/inflections' module ActiveSupport # The Inflector transforms words from singular to plural, class names to table # names, modularized class names to ones without, and class names to foreign # keys. The default inflections for pluralization, singularization, and # unco...
37.544271
119
0.591801
391652c069c5f5e4088501ee863018a3c25ab71e
397
class AddAssignedToToAttendances < ActiveRecord::Migration def up add_column :attendances, :assigned_to, :integer add_column :attendances, :user_id, :integer add_column :attendances, :access, :string, :default => "Public" end def down remove_column :attendances, :assigned_to remove_column :...
26.466667
67
0.72796
1d15bd1da1d7178e82cf425e0d914e3983bdb138
141
class ProjectPosition < ApplicationRecord acts_as_list scope: [:project_id] validates_presence_of :project_id, :story_id, :position end
23.5
57
0.808511
7a9e2cbb05447e253e2dca606b4fafbe2d16c014
419
# ---------------------------------------------------------------------------- # Frozen-string-literal: true # Copyright: 2012 - 2016 - MIT License # Encoding: utf-8 # ---------------------------------------------------------------------------- Jekyll::Assets::Hook.register :env, :init do asset_config["sources"] ||=...
29.928571
78
0.436754
6a30c572f3ea5d8b4bf7519f720876e4eae6632e
706
json.set! :@context, 'http://www.shared-canvas.org/ns/context.json' json.set! :@id, services_manifests_url(@identifier) json.set! :@type, 'sc:AnnotationsList' json.resources @data do |datum| json.set! :@id, blank_identifier(@identifier, datum[:index], 'anontation') json.set! :@type, 'oa:Annotation' json.motivati...
39.222222
138
0.695467
874be3bc7a2724fed587aea8e0fa8b383d17e731
7,367
# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
39.607527
108
0.546491
28afcb9853fdc2abb6956f50a447014cdefb4e85
2,226
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Mysql::Mgmt::V2017_12_01 module Models # # Represents a Database. # class Database < ProxyResource include MsRestAzure # @return...
26.5
70
0.448787
bf023fae0bbf1d12b40254e18a4241e5e819295d
111
class AddUrlToItems < ActiveRecord::Migration[5.1] def change add_column :items, :url, :string end end
18.5
50
0.720721
1dc0e7be4fdf2a12c7897b8a01daaf6cc1434e21
474
# frozen_string_literal: true $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'grape' require 'benchmark/ips' api = Class.new(Grape::API) do prefix :api version 'v1', using: :path params do requires :param, type: Array[String] end get '/' do 'hello' end end env = Rack::...
18.96
69
0.679325
5d79e9d37353e64294193c59c69f2a1b5985ffc4
135
class GroupMessage < ActiveRecord::Base belongs_to :user has_and_belongs_to_many :groups validates :message, presence: true end
19.285714
39
0.792593
1c0c92d21e3da854c1e646877e3495878a14aaf6
2,452
class SignupPolicy < ApplicationPolicy delegate :run, to: :record delegate :event, to: :run delegate :convention, to: :event def read? return true if oauth_scoped_disjunction do |d| d.add(:read_signups) { user && record.user_con_profile&.user_id == user.id } d.add(:read_events) { signed_up_for_...
26.652174
95
0.64478
b9ece61174c0bafbaf6ec9724aa36b6b4b552de0
22,141
=begin #BillForward REST API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file e...
47.924242
188
0.698975
bb5431367b542e4f7abf9fd7ff2cd9b87aef3fff
2,476
module ActiveMerchant #:nodoc: class ActiveMerchantError < StandardError #:nodoc: end module Shipping #:nodoc: class Error < ActiveMerchant::ActiveMerchantError end class ResponseError < Error attr_reader :response def initialize(response = nil) if response.i...
30.195122
109
0.547658
5dae1f2be44784300a2ecae1f9c9efc1ab4f583a
3,688
# This file is copied to spec/ when you run 'rails generate rspec:install' ENV['RAILS_ENV'] ||= 'test' require 'spec_helper' require File.expand_path('../../config/environment', __FILE__) require 'rspec/rails' # Add additional requires below this line. Rails is not loaded until this point! # Requires supporting ruby f...
30.479339
101
0.734544
bfb9ce24a899d7e6406015ba9b7f66bd675133f0
1,507
require 'spec_helper' describe TagsController do render_views describe "GET 'index'" do before(:each) do Tag.create!(:name => "Ruby") Tag.create!(:name => "Rails") Tag.create!(:name => "Other") end it "should be successful" do get 'index', :format => 'json' response.shou...
27.4
58
0.575315
620eac0110602c4e22bb56ed955fd212b6130718
800
# frozen_string_literal: true require "test_helper" class ActionText::MailerRenderTest < ActionMailer::TestCase test "uses default_url_options" do original_default_url_options = ActionMailer::Base.default_url_options ActionMailer::Base.default_url_options = { host: "hoost" } blob = create_file_blob(fil...
33.333333
85
0.745
f86f3ea579f3d2b87037fb12f1f97f8d3d399154
2,709
require 'test_helper' class SubscriptionsControllerTest < ActionController::TestCase include Devise::Test::ControllerHelpers test 'should list subscriptions for the logged-in user' do sign_in users(:regular_user) get :index assert_select '.subscription', count: 3 end test "should not list othe...
27.363636
128
0.72093
79886aad1494fedf436897643bafb3982039af47
1,290
module DeviseBasecamper module Confirmable extend ActiveSupport::Concern module ClassMethods ## Override for password resets ------------------- def send_confirmation_instructions(attributes={}) if confirm_with_login? subdomain_resource = find_resource_by_su...
40.3125
131
0.666667
1ad4b07a30e01d30b38fcb35191c05d1e719c7e1
3,074
module Aws::RailsProvisioner class Vpc SUBNETS_DEFAULTS = { application: { cidr_mask: 24, type: 'private' }, ingress: { cidr_mask: 24, type: 'public' }, database: { cidr_mask: 28, type: 'isolated' } } # Configuration va...
27.446429
135
0.590436
38bbe2e0edeaee09e0cef88d78ae86c0d6ca15d2
5,413
require 'fog/compute' require 'fog/cloudsigma/connection' module Fog module Compute class CloudSigma < Fog::Service requires :cloudsigma_password, :cloudsigma_username recognizes :cloudsigma_password, :cloudsigma_username, :cloudsigma_host model_path 'fog/cloudsigma/models' request_path...
24.382883
87
0.605025
ab61886d9c0439cfc61de1f41128c19bbe8f0494
1,799
# frozen_string_literal: true class ApplicationController < ActionController::API include Pundit rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized private def user_not_authorized render json: { message: 'You are not authorized to do that' }, status: :unauthorized end def pundit_use...
25.338028
93
0.694275
7a6a6becee0ec83685c481c297764bc4bf91420b
702
Pod::Spec.new do |s| s.name = "SlideMenuControllerSwift_fix" s.version = "4.0.2" s.summary = "iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app." s.homepage = "https://github.com/dekatotoro/SlideMenuControllerSwift" s.license = { :type => "MIT", :file => "LICENSE" } ...
43.875
108
0.623932
39b52ce6eebb860e3fd6315f7ef00a402e2e6367
540
class Story::AfterVerdictNoticeContext < BaseContext def initialize(verdict) @verdict = verdict end def perform run_callbacks :perform do @verdict.story.story_subscriptions.each do |story_subscription| subscriber = story_subscription.subscriber mailer_constantize(subscriber).delay....
22.5
93
0.742593
bfcbed9d1fa68c9f5a80faa0dfe5423245dd34e2
413
class CreateReviews < ActiveRecord::Migration def change create_table :reviews do |t| t.integer :rating t.text :content t.integer :user_id t.integer :condition_id t.integer :organization_id t.timestamps end add_index :reviews, :user_id add_index :reviews, :con...
21.736842
45
0.673123
f83a62069c2760f2b80e2aeb3fb72bb76e18ea89
5,292
# # Be sure to run `pod spec lint BLAPIManagers.podspec' to ensure this is a # valid spec and to remove all comments including this before submitting the spec. # # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html # To see working Podspecs in the CocoaPods repo see https://gith...
37.006993
114
0.60393
1835212256306813a6de31ba4d15053e0d2eda24
1,922
# 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::Storage::Mgmt::V2018_11_01 module Models # # Identity for the resource. # class Identity include MsRestAzure #...
26.328767
77
0.494797
38468f1b0b87e8c94c285e282cfbdd7c9b3cdd72
2,485
require 'nokogiri' require 'json' require 'uri' def write_sublet_json(sublets) File.open('data/sublet.json', 'w') do |f| f.write JSON.pretty_generate(Hash[sublets.sort]) log 'Saved data/sublet.json' end end def write_banks_json(banks) File.open('data/banks.json', 'w') do |f| f.write JSON.pretty_gene...
28.895349
133
0.675654
335e5a490a6a3848b49b0480b2e0f76d1a009c86
975
# frozen_string_literal: true require 'spec_helper' RSpec.describe Gitlab::Metrics::RackMiddleware do let(:app) { double(:app) } let(:middleware) { described_class.new(app) } let(:env) { { 'REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/foo' } } describe '#call' do it 'tracks a transaction' do expe...
26.351351
79
0.687179
5d83f353754e49237ad07057463decb9d497eb37
152
require "openapi/enumerable_object" module Openapi class PathsObject < EnumerableObject def element_class PathItemObject end end end
15.2
38
0.756579
6a3d766e24988bc3bc4c7d42b830416c228113a3
264
module Ray class Music def initialize(filename = nil) open(filename) if filename end def pretty_print(q) super q, ["time", "duration", "looping?"] end alias time= seek alias position pos alias position= pos= end end
15.529412
47
0.617424
1c4f506943f49137ad15f2ca25e306dc27f736ac
5,262
class ManageIQ::Providers::Vmware::CloudManager < ManageIQ::Providers::CloudManager require_nested :AvailabilityZone require_nested :OrchestrationServiceOptionConverter require_nested :OrchestrationStack require_nested :OrchestrationTemplate require_nested :EventCatcher require_nested :EventParser require...
27.40625
104
0.574496
08dac5c5a51dbc84f44447d015ef5a6fee376ab9
2,479
# encoding: UTF-8 require_relative 'spec_helper' describe 'openstack-telemetry::identity_registration' do describe 'ubuntu' do let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } let(:chef_run) { runner.converge(described_recipe) } include_context 'telemetry-stubs' ...
28.170455
67
0.598628
1ad74a3d47993df57d77f6b16b6352d89cd1b3d9
3,757
# frozen_string_literal: true RSpec.describe Saml::Kit::Bindings::UrlBuilder do describe '#build' do let(:xml) { '<xml></xml>' } let(:destination) { FFaker::Internet.http_url } let(:relay_state) { FFaker::Movie.title } [ [Saml::Kit::AuthenticationRequest, 'SAMLRequest'], [Saml::Kit::Logo...
44.2
144
0.65185
012be52ecdd29aacf126c319155e2161cc4befb5
827
cask 'master-pdf-editor' do version '5.3.16' sha256 '8b36bff13d5a8ef8fafe16962de2c1c271e656a47693ff3de7f13e0f846a33c9' url 'https://code-industry.net/public/MasterPDFEditor.dmg' appcast 'https://code-industry.net/get-masterpdfeditor/' name 'Master PDF Editor' homepage 'https://code-industry.net/masterpdfed...
39.380952
166
0.721886
0374f4cd35cc837cdbf6fe0750921db9d404f53f
8,303
#=============================================================================== # Legacy animation player compatibility #=============================================================================== class PBAnimationPlayerX #----------------------------------------------------------------------------- # determ...
41.515
136
0.576177
79466b3af272f114b74548e887c5011d20eba44e
1,209
class UsersController < ApplicationController get '/signup' do if !is_logged_in? erb :'/users/sign_up' else redirect '/recipes' end end post '/signup' do if params[:user][:username] == "" || params[:user][:email] == "" || params[:user][:password] == "" redirect '/signup' els...
16.791667
102
0.578991
4ab134d946fb85c8fed85e6cf2057fe6afb8039f
763
# -*- encoding: utf-8 -*- require File.expand_path('../lib/dtk-common-core/version', __FILE__) Gem::Specification.new do |gem| gem.authors = ["Rich PELAVIN"] gem.email = ["rich@reactor8.com"] gem.description = %q{DTK Common Core is a shared library used by several DTK components.} gem.summary ...
38.15
93
0.634338
61b166a37e868f29955b03a417846e8ee9a9474b
18,067
#!/usr/bin/env oo-ruby #-- # Copyright 2013 Red Hat, 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 applicabl...
35.564961
126
0.673825
b96a3c11854ce8d56ce049ce6cba50aeec1503d8
475
cask :v1 => 'servetome' do version '3.9.0.3053' sha256 '87bf1184b7656a96088b25880e7e1c772f30d8dfa1e602f9b43ccbdd0608fdf2' url "http://downloads.zqueue.com/ServeToMe-v#{version}.dmg" appcast 'http://zqueue.com/servetome/stm3_mac_appcast.xml', :sha256 => '48cc93d336da8f71ab2a804d609e54d2e81ce4cd17f626e...
36.538462
87
0.762105
7ac2f121b31a78f19130f8106b082f78d52f6d1f
203
require "document_metadata_decorator" class EsiFund < DocumentMetadataDecorator set_extra_field_names [ :fund_state, :fund_type, :location, :funding_source, :closing_date, ] end
16.916667
41
0.729064
ab8c5c59d86807bf08bac4f4f23ac9b97e5ce58a
1,317
require "httparty" module ZeusSdk::V1 class Assets SUBDOMAIN = "assets" LOCAL_PORT = 3004 include HTTParty include ServiceBase def list_images(query) resp = self.class.get("/api/v1/images", query: query, headers: self.get_headers).parsed_response re...
30.627907
120
0.588459
87b9ac29808e9d29b5ef64c8a11a857b3f618768
198
module Core class AccessField < ActiveRecord::Base belongs_to :access belongs_to :quota_kind def to_s "#{quota_kind.name}: #{quota} #{quota_kind.measurement}" end end end
18
62
0.676768
5d0e2b03f5e960174a71132560147ca28a8e59dc
1,369
# frozen_string_literal: true require 'dry-monads' require 'net/http' require_relative 'metadata_validator' module ImageDownloader class DownloadJob attr_accessor :url, :destination_path include Dry::Monads[:result] def initialize(url, destination_path) @url = URI.parse(url) @destination_p...
21.730159
108
0.600438
6ab436b540c3ccfdb881454a3de72c10e3050eb9
54
require 'spree_core' require 'spree_pre_order/engine'
18
32
0.833333
d5e3be2c3b44d2dfd052e219af7eb3179f3bd4ee
861
module OpenActive module Models # This type is derived from http://www.w3.org/2004/02/skos/core#ConceptScheme. class ConceptScheme < ::OpenActive::JsonLdModel # @!attribute type # @return [String] def type "ConceptScheme" end # @return [String] define_property :tit...
22.657895
82
0.554007