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
4a77d047e15594b11f4584a7d40d19b372f94c32
919
class CreateMcPayloadStageClasses < ActiveRecord::Migration # # CONSTANTS # # Name of the table being created TABLE_NAME = :mc_payload_staged_classes # # Instance Methods # # Drop {TABLE_NAME}. # # @return [void] def down drop_table TABLE_NAME end # Create {TABLE_NAME}. # # @retur...
20.422222
72
0.618063
3977617d142d02ac8a643d27222db7bae4f6692e
827
=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::OneOfflowAccountBody1 # Au...
23.628571
85
0.750907
6a42281d40be5103b84abf14c0340408cfdcc222
170
require File.dirname(__FILE__) + '/test_helper.rb' class TestTamarind < Test::Unit::TestCase def setup end def test_truth assert true end end
14.166667
51
0.658824
260c644bae4cbfc29bfb525604de2f2ad8fbe039
121
class AddRoleToMembers < ActiveRecord::Migration[5.1] def change add_column :memberships, :role, :string end end
20.166667
53
0.743802
1d3eb054f3ce8138b63b03ce96ecf3a2ec629d67
649
Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'activerecord4-bigquery-adapter' s.version = '0.0.2' s.summary = 'BigQuery adapter for ActiveRecord 4' s.description = 'BigQuery _makeshift_ adapter for ActiveRecord 4.' s.license = 'MIT' s.authors = ['Mark Slemko'] s.email = 'mark...
32.45
76
0.676425
ac71cb7f2389a94f465f21e3108262bf49358e40
1,502
# frozen_string_literal: true # Copyright 2021 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...
30.04
85
0.648469
ff79822e0f9e87cc828d037ec6488e2c084ded76
1,213
# frozen_string_literal: true class SuperAdmin::OrgSwapsController < ApplicationController include OrgSelectable after_action :verify_authorized def create # Allows the user to swap their org affiliation on the fly authorize current_user, :org_swap? # See if the user selected a new Org via the Or...
30.325
165
0.70404
d58e3b2841ec30bd7f89c8c589e26d3ae5825c62
10,962
require 'spec_helper' describe 'Dashboard Todos' do let(:user) { create(:user) } let(:author) { create(:user) } let(:project) { create(:project, :public) } let(:issue) { create(:issue, due_date: Date.today) } context 'User does not have todos' do before do sign_in(user) visit dashboard...
30.534819
160
0.640759
ed5e0053a0030a57e53d3e2fb77df04a3394336f
1,242
# Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
34.5
77
0.748792
e96c13aede38b54840ada4bc41fdde51982e95c3
469
require 'spec_helper' describe Gitlab::Ci::Status::Created do subject do described_class.new(double('subject'), double('user')) end describe '#text' do it { expect(subject.text).to eq 'created' } end describe '#label' do it { expect(subject.label).to eq 'created' } end describe '#icon' do ...
19.541667
59
0.658849
1d7786bcbd1bcb67cea09dde182c5bc8a0901aec
1,220
# frozen_string_literal: true require 'application_system_test_case' class UserInfosTest < ApplicationSystemTestCase setup do @user_info = user_infos(:one) end test 'visiting the index' do visit user_infos_url assert_selector 'h1', text: 'User Infos' end test 'creating a User info' do visi...
24.4
59
0.715574
2172895d66cb9c01030cecbd5acb0cebd862c9ae
906
require 'active_support/concern' module ModelCallbacks extend ActiveSupport::Concern def after_init names = self.class.after_init_names[self.class] names.each { |name| self.send(name) } end def self.included(klass) class << klass alias_method :__new, :new def new(*args) e = __...
19.695652
60
0.620309
1aa62887f14714473ff5d985b136abe85ca1a9a6
5,057
# 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...
47.707547
148
0.664228
21ee35f09aa7611da0d39a18f48f548512547faa
496
require 'rails_helper' feature 'capture complete step' do include IdvStepHelper include DocAuthHelper include DocCaptureHelper before do complete_doc_capture_steps_before_capture_complete_step allow_any_instance_of(DeviceDetector).to receive(:device_type).and_return('mobile') end it 'is on the co...
27.555556
87
0.802419
4ad2b59eddf54f9312553c1d83500ab2df907cf8
207
class CreateHeartbeats < ActiveRecord::Migration def change create_table :heartbeats do |t| t.references :device, index: true, foreign_key: true t.timestamps null: false end end end
20.7
58
0.705314
87b0bb43c99e12c4c57f3031e1c97ba7b0411882
1,054
require 'spec_helper' RSpec.describe 'Yunbi integration specs' do let(:client) { Cryptoexchange::Client.new } let(:btc_cny_pair) { Cryptoexchange::Models::MarketPair.new(base: 'BTC', target: 'CNY', market: 'yunbi') } it 'fetch pairs' do pending ":error, yunbi's service is temporarily unavailable." pair...
28.486486
108
0.696395
79bdc4af2f2b5878bad873e1b045e5c65eb377d6
47
module Lookfile VERSION = '0.1.5'.freeze end
11.75
26
0.702128
ed174a57121cd7f990a0e49888c4f5338df9640b
1,773
require 'spec_helper' module RubySpeech module SSML describe Sub do let(:doc) { Nokogiri::XML::Document.new } subject { described_class.new doc } its(:name) { should == 'sub' } describe "setting options in initializers" do subject { Sub.new doc, :alias => 'foo' } its(:...
28.596774
131
0.57586
1d5ca2d23368f514ee0289a8f5e48b3de5cf8e58
2,529
class I686ElfGcc < Formula desc "GNU compiler collection for i686-elf" homepage "https://gcc.gnu.org" url "https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz" mirror "https://ftpmirror.gnu.org/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz" sha256 "d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b" l...
37.746269
111
0.62673
916381d41c5e30f4859538eeb01abb6ae8d7d3d3
567
class CopyAreaFeaturesAndAreasToAreaPlaces < ActiveRecord::Migration def up execute "INSERT INTO area_places (area_id,place_id) SELECT a.id, p.id FROM area_features af INNER JOIN places a ON af.area_id = a.area_id INNER JOIN places p ON af.feature_id = p.feature_id UNION ...
33.352941
80
0.664903
5da539dd1b03d226b6911fc9ecfbc66844e4a233
1,091
class Pandaseq < Formula # cite Masella_2012: "https://doi.org/10.1186/1471-2105-13-31" desc "PAired-eND Assembler for DNA sequences" homepage "https://github.com/neufeld/pandaseq" url "https://github.com/neufeld/pandaseq/archive/v2.11.tar.gz" sha256 "6e3e35d88c95f57d612d559e093656404c1d48c341a8baa6bef7bb0f09...
30.305556
91
0.735105
618ad7feb4e0d2c208152fced135688effb77f6f
10,585
# frozen_string_literal: true require 'haml/attribute_builder' require 'haml/attribute_compiler' require 'haml/temple_line_counter' module Haml class Compiler include Haml::Util attr_accessor :options def initialize(options) @options = Options.wrap(options) @to_merge = [] @temp...
31.88253
159
0.586301
39d6c7e109a042bae3dcd437036bc62824581983
1,450
module SessionsHelper # Logs in the given user. def log_in(user) session[:user_id] = user.id end # Returns the current logged-in user (if any). def current_user @current_user ||= User.find_by(id: session[:user_id]) end def current_user?(user) user == current_user end # Remembers a user i...
24.576271
73
0.687586
8784e86f2839f51787bf3e3fcf91621f4fe9fbbe
135
require 'test_helper' class HomePageControllerTest < ActionController::TestCase # test "the truth" do # assert true # end end
16.875
57
0.733333
bbcd8cac6fa76b6c2e518f5c4ef650972145306c
166
# frozen_string_literal: true require_relative '../../common/spec/spec_helper_head' require 'nanoc/external' require_relative '../../common/spec/spec_helper_foot'
20.75
53
0.777108
185b0db2294c4c826584e6f37ee0065bce688ed4
5,455
=begin #Swagger 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: \" \\ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codege...
28.118557
157
0.610816
39b9c83fcaa48993440206e114802ab124901877
2,059
class GmtAT4 < Formula desc "Manipulation of geographic and Cartesian data sets" homepage "https://gmt.soest.hawaii.edu/" url "ftp://ftp.soest.hawaii.edu/gmt/gmt-4.5.17-src.tar.bz2" mirror "https://fossies.org/linux/misc/GMT/gmt-4.5.17-src.tar.bz2" mirror "https://mirrors.ustc.edu.cn/gmt/gmt-4.5.17-src.tar.bz...
41.18
94
0.663429
4ad9eb92d1e760038f92ae8d6cd6603bed5b1f83
3,494
require_relative '../../spec_helper' require 'bigdecimal' describe "BigDecimal#truncate" do before :each do @arr = ['3.14159', '8.7', "0.31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385...
42.609756
273
0.691757
08ba5575714f60dd9a76c6712ccffe6a246829d3
1,513
title 'Tests to confirm renderproto library exists' plan_origin = ENV['HAB_ORIGIN'] plan_name = input('plan_name', value: 'renderproto') control 'core-plans-renderproto-library-exists' do impact 1.0 title 'Ensure renderproto library exists' desc ' Verify renderproto library by ensuring that (1) its install...
40.891892
123
0.730998
1cb20ad768b2be62fa29d3bcb0f743349f1db6e9
163
shared_examples_for 'a worker' do let(:worker) { described_class } it 'responds to :handle_event' do expect(worker).to respond_to(:handle_event) end end
23.285714
47
0.736196
7aa6ced93f39cea1a2feb88dd8e1c2ff43f9361b
296
class CreateTripExpenses < ActiveRecord::Migration def change create_table :trip_expenses do |t| t.integer :schedule_id t.string :section t.boolean :round, null: false, default: true t.string :way t.integer :price t.timestamps end end end
21.142857
52
0.641892
03603055a13a213ae5844b97c781c6d627bc11b6
676
#!/usr/bin/env ruby1.9 # vim: filetype=ruby, fileencoding=UTF-8, tabsize=2, shiftwidth=2 #Copyright (c) 2008 Engine Yard, Inc. All rights reserved. #This code was directly ported from <https://GitHub.Com/RubySpec/RubySpec/tree/master/language/not_spec.rb> require File.expand_path File.join(File.dirname(__FILE__), 'sp...
24.142857
107
0.727811
3844f77a402bc61d8614d311c808280a4759af86
4,256
# frozen_string_literal: true require 'spec_helper' require 'overcommit/hook_context/prepare_commit_msg' describe Overcommit::Hook::PrepareCommitMsg::ReplaceBranch do def checkout_branch(branch) allow(Overcommit::GitRepo).to receive(:current_branch).and_return(branch) end def new_config(opts = {}) defa...
32.242424
80
0.655075
28f0e37d743853bc069eba7fe14bd4f560fceb43
624
class SearchEngine class SearchRequest class BasePart attr_reader :name attr_reader :value attr_reader :exclude def initialize(name:, value:, exclude: false) self.name = name self.value = value self.exclude = exclude end def name=(value) ; @name = val...
20.129032
58
0.559295
bfddfa0eb96a0f5f8b41cf44d3b437361e70f16d
1,920
Pod::Spec.new do |s| s.name = "ReactiveCocoa" s.version = "2.2.4" s.summary = "A framework for composing and transforming streams of values." s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source" s.author = { "Josh Abernathy" => "josh@github.com" } s.source...
51.891892
269
0.674479
b93fc03b1b4c170b346e1cacf37e3cf178ab01be
106
# frozen_string_literal: true class CreateAllTables < ActiveRecord::Migration[6.0] def change; end end
17.666667
52
0.783019
1c6bfde5723211652f932788cdc9d9907cfccb64
321
# frozen_string_literal: true module QryFilter module Generators class InstallGenerator < ::Rails::Generators::Base source_root File.expand_path('templates', __dir__) def copy_application_filter template 'application_filter.rb', 'app/filters/application_filter.rb' end end end end...
22.928571
77
0.728972
797c37e197e5ddeed50ddc7dbdedd5ca6e71cb5c
12,604
require "os/linux/glibc" class LlvmAT5 < Formula desc "Next-gen compiler infrastructure" homepage "https://llvm.org/" url "https://releases.llvm.org/5.0.2/llvm-5.0.2.src.tar.xz" sha256 "d522eda97835a9c75f0b88ddc81437e5edbb87dc2740686cb8647763855c2b3c" revision 1 bottle do cellar :any rebuild 1 ...
36.853801
144
0.651142
614584ba59bdc38f2cc151fc265c03a33fcd57fa
533
cask 'creepy' do version '1.4.1' sha256 'c500216420cb32b7779f20726bc838868c4424d234b9dc7f076d083b317b5450' # github.com/jkakavas/creepy was verified as official when first introduced to the cask url "https://github.com/jkakavas/creepy/releases/download/v#{version}/cree.py_#{version}.dmg.zip" appcast 'https:/...
38.071429
99
0.772983
d58d23d238f53fa22d5f05afb317d29d4d51bdc4
716
class EventSerializer < ActiveModel::Serializer include ActionView::Helpers::TextHelper attributes :guid, :title, :length, :scheduled_date, :language, :abstract, :speaker_ids, :type, :room, :track def scheduled_date t = object.time t.blank? ? '' : %( #{I18n.l t, format: :short}#{t.formatted_offset(false...
22.375
110
0.678771
33251541e015776327d0b63bfc9700012b1b8fc2
1,842
require 'test_helper' class CustomerConfigurationsControllerTest < ActionController::TestCase setup do @customer_configuration = customer_configurations(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:customer_configurations) end test "should...
36.84
334
0.799131
1a82a655d1a512bdeaf0fcf621638206bb820ba7
2,119
# frozen_string_literal: true module DocTemplate module Tags class HeadingTag < BaseTag TEMPLATE = 'heading.html.erb' def parse(node, opts = {}) # we have to collect all the next siblings until next stop-tag params = { content: parse_nested(content_until_break(node), opts),...
23.285714
70
0.622463
ffde2accad65533abaf0bdc133f33ef188043200
12,335
class Menu attr_accessor :user def run welcome_banner self.user = User.prompt_for_user main_menu end def welcome_banner puts "\n\n" puts" ,gggg, " puts" ,88*Y8b, " ...
36.067251
116
0.461775
e230262a052c71b48f6f25246b969cf0440607ec
456
class CreateAnimalPermits < ActiveRecord::Migration[5.2] def change create_table :animal_permits do |t| t.integer :permitter_id t.integer :permitted_id t.boolean :is_permit, default: false t.timestamps end add_index :animal_permits, :permitter_id add_index :animal_permits, :permi...
28.5
75
0.730263
ffa1c69b91f88a38b35187e200b88e63e2380742
308
module Polymorph class OrderableController < Polymorph::ApplicationController def create klass.reorder(order) head :ok end private def klass @klass = params[:orderable_type].constantize end def order params[klass.table_name.singularize] end end end
16.210526
62
0.672078
e2894cc74f406e9b0d58ff252db22d125f95d7d7
1,328
require "url_shortener" module Lita module Handlers class Bitly < Handler config :apikey config :username route(/(?:bitly|shorten)\s(.+)/i, :shorten_url, command: true, help: {"bitly | shorten URL" => "Shorten the URL using bitly"} ) def shorten_url(respons...
30.883721
108
0.606928
b9d254bd60d45361802efa80481d7d738d5dc51b
6,611
class ESIClient Faraday.register_middleware(:response, :logging => Echo::ClientMiddleware::LoggingMiddleware) def self.submit_esi_request(*args) new.submit_esi_request(*args) end def self.get_esi_request(*args) new.get_esi_request(*args) end def submit_esi_request(collection_id, params, method, r...
28.619048
116
0.671759
1dabb26609bad998668c2e48693fe1653968fc4f
3,789
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
41.184783
102
0.757192
1d616c3274588cb1e8198a9b4c9506a4de9eec55
1,675
require 'set' module MARC # MARC records contain control fields, each of which has a # tag and value. Tags for control fields must be in the # 001-009 range or be specially added to the @@control_tags Set class ControlField # Initially, control tags are the numbers 1 through 9 or the string '000' ...
23.263889
107
0.627463
2801fa834667b47ce6592995ff5a5f0076754164
3,395
# frozen_string_literal: true # == Schema Information # # Table name: inboxes # # id :integer not null, primary key # allow_messages_after_resolved :boolean default(TRUE) # channel_type :string # csat_survey_enabled :boolean default(F...
26.732283
86
0.648306
bf099ab3079c640045c0ab17c3ce856bf5384bad
363
class CreateRelationships < ActiveRecord::Migration[5.2] def change create_table :relationships do |t| t.integer :follower_id t.integer :followed_id t.timestamps end add_index :relationships, :follower_id add_index :relationships, :followed_id add_index :relationships, [:followe...
25.928571
71
0.721763
62416ed17af5c89bc13dddfd571906e573b77147
13,299
=begin #Mailchimp Marketing API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 3.0.22 Contact: apihelp@mailchimp.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.12 =end require 'uri' modu...
42.085443
269
0.675991
b927ce88a1dd033542dcdb7ce048493ff9e98284
2,750
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/ads/googleads/v6/services/ad_parameter_service.proto require 'google/protobuf' require 'google/ads/google_ads/v6/resources/ad_parameter_pb' require 'google/api/annotations_pb' require 'google/api/client_pb' require 'google/api/field_behavior_...
48.245614
167
0.759636
61be8074ddc7bed4ec30076f56f081c8459a8bb3
1,705
class XercesC < Formula desc "Validating XML parser" homepage "https://xerces.apache.org/xerces-c/" url "https://www.apache.org/dyn/closer.lua?path=xerces/c/3/sources/xerces-c-3.2.2.tar.gz" mirror "https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.2.tar.gz" sha256 "dd6191f8aa256d3b4686b64b0544ee...
32.169811
93
0.679765
ab8b0e4327588049761fa0168e8b6464983b82aa
1,200
# frozen_string_literal: true require "sidekiq/extensions/generic_proxy" module Sidekiq module Extensions ## # Adds 'delay', 'delay_for' and `delay_until` methods to all Classes to offload class method # execution to Sidekiq. Examples: # # User.delay.delete_inactive # Wikipedia.delay.downlo...
27.906977
96
0.675833
d5e7211c8e40386fb9d24afcdc5327fdbcb9e80c
391
# frozen_string_literal: true class SessionDecorator < ApplicationDecorator delegate_all # Define presentation-specific methods here. Helpers are accessed through # `helpers` (aka `h`). You can override attributes, for example: # # def created_at # helpers.content_tag :span, class: 'time' do # ...
26.066667
75
0.685422
3996265f9813497b7300b5f74b3799d66b0f4d7f
749
=begin Insights Service Catalog API This is a API to fetch and order catalog items from different cloud sources OpenAPI spec version: 1.0.0 Contact: you@your-company.com Generated by: https://github.com/swagger-api/swagger-codegen.git =end class ProgressMessage < ApplicationRecord acts_as_tenant(:tenant) afte...
23.40625
77
0.735648
3362c71d8ff581659bc2167a7304fdb6e4596114
445
# # is_hash.rb # module Puppet::Parser::Functions newfunction(:is_hash, type: :rvalue, doc: <<-EOS Returns true if the variable passed to this function is a hash. EOS ) do |arguments| raise(Puppet::ParseError, "is_hash(): Wrong number of arguments given (#{arguments.size} for 1)") if argumen...
21.190476
124
0.644944
d56e9974742590c2707a0adac931d89fceb3c318
36
require 'omniauth/strategies/origo'
18
35
0.833333
ff5e988c4399072d81c136041e69c2723f70ee40
1,624
# Fact: domain # # Purpose: # Return the host's primary DNS domain name. # # Resolution: # On UNIX (excluding Darwin), first try and use the hostname fact, # which uses the hostname system command, and then parse the output # of that. # Failing that it tries the dnsdomainname system command. # Failing that ...
25.375
126
0.617611
bb29e629fa027fa094ff0d0a3b513400a68b1ba4
3,925
require 'faraday' require 'json' require 'wmp_sdk/error' module WmpSdk class Api # 登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。 def self.invoke_auth_session(code) response = Faraday.get('https://api.weixin.qq.com/sns/jscode2session', { appid: WmpSdk.configuration.app_id, ...
40.885417
148
0.664713
5dcf5f28ed1133557e21e00f5ccb3953547d07d0
1,982
class Ncmpcpp < Formula desc "Ncurses-based client for the Music Player Daemon" homepage "https://rybczak.net/ncmpcpp/" url "https://rybczak.net/ncmpcpp/stable/ncmpcpp-0.9.2.tar.bz2" sha256 "faabf6157c8cb1b24a059af276e162fa9f9a3b9cd3810c43b9128860c9383a1b" license "GPL-2.0-or-later" revision 3 bottle do ...
29.58209
139
0.688698
bbe14522ea14fcf0079cb82a59a1d08253a2a24e
1,986
#!/usr/bin/env ruby # # Check the size of a database queue # require 'rubygems' require 'choice' require 'mysql' EXIT_OK = 0 EXIT_WARNING = 1 EXIT_CRITICAL = 2 EXIT_UNKNOWN = 3 Choice.options do header '' header 'Specific options:' option :warn do short '-w' long '--warning=VALUE' desc 'Warning th...
19.281553
90
0.632427
39bbb8e202d02cf4294a53366ffac1b3c3d5985e
1,923
require 'rails_helper' RSpec.describe Event, type: :model do describe '#outdated?' do context 'when starts_at is before today' do it 'should return true' do event = Event.new(starts_at: Date.new(2001, 2, 3)) expect(event.outdated?).to eq true end end context 'when starts_at is...
32.59322
114
0.572543
034f6c0a4803ad67d3005c5420a520f2ea0af92a
37
module Avaya VERSION = "0.0.6" end
9.25
19
0.648649
799884d7a7400e31964a0f758f50b50680858906
20,007
# frozen_string_literal: true require 'spec_helper' RSpec.describe Gitlab::Experimentation::ControllerConcern, type: :controller do include TrackingHelpers before do stub_const('Gitlab::Experimentation::EXPERIMENTS', { test_experiment: { tracking_category: 'Team', rollout_strategy...
29.596154
163
0.639576
33f2c7349b73b2ddc40521102572885d1706dd91
3,452
# frozen_string_literal: true module RubyEventStore module ROM module Memory module Relations class Events < ::ROM::Relation[:memory] schema(:events) do attribute(:id, ::ROM::Types::Strict::Integer.default { RubyEventStore::ROM::Memory.fetch_next_id }) attribute :e...
31.381818
122
0.573291
261e8eb3f2254d1643bf13d4925aaa0366de28c0
734
#-------------------------------------------------------------------- # @file include.rb # @author Johnny Willemsen # # @brief Include visitor dds4ccm # # @copyright (c) Remedy IT Expertise BV #-------------------------------------------------------------------- require 'ridlbe/c++11/visitors/include' module IDL...
29.36
123
0.561308
282c91467f0e40c9478c6d1255cfbe316ead191a
2,716
class Filebeat < Formula desc "File harvester to ship log files to Elasticsearch or Logstash" homepage "https://www.elastic.co/products/beats/filebeat" url "https://github.com/elastic/beats/archive/v6.1.1.tar.gz" sha256 "c69f0047644be919e42a1d8fa3383c894ca8e054d5b6f727f161ed4ce497ca84" head "https://github.co...
30.177778
185
0.655376
1d1d8830df69d6fdc7805958a9abd35009abf5cc
1,303
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: "", ...
33.410256
78
0.529547
e840a1bcfd80d6355b1f0d7e873b0b2e949d6d6f
5,641
module ActiveMerchant #:nodoc: module Billing #:nodoc: class PayJunctionV2Gateway < Gateway self.display_name = 'PayJunction' self.homepage_url = 'https://www.payjunction.com/' self.test_url = 'https://api.payjunctionlabs.com/transactions' self.live_url = 'https://api.payjunction.com/tran...
29.689474
154
0.586775
4a8002616250307b7155e6249d5a3568f2673f36
4,453
# frozen_string_literal: true require 'spec_helper' require Rails.root.join('config', 'object_store_settings.rb') RSpec.describe ObjectStoreSettings do describe '#parse!' do let(:settings) { Settingslogic.new(config) } subject { described_class.new(settings).parse! } context 'with valid config' do ...
34.789063
99
0.599371
33825081625b158802e4516d234451c9f92745fa
2,090
# frozen_string_literal: true require "spec_helper" describe GraphQL::Schema::InputObject do let(:input_object) { Jazz::EnsembleInput } describe "type info" do it "has it" do assert_equal "EnsembleInput", input_object.graphql_name assert_equal nil, input_object.description assert_equal 1, inp...
29.027778
97
0.639713
bb62b8dece61a507796a88c6e43b1b6ab4a3378b
1,861
# frozen_string_literal: true # run once a day, overnight, to synchronize systems class NightlySyncsJob < CaseflowJob queue_with_priority :low_priority application_attr :queue # arbitrary def perform RequestStore.store[:current_user] = User.system_user sync_vacols_users sync_vacols_cases sync_...
30.016129
96
0.760344
61413e854014bf7386b1ae244e00f9a1c4cdc814
499
require 'spec_helper' describe PivotalTracker::Task do before do @project = PivotalTracker::Project.find(102622) @story = @project.stories.find(4459994) end context ".all" do it "should return an array of tasks" do @story.tasks.all.should be_a(Array) @story.tasks.all.first.should be_a(Pi...
22.681818
65
0.687375
bffaf1a4059e5ed3d87f20735686d8eba810d948
1,060
module Fastlane module Actions class OptOutCrashReportingAction < Action def self.run(params) ENV['FASTLANE_OPT_OUT_CRASH_REPORTING'] = "YES" UI.message("Disabled crash reporting") end def self.description "This will prevent reports from being uploaded when _fastlane_ cr...
25.238095
96
0.616981
f728155ff9ba5c02744fc38fc0d6af2aedbf6797
225
class CreateWidgetComments < ActiveRecord::Migration[5.2] def change create_table :widget_comments do |t| t.references :widget, foreign_key: true t.string :username t.string :comment end end end
22.5
57
0.697778
26f454fbc5ad6fb6489632de845ffed7090f5ee0
337
require 'fileutils' module Pod class Command class Setup < Command self.summary = 'Setup the CocoaPods environment' self.description = <<-DESC Setup the CocoaPods environment DESC def run # Right now, no setup is needed UI.puts 'Setup completed'.green end ...
17.736842
54
0.623145
33a14669b6f996ad5c23f6f5a9d6d409c2bdcbf4
992
Gem::Specification.new do |s| s.name = 'ruby-search-engine' s.version = '0.0.1' s.executables = ['ruby_search_engine.rb'] s.date = '2016-03-29' s.summary = "Search the web using Ruby" s.description = "Search the web using Ruby with this fast and lightweight gem, made to prioritize speed and efficiency. Compared t...
58.352941
382
0.708669
62d33eac1f3002f58c7a7effa002f0dcdea4b228
1,092
# frozen_string_literal: true RSpec.describe Loggi::Credential, type: :model do describe '#initialize' do subject { described_class.new(options) } context 'without options' do let(:options) { {} } it 'shouldnt full any field' do expect(subject.email).to be_nil expect(subject.pas...
26.634146
78
0.649267
39e3a4f3d5316cf7b4fdb8b705fc75ec3536ac80
134
module Pixela class Configuration # @!attribute debug_logger # @return [Logger] attr_accessor :debug_logger end end
16.75
31
0.701493
5dcb6aceac94e23704782bcfe9c4f9134d370249
2,679
require File.expand_path('../../../spec_helper', __FILE__) # MRI magic to use built but not installed ruby $extmk = false require 'rbconfig' OBJDIR ||= File.expand_path("../../../ext/#{RUBY_ENGINE}/#{RUBY_VERSION}", __FILE__) mkdir_p(OBJDIR) def extension_path File.expand_path("../ext", __FILE__) end def object_...
29.43956
93
0.611049
f8d8fc3c01f4a935942843c833138256daca85fc
166
require 'sales_tax/rate' require 'sales_tax/rate_store' module SalesTax Data = RateStore.new def self.[](zip_code) Data.find_by_zip_code zip_code end end
15.090909
34
0.753012
622fbb84c02930cfd88e39bb58101ee5da24b4fb
730
class CategoriesController < ApplicationController before_action :authenticate_user!, only: [:new, :create, :edit, :update, :destroy] def new @category = Category.new end def create @category = Category.new category_params if @category.save redirect_to posts_path, flash: { notice: 'Your ca...
25.172414
93
0.693151
ff4725eaf6489006aac09af4c396cb910fc74dd4
8,228
module Mutest module AST module Regexp class Transformer # Transformer for nodes which map directly to other domain # # A node maps "directly" to another domain if the node never # has children or text which needs to be preserved for a mapping # # @example dir...
80.666667
157
0.514706
216b19dcf22cc89d9dbde8a9b2a73152518ae8ad
719
# frozen_string_literal: true $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib') %w[ bundler/setup signalwire ].each { |f| require f } # Setup your ENV with: # SIGNALWIRE_PROJECT_KEY=YOUR_SIGNALWIRE_ACCOUNT_ID # SIGNALWIRE_TOKEN=YOUR_SIGNALWIRE_ACCOUNT_TOKEN # # Set logging to debug for testing Signalwire::Lo...
24.793103
123
0.730181
e958687e86bc4a78ba32166ec25d75d47a8dce2a
417
class Eagle < Cask version '7.1.0' sha256 '95a721bae751ea210fad390c9b414ec5e317332133072f08247b552e125ab2d5' url "ftp://ftp.cadsoft.de/eagle/program/#{version.gsub(/\.\d$/, '')}/eagle-mac-#{version}.zip" homepage 'http://www.cadsoftusa.com/' license :unknown pkg "eagle-#{version}.pkg" uninstall :pkgutil...
32.076923
96
0.695444
e845714240ddce4b0f9da52e761a9c831adfbbcc
2,764
class NeovimRemote < Formula include Language::Python::Virtualenv desc "Control nvim processes using `nvr` command-line tool" homepage "https://github.com/mhinz/neovim-remote" url "https://files.pythonhosted.org/packages/cc/d8/82aec85fc7ad0853afca2c88e73ecc7d3a50c66988c44aa9748ccbc9b689/neovim-remote-2.4.0.tar...
40.057971
141
0.764472
1c84c408eba5e732edc0c0d25f586266b8f4eee9
233
# frozen_string_literal: true module RuboCop module Cop module Style class AndOr < Cop YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!" \ '`%<current>s` じゃなくて `%<prefer>s` をつかいましょうねー!' end end end end
17.923077
66
0.553648
d545a41f21d09cc992d56d1c5dd78f312774f96d
2,670
require 'spec_helper' describe Admin::RevisionsController do describe '#restore' do it 'does not allow account manager to restore revisions for other account' do account = create(:account) entry = create(:entry) earlier_revision = create(:revision, :frozen, :entry => entry) sign_in(creat...
34.230769
103
0.643446
ab7c64c66c31d869059d474d6beaa9ca38bb2a99
2,352
class Projects::PathLocksController < Projects::ApplicationController include PathLocksHelper include ExtractsPath # Authorize before_action :require_non_empty_project before_action :authorize_push_code!, only: [:toggle] before_action :check_license before_action :assign_ref_vars, only: :toggle before...
24
98
0.705782
62a33f7ed975bffbf65879f9d0614c6faf4c40e7
673
# # Cookbook:: build_cookbook # Recipe:: deploy # # Copyright:: 2017, Corey Hemminger # # 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 # # Un...
33.65
74
0.757801
219161f7fe14edc6aec8f0cdafd7b4bb853224d7
711
Pod::Spec.new do |s| s.name = "Commercetools" s.version = "0.12.3" s.summary = "The e-commerce Swift SDK from commercetools" s.homepage = "https://github.com/commercetools/commercetools-ios-sdk" s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" } s.author ...
37.421053
115
0.635724
26534fb4f0fc1c18996e4185739844c537707450
319
module HealthSeven::V2_5 class MfqM01 < ::HealthSeven::Message attribute :msh, Msh, position: "MSH", require: true attribute :sfts, Array[Sft], position: "SFT", multiple: true attribute :qrd, Qrd, position: "QRD", require: true attribute :qrf, Qrf, position: "QRF" attribute :dsc, Dsc, position: "DSC" end end
35.444444
62
0.708464
b90c350c6209c98b47b0c96e8b6201845278eba7
604
# frozen_string_literal: true module VAOS module V0 class BaseController < ::ApplicationController before_action :authorize protected def authorize raise_access_denied unless current_user.authorize(:vaos, :access?) raise_access_denied_no_icn if current_user.icn.blank? en...
24.16
98
0.701987
4a5e5feab4c15c8a80f2db45ca63a7fafb13e80c
132
# Preview all emails at http://localhost:3000/rails/mailers/auth/notifier class Auth::NotifierPreview < ActionMailer::Preview end
26.4
73
0.795455
2166dbed663382eacb6258415d1b8fa1356f3a64
7,184
# frozen_string_literal: true require 'spec_helper' require 'bolt/applicator' require 'bolt/executor' require 'bolt/inventory' require 'bolt/pal' require 'bolt/puppetdb' require 'bolt/target' describe Bolt::Applicator do let(:uri) { 'foobar' } let(:target) { Bolt::Target.new(uri) } let(:inventory) { Bolt::Inven...
34.047393
114
0.594655
796fb6286ca28ba4d912a25fa064a1f8c989b1a2
35
module Grandstand::UsersHelper end
11.666667
30
0.857143
b9bd39e55754951c4f7b68d04012b955c0407497
581
BlCommons::Engine.routes.draw do post '/bl_resources/:resource_name/sync', to: 'resources#sync' post '/bl_resources/:resource_name/batch_sync', to: 'resources#batch_sync' post '/bl_resources/:resource_name/require_sync', to: 'resources#require_sync' get '/bl_resources/:resource_name', to: 'resources#index' po...
52.818182
80
0.748709
61ffc0e716d63a34b7dde6690581f419a279c201
1,332
# # Cookbook Name:: ossec # Recipe:: client # # Copyright 2010, Opscode, 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 req...
25.615385
76
0.688438