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
91e3af98277e40f5a3836590387f17ed73024747
823
require 'test_helper' class MicropostsControllerTest < ActionDispatch::IntegrationTest def setup @micropost = microposts(:orange) end test "should redirect create when not logged in" do assert_no_difference 'Micropost.count' do post microposts_path, params: { micropost: { content: "Lorem ipsum" }...
24.939394
77
0.735115
e9187f029a1184be99bf8f0f849d752b0b5f2816
1,679
# frozen_string_literal: true lib = ::File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'proxy_pac_rb/version' Gem::Specification.new do |spec| spec.name = 'proxy_pac_rb' spec.version = ProxyPacRb::VERSION spec.authors = ['Dennis Günnewig'] spec...
50.878788
455
0.711138
1800c0eaa466d9bddc8d6ec3eba29e6ebf572d95
414
require 'spec_helper' describe OboParser::Utilities::Viz do let(:o) { parse_obo_file( File.read(File.expand_path(File.join(File.dirname(__FILE__), '../../files/hao.obo')) ) ) } specify '#mock_coordinate_space' do capture_stderr do expect(OboParser::...
29.571429
113
0.620773
1c796c829c401ace2fb4bf2840f83441da9b93df
4,194
module ActiveAdmin module Views module Pages class Base < Arbre::HTML::Document def build(*args) super add_classes_to_body build_active_admin_head build_page end private def add_classes_to_body @body.add_class(params[:actio...
28.337838
145
0.593467
39847de572592ec398ceb30571ab9c283f371559
1,210
# frozen_string_literal: true require 'spec_helper' RSpec.describe Mutations::Admin::Analytics::DevopsAdoption::Segments::Create do include GraphqlHelpers let_it_be(:admin) { create(:admin) } let_it_be(:group) { create(:group, name: 'bbbb') } let(:variables) { { namespace_id: group.to_gid.to_s } } let(:mu...
25.208333
117
0.682645
edb4e223d9aacb9ad3dbe2cce5094ca42553cded
1,267
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'sepa_king/version' Gem::Specification.new do |s| s.name = 'sepa_king' s.version = SEPA::VERSION s.authors = ['Georg Leciejewski', 'Georg Ledermann'] s.email =...
36.2
85
0.681926
1db82bfa5a4b3065a214c60b49cbacb493336aef
181
Spree::Admin::ProductsController.class_eval do include SpreeSku::SkuGeneratorHelper def new @product = Spree::Product.new @product.master.sku = generate_sku end end
18.1
46
0.745856
6aabea47b763fb5726a9a5f148274d2c8db9f3fe
4,627
# # Copyright 2011-2013, Dell # Copyright 2013-2014, SUSE LINUX Products GmbH # # 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 requi...
36.148438
151
0.685325
876ef6d930c633c7088f96e01f270ccb21c9bdbe
144
require 'mxx_ru/cpp' MxxRu::Cpp::exe_target { required_prj "so_5/prj.rb" target "_unit.test.coop.user_resource" cpp_source "main.cpp" }
12
39
0.722222
08478748e593d324abde17019adfbc7bb5733952
3,454
require_relative '../../spec_helper' require_relative 'fixtures/classes' require_relative 'shared/enumeratorized' describe "Enumerable#each_slice" do before :each do @enum = EnumerableSpecs::Numerous.new(7,6,5,4,3,2,1) @sliced = [[7,6,5],[4,3,2],[1]] end it "passes element groups to the block" do ac...
33.211538
87
0.625651
1d3fe5baf41a160fecd6de2fcf3328bad929b058
1,008
require_relative 'boot' 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 ThankYou class Application < Rails::Application # Initialize configuration defaults for originally generated Rails ...
31.5
82
0.74504
b936633c57c7ee3390aa635b78f2d74a2397261c
326
# frozen_string_literal: true Kaminari.configure do |config| # config.default_per_page = 25 # config.max_per_page = nil # config.window = 4 # config.outer_window = 0 # config.left = 0 # config.right = 0 # config.page_method_name = :page # config.param_name = :page # config.params_on_first_page = fals...
23.285714
39
0.705521
1de7d32d813fe80de3242fdb8513bd801cd5bb72
1,598
=begin #Xero Payroll UK #This is the Xero Payroll API for orgs in the UK region. The version of the OpenAPI document: 2.6.0 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 =end require 'time' require 'date' module XeroRuby::PayrollUk class StatutoryDeductionCat...
31.96
124
0.737171
1c8330b83cc8bbe85c185968996ebfbcce60527f
1,048
require 'test_helper' class UsersEditTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) end test "unsuccessful edit" do log_in_as(@user) get edit_user_path(@user) assert_template 'users/edit' patch user_path(@user), params: { user: { name: "", email: "foo@inv...
27.578947
66
0.663168
f8f5d0e7781852b833ecf61719034be7787eca5e
763
# frozen_string_literal: true RSpec.shared_context 'token' do let(:value) { 'token' } let(:scope) { 'https://example.com/.default' } let(:expire) { Time.now + 10 } let(:token) { MSIDP::AccessToken.new(value, expire, scope) } let(:attributes) { { value: value, scope: scope, expire: expire } } end RSpec.share...
29.346154
71
0.711664
4a097a79e8e2331a7856cdcc190c8718aaa14bf8
1,520
require 'spec_helper' describe '#geopos' do let(:key) { 'cities' } context 'with existing key' do let(:san_francisco) { [-122.5076404, 37.757815, 'SF'] } let(:los_angeles) { [-118.6919259, 34.0207305, 'LA'] } before { @redises.geoadd(key, *san_francisco, *los_angeles) } after { @redises.zrem(key...
27.142857
65
0.601316
91f4926b84227db7e50bde3dfc4fc91c9a0f26c4
29,617
require_relative '../../_test_helpers/CommonTestHelpers' def configure_contracts_for_tests run %(cleos system newaccount --stake-cpu "10.0000 EOS" --stake-net "10.0000 EOS" --transfer --buy-ram-kbytes 1024 eosio testuser1 #{CONTRACT_PUBLIC_KEY} #{CONTRACT_PUBLIC_KEY}) run %(cleos system newaccount --stake-cpu "10...
50.369048
562
0.666239
2650e40ee680164d90ca33c3b783d06fddd4c512
73,380
# MdTranslator - minitest of # writers / fgdc / class_spatialReference # History: # Stan Smith 2018-01-03 original script require_relative 'fgdc_test_parent' require_relative '../../helpers/mdJson_hash_objects' require_relative '../../helpers/mdJson_hash_functions' class TestWriterFgdcMapProjection < TestWriterFGDC...
53.67959
221
0.766966
ac00fe4c9e3c0b8e34d1954336e672dfa5c998a1
1,443
class Eigen < Formula desc "C++ template library for linear algebra" homepage "http://eigen.tuxfamily.org/" url "https://bitbucket.org/eigen/eigen/get/3.2.5.tar.bz2" sha256 "5f6e6cb88188e34185f43cb819d7dab9b48ef493774ff834e568f4805d3dc2f9" bottle do cellar :any sha256 "6f3d26b12625d87f96a92c0c14745c4...
28.86
95
0.643798
ac7dc14e833cf8989579a9d096909608640e1f57
820
actions :create, :create_if_missing attribute :source, :kind_of => String, :name_attribute => true attribute :path, :kind_of => String attribute :access_key_id, :kind_of => String attribute :secret_access_key, :kind_of => String attribute :checksum, :kind_of => String, :default => nil attribute :owner, :regex => Chef:...
45.555556
78
0.492683
11234982dd49dba20a3d26537c13ee99429098be
105,985
# frozen_string_literal: true require 'spec_helper' describe MergeRequest do include RepoHelpers include ProjectForksHelper include ReactiveCachingHelpers using RSpec::Parameterized::TableSyntax subject { create(:merge_request) } describe 'associations' do it { is_expected.to belong_to(:target_proj...
32.490803
145
0.667113
286aa2478d71e99ba39ecf8c68fb0bb54ede11ff
22,191
# frozen_string_literal: true # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/...
34.035276
175
0.585643
398e1d2462e76451a4245192e49f3b85727bf229
2,767
class Courses::CourseDetailController < ApplicationController def index puts "ec- In CourseDetailController -index" puts ("#{params[:course_id]}") @coursedetail = CourseDetail.where(course_id: params[:course_id]) respond_to do |format| format.html {render :index} # format.json {rend...
25.154545
116
0.666064
3310a118cfd9447b5ed952ac7c2df3968fdc4f7e
275
# frozen_string_literal: true class BlogEntry < ApplicationRecord self.table_name = :blog_entries belongs_to :blog has_many :images, dependent: :restrict_with_error validates :blog_id, :title, :text, presence: true validates :blog, presence: { if: :blog_id } end
25
51
0.756364
1c1f4efe3d5dfd32f4084e4c40b51e41d326fa8e
1,360
module Ark class UnzipCommandBuilder def unpack if resource.strip_components > 0 unzip_with_strip_components else "unzip -q -o #{resource.release_file} -d #{resource.path}" end end def dump "unzip -j -q -o \"#{resource.release_file}\" -d \"#{resource.path}\"" ...
26.666667
100
0.580147
2136b588b00f0ba40bf81e427116a24dedec48c0
4,713
module Fastlane module Actions class GetInfoPlistPathAction < Action require 'xcodeproj' require 'pathname' def self.run(params) unless params[:xcodeproj] if Helper.test? params[:xcodeproj] = "/tmp/fastlane/tests/fastlane/bundle.xcodeproj" else ...
39.275
210
0.565457
1ac6f9361da97e707d9213833890335ea42434d3
534
class SelectionHandler attr_accessor :next_selection_handler, :previous_selection_handler def handle_input input = gets.downcase if input.is_a? Integer #all methods for selecting search parameters will return integers; #it is up to the methods themselves to discern whether or not the #inp...
29.666667
72
0.719101
084f56a2b8709a9680b2ceba00baf9a90907f413
764
def staircase(n) to_return = {} 1.upto n do |crnt_size| next if crnt_size.even? all = Array.new(crnt_size) { |i| i + 1 } evens = all.select { |i| i.even? } to_return[crnt_size] = evens end to_return end #================================ #paul fitz & meads def staircase(n) answer = Hash.new ...
17.767442
58
0.566754
7a454d292d0e27a32dd090565cad1f3c2da5b92e
61
require "sc4ry/version" require "sc4ry/dependencies"
5.545455
28
0.704918
e86c3b591cc496682625192e9e841a257c6e4940
1,747
# # The MIT License (MIT) # # Copyright (c) 2014 Wynand Pieterse # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, co...
35.653061
80
0.752147
5d846fa29a449b3ccbea3cfb7b75397b346ef824
1,622
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'tensor_stream/version' Gem::Specification.new do |spec| spec.name = "tensor_stream" spec.version = TensorStream::VERSION spec.authors = ["Joseph Emmanuel Dayo"] spec....
38.619048
96
0.692972
798becc54cf9efd3c47faad7ce034d0925794b20
155
require 'spec_helper' module Credere describe Asset do it_behaves_like 'a Credere::Account subtype', kind: :asset, normal_balance: :debit end end
19.375
86
0.754839
7a5d4dc6dddb56c21bb7c323429d88d268fbb140
5,215
=begin #EVE Swagger Interface #An OpenAPI for EVE Online OpenAPI spec version: 1.2.9 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'date' module EVEOpenAPI # Unprocessable entity class GetWarsWarIdKillmailsUnprocessableEntity # Unprocessable ...
28.037634
107
0.61745
bfa5cf75d6d8c814cf84d15751124a8f5a49e9bb
1,151
# frozen_string_literal: true require 'English' class ImageOptim # Helper for running commands module Cmd class << self # Run using `system` # Return success status # Will raise SignalException if process was interrupted def run(*args) success = system(*args) check_sta...
22.134615
80
0.595135
611cf8d5fe9f1fdba1cd135bff2fdbe03e54296f
2,290
require_relative '../../version1_0' require_relative '../../function' require_relative '../../signature' require_relative '../../semantics' module BELParser module Language module Version1_0 module Functions # Reaction: Denotes the frequency or abundance of events in # a reaction cl...
26.321839
102
0.500437
f85c364e4f6bd8f4ee19247bf7296112a6a90b5e
199
Rails.application.routes.draw do # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Defines the root path route ("/") # root "application#hello" end
28.428571
93
0.743719
fff48e4f589b68fb0dbb026f99c9ec63454b0746
427
cask 'unity-download-assistant@5.5.3f1' do version '5.5.3f1,4d2f809fd6f3' sha256 'a1f48d94839096bd2e1f2c12d5d7eaa4173852d35ce8e1e29e1d5b30decedbba' url "http://download.unity3d.com/download_unity/#{version.after_comma}/UnityDownloadAssistant-#{version.before_comma}.dmg" name 'Unity' homepage 'https://unity3d...
32.846154
124
0.782201
0194ddbf2fcb0f1203ec305698f11265144c6c0d
655
require_relative 'helper' class User < Sohm::Model include Sohm::AutoId end test "returns an empty hash if model doesn't have set attributes" do assert_equal Hash.new, User.new.to_hash end test "returns a hash with its id if model is persisted" do user = User.create assert_equal Hash[id: user.id], user.to_h...
19.848485
68
0.732824
d52c3f2fab955ec9e18874f99dbefceb1fc17d93
564
require "rails_helper" describe SiteStatusPolicy do let(:organisation) { site_status.course.provider.organisations.first } let(:site_status) { create :site_status } subject { described_class } permissions :update? do let(:user) { create(:user).tap { |u| organisation.users << u } } context "with an u...
24.521739
72
0.680851
1dcd3ac78d25a0da6c2a3a2cdb9888351714bac1
423
module Org module Model::JobDescription extend ActiveSupport::Concern included do attribute :requirements, :text attribute :advanced_requirements, :text attribute :english_requirement, :string attribute :degree_requirement, :string attribute :duties, :text attribute :salar...
22.263158
45
0.699764
9192aa2d9b793d367175600a60ee796e50e0f542
133
class PgTableAccess < AdminFullAccess def show?(table) PgDataSourceAccess.new(context).can? :show, table.data_source end end
22.166667
65
0.766917
2698b963a318ea71a8261a195eb13217ed180566
576
require 'rails_helper' RSpec.describe PessoaPolicy do let(:user) { User.new } subject { described_class } permissions ".scope" do pending "add some examples to (or delete) #{__FILE__}" end permissions :show? do pending "add some examples to (or delete) #{__FILE__}" end permissions :create? d...
19.862069
58
0.682292
aba7d20b48389639d9ae00bad03fb7f1a36f69bd
749
# frozen_string_literal: true class CreateGrades < ActiveRecord::Migration def change create_table :grades do |t| t.string :grade t.integer :parent_id, index: true t.timestamps null: false end create_table :document_grades do |t| t.references :document, index: true, foreign_key: ...
27.740741
60
0.687583
1d26144f2148df0c229c870a58664104dd5bc154
894
#------------------------------------------------------------------------------- # # Thomas Thomassen # thomas[at]thomthom[dot]net # #------------------------------------------------------------------------------- module TT::Plugins::SolidInspector2 module Binary module Types # Standard Types...
21.804878
81
0.439597
3379adad443caa6669f22313e6a7db36729834af
5,073
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' require 'net/ssh' class Metasploit3 < Msf::Auxiliary include Msf::Auxiliary::Scanner include Msf::Auxiliary::Report include Msf::Auxiliary::CommandShell ...
25.621212
85
0.597871
03d2e87bdac317c80898258d60e553cbb2471068
1,149
module RubyCAS module Server module Core module Tickets class TicketGrantingTicket < Storage attr_accessor :id, :ticket, :client_hostname, :username, :extra_attributes, :service_tickets, :proxy_tickets, :created_at, :updated_at def...
29.461538
76
0.54134
7a9fdd45e8214df90e7686c9aaec674fa07a9963
5,888
# encoding: utf-8 require "cases/helper" require 'active_record/base' require 'active_record/connection_adapters/postgresql_adapter' require 'support/schema_dumping_helper' module PostgresqlJSONSharedTestCases include SchemaDumpingHelper class JsonDataType < ActiveRecord::Base self.table_name = 'json_data_ty...
29.148515
129
0.676461
91182d7ffb3a9ae2f8ba85a5ba32547c86dc6b94
475
require 'bundler/setup' require 'minitest' require 'minitest/autorun' require 'minitest/reporters' require 'minitest/spec' require 'dragonfly' require 'dragonfly_pdf' SAMPLES_DIR = Pathname.new(File.expand_path('../../samples', __FILE__)) Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new def test_app(...
22.619048
71
0.749474
e95251f4ae37bffb900fc3cd8ead5c90cebf4489
126
require 'test_helper' class BoardMessageTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
15.75
48
0.714286
79440bbc490d4423a3996616c694af6c44d52f8d
438
class News include Mongoid::Document field :version, type: String field :message, type: String validates :version, presence: true, format: { with: /\A\d{1,3}\.\d{1,3}\.\d{1,3}\z/ } validates :message, presence: true, length: { minimum: 3, maximum: 300 } def ==(obj) return false if obj.nil? return ...
29.2
87
0.646119
bb27766712cdcf277986c8aa4addae530164e97c
4,478
class Post < ApplicationRecord include WithActivity include ContentProcessable include ContentEmbeddable WordfilterCallbacks.hook(self, :post, :content) acts_as_paranoid resourcify processable :content, LongPipeline update_algolia 'AlgoliaPostsIndex' embed_links_in :content, to: :embed enum locked...
32.215827
97
0.722421
d569cdc3c38c2105d56007eae67c2c8dd03ef850
951
# frozen_string_literal: true require_relative '../core/lib/spree/core/version.rb' Gem::Specification.new do |gem| gem.author = 'Solidus Team' gem.email = 'contact@solidus.io' gem.homepage = 'http://solidus.io/' gem.license = 'BSD-3-Clause' gem.summary = 'REST API for the So...
32.793103
75
0.656151
4aa0f87cbde0b45b5cb5d8ff8867fae0baa72613
416
# frozen_string_literal: true FactoryBot.define do factory :assignment do title do Faker::Marketing.buzzwords + Faker::Number.between(from: 1, to: 9999).to_s end deadline { Faker::Time.forward(days: 30) } accepted_file_type { '.pdf' } trait :with_lecture do association :lectu...
21.894737
54
0.677885
5dcc95be63fa0192675c8fa2cd88c7856def4e59
2,198
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/datacatalog/v1/table_spec.proto require 'google/api/field_behavior_pb' require 'google/api/resource_pb' require 'google/protobuf' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/datacatalog/v1/table_spe...
43.098039
154
0.743858
38f3eadbb223a5579b704959470af68054a5e4ae
95,485
# frozen_string_literal: true require 'spec_helper' RSpec.describe Group do include ReloadHelpers let!(:group) { create(:group) } describe 'associations' do it { is_expected.to have_many :projects } it { is_expected.to have_many(:group_members).dependent(:destroy) } it { is_expected.to have_many(:...
34.458679
186
0.669288
ab7a06c69d4b0576117c86d299dc851d97fabe2f
1,341
$:.push File.expand_path('../lib', __FILE__) require 'ripple/version' Gem::Specification.new do |gem| # Meta gem.name = "ripple" gem.version = Ripple::VERSION gem.summary = %Q{ripple is an object-mapper library for Riak, the distributed database by Basho.} gem.description = %Q{ripple is an object-mapper libr...
44.7
197
0.654735
eda34a0af15bac09c1f239c44e0ed3825bde2348
349
require "rails_helper" RSpec.describe "Site layout", type: :system do describe "footer" do it "is present" do visit searches_show_path expect(page).to have_selector('footer') end end describe "header" do it "is present" do visit searches_show_path expect(page).to have_selecto...
20.529412
46
0.673352
08d661c67d5e28619f004fac4c95f977503e0258
768
module Fixy module Formatter module Alphanumeric # # Alphanumeric Formatter # # Only contains printable characters and is # left-justified and filled with spaces. # def format_alphanumeric(input, byte_width) input_string = String.new(input.to_s).tr "#{self.class...
23.272727
100
0.5625
d5eda3afafc3364e88786241399f2a38e122eaa9
1,325
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core/handler/reverse_https' require 'msf/base/sessions/meterpreter_options' require 'msf/base/sessions/mettle_config' require 'msf/base/sessions/meterpreter_aarch64_lin...
28.191489
95
0.632453
edf2e0ea19b741f918438eb8d1eaf781be3e4ed7
268
class Genotype < ApplicationRecord belongs_to :strain belongs_to :gene belongs_to :modification accepts_nested_attributes_for :gene#,:reject_if => proc { |a| a['title'].blank? } accepts_nested_attributes_for :modification validates_presence_of :gene end
24.363636
83
0.779851
e9cc786c566f3ba3ef8111b9087dc81fdcc9be61
1,093
class Pstoedit < Formula desc "Convert PostScript and PDF files to editable vector graphics" homepage "http://www.pstoedit.net/" url "https://downloads.sourceforge.net/project/pstoedit/pstoedit/3.71/pstoedit-3.71.tar.gz" sha256 "0589cd22cd9c23dee12d9bc9f26760f872185d8a1fb72a05bc58f6b824cfbc95" bottle do ...
36.433333
93
0.740165
abe48bf23b68a3591dcbb613abbe7d1e241deb6c
1,207
# frozen_string_literal: true # ## Schema Information # # Table name: `killmail_fittings` # # ### Columns # # Name | Type | Attributes # ------------------ | ------------------ | --------------------------- # **`items`** | `jsonb` | # **`similarity`** | `decimal(, )` ...
30.175
113
0.551781
b90f92c976ccdc79002a83c3c1f8a838576f508b
572
require 'securerandom' module Capistrano module Postgresql module PasswordHelpers def generate_random_password SecureRandom.hex(10) end # This method is invoked only if :pg_password is not already set in config/#{:stage}/deploy.rb. Directly setting :pg_password has precedence. d...
23.833333
147
0.687063
1a9497feb9f218e668ff7808d5629a7f3810bb4f
2,553
#-- encoding: UTF-8 #-- copyright # OpenProject is an open source project management software. # Copyright (C) 2012-2020 the OpenProject GmbH # # 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 ChiliProje...
31.134146
91
0.608696
7941d936f5dd8a2b29b383d6fc6ab09c760b2b1e
2,084
#!/usr/bin/ruby ### ### $Release: 2.6.6 $ ### copyright(c) 2006-2010 kuwata-lab.com all rights reserved. ### require 'rubygems' unless defined?(Gem) spec = Gem::Specification.new do |s| ## package information s.name = "erubis" s.author = "makoto kuwata" s.email = "kwa(at)kuwata-lab.com" s...
30.202899
92
0.636276
91fa0f2afa0364f110104085418e3d75f5801909
3,748
require_relative 'test_helper' class IrcBotTest < Minitest::Test def setup @socket = mock('socket') @irc_message = MockMessage.new @irc_message.stubs(type: :PRIVMSG, method_symbol: "on_privmsg_messages") @plugin = MockPlugin.new @plugin_responses = ['RESPONSE1', 'RESPONSE2'] end def test_i...
25.324324
84
0.739861
ff26cff5b34466e2cfa1cabb9524e7e30223a53e
46,260
# frozen_string_literal: true # DO NOT EDIT, ALTER, OR DELETE THIS FILE # This file is copied from core puppet and frozen # It is used in spec tests to ensure compatibility # between this module and the old built-in type. # Frozen from: https://github.com/puppetlabs/puppet/blob/5.5.3/lib/puppet/util/windows/taskschedu...
36.48265
126
0.620147
382efd6b10db211a2461166e7f9eb8c62d801591
621
require 'rails_helper' RSpec.describe CollectionObjectObservation, type: :model, group: :collection_objects do let(:collection_object_observation) { CollectionObjectObservation.new } context 'validation' do before {collection_object_observation.valid?} specify 'data is required' do expect(col...
27
87
0.747182
1d8573b89c4e3377e2a00e0d79d60cf6f9345eb8
336
Refinery::Application.routes.draw do scope(:path => 'refinery', :as => 'admin', :module => 'admin') do match 'dashboard', :to => 'dashboard#index', :as => :dashboard match 'disable_upgrade_message', :to => 'dashboard#disable_upgrade_message', :as => :disable_upgrade_me...
28
67
0.60119
e833564e2ebc69a39caa16c4fa4c61614d330802
1,453
# frozen_string_literal: true # WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'aws-sdk-core' require 'aws-sigv4' require_relative 'aws-sdk-mediali...
26.418182
91
0.752237
3304ed19d7263c189a83617b76bc2a0dc35abf23
5,897
# frozen_string_literal: true require 'shopify_cli' module ShopifyCli ## # ShopifyCli::Project captures the current project that the user is working on. # This class can be used to fetch and save project environment as well as the # project config `.shopify-cli.yml`. # class Project include SmartProper...
28.906863
107
0.583008
39e376ab634210e50280b3abadfaf6f4802a5be4
87
class RfeedfinderSlice::Application < Merb::Controller controller_for_slice end
17.4
54
0.793103
4a012cf0ae48163207313ff50a3f502c669e3263
5,087
#============================================================================== # ** Window_MenuStatus #------------------------------------------------------------------------------ # This window displays party member status on the menu screen. #========================================================================...
40.373016
79
0.344211
08f09ce1fdabe8f3af8d0619637be242c2124572
444
ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' require 'rails/test_help' #require 'minitest/reporters' #Minitest::Reporters.use! class ActiveSupport::TestCase # Run tests in parallel with specified workers parallelize(workers: :number_of_processors) # Setup all fixtures in test/fixtures/*....
27.75
82
0.754505
91812e937991159aae24ea315a0d264795e0ed7e
1,160
require_relative 'spec_helper' describe Passenger do after(:each) do Passenger.destroy_all end describe 'attributes' do it 'has data attributes from a migration file' do joshua = Passenger.create(name: 'Josh RS', phone_num: '347 000 1111') expect(joshua.name).to eq('Josh RS') expect(j...
30.526316
75
0.660345
e89d336196556ea95c3c9c38e4e1448f4284baa1
12,989
#!/usr/bin/env ruby # -*- coding: utf-8 -*- require 'test/unit' require File.join(File.dirname(__FILE__), 'setup_variant') require 'stringio' unless Array.method_defined?(:permutation) begin require 'enumerator' require 'permutation' class Array def permutation Permutation.for(self).to_enu...
33.219949
98
0.571099
877ffe936be4a41b2490753b1d8f38779231f8e4
1,427
# frozen_string_literal: true # WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'aws-sdk-core' require 'aws-sigv4' require_relative 'aws-sdk-iotwire...
26.425926
84
0.752628
33f0c983b8ac43b5833789759cc358b27b31ad79
697
require 'rails_helper' module DealRedemptions RSpec.describe Admin::SettingsController, :type => :controller do routes { DealRedemptions::Engine::routes } let(:valid_session) { { admin_user_id: 1 } } describe 'GET #index' do before(:each) do @user = FactoryGirl.create(:user) get :...
24.034483
67
0.642755
26607284cc95f6863ebef02f7ba7ccb2361cfd4a
1,421
=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 'spec_helper' require 'json' require 'date' # Unit tests for Tatum::TronTxInternalTransactions...
26.811321
102
0.736805
21a3290419cf05252a4494fd6569fea16f2d375e
2,540
require "helper" require "inspec/resource" require "inspec/resources/os" # require 'inspec/plugin/v1/plugin_types/resource' describe Inspec::Plugins::Resource do let(:base) { Inspec::Plugins::Resource } describe "#name" do it "won't register a nil resource" do Class.new(base) { name nil; } _(Inspe...
26.185567
64
0.626378
e9d30bee915a9b7154e1e260fe1952907c6294f0
985
# # Be sure to run `pod spec lint StashAnalytics.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 https://guides.cocoapods.org/syntax/podspec.html # To see working Podspecs in the CocoaPods repo see https:/...
36.481481
99
0.692386
2146e50cd20d008e36cc5b3b79f57d0bca0e3803
92
desc "Open a pry session preloaded with this library" task :console do sh "pry --gem" end
18.4
53
0.728261
28e232a4a6e003fc9265f388a178999e8bec2b91
3,784
#-- # Copyright (c) 2016 SolarWinds, LLC. # All rights reserved. #++ module AppOpticsAPM module SDK module CustomMetrics # Send counts # # Use this method to report the number of times an action occurs. The metric counts reported are summed and flushed every 60 seconds. # # === Ar...
39.831579
196
0.607822
7a1c82b1e2765ee3fbf761b62997f565942009d2
1,011
class Cocoapods < Formula desc "Dependency manager for Cocoa projects" homepage "https://cocoapods.org/" url "https://github.com/CocoaPods/CocoaPods/archive/1.6.0.tar.gz" sha256 "7980fc1675d16c978324614f6ff6d2f98153e6805174c566cfa84cec9c336ba9" bottle do cellar :any_skip_relocation sha256 "17db9489e0...
34.862069
93
0.748764
6aecb88080231a335975bbd8dc78bf5374d21883
1,011
module Archer module Routes class Route delegate :match?, to: :matcher attr_reader :controller, :action def initialize param, options @type = options[:type] @controller_path, @action = options[:to].split '#' @action = @action.to_sym @param = param end ...
20.632653
84
0.558853
e8bc0d4f2c9b40e100c0c02fc0a8e1ab83541bd3
880
require 'spec_helper_acceptance' # Ensure SELinux is not disabled in bootloader configuration - Section 1.6.1.1 describe file('/etc/default/grub') do it { should be_file } it { should be_owned_by 'root' } it { should be_grouped_into 'root' } it { should be_mode 644 } its(:content) { should match /G...
33.846154
78
0.701136
267f1ec7b521a9f1d643b800ae0ee9ae7b126574
242
class CreateRepresentatives < ActiveRecord::Migration[5.1] def change create_table :representatives do |t| t.string :name t.string :party t.string :office t.integer :money t.string :cid end end end
17.285714
58
0.644628
793672b1d58e8e03f574aeabb38e0c96fd58415e
1,462
# coding: utf-8 class NotesController < ApplicationController load_and_authorize_resource before_filter :init_base_breadcrumb def init_base_breadcrumb drop_breadcrumb(t("menu.notes"), notes_path) end def index @notes = current_user.notes.recent_updated.paginate(:page => params[:page], :per_page =>...
21.5
96
0.656635
28254cf0f9d2046c7738dc655e5940777f1f90a0
118
class ApplicationController < ActionController::Base def hello render text: "hello, world!" end end
19.666667
52
0.677966
010dd1ef3847f2d47645483ad8b1c43eee760649
692
module Hyperstack module Component module FreeRender def self.included(base) base.instance_eval do alias :hyperstack_component_original_meth_missing method_missing def method_missing(name, *args, &block) if const_defined?(name) && (klass = const_get(nam...
31.454545
82
0.583815
03d83495a02f30d6a9fcc40c8b09d566e5696313
1,301
# Copyright [2020] [University of Aizu] # # 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 i...
28.911111
79
0.618755
032a2ad6b727a4656eec5b195b1692936cf9abb7
3,718
# Copyright 2016 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 applicable law or agreed to in writing, ...
35.409524
79
0.615654
21fdbf96430ec82c3bc44d24621d8cb08a05b514
186
class Favourite < ActiveRecord::Base # This is Sinatra! Remember to create a migration! belongs_to :user belongs_to :product validates :user_id, uniqueness: {scope: :product_id} end
26.571429
53
0.774194
bf14887e7146eee2fb24c7ca5fc43e6ab3a158dd
785
require_relative '../automated_init' context "Publish" do context "Expected Version" do publish = Publish.new entity = Controls::Entity.example version = Controls::Version.example publish.store.add(entity.id, entity, version) recorded_event = Controls::Messages::Recorded.example publish.c...
22.428571
77
0.698089
b92944ebfdcfa6a15ccc98edf041dfad3777d1e6
447
class Micropost < ApplicationRecord belongs_to :user default_scope -> {order(created_at: :desc)} mount_uploader :picture, PictureUploader validates :user_id, presence: true validates :content, presence: true, length: { maximum: 140 } validate :picture_size private #アップロードされた画像のサイズをバリデーションする def ...
24.833333
62
0.713647
619a92e78e4ad7239c8fd7d844e0c53e8d765894
2,376
require "spec_helper" RSpec.describe Blurb::Snapshot do include_context "shared setup" describe "#create" do context "given a keywords recordType" do it "returns a keywords snapshot" do payload_response = Blurb::Snapshot.create({ "recordType" => Blurb::Snapshot::KEYWORDS, "st...
28.97561
71
0.633838
284e4fa9adcb3579453bfa5e512217b7c85deb29
213
class RemovePhotoFieldsFromBeer < ActiveRecord::Migration def change remove_column :beers, :photo_file_name remove_column :beers, :photo_content_type remove_column :beers, :photo_file_size end end
26.625
57
0.788732
391cb48576df2d4018fa5deacf55b158feb609fd
2,547
require_relative '../../../spec_helper' require_relative '../../../factories/users_helper' describe Carto::Kuviz::VisualizationsController do include Warden::Test::Helpers after(:all) do FileUtils.rmtree(Carto::Conf.new.public_uploads_path + '/kuviz_assets') end describe '#show' do before(:each) do ...
30.686747
103
0.65214
e9eef1ed17d5b31ad2266d4fbbc477fbfcc009a2
1,299
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'liquid-validator/version' Gem::Specification.new do |spec| spec.name = "liquid-validator" spec.version = LiquidValidator::VERSION spec.authors = ["Jeremy W. Rowe"] sp...
39.363636
137
0.683603
26c3e59dee1988ceaeaccc748bb5e25a738857db
200
class GroupSerializer < ActiveModel::Serializer attributes( :id, :name, :organization_id, :group_type, :archived, :test, :dummy, :created_at, :updated_at ) end
14.285714
47
0.61