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
618da79b9559ee9c7c9b826d084d7fd647e38599
124
require 'test_helper' class UsersBadgeTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
15.5
46
0.709677
7a4b541aadfc7ae3a2846074e5f80db27da425a9
2,560
# frozen_string_literal: true class RemovePaperclipColumns < ActiveRecord::Migration[6.1] def change remove_paperclip_metadata remove_other_obsolete_columns end def remove_other_obsolete_columns # This is now saved in the DB instead of being set dynamically. remove_column :operations, :attachmen...
52.244898
149
0.793359
611eb056042df9f844d853a51579a1b54ef678e0
136
# frozen_string_literal: true module Types class BaseField < GraphQL::Schema::Field argument_class Types::BaseArgument end end
17
42
0.772059
d5d1fabc84bdf6cb83a3a99a2cf627acca45c8c9
33,500
# Comprehensively test a formula or pull request. # # Usage: brew test-bot [options...] <pull-request|formula> # # Options: # --keep-logs: Write and keep log files under ./brewbot/ # --cleanup: Clean the Homebrew directory. Very dangerous. Use with care. # --clean-cache: Remove all cached downloads. Use wit...
33.037475
131
0.608239
62db692378e9a49871ad6ffd622d2e7501f126bc
80
# frozen_string_literal: true require_relative "has_navigation/has_navigation"
20
48
0.8625
bf1878e3a17be2b7c1a7d07951dfcf8c13c69932
1,305
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'rails_script/version' Gem::Specification.new do |spec| spec.name = 'rails_script' spec.version = RailsScript::VERSION spec.authors = ['Kevin Pheasey'] spec.email ...
50.192308
360
0.702682
398707671cf2bc17e46e844c90bd10db115751b7
233
require 'mqtt' require 'mqtt_pipe/version' require 'mqtt_pipe/types' require 'mqtt_pipe/packer' require 'mqtt_pipe/listener' require 'mqtt_pipe/pipe' module MQTTPipe extend self def create &block Pipe.new &block end end
14.5625
28
0.759657
abb5e160af635912675f4f3f6aecc792a6a84f06
1,024
# frozen_string_literal: true require "spec_helper" require "yaml" RSpec.describe H3m::Map do YAML.load_file("spec/resources/resources.yml").each do |map_spec| map_file = map_spec["file"] map_path = "spec/resources/#{map_spec["file"]}" map = H3m::Map.new(map_path) it "should parse game_version for ...
27.675676
78
0.683594
38b3d3fb44660abe3b01af6f4ac510df4df52d4c
184
arr = [1, 2, 3, 4, 5, 6, 7] puts 'Исходный массив:', arr.to_s reversed = [] arr.each do |i| reversed.unshift i end puts 'Новый массив, полученный из исходного:', reversed.to_s
15.333333
60
0.652174
e25e24b5cd286a7862bd79c2ba411df3b6f9ff42
4,838
module Rubybear module Mixins module ActsAsPoster # Creates a post operation. # # bears = Rubybear::Chain.new(chain: :bears, account_name: 'your account name', wif: 'your wif') # options = { # title: 'This is my fancy post title.', # body: 'This is my fancy ...
38.704
132
0.59198
18c6cfb1f5415d84814b8af40ec07b7fc5feecc3
6,543
=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-ap...
21.523026
177
0.554333
ac8433599114b4d9f656a4f576c11fa7d8aebe56
834
require "spec_helper" describe ChildBenefitRates, type: :model do let(:year) { 2014 } let(:first_child_rate) { 42.42 } let(:additional_child_rate) { 13.17 } let(:calculator) { ChildBenefitRates.new(year) } let(:rates) { { year => [first_child_rate, additional_child_rate] } } before do allow(calculator...
26.0625
75
0.71223
ff81396ecd65c70884c05b51ddcd1afcd3571d1c
1,734
# frozen_string_literal: true module Kenna module Toolkit class UploadFile < Kenna::Toolkit::BaseTask def self.metadata { id: "upload_file", name: "Upload File", description: "This task uploads a file to a specified connector", options: [ { name: ...
28.9
77
0.526528
ff324b01dab82ad43e20f51c891e281ed830b55e
7,438
require 'active_record' require 'active_record/base' require File.expand_path(File.join(File.dirname(__FILE__), "rails_integration_proxy")) require File.expand_path(File.join(File.dirname(__FILE__), "html_document_handler.rb")) class Relevance::Tarantula::Crawler extend Forwardable include Relevance::Tarantula ...
28.067925
112
0.630949
f741a1b7d108eb827db769efe403c66e38f7fa02
78
json.extract! @post, :id, :title, :body, :published, :created_at, :updated_at
39
77
0.705128
abccb58f561ac69619ddef297bf3f681f995e1aa
96
property :extra_options, Hash, description: 'Used for setting any HAProxy directives'
32
64
0.729167
ed9477ae67d4755e5f9bd181fdc66a55b7cdeb16
1,253
require 'xmlrpc/client' require 'gandi/zlib_parser_decorator' require 'gandi/version' require 'gandi/price' require 'gandi/contact' require 'gandi/domain' require 'gandi/operation' module Gandi class Error < StandardError; end class DataError < Error; end class ServerError < Error; end class Validatio...
23.641509
97
0.651237
bb4eda67345d15901e120e052a9145c38e93c4f6
1,960
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Monitor::Mgmt::V2018_06_01_preview module Models # # Guest diagnostic setting resource for patch operations # class GuestDiagnosticSettingsAss...
29.69697
77
0.538776
26ebbaae13af12df7c9896aa4bb91b3614adf53e
84
module Subscribem class ApplicationController < ::ApplicationController end end
16.8
55
0.821429
ac71f96a74e1549a41e2554f979ed4f2224b4b9e
74
# frozen_string_literal: true module BucketStore VERSION = "0.5.0" end
12.333333
29
0.743243
1d521e9a998b88fad745d15d90db2fddee07f524
811
# frozen_string_literal: true require 'uploads' # An image uploaded by a staff member class Image < ApplicationRecord has_one_attached :file validates :title, presence: true validate :attached_file_is_image before_create :create_unique_identifier def to_param unique_id end def file_variant(width:...
22.527778
79
0.738594
1c46efa8b0414dbf566b04ce64782ff5bdbf3fd5
236
class Coordinate attr_reader :x, :y def initialize(x, y) @x = x @y = y end def distance_from(other) # TODO: actually calculate distance between the coordinates. # e.g. (@x - other.x).abs 0 end end
14.75
64
0.59322
0317a6bd466f8aa1772bae840642d309a1ec5ff6
1,526
module RubyCollections class LinkedList attr_accessor :size, :top #TODO: implement iterator #TODO: implement to_a def initialize @size = 0 @top = nil end def empty? size.zero? end def header @top ? @top.to_s : nil end def add(dat...
19.316456
58
0.521625
ff9417e952292db06689e4d876e2f83955c9b1c4
2,353
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 s...
28.349398
78
0.650659
38b19e23fea54e7495675e9b77c770b11b7151c3
190
# Load the Rails application. require_relative "application" # Initialize the Rails application. Rails.application.initialize! require 'carrierwave' require 'carrierwave/orm/activerecord'
21.111111
38
0.821053
015ee875c20ad1a72fac4378d84168b5c3a34129
2,065
module MongrelRecipes module RackStack module Helpers def pidfile(port) "/var/run/mongrel/rails/mongrel.#{port}.pid" end def restart_app(command) instance = instances(:app_master) old_pid = instance.ssh("cat #{pidfile(5000)}").stdout instance.ssh!("/engineyard/...
22.692308
73
0.615012
39a66637837db5bda0c0980d140672c456b9b466
1,097
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
40.62963
86
0.762078
387a50a5fe920311702b296186638d7b1ee0c1b5
1,634
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suit...
40.85
85
0.77295
bbf636eb4b6d57dd47a042028ae9989d741765d1
170
class AddActionTargetTypeToEntourageModerations < ActiveRecord::Migration[4.2] def change add_column :entourage_moderations, :action_target_type, :string end end
28.333333
78
0.817647
62df44d1d7e97b00ff5602e52b409a7079dfef2d
1,722
class CaseAssignment < ApplicationRecord has_paper_trail belongs_to :casa_case belongs_to :volunteer, class_name: "User", inverse_of: "case_assignments" validates :casa_case_id, uniqueness: {scope: :volunteer_id} # only 1 row allowed per case-volunteer pair validates :volunteer, presence: true validate :a...
31.888889
126
0.723577
033850583806a4f3ca20b9d1e5a85bdb62a04a30
4,946
=begin This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services. Copyright © 2011 Dan Wanek <dan.wanek@gmail.com> 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 ...
43.769912
119
0.680146
f75cb322fe9fad07c18b8c18c18377296a31c4d3
1,773
# frozen_string_literal: true require 'spec_helper' RSpec.describe Ci::PrepareBuildService do describe '#execute' do let(:build) { create(:ci_build, :preparing) } subject { described_class.new(build).execute } before do allow(build).to receive(:prerequisites).and_return(prerequisites) end ...
25.695652
114
0.648054
b93e61e84c525bb3c114483c44d4f864b1496042
1,362
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...
33.219512
79
0.764317
ff7b095d7377ab4c5cdd638bc086d725e5abcf68
61
module Devise module AuthN VERSION = "0.1.7" end end
10.166667
21
0.639344
f74549ecc9fa023a59af5a6597625d9b8faccdd9
150
require_relative '../../../spec_helper' class CorePlacePage < CoreAuthorityPage include Logging include Page include CollectionSpacePages end
16.666667
39
0.78
035e95297df4c8727202ee4007f99787499c9d16
557
Pod::Spec.new do |s| s.name = 'GSPlayer' s.version = '0.2.16' s.summary = '⏯ Video player, support for caching, fullscreen transition and custom control view. 视频播放器,支持边下边播、全屏转场和自定义控制层' s.homepage = 'https://github.com/wxxsw/GSPlayer' s.license = 'MIT' s.author = { 'Gesen'...
34.8125
129
0.601436
2141e816687e33ceabb694433fc83cb324d85033
585
# 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. # When updating Pageflow, update this as well. It will force a refresh for i18n-js. Rails.application.config.assets.version = '37' # Add additional assets to the asset load path # R...
45
93
0.777778
285157a0157c07e1de43b6be2f8878d63adf7923
1,498
# frozen_string_literal: true require "rails_helper" describe SoftwareType do describe "fields" do subject { described_class } it { is_expected.to have_field(:id).of_type(!types.ID) } it { is_expected.to have_field(:type).of_type("String!") } end describe "software as formatted citation", elastics...
29.96
328
0.598131
218b6dc019cf8a4b46eda8de9f7ae515e3801f80
171
class CreatePosts < ActiveRecord::Migration[5.2] def change create_table :posts do |t| t.string :name t.text :body t.timestamps end end end
15.545455
48
0.631579
e263d970275ef376d6b9a7c53d223cb5963ab23f
327
# frozen_string_literal: true FactoryBot.define do sequence(:email) { |i| "pfinderuser_#{i}@pfinder.local" } factory :user do name { Faker::Name.first_name } scoutname { Faker::Lorem.word } scoutgroup { Faker::Lorem.word } canton { :zh } birthdate { Faker::Date.birthday(18, 50) } email e...
21.8
59
0.654434
1c0749e57d317086b777766ecf7638e805e05fd1
105
class DashboardController < ApplicationController def section_id :dashboard end private end
10.5
49
0.761905
3357abe3dc48f84cad6c74edd94f80b9c3807b77
6,787
# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::Glacier class Account extend Aws::Deprecations # @overload def initialize(id, options = ...
28.516807
102
0.603359
262287182032937516b9dec7a88b160d54f5e9ae
1,604
Pod::Spec.new do |s| s.name = "RxSwift" s.version = "4.4.1" s.summary = "RxSwift is a Swift implementation of Reactive Extensions" s.description = <<-DESC This is a Swift port of [ReactiveX.io](https://github.com/ReactiveX) Like the original [Rx](https://github.com/Reactive-e...
40.1
177
0.643392
f7e5b6e48642554a5029ed48ec1e9ea34e4b4105
6,525
# # Modules: Rails # Adds settings and tasks for managing Rails projects. # # require 'mina/rails' require 'mina/bundler' # ## Settings # Any and all of these settings can be overriden in your `deploy.rb`. # ### rails_env # Sets the Rails environment for `rake` and `rails` commands. # # Note that changing this w...
26.52439
136
0.627893
18e257bcfa66e035fbddab98e917ada73316f9cf
11,283
# frozen_string_literal: true require_relative './data_absent_reason_checker' require_relative './profile_definitions/us_core_practitioner_definitions' module Inferno module Sequence class USCore311PractitionerSequence < SequenceBase include Inferno::DataAbsentReasonChecker include Inferno::USCore31...
45.132
188
0.672516
918d27b105362395a83d4121a56300edd083cced
13,613
require "net/https" require "digest" module RETS class HTTP attr_accessor :login_uri ## # Creates a new HTTP instance which will automatically handle authenting to the RETS server. def initialize(args) @headers = {"User-Agent" => "Ruby RETS/v#{RETS::VERSION}", "Accept-Encoding" => "none", "RET...
40.038235
166
0.596121
1d80c5ec500a8080f23aa816424f4deff9d5805a
327
# encoding: utf-8 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. module Azure end module Azure::Customimagesearch end module Azure::Customimagesearch::Profiles end module Azure::Customimagesearch::Profiles::Late...
36.333333
94
0.807339
8714be352a13fea5c62b0bbeeca95f92fa05aab3
1,355
require 'spec_helper' RSpec.describe Newgistics::StringHelper do describe '.camelize' do context "when upcase_first is true" do it "transforms an underscored string as expected" do result = described_class.camelize('a_sample_string', upcase_first: true) expect(result).to eq('ASampleString'...
28.229167
81
0.681919
3361fc5c087fc0ab81dff830e32da650e6630839
813
require 'spec_helper' module Alf describe Reader do subject{ Reader } it { should respond_to(:rash) } describe "rash on a real IO" do subject{ Reader.rash($stdin) } it{ should be_a(Reader::Rash) } end describe "reader" do specify "when associated" do r = Reader.reader...
21.972973
79
0.602706
7abeb3b406734dd0e78f5649a9d610f5ccc8d138
221
class CreatePosts < ActiveRecord::Migration[6.1] def change create_table :posts do |t| t.string :title t.text :body t.integer :user_id t.boolean :edited t.timestamps end end end
17
48
0.624434
ff2b4594a374e6c3f27b8bac8ed66ab23cbdf4fd
3,824
require File.expand_path('../../test_helper', __FILE__) class DomainMembersControllerTest < ActionController::TestCase def setup @user = with_unique_user with_domain end def with_domain @domain = Domain.first :as => @user unless @domain @domain = Domain.new(get_post_form.merge(:as => @use...
31.344262
99
0.647228
b90dce46e6c4d71003e9bb9e04da20a25c8daec0
951
default['nomad']['version'] = '0.7.1' default['nomad']['service_name'] = 'nomad' default['nomad']['service_user'] = 'nomad' default['nomad']['service_group'] = 'nomad' default['nomad']['create_service_user'] = true default['nomad']['archive_name'] = 'nomad' default['nomad']['archive_url'] = 'https://releases.hashicorp....
47.55
77
0.649842
33d8d4e36c022d149c2c9a9b707277429cc5d0c7
766
require 'benchmark' total = (ENV['TOTAL'] || 100_000).to_i const = 2 ** 12 Benchmark.bmbm do |x| x.report("Fixnum#+const") do total.times do |i| const + const end end x.report("Fixnum#*const") do total.times do |i| const * const end end x.report("Fixnum#+i") do total.times...
13.678571
38
0.520888
5da927a40811f9aa7a8e195c9b2138220fea13c8
524
module WashOut module Model def wash_out_columns columns_hash end def wash_out_param_map types = { :text => :string, :float => :double, :decimal => :double, :timestamp => :string } map = {} wash_out_columns.each do |key, column| ...
18.068966
50
0.538168
081e63eb09435c4a020c04aa7c41789851557370
391
# == Schema Information # # Table name: subjects # # created_at :datetime not null # id :bigint(8) not null, primary key # name :string not null # updated_at :datetime not null # class Subject < ApplicationRecord has_and_belongs_to_many :activity_types, join_table: ...
26.066667
78
0.644501
bb9e109bc45656717aedf0b951e061882ba96cdb
5,049
a = File.absolute_path(__FILE__).split "/" a.pop 2 $:.unshift a.join("/") + "/lib" require "pry" require "washington/global" def log text puts "\e[1m" + text + "\e[0m" end def cleanup! Washington.reset end log "Washington" log "==========" log "" ################################################################...
22.95
77
0.634977
7a016f402878fbe091a72d7d3365b9212c7ff8b7
909
class Node attr_accessor :value, :next_node def initialize(value, next_node = nil) @value = value @next_node = next_node end end class Stack def initialize @head = nil @min = nil end def push(number) # your code here @min = Node.new(number, @min) if @mi...
15.672414
74
0.561056
1adca9cb4450aed402baec85ac95f5ff9c398b66
108
# -*- encoding : utf-8 -*- require 'spec_helper' describe UserTotal do pending "put some tests here" end
15.428571
31
0.694444
1c0f582e16d44c55c6c830f21d35085cb252a1ec
368
module FbGraph module Connections module PromotablePosts def promotable_posts(options = {}) posts = self.connection :promotable_posts, options posts.map! do |post| PromotablePost.new post[:id], post.merge( :access_token => options[:access_token] || self.access_token ...
26.285714
72
0.616848
7a43a68209a87df260074a543016d8c24f74a665
10,562
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2018 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 ...
25.450602
91
0.587483
91097075fdf75b32b1a27bdc9c9b8db1dd996aeb
2,331
# encoding: utf-8 module Slideshow class ManifestFinder include LogUtils::Logging include ManifestHelper def initialize( config ) @config = config @usrdir = File.expand_path( Dir.pwd ) # save original (current) working directory end attr_reader :config attr_reader :usrdir ...
30.671053
121
0.642643
7aa37616bf64b0927d80bb1251b632cd3203dd5c
3,105
## # MachineLearning module # Copyright (c) Hiroyuki Matsuzaki 2015 # # See Copyright Notice in LICENSE # module MachineLearning ## # NaiveBayes class # class NaiveBayes ## # call-seq: # nb.word_count_up(word, category) # def word_count_up(word, category) unless self.vocabularie...
22.021277
86
0.585829
7a24d65e5a8d3b50978d9b14e76271c74981bbf2
1,948
module Voltron module Upload module CarrierWave module Uploader module Base def initialize(*args) self.class.send(:before, :store, :save_timestamp) self.class.send(:after, :store, :apply_timestamp) super(*args) end def to_upload_jso...
28.231884
89
0.499487
1c9bd77c7768796bf69b6e3d6bf12de8a83d50d5
598
module Vultr class UserResource < Resource def list(**params) response = get_request("users", params: params) Collection.from_response(response, key: "users", type: User) end def create(**attributes) User.new post_request("users", body: attributes).body.dig("user") end def retr...
23.92
71
0.647157
030364d5e6af9ff595a84d9ed1b20971de6bdcc1
210
# frozen_string_literal: true require 'rspec/expectations' require 'semantic_puppet' RSpec::Matchers.define :be_semanticlly_correct do match do |actual| SemanticPuppet::Version.valid?(actual) end end
19.090909
49
0.785714
f8cc48b8f363af3e6974f4ba8f70ddb4133b0e75
625
module Setup class PullImport < Setup::BasePull include Setup::DataUploader include RailsAdmin::Models::Setup::PullImportAdmin build_in_data_type def run(message) message[:discard_collection] = true unless message.has_key?('discard_collection') super end protected def sourc...
24.038462
87
0.6944
bfd666ac7445614c50b977a79cc2de9c47fef4cd
61
module DwollaV2 class InvalidScopesError < Error end end
12.2
34
0.786885
bb0b5bc72f31e32a9fd0dec4b627927be4669689
2,842
require "rails_helper" RSpec.describe "routes for authentication", type: :routing do describe "production settings" do context "dfe_signin" do it "default default" do expect(get: "/auth/dfe/callback").to route_to("sessions#create") expect(get: "/auth/dfe/signout").to route_to("sessions#dest...
40.028169
92
0.705841
796e1a562659bb6c51ee7c4e3244de144280bed8
1,641
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{has_draft} s.version = "0.1.1" s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version= s.authors = ["Ben Hughes"] s.date = %q{2009-03-09} s.description = %q{Allows for your ActiveRecord mo...
49.727273
378
0.703839
181a605cc4dc7e5c557b680a963fe2f6ac4a6b26
2,778
# frozen_string_literal: true require "dry/configurable" require "dry/core/constants" module Hanami class Application # Application settings # # Users are expected to inherit from this class to define their application # settings. # # @example # # config/settings.rb # # frozen_st...
29.553191
88
0.62167
181f96af2b62938683856c512ebe78554bfe6ae6
164
require 'global_phone' puts "\n\n\n\n\n\n\n\n\n\n\n#{ConSync::Engine.root}\n\n\n\n\n\n\n\n" GlobalPhone.db_path = ConSync::Engine.root.join('db/global_phone.json')
41
71
0.707317
bf324a100b0c587708f382eb0f9915cd5b9b2272
86
class AddQuestionTypetoQuestion < ActiveRecord::Migration[5.1] def change end end
17.2
62
0.790698
878c840cd69b9f49ee6263b3167b772b5791abdd
12,113
class Cookbook < ActiveRecord::Base include PgSearch # # Query cookbooks by case-insensitive name. # # @param name [String, Array<String>] a single name, or a collection of names # # @example # Cookbook.with_name('redis').first # #<Cookbook name: "redis"...> # Cookbook.with_name(['redis', '...
29.472019
108
0.683728
6afba203a23b487c5cd8e505b7fe0647355bd43e
1,643
module EventsHelper def show_attendees content_tag_for(:h2, @event.attendees) do |attendee| "#{@event.attendees.index(attendee) + 1})" + attendee.name unless @event.attendees.nil? end end def past_events_header content_tag(:h1) do 'past events' unless @past_events.nil? end end de...
27.383333
117
0.670116
bb24263266a637a4cd72d94d792892b92c92bf02
3,092
########################################################################## # Copyright 2007 Applied Research in Patacriticism and the University of Virginia # # 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 ...
47.569231
158
0.733182
03ce48f6f47a38ef4017f72134a132ad17eb3372
711
cask 'keka' do version '1.0.6' sha256 'c164cdca023c47a9c61ef1c93bf64252636ed73433bf36117408db4a1647c966' url "http://www.kekaosx.com/release/Keka-#{version}.dmg" appcast 'http://www.kekaosx.com/update/keka.xml', checkpoint: '76c07c4ead37d0ec9771f0aec315596d496fa0f80aacb9188c5ac5d9cf631e4e' name 'Ke...
30.913043
88
0.658228
33f92a0388eec8bdb88f32c09a7ae685a9bfcbdd
6,870
describe Fastlane do describe Fastlane::FastFile do describe "upload_symbols_to_crashlytics" do before :each do allow(FastlaneCore::FastlaneFolder).to receive(:path).and_return(nil) end it "extracts zip files" do binary_path = './fastlane/spec/fixtures/screenshots/screenshot1.pn...
42.670807
110
0.629694
08a3101313c801251e357b58fe168139b5551fdf
5,511
# frozen_string_literal: true require "abstract_class" require_relative "core" require_relative "mixins/built_in" module RSpec module JsonMatchers module Expectations # @api private # All classes within module should NOT be able # to be used directly / extended # # All classes...
28.117347
128
0.561604
623ae241051d4ce01dbadb452321b532717e0fd8
491
#!/usr/bin/env rspec require 'spec_helper' require 'puppet/node' require 'puppet/indirector/memory' require 'puppet/indirector/catalog/store_configs' class Puppet::Resource::Catalog::StoreConfigsTesting < Puppet::Indirector::Memory end describe Puppet::Resource::Catalog::StoreConfigs do after :each do Puppet::R...
27.277778
81
0.796334
621935c60a87225f9631fe4045f0b722f3ae5bb2
22,836
#-- vim:sw=2:et #++ # # :title: Markov plugin # # Author:: Tom Gilbert <tom@linuxbrit.co.uk> # Copyright:: (C) 2005 Tom Gilbert # # Contribute to chat with random phrases built from word sequences learned # by listening to chat class MarkovPlugin < Plugin Config.register Config::BooleanValue.new('markov.enabled', ...
30.007884
381
0.600937
6a25546a4547451f421cb9b75dd5e6b61e6c8d8a
111
class ApplicationController < ActionController::Base before_action :masquerade! protect_from_forgery end
15.857143
52
0.828829
ed9cce74cb8d7b21765ea2e2877edbc073c3a7af
865
require 'spec_helper' describe Owenbot::Commands::Calculate do let(:app) { Owenbot::Bot.instance } it 'adds two numbers' do expect(message: 'owenbot calculate 2+2', channel: 'channel').to respond_with_slack_message('4') end it 'adds two numbers via =' do expect(message: '= 2+2', channel: 'channel').to ...
41.190476
140
0.721387
2152f90e37d935b5b93f2c8dc921c7bd3965da50
4,119
# frozen_string_literal: true require "json" module Kenna module Toolkit module Contrast class Client def initialize(contrast_host, contrast_port, contrast_api_key, contrast_auth_header, contrast_org_id, contrast_use_https) protocol = contrast_use_https ? "https://" : "http://" ...
38.495327
194
0.606215
39afc2a65d6929cc468f5e0456b06527e09a1d66
684
module Notification class Base include Rails.application.routes.url_helpers def self.key name.split("::").last.underscore.to_sym end def self.description name.split("::").last.underscore.gsub("_", " ").capitalize end # :nocov: def text raise "Expected `#{self.class}` t...
16.285714
64
0.576023
62fd0d84ea323312ec5e4bece5445c703176d4de
865
Gitlab::Seeder.quiet do Project.all.reject(&:empty_repo?).each do |project| branches = project.repository.branch_names branches.each do |branch_name| break if branches.size < 2 source_branch = branches.pop target_branch = branches.pop # Random user user = project.team.users.sam...
25.441176
85
0.641618
62c15fb38e45b687e8de9fa481101d0afeb8663d
2,660
class UserAgent module Browsers module All include Comparable def <=>(other) if respond_to?(:browser) && other.respond_to?(:browser) && browser == other.browser version <=> Version.new(other.version) else false end end def eql?(othe...
21.626016
89
0.538722
910ed4bbf48fbef15a5c8401e2bed528e552c38d
938
module Babeltrace class Trace attr_reader :context attr_reader :handle_id def initialize(context, handle_id) @context = context @handle_id = handle_id end def get_path Babeltrace.bt_trace_handle_get_path(@context, @handle_id) end def get_timestamp_begin(clock_type = :RE...
32.344828
91
0.721748
0836704224c748d042308779904d6fded9324077
2,276
require 'spec_helper' describe Taza::ProjectGenerator do context "taza create foo_site" do context "creates" do let(:subject) { Taza::ProjectGenerator.new(['foo_site']) } let(:output) { capture(:stdout) { subject.create } } it 'a Gemfile' do expect(output).to include("Gemfile") ...
29.558442
81
0.621265
f851f4242969ff69b8f4475cad8047f2d2bf0f34
421
# frozen_string_literal: true class SchoolManagerMailer < ApplicationMailer def new_member(school_manager:, member:) @school_manager = school_manager @member_presenter = ::Presenters::User.new(member) @school_manager_presenter = ::Presenters::User.new(school_manager) mail(subject: "Nouveau #{@member...
32.384615
91
0.750594
11331dae121fb64a4869548eb35d2e30b42e90db
1,022
require File.dirname(__FILE__) + "/lib/stupidedi/version" Gem::Specification.new do |s| s.name = "stupidedi" s.summary = "Parse, generate, validate ASC X12 EDI" s.description = "Ruby API for parsing and generating ASC X12 EDI transactions" s.homepage = "https://github.com/irobayna/stupidedi" s...
35.241379
80
0.533268
38042a20b941dcbc69d195323834d9c81f337c19
754
cask "unity-ios-support-for-editor" do version "2020.1.12f1,55b56f0a86e3" sha256 "ecccacac1c64857bce84ec65b2031f038ce4e1893f5ac4c96b97bdf9a2711bd4" # download.unity3d.com/download_unity/ was verified as official when first introduced to the cask url "https://download.unity3d.com/download_unity/#{version.after_...
41.888889
161
0.789125
acbd13a360ea4c48b49478a69beee7c5bb61c8ad
178
json.array!(@trackers) do |tracker| json.extract! tracker, :id, :wb_id, :part_code, :employee_id, :shift, :device_id, :count json.url tracker_url(tracker, format: :json) end
35.6
90
0.719101
ed3c0de45fdc2417e0a903e9ba8207e55978b5b8
3,132
module Api module V1 class CommoditiesController < ApiController before_action :find_commodity, only: [:show, :changes] def show @measures = MeasurePresenter.new( @commodity.measures_dataset.eager( { footnotes: :footnote_descriptions }, { measure_type: :measu...
46.058824
125
0.526501
26e36f139725a8bd5680dac4da0c490e2e6817cd
19,810
# frozen_string_literal: true require "rubocops/extend/formula" module RuboCop module Cop module FormulaAudit # This cop checks for various miscellaneous Homebrew coding styles. class Lines < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, _body_node) [:automak...
40.101215
115
0.576779
3877897a1c9ef0578d806ff3562f243c5b22722f
221
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'gastly' require 'coveralls' Coveralls.wear! RSpec.configure do |config| config.before(:suite) do Phantomjs.implode! Phantomjs.path end end
17
58
0.723982
284c43113db5f5e2aeda39fff6e6e1dab078ca55
977
require 'spec_helper' describe EventInvitationMailer do let(:email) { ActionMailer::Base.deliveries.last } let(:event) { Fabricate(:event, date_and_time: Time.zone.local(2017, 11, 12, 10, 0), name: 'Test event') } let(:member) { Fabricate(:member) } let(:invitation) { Fabricate(:invitation, event: event, membe...
32.566667
108
0.728762
87392e454ddb75dae07e1598f77da103c4426d2b
1,180
module ThemeInterface def self.getlist raise NotImplementedError.new("#{self.class}##{__method__} are not exist") end def self.get raise NotImplementedError.new("#{self.class}##{__method__} are not exist") end end class Theme include ThemeInterface attr_reader public de...
27.44186
163
0.566949
288da3c8cd90227821f094e0c71cb3dcc5910ad6
1,884
module Selenium module WebDriver module Chrome # # @api private # class Service START_TIMEOUT = 20 STOP_TIMEOUT = 5 MISSING_TEXT = "Unable to find the chromedriver executable. Please download the server from http://code.google.com/p/selenium/downloads/list and p...
29.4375
253
0.608811
08246d3ec2b1b20cca596a006dc8d400c960c0dd
1,922
require 'spec_helper' describe 'keepalived::instance', :type => :define do let :title do 'something' end let :default_params do { :interface => 'eth0', :virtual_ips => [ '10.0.0.1 dev bond0.X' ], :state => 'BACKUP', :state => 'BACKUP', :priority ...
29.569231
343
0.596774
28039ff19427506bf9e6685f185c9e4e76d57561
11,499
require 'socket' # == Synopsis # A Piper is used to fork a child process and then establish a communication # pipe between the parent and child. This communication pipe is used to pass # Ruby objects between the two. # # == Details # When a new piper instance is created, the Ruby process is forked into two # processes...
30.582447
79
0.662058