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
ab9f9394dec8620cba435c5ed449dbd03c98feb1
197
class CreateComments < ActiveRecord::Migration[5.0] def change create_table :comments do |t| t.references :post, index: true t.text :content t.timestamps end end end
17.909091
51
0.659898
bfd8537cbdd6bf12baafe16b85988f78cc69809b
541
# given a string, return the character after every letter "r" # # pirates_say_arrrrrrrrr("are you really learning Ruby?") # => "eenu" # pirates_say_arrrrrrrrr("Katy Perry is on the radio!") # => "rya" # pirates_say_arrrrrrrrr("Pirates say arrrrrrrrr") # => "arrrrrrrr" def pirates_say_arrrrrrrrr(string) new_...
31.823529
74
0.693161
0815131b3a24101957e4e1f7f65c723d431f51d4
2,728
Pod::Spec.new do |s| s.name = 'ARAnalytics' s.version = '1.2' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'Use multiple major analytics platforms with one clean simple API.' s.homepage = 'http://github.com/orta/ARAnalytics' s.author = { 'orta' => 'ort...
55.673469
146
0.605205
d5cc58f002ba70ef894753893d51ab470e7d4e27
4,092
require 'twilio-ruby/rest/base_client' module Twilio module REST class LookupsClient < BaseClient API_VERSION = 'v1' DEFAULTS = { host: 'lookups.twilio.com', port: 443, use_ssl: true, ssl_verify_peer: true, ssl_ca_file: File.dirname(__FILE__) + '/../....
34.677966
101
0.609971
ac9c067154f3ee931f8337a5edbf8703806cecac
43
module CryptoPrices VERSION = "0.1.0" end
14.333333
19
0.72093
6a27cfedbc2cb145133a77f0f7bb841721564888
356
cask 'macmoney' do version '3.7.1' sha256 '65c24dafbb957f2f050c10dafe39756f04a1dc12e2d8f3016e00a5347dcb5171' url 'http://www.devon.riceball.net/downloads/macmoney37.zip' name 'MacMoney' homepage 'http://www.devon.riceball.net/display.php?file=m01' license :commercial container :nested => "MacMoney_#{ver...
27.384615
75
0.758427
2129cffcbd43070aea7abcea14076cb1d3799bed
1,077
# メインのサンプルユーザーを1人作成する User.create!(name: "wakaharariku", email: "example@railstutorial.org", password: "riku1123", password_confirmation: "riku1123", admin: true, activated: true, activated_at: Time.zone.now) # 追加のユーザーをまとめて生成する...
28.342105
65
0.618384
3356521a4fd76f596db92612953e41ec7659e80c
2,964
# # Copyright 2015-2016, Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
30.244898
118
0.772267
e892d1f8dbf021d79b75bd8c8deec9149c2674a7
633
class Groups::BoardsController < Groups::ApplicationController include BoardsResponses before_action :assign_endpoint_vars before_action :boards, only: :index def index respond_with_boards end def show @board = boards.find(params[:id]) respond_with_board end private def boards @b...
19.181818
68
0.737757
aba9ce7070bf895bc9c3e489653eb6feb9f6ae50
783
# frozen_string_literal: true module NanoRpc # NanoRpc::Accounts wraps the concept of a set of Nano accounts # * It exposes `addresses` as a persistent attribute # * It exposes accounts-specific RPC methods (such as bulk creation) # * It provides a number of convenience methods via mixins class Accounts ...
26.1
71
0.675607
287dbc193f2b2093b28ee795987d14e9cde50daf
139
require './test/test_helper' class NavigationTest < ActionDispatch::IntegrationTest # test "the truth" do # assert true # end end
17.375
54
0.719424
6aea650a5378bb3469d8099cc6d021746f3dd08b
250
# frozen_string_literal: true class AccessCode < ActiveRecord::Base validates :code, presence: true, uniqueness: true scope :active, -> { where(active: true) } scope :by_code, ->(value) { active.where('lower(code) = ?', value.downcase) } end
27.777778
79
0.696
1dbbd7e1fbe58c888bce9d45c108548331ab12fb
4,798
# frozen_string_literal: true class MyMissingDataError < StandardError end # Calculate scores given the content of a completed response and its questionnaire definition class CalculateScores < ActiveInteraction::Base include ConversionHelper hash :content, strip: false # strip: false means allow all keys hash :...
31.359477
116
0.705294
7a02b369304ba982754518ffedf67c7857a1358d
1,372
=begin #FastAPI #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 0.1.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.0.0 =end module OpenapiClient class ApiError < StandardError attr_re...
23.655172
107
0.611516
112c1eba22e86ba822ab8b7eb014a0d89ac76865
1,217
require Pathname.new(__FILE__).parent.to_s + '/shared_connection_db_helpers' module Marty; module RSpec; module SharedConnection @@classes_to_exclude_from_shared = ['Marty::Log'] mattr_accessor :classes_to_exclude_from_shared EXCL_LAMBDA = lambda { classes_to_exclude_from_shared }.freeze class ActiveRecord::...
30.425
76
0.655711
ac85092eb9d3c15f20cc54ffe611beba4687fd3f
444
# frozen_string_literal: true module Spree module Gallery module ProductGalleryDecorator attr_accessor :viewable_ids def self.prepended(base) def images @images ||= Spree::Image.where(id: @product.variant_images.distinct(false).select(:image_id).group(:image_id).unscope(:order).map...
24.666667
169
0.684685
b958c9170c8c337a12174923558eeea1da3a7bf5
1,835
# # Cookbook Name: zookeeper # Recipe: zookeeper_service.rb # # Copyright (c) 2012 Dell 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...
31.101695
121
0.700272
1a59f44de457acb9e323180397a1872d92f2414c
2,219
require 'httparty' require 'json' module CricApi class Request include HTTParty base_uri 'https://cricketlive.herokuapp.com' def initialize(service, page) @options = { query: {site: service, page: page} } end def cricket self.class.get("/api/cricket", @options) end def match...
18.338843
55
0.521406
1a3f544ac14f942512e131afe2241b131670847b
263
class FakeRSpec @@befores = Hash.new([]) def self.before(scope, &blk) @@befores[scope] << blk end def self.befores @@befores end def self.include(modjewel) super(modjewel) end def self.reset! @@befores = Hash.new([]) end end
13.15
30
0.612167
ffb5d8332124536e007298825f8bc08d16627419
658
#! /usr/bin/env ruby require 'spec_helper' require 'puppet/indirector/run/local' describe Puppet::Run::Local do it "should be a subclass of Puppet::Indirector::Code" do Puppet::Run::Local.superclass.should equal(Puppet::Indirector::Code) end it "should call runner.run on save and return the runner" do ...
29.909091
83
0.715805
1dd16a918e35a41a50faef36d31b7c2611f241d7
138
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_ledger_session'
34.5
76
0.804348
61ec4c51bf732245400afbd9f35374b00183473a
133
class AuthorSerializer < ActiveModel::Serializer attributes :id, :first_name, :last_name, :position, :paper_id end
16.625
48
0.691729
bf2a15c9673ea21b7debb375bfcc35cd1bde2c29
2,454
# server-based syntax # ====================== # Defines a single server with a list of roles and multiple properties. # You can define all roles on a single server, or split them: # server "example.com", user: "deploy", roles: %w{app db web}, my_property: :my_value # server "example.com", user: "deploy", roles: %w{ap...
34.56338
88
0.685819
5de6af7f57f1b7ec417566c24aa415798927fd3a
215
module Critical module OutputHandler end end require 'critical/output_handler/base' require 'critical/output_handler/dispatcher' require 'critical/output_handler/deferred' require 'critical/output_handler/text'
23.888889
44
0.84186
7a74709d32e79bbbabead61f72660f0b037dc148
2,380
require 'spec_helper' module Bosh::Director describe Api::DeploymentManager do let(:deployment) { Models::Deployment.make(name: 'DEPLOYMENT_NAME') } let(:task) { double('Task') } let(:username) { 'FAKE_USER' } let(:options) { {foo: 'bar'} } before do Bosh::Director::Models::DirectorAttribu...
36.615385
146
0.67437
d5c5b1d5fe8773cf502754007f852b0ce06e84c8
355
class ApplicationSerializer < ActiveModel::Serializer attributes :name, :shortname, :archived, :deploy_freeze attribute :status_notes, key: :notes attribute :repo_url, key: :repository_url attribute :default_branch, key: :repository_default_branch attribute :on_aws, key: :hosted_on_aws attribute :cd_enabled...
39.444444
60
0.794366
d5b826f7758ba9564a212649b4e21909bab794c7
129
class ChangeColumnName < ActiveRecord::Migration[6.0] def change rename_column :dailychecklists, :user, :user_id end end
21.5
53
0.75969
ffb935809731702794fcc78ed3aa7043c9a6839b
1,009
module Address class Selling include ActiveModel::Model attr_accessor :cpf, :observation, :cadastre validates :cpf, cpf: true, presence: true validates :observation, presence: true validate :cpf_valid? private def cpf_valid? @cadastre = ::Candidate::Cadastre.find_by_cpf(self.cp...
28.027778
126
0.662042
911588bb69fbfb67035f5dca09aa457bb39ce3c3
861
Given(/^I am viewing the TodoMVC Vue example$/) do visit('http://todomvc.com/examples/vue/') end When(/^I enter a todo$/) do input = find('.new-todo') input.set('Write Future Sync slides') input.native.send_keys(:return) end Then(/^I see my todo in the list$/) do find('.todo-list .todo label', :text => 'Wri...
24.6
72
0.651568
3938feb1ddbec5804c89bbd2b1de5c9906b78e42
239
require 'shopping_cart/engine' module ShoppingCart mattr_accessor :product_class mattr_accessor :user_class def self.product_class @@product_class.constantize end def self.user_class @@user_class.constantize end end
15.933333
31
0.778243
113c745b25aa34804a42b1805da18e8e26f68ef6
523
module Flor class Timer < FlorModel def to_trigger_message d = self.data(false) m = d['message'] m['timer_id'] = self.id sm = d['m'] { 'point' => 'trigger', 'exid' => self.exid, 'nid' => self.onid, 'bnid' => self.nid, 'type' => self.type...
14.942857
36
0.456979
ffc5cbf18059a18d0a60a885eed70caaea4f6863
311
Sequel.migration do change do create_table :product do primary_key :id BigDecimal :price, size: [10, 2] String :description end create_table :line_item do primary_key :id BigDecimal :quantity, size: [10, 2] foreign_key :product_id, :product end end end
19.4375
42
0.639871
1cddc3ef589c17dc368bf75f14edf7ac8ab60dbe
1,110
cask 'unity-ios-support-for-editor@2017.4.14f1' do version '2017.4.14f1,b28150134d55' sha256 :no_check url "https://download.unity3d.com/download_unity/b28150134d55/MacEditorTargetInstaller/UnitySetup-iOS-Support-for-Editor-2017.4.14f1.pkg" name 'iOS Build Support' homepage 'https://unity3d.com/unity/' pk...
30.833333
139
0.714414
2845a49a379bb0e804f556322e1c194104370bd5
237
class CreateGroups < ActiveRecord::Migration[5.2] def change create_table :groups, id: :uuid do |t| t.references :school, foreign_key: true, type: :uuid, index: true t.string :name t.timestamps end end end
21.545455
71
0.658228
03e17b83b906fb092845a2aea4ad5c86aff2d638
8,320
# ----------------------------------------------------------------------------- # # GEOS implementation additions written in Ruby # # ----------------------------------------------------------------------------- module RGeo module Geos module ZMGeometryMethods # :nodoc: include Feature::Instance def...
23.636364
143
0.597837
ace2537fc0ea9e58154ffe3b124dea0b7613789d
1,886
# frozen_string_literal: true module QA module Page module Project module Issue class Index < Page::Base view 'app/helpers/projects_helper.rb' do element :assignee_link end view 'app/views/projects/issues/export_csv/_button.html.haml' do elemen...
26.194444
94
0.600212
e837bc8398051c9f774571db10e8dd65d33e5f01
1,157
require 'spec_helper' describe Mocatra do it 'has a version number' do expect(Mocatra::VERSION).not_to be nil end it "returns ok" do get '/' expect(last_response).to be_ok expect(last_response.body).to eq({"version"=>"1", "result"=>"OK"}.to_json) end it "returns 404 not found" do get '/...
27.547619
91
0.639585
bb0a745a8cda1754787d0cf2ea13e501f3b36bc4
2,688
RSpec.describe 'find pattern' do it 'finds first seven letter word' do words = ["capricious", "berry", "unicorn", "bag", "apple", "festering", "pretzel", "pencil"] found = nil words.each do |word| if word.length == 7 found = word break end end expect(found).to eq("unic...
18.285714
96
0.517857
e9dc89dcca706ee6193b4b4aa3b896c6e8c9f339
106
require '/tmp/kitchen/spec/spec_helper.rb' describe package('httpd') do it { should be_installed } end
17.666667
42
0.745283
e2226d9db927504d7b2af5335016b2fe5c214dbf
5,331
require "active_support/core_ext/integer/time" 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 applica...
44.057851
114
0.765147
4adaed4b37051a446dd7d8490e7763ca969b6740
232
class CreateProducts < ActiveRecord::Migration def self.up create_table :products do |t| t.string :name, :limit => 255, :null => false t.timestamps end end def self.down drop_table :products end end
17.846154
51
0.655172
265cf9071eb1d511b57b9f290739c3fe7c9bdb77
5,081
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'net/ssh' class MetasploitModule < Msf::Auxiliary include Msf::Auxiliary::Scanner include Msf::Auxiliary::Report include Msf::Auxiliary::CommandShell include Msf::E...
26.05641
85
0.599882
62a6b0e0eca3e30a13e9110c022dc7b51810ddc3
101
module InfluxDB module Arel module Nodes class In < Equality end end end end
11.222222
25
0.613861
7adfed2e716d044ad13070f0431fae722b091cae
1,139
require "spec_helper" describe Multiblock::Wrapper do let(:wrapper) { described_class.new } it "should register block" do wrapper.foo { "foo" } wrapper.call(:foo).should == "foo" end it "should call registered block by String" do wrapper.foo { "foo" } wrapper.call("foo").should == "foo...
23.729167
91
0.67691
4ad240992b2abf6f4cc57d9798001de9698ab29e
639
# frozen_string_literal: true Capybara::SpecHelper.spec '#frame_title', requires: [:frames] do before do @session.visit('/within_frames') end it 'should return the title in a frame' do @session.within_frame('frameOne') do expect(@session.driver.frame_title).to eq 'This is the title of frame one' ...
26.625
80
0.704225
1ad070de1eaa3d505b411eabd99e39c441ed672a
2,185
# frozen_string_literal: true require 'spec_helper' require Rails.root.join( 'db', 'migrate', '20200831222347_insert_project_feature_flags_plan_limits.rb' ) RSpec.describe InsertProjectFeatureFlagsPlanLimits do let(:migration) { described_class.new } let(:plans) { table(:plans) } let(:plan_limits) { table...
26.975309
87
0.639359
bbb29e5b2bf6eb177aa98c6deeeacaee3c94a1ab
40
module SnowSync VERSION = "3.1.6" end
10
19
0.675
ed8cb9f40fb03d93c6a9c8b0a22a03d2d2108b3e
687
class Allocator attr_reader :registers def initialize @registers = [] end def size @registers.size end def allocate(value, at=nil) return allocate_value_at(value, at) if at register = @registers.select { |r| r.free? }.first || grow register.value = value @registers.index register ...
14.3125
62
0.62591
4a84759210a4a768b76b70408e9d04e2ef540812
562
# frozen_string_literal: true module RTask module TaskStatus # The task has been initialized but has not yet been scheduled. CREATED = 'created' # The task has been scheduled for execution but has not yet begun executing. PENDING = 'pending' # The task is running but has not yet completed. ...
23.416667
80
0.688612
edc2a9df0a9f095538bb6c637b35a35c8f30dbcd
1,125
Pod::Spec.new do |s| s.name = "ActionCableClient" s.version = "0.2.5.1" s.summary = "A Swift client for the Rails ActionCable WebSocket server." s.description = <<-DESC ActionCable is a new WebSocket server being released with Rails 5 which makes it easy to add real-time fea...
46.875
257
0.651556
21c641e819c76e1c1a60bf91f6e9f7c7f79d9cec
3,173
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) $LOAD_PATH.unshift File.expand_path("../..", __FILE__) # Needs to be required and started before danger require "simplecov" SimpleCov.start do add_filter "/spec/" end require "danger" require "webmock" require "webmock/rspec" require "json" Dir["spec/suppo...
24.596899
80
0.720769
3846394b81a22ed69fab988c1982ba15401dc343
4,777
require 'json' require 'salus/scanners/node_audit' # Yarn Audit scanner integration. Flags known malicious or vulnerable # dependencies in javascript projects that are packaged with yarn. # https://yarnpkg.com/en/docs/cli/audit module Salus::Scanners class YarnAudit < NodeAudit # the command was previously 'yar...
31.635762
93
0.59305
2106401b1b48de541474a9202c4dd06cc924fc63
2,390
# frozen_string_literal: true module RuboCop module Cop module Style # Enforces that optional keyword parameters are placed at the # end of the parameters list. # # This improves readability, because when looking through the source, # it is expected to find required parameters at th...
31.447368
98
0.60795
38da647885d3146cc5a27bfc9e9d5fc1f37c4613
1,286
# frozen_string_literal: true require 'singleton' module Apress module Api module Callbacks class Config include Singleton class << self delegate :add_service, :services, to: :instance delegate :allowed_client?, :add_client, to: :instance delegate :add_handler...
22.172414
72
0.550544
5d6036b4ea62b658412f9f10e1fa4564408edfb0
805
# frozen_string_literal: true module Valkyrie::Persistence::Postgres module ORM # ActiveRecord class which the Postgres adapter uses for persisting data. # @!attribute id # @return [UUID] ID of the record # @!attribute metadata # @return [Hash] Hash of all metadata. # @!attribute created_a...
28.75
79
0.667081
e81b77ccc5649186cee84538b5a84c25b035f11d
979
set :application, 't4c' set :repo_url, 'git@github.com:sigmike/code4gamecredits.git' # ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } set :deploy_to, "/home/apps/p4c" set :scm, :git set :rvm_type, :user set :rvm_ruby_version, '2.0.0-p247' set :rvm_custom_path, '~/.rvm' set :format, :pretty # set :log...
22.25
63
0.663943
873068f9eb7652f4244a10e961625335369f4274
256
# frozen_string_literal: true module Interactive class Render def initialize(item) @item = item end def call " id:#{@item.id}\n\n done:\n#{@item.done}\n\n title:\n#{@item.title}\n\n body:\n#{@item.body}" end end end
16
104
0.59375
6a26eae2a3e73901b17f48e4d0a94a29be7e842d
13,129
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmat...
49.357143
154
0.75139
ab6e8bd85b91a8f7efe901175f169c6525f79637
604
require 'test_helper' module Elasticsearch module Test class XPackLicenseDeleteTest < Minitest::Test context "License: Delete" do subject { FakeClient.new } should "perform correct request" do subject.expects(:perform_request).with do |method, url, params, body| asse...
22.37037
79
0.614238
212a698b2018263042bad556d6e0e25eecdc3f83
2,783
# -*- encoding: utf-8 -*- # stub: selenium-webdriver 3.142.7 ruby lib Gem::Specification.new do |s| s.name = "selenium-webdriver".freeze s.version = "3.142.7" s.required_rubygems_version = Gem::Requirement.new("> 1.3.1".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "changelog_uri" => "ht...
52.509434
207
0.678764
e962c04383a13d1eee5e3816401c24fd59f43e35
34,319
# frozen_string_literal: true # = net/smtp.rb # # Copyright (c) 1999-2007 Yukihiro Matsumoto. # # Copyright (c) 1999-2007 Minero Aoki. # # Written & maintained by Minero Aoki <aamine@loveruby.net>. # # Documented by William Webber and Minero Aoki. # # This program is free software. You can re-distribute and/or # modify...
30.210387
190
0.631487
e9c24bf97261c7b49977c900fb073758b4ea840a
138
require 'rails_helper' RSpec.describe AdminSignupNotifierJob, type: :job do pending "add some examples to (or delete) #{__FILE__}" end
23
56
0.768116
1c077cf2e63eed077d01e9b201bf0e7f1bd3a668
963
# frozen_string_literal: true module ZohoHub # Adds the ability to do API requests (GET / PUT and POST requests) when included in a class. module WithConnection def self.included(base) base.extend ClassMethods end module ClassMethods def get(path, params = {}) ZohoHub.connection.ge...
21.4
95
0.61163
26cc4b6586aea0ee8a94079eceb41e70f2ad4bb7
10,062
=begin Wallee API: 1.0.0 The wallee API allows an easy interaction with the wallee web service. 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...
46.155963
210
0.731962
627680e28d77dd29d4a63573e772d20a5a941fce
20,888
require 'puppet/face' require 'puppet/pops' require 'puppet/parser/files' require 'puppet/file_system' Puppet::Face.define(:epp, '0.0.1') do copyright "Puppet Inc.", 2014 license _("Apache 2 license; see COPYING") summary _("Interact directly with the EPP template parser/renderer.") action(:validate) do ...
39.560606
152
0.665933
5dce82adfd0f8c4739c5433949ac2345b9fff06b
28,282
# frozen_string_literal: true Prawn::Font::AFM.instance_variable_set :@hide_m17n_warning, true require 'prawn/icon' Prawn::Icon::Compatibility.send :prepend, (::Module.new { def warning *args; end }) module Asciidoctor module Prawn module Extensions include ::Asciidoctor::PDF::Measurements include ::Asciidoctor:...
31.459399
116
0.697511
e9b6824d84613d12ee34a3427137afeeade6c6be
23
module PoniesHelper end
11.5
19
0.913043
ab623b6ae69cedbe693c73febf3907652559e415
2,693
# # Cookbook Name:: ipfs # Recipe:: default # # The MIT License (MIT) # # Copyright:: 2018, Kosmos Developers # # 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 ...
30.602273
87
0.712217
bb951b05b59dc2fa3279faed2d71d992021c4ced
97
class IngredientsProduct < ApplicationRecord belongs_to :product belongs_to :ingredient end
16.166667
44
0.824742
b94ba0f6cff7de69ee07dcb46474e7c21779236c
285
class NOVAHawk::Providers::Google::CloudManager::MetricsCollectorWorker < NOVAHawk::Providers::BaseManager::MetricsCollectorWorker require_nested :Runner self.default_queue_name = "google" def friendly_name @friendly_name ||= "C&U Metrics Collector for Google" end end
25.909091
73
0.778947
f776a4278b6876be7ea3b3be833e3f370e036cbb
198
module XingApi class User class BusinessAddress < XingApi::Base def self.update(options = {}) request(:put, '/v1/users/me/business_address', options) end end end end
19.8
63
0.641414
1d6a4c8df9772b0c0bceaa8cbaf1944741adf8e6
1,621
class ListingRequestsController < ApplicationController skip_before_action :authenticate_user #, only: [:show, :create] def create @pet = Pet.find(request_params.dig(:pet, :pet_id)) render_unprocessable unless current_user && @pet if @pet @listing_requests = Listing...
27.474576
86
0.61752
fff81f3247b073cfd60de25bf0419cfc08687308
9,951
# frozen_string_literal: true require 'spec_helper' require 'et_azure_insights/trace_parent' RSpec.describe EtAzureInsights::TraceParent do subject(:trace_parent) { described_class } describe '.parse' do it 'should return a TraceParent' do result = trace_parent.parse('00-4bf92f3577b34da6a3ce929d0e0e4736...
57.854651
169
0.569993
7983a7220396ff0427cc06c525e38966a40b7a14
1,327
require_relative "macho/structure" require_relative "macho/view" require_relative "macho/headers" require_relative "macho/load_commands" require_relative "macho/sections" require_relative "macho/macho_file" require_relative "macho/fat_file" require_relative "macho/exceptions" require_relative "macho/utils" require_rela...
32.365854
80
0.730972
0891fc42a01bdf43ff8a1f9fffa9f9c431621523
1,535
Winnipegrb::Application.configure do # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web...
36.547619
84
0.77785
1c111d533b8e51a25d01331db3166f64f536579c
2,780
require 'colored' require "cloudpad/version" require "cloudpad/task_utils" require "cloudpad/cloud" require "cloudpad/docker" require "cloudpad/kube" require "active_support/core_ext" module Cloudpad def self.gem_context_path File.expand_path("../../context", __FILE__) end def self.context=(ctx) @conte...
30.888889
118
0.669784
ed1b1a459bfcae0ac10bc8c1cc42145b3de65013
129
RSpec.describe AdventOfCode2020 do it "has a version number" do expect(AdventOfCode2020::VERSION).not_to be nil end end
18.428571
51
0.75969
acdd11ec5c090a58932229898c6dc301e23064cb
1,733
#!/usr/bin/env ruby require 'net/http' require 'json' issuenumber = '' issuetitle = '' issuestatus = '' currentindex = 0 maxindex = 0 totalnumberofrecords = 0 repos_issues = Array.new numberofrecordstodisplay = 7 #plus 1 = 10 #Fetch data every 5 minutes SCHEDULER.every '5m', :first_in => 0 do |job| http = Net::HTTP...
29.87931
116
0.6809
01cf1965088b736b29f2263dfd84a8f29b28ca17
185
default_unless['sys']['updatedb']['prunebindmounts'] = String.new default_unless['sys']['updatedb']['prunepaths'] = String.new default_unless['sys']['updatedb']['prunefs'] = String.new
46.25
65
0.724324
ff4459dc696f6b0f3e5519fa1774c8b7ae4e7f2b
6,572
require 'minitest' def run_spec_test(test_case, options = {}) if test_case.todo? skip "Skipped todo" unless options[:run_todo] end assert_filename_length!(test_case.input_path, options) assert_filename_length!(test_case.expected_path, options) assert File.exists?(test_case.input_path), "Input #{test_ca...
33.876289
170
0.617012
79d66d040c4cc15327ebaf33116ee1ec20f3a351
177
FactoryBot.define do factory :confirmed_user, parent: :user do confirmed_at { Time.now } confirmation_sent_at { Time.now } confirmation_token { '12345' } end end
25.285714
43
0.711864
21f2c2d7d44cdc253f6b8f4bfe66af7644219392
177
RSpec.describe Heroes do it "has a version number" do expect(Heroes::VERSION).not_to be nil end it "does something useful" do expect(false).to eq(true) end end
17.7
41
0.694915
91a82c50c1c672bf80fece7248a90ebb13229053
1,140
cask 'microsoft-r-open' do version '3.4.3' sha256 '4998500839389821f995d3ebb89ee7e8e5a35a61a63ba0ac54d63adf53288947' # mran.blob.core.windows.net was verified as official when first introduced to the cask url "https://mran.blob.core.windows.net/install/mro/#{version}/microsoft-r-open-#{version}.pkg" name 'Mi...
33.529412
97
0.513158
1138106b8066cecc523e2c6fcbc3cf15e490ab25
907
require 'test_helper' class Abilities::ImpersonateTest < ActiveSupport::TestCase def setup @provider = FactoryBot.create :provider_account end test "master admin cannot impersonate provider accounts without 3scale admin user" do user = Account.master.admins.first assert_cannot Ability.new(user), :i...
31.275862
104
0.768467
1175b6cc16981e845b484805ec3f4feb4bd30db6
2,758
# encoding: UTF-8 # This file contains data derived from the IANA Time Zone Database # (http://www.iana.org/time-zones). module TZInfo module Data module Definitions module America module Cancun include TimezoneDefinition timezone 'America/Cancun' do |tz| ...
40.558824
66
0.563452
6131c3b55db1c63f3dd5ee5e0ddf474234403da6
2,599
# # specifying flor # # Wed May 31 05:14:14 JST 2017 圓さんの家 # require 'spec_helper' describe 'Flor procedures' do before :each do @executor = Flor::TransientExecutor.new end describe 'length' do it 'returns the length of its argument' do r = @executor.launch( %q{ [ ...
21.658333
76
0.442093
8777c00b397f18f94618489d333911131f73e50c
4,389
class Msitools < Formula desc "Windows installer (.MSI) tool" homepage "https://wiki.gnome.org/msitools" url "https://download.gnome.org/sources/msitools/0.100/msitools-0.100.tar.xz" sha256 "bbf1a6e3a9c2323b860a3227ac176736a3eafc4a44a67346c6844591f10978ea" license "GPL-2.0" livecheck do url :stable e...
39.540541
103
0.663021
bb24501912c988e83e7d26935868859f7adf1d67
318
# frozen_string_literal: true require_relative "./laughter_break/joke" require_relative "./laughter_break/api" require_relative "./laughter_break/cli" require_relative "./laughter_break/version" require "pry" require "httparty" module LaughterBreak class Error < StandardError; end # Your code goes here... end
21.2
43
0.789308
080a6199940478426e7ebeeaad05649191e9dae2
185
# frozen_string_literal: true control 'arvados workbench package' do title 'should be installed' describe package('arvados-workbench') do it { should be_installed } end end
18.5
42
0.745946
9109e2db2b27f67927d2d17db883d36958bd6ca9
697
class AddCreatorToPlans < ActiveRecord::Migration[6.0] class Plan < ActiveRecord::Base; end class Member < ActiveRecord::Base; end class User < ActiveRecord::Base; end def change change_table :plans do |t| t.bigint :creator_id, foreign_key: true end Plan.all.each do |plan| default_crea...
30.304348
98
0.711621
912361eab7af60c844c1ad21fc32029927bd0104
650
class AppDelegate def applicationDidFinishLaunching(notification) buildMenu buildWindow end def buildWindow @mainWindowController = MainWindowController.alloc.initWithWindowNibName('MainWindowController') @mainWindowController.window.makeKeyAndOrderFront(self) end end class MainWindowControll...
20.967742
100
0.763077
381465cb089cb569a03992042ee5230c83f7a304
337
# return.rb def add_three(number) return number + 3 number + 4 end returned_value = add_three(4) #stores the result of the method (with 4 passed in as an argument) into the variable returned_value puts returned_value #prints the variable returned_value def just_assignment(number) foo = number + 3 end puts j...
22.466667
131
0.768546
91a55514a9a64d5d57e2425379ccf4895ac9d625
970
# Base class for deployment services # # These services integrate with a deployment solution like Kubernetes/OpenShift, # Mesosphere, etc, to provide additional features to environments. class DeploymentService < Service default_value_for :category, 'deployment' def self.supported_events %w() end def pred...
28.529412
80
0.626804
e99404153b6d67dd115023d1becbe9b94ff6c468
1,326
# Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
34.894737
84
0.735294
e2da4e83973ce2faad119788bb101e6e814be7ab
439
require 'rails_helper' # Specs in this file have access to a helper object that includes # the SummaryHelper. For example: # # describe SummaryHelper do # describe "string concat" do # it "concats two strings with spaces" do # expect(helper.concat_strings("this","that")).to eq("this that") # end # en...
27.4375
71
0.703872
035e1cdcdd601fe76a301e9037c0c04b5c113336
194
# frozen_string_literal: true RSpec.describe(BetterGraphQL) do describe '.VERSION' do it 'returns version number' do expect(BetterGraphQL::VERSION).not_to(be(nil)) end end end
21.555556
52
0.721649
e95a962f392c1ffd15153036ce5a68ae00f8edec
245
module Departure class ConnectionBase < ActiveRecord::Base def self.establish_connection(config = nil) super.tap do ActiveRecord::Base.connection_specification_name = connection_specification_name end end end end
24.5
88
0.742857
ffe4c7376f43eb59286eebb7558ad1ca59887965
1,471
class DeviseCreateUsers < ActiveRecord::Migration def change create_table(:users) do |t| ## Database authenticatable t.string :email, :null => false, :default => "" t.string :encrypted_password, :null => false, :default => "" ## Recoverable t.string :reset_password_to...
31.978261
94
0.645139
87b697956adce76725c6752f679cf15a441f9add
816
require 'ebay/types/pagination' module Ebay # :nodoc: module Requests # :nodoc: # == Attributes # text_node :item_id, 'ItemID', :optional => true # text_node :best_offer_id, 'BestOfferID', :optional => true # text_node :best_offer_status, 'BestOfferStatus', :optional => true # object_node :pa...
35.478261
85
0.682598
ed4cdcc52abf74d4baa01f4b292d8cc6bb4d4452
1,416
require File.expand_path("../../helpers", __FILE__) class ScannerMeta < Test::Unit::TestCase tests = { 'abc??|def*+|ghi+' => { 0 => [:literal, :literal, 'abc', 0, 3], 1 => [:quantifier, :zero_or_one_reluctant, '??', 3, 5], 2 => [:meta, :alternation, ...
34.536585
70
0.440678