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
5d1195c92f937ccae40233a03fd941b3e0d71450
1,363
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'ua_parser/version' Gem::Specification.new do |spec| spec.name = "ua_parser" spec.version = UAParser::VERSION spec.authors = ["Jason Meller"] spec.email = ["ja...
35.868421
96
0.661775
e91b259b8ffe7a81483cc110aa8585c687df1248
3,051
# frozen_string_literal: true require "bindata" require "webauthn/authenticator_data/attested_credential_data" require "webauthn/error" module WebAuthn class AuthenticatorDataFormatError < WebAuthn::Error; end class AuthenticatorData < BinData::Record RP_ID_HASH_LENGTH = 32 FLAGS_LENGTH = 1 SIGN_COUN...
23.290076
93
0.709276
910e17e0613c7f658adb131241b8f72f28e0ec69
9,984
# # Filename:: alertmanager_spec.rb # Description:: Verifies alertmanager recipe(s). # # Author: Elijah Caine <elijah.caine.mv@gmail.com> # require 'spec_helper' # Caution: This is a carbon-copy of default_spec.rb with some variable replacements. describe 'prometheus::alertmanager' do let(:chef_run) do ChefSpe...
36.841328
123
0.646635
4aeda6e643a3b61937982e33ab0dfde710ed64eb
2,602
describe 'Updating System Level Groups', js: true do context 'when editing a system level group as an admin' do before :all do @group_name = random_group_name @group_description = random_group_description @group = create_group( name: @group_name, description: @group_description,...
32.525
91
0.659877
1ae45a41e2dbe924ff0c59dcf4e150a650476ae0
6,625
require_relative '../../test_helper' describe Spinach::Runner::FeatureRunner do let(:feature) { stub('feature', name: 'Feature', scenarios: [], background_steps: [] ) } subject{ Spinach::Runner::FeatureRunner.new(feature) } describe '#initialize' do it 'initializes...
34.149485
98
0.61917
4a010a5c30ddedb83647666cd9c9aeb02f233c45
132
FactoryBot.define do factory :work do title { ["Work"] } access_control skip_create override_new_record end end
14.666667
23
0.681818
110ea87c20364015309c04d1cb1d32ce5528e53c
3,714
class OpensshAT78 < Formula desc "OpenBSD freely-licensed SSH connectivity tools" homepage "https://www.openssh.com/" url "https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.8p1.tar.gz" mirror "https://mirror.vdms.io/pub/OpenBSD/OpenSSH/portable/openssh-7.8p1.tar.gz" version "7.8p1" revision 1 ...
30.95
133
0.640819
01152a55314484bd971b34b865c11e9f4161a9ad
1,089
# frozen_string_literal: true module Spandx module Ruby class Index include Enumerable attr_reader :directory, :name, :rubygems def initialize(directory:) @directory = directory @name = 'rubygems' @cache = ::Spandx::Core::Cache.new(@name, root: directory) @ruby...
20.54717
72
0.515152
089c7a9db9410875eec33e5afb2c1ef8fbad812f
508
eu_vat = Spree::Zone.find_or_create_by!(name: "EU_VAT", description: "Countries that make up the EU VAT zone.") north_america = Spree::Zone.find_or_create_by!(name: "North America", description: "USA + Canada") %w(PL FI PT RO DE FR SK HU SI IE AT ES IT BE SE LV BG GB LT CY LU MT DK NL EE). each do |symbol| eu_vat.zo...
42.333333
111
0.732283
f7d1f93dffb6951ff90dd49eaaf12dfee77bf3dc
945
class Exploitdb < Formula desc "The official Exploit Database" homepage "https://www.exploit-db.com/" url "https://github.com/offensive-security/exploitdb.git", :tag => "2019-11-20", :revision => "72cddaee5157cd67d25653f16b34790b074cd680" version "2019-11-20" head "https://github.com/offensiv...
28.636364
77
0.65291
e9a87e7ac95c4485932a8a084552c540fc326051
982
require 'spec_helper' require 'autoscaler/heroku_scaler' describe Autoscaler::HerokuScaler, :online => true do let(:cut) {Autoscaler::HerokuScaler} let(:client) {cut.new} subject {client} its(:workers) {should == 0} describe 'scaled' do around do |example| client.workers = 1 example.yield ...
22.318182
70
0.641548
e9851eacdf61e6afead2bd3f449e8b46874161b0
6,402
require 'test_helper' class RemotePinTest < Test::Unit::TestCase def setup @gateway = PinGateway.new(fixtures(:pin)) @amount = 100 @credit_card = credit_card('5520000000000000', :year => Time.now.year + 2) @visa_credit_card = credit_card('4200000000000000', :year => Time.now.year + 3) @declined_...
33.873016
127
0.728054
e2c1c604d4ff6b496f3ba387b20052929a38d050
555
require 'travis/cli/setup' module Travis module CLI class Setup class CloudFiles < Service description "automatic pushing to Rackspace Cloud Files" def run deploy 'cloudfiles' do |config| config['username'] = ask("Rackspace Username: ").to_s config['api_ke...
26.428571
84
0.567568
f77013251c54002523172c6b0b5f23927f1d97c9
9,745
=begin #Kleister OpenAPI #API definition for Kleister, manage mod packs for Minecraft The version of the OpenAPI document: 1.0.0-alpha1 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.1.0 =end require 'date' require 'time' module Kleister class Build attr_accessor :id attr_acc...
28.328488
193
0.594253
1a556c0346fd5a48b0e922798cc93d53e3378ca9
825
require_relative "../canvas_base_input_type" module LMSGraphQL module Types module Canvas class CanvasCreatedEventDatumInput < BaseInputObject description "Course Audit log. API Docs: https://canvas.instructure.com/doc/api/course_audit_log.html" argument :name, [String], "Example: , Course...
45.833333
144
0.716364
878f8809a172369e3714de181ed335cc4ef27848
1,618
# frozen_string_literal: true require 'recursive-open-struct' require_relative '../concerns/currencyable' require_relative '../concerns/environmentable' require_relative '../concerns/humanizeable' require_relative '../concerns/terminalable' require_relative '../gemini_api/get' require_relative '../gemini_api/post' mo...
31.72549
165
0.754635
1aa07fd07b693234d4c44ff2147ea18dd55531f9
3,543
# -*- encoding: utf-8 -*- # stub: sprockets 3.5.2 ruby lib Gem::Specification.new do |s| s.name = "sprockets" s.version = "3.5.2" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.require_paths = ["lib"] s.authors = ["Sam Stephenson", "Joshua Peek"] ...
44.848101
150
0.607113
03c542d458e42223fbbe060add6bf7a80be56331
302
# frozen_string_literal: true module AcaEntities module Medicaid module Atp # entity for atp MedicaidMagiFormerFosterCareEligibilityBasis class MedicaidMagiFormerFosterCareEligibilityBasis < EligibilityBasis # Additional attributes, if necessary end end end end
21.571429
75
0.758278
f8d5d8a595b35e027df175c86bf6cf1ccd9e9ba2
896
require 'pry' tries = 3 random_number = rand(1..10) binding.pry puts "What is your name?" name = gets.strip puts "Hello" + " " + name + "!" puts "Want to play a game, " + name + "?" answer = gets.strip.downcase if answer == "yes" print 'Great!' loop do print "I'm thinking of a number..." print ...
22.4
83
0.554688
081e15f2fb28b76b3aa890c07c3b44a2f464f1f6
8,022
module Selenium module WebDriver module Support class Select # # @param [Element] element The select element to use # def initialize(element) tag_name = element.tag_name unless tag_name.downcase == "select" raise ArgumentError, "unexpected t...
27.285714
128
0.538893
ff8db76f8c47605674d666a5dd6c3db8bc65609c
16,257
#!/usr/bin/env rspec require 'spec_helper' MCollective::PluginManager.clear require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/connector/stomp.rb' module MCollective module Connector describe Stomp do before do unless ::Stomp::Error.constants.map{|c| c.to_s}.include?("NoCurren...
38.707143
137
0.550101
ff8c9578c084c0e6d590d82828b1c8ce57ebf884
3,037
## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # web site for more information on licensing and terms of use. # http://metasploit.com/ ## require 'msf/core' class Metasploit3 < Msf::Auxiliary include Msf::Exploit::Ca...
21.848921
86
0.648996
6292e1dd8a0e1a96dacc8790d3698ca2c762f9b2
42
module SendWithUs VERSION = '4.1.0' end
10.5
19
0.690476
1d85ada1324aac744066a5a4546c3de217da76b8
239
class CreateResponseCacheMaps < ActiveRecord::Migration def change create_table :response_cache_maps do |t| t.integer :origin_id t.integer :target_id t.integer :response_set_id t.timestamps end end end
19.916667
55
0.707113
e8f60eb9e27fae0ab2a36f16072696aabf33b6a2
3,008
=begin #OpenAPI Petstore #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.0.0-SNAPSHOT =en...
34.574713
165
0.688497
6288dbc49c9c6f943b3bcb55ab5604be1649e3d3
2,745
require './lib/token' class Lexer TOKENS = { # keywords, current list was taken from java # and does not match the final keyword list if: 'if', elif: 'elif', else: 'else', while: 'while', for: 'for', do: 'do', return: 'return', boolean: 'bool', int: 'int', void: 'void', class: 'class', new: 'ne...
26.911765
80
0.553005
ac2b8c21e0e4407161648f8abb67da386f897cb0
1,847
class Libbdplus < Formula desc "Implements the BD+ System Specifications" homepage "https://www.videolan.org/developers/libbdplus.html" url "https://download.videolan.org/pub/videolan/libbdplus/0.1.2/libbdplus-0.1.2.tar.bz2" mirror "https://ftp.osuosl.org/pub/videolan/libbdplus/0.1.2/libbdplus-0.1.2.tar.bz2" ...
36.215686
93
0.709258
5d9731cddf6029f3a06647d3a8df2eeaa5e3eb55
6,857
module ChatWork::Client::RoomMethods # Get the list of all chats on your account # # @see http://developer.chatwork.com/ja/endpoint_rooms.html#GET-rooms # @see http://download.chatwork.com/ChatWork_API_Documentation.pdf # # @yield [response_body, response_header] if block was given, return response body and...
43.675159
137
0.674347
f89666167193af84a4e5638d1b98d8853f7ff961
3,408
# frozen_string_literal: true require 'uri' require 'http' RSpec.describe HTTP::Tracer do context 'without instrumentation' do it 'does not add headers' do uri = URI('http://localhost:3000') opts = HTTP::Options.new client = HTTP::Client.new allow(client).to receive(:request) cli...
28.881356
75
0.620012
bfadfb7af38ad46d2c0fdca40b65707c72b1564f
6,908
module RedCloth::Formatters::HTML include RedCloth::Formatters::Base [:h1, :h2, :h3, :h4, :h5, :h6, :p, :pre, :div].each do |m| define_method(m) do |opts| "<#{m}#{pba(opts)}>#{opts[:text]}</#{m}>\n" end end [:strong, :code, :em, :i, :b, :ins, :sup, :sub, :span, :cite].each do |m| define_...
19.965318
116
0.490735
01a6ad491ab1d0d08e7fa4fbb1862fd14382e0ac
2,330
class Supervisor < Formula include Language::Python::Virtualenv desc "Process Control System" homepage "http://supervisord.org/" url "https://files.pythonhosted.org/packages/b3/41/2806c3c66b3e4a847843821bc0db447a58b7a9b0c39a49b354f287569130/supervisor-4.2.4.tar.gz" sha256 "40dc582ce1eec631c3df79420b187a6da27...
31.486486
138
0.695279
d5e02409726d8c1aefc605e47ea01c85ca8a128b
744
class Company < ActiveRecord::Base belongs_to :user belongs_to :industry has_many :job_descriptions, dependent: :destroy has_many :activities, as: :trackable, dependent: :destroy has_many :applicants, dependent: :destroy validates :company_name, :clientname, :role, :email, :phonenumber, :about, presence: t...
21.257143
102
0.706989
03675f2f729c68cd9ee00c37a232876c985f5b20
2,757
module Geminabox class GemStore attr_accessor :gem, :overwrite def self.create(gem, overwrite = false) gem_store = new(gem, overwrite) gem_store.save end def initialize(gem, overwrite = false) @gem = gem @overwrite = overwrite && overwrite == 'true' end def save ...
27.57
163
0.670294
bb8ce7367a349e16118cf98cd2905f6b9ecbd5ff
460
class ApplicationController < ActionController::Base protect_from_forgery def current_user @current_user ||= User.find(session[:user_id]) if session[:user_id] end helper_method :current_user def authenticate! unless current_user redirect_to(login_url, alert: "Anmeldung erforderlich.") and ret...
20.909091
73
0.732609
26c7f1935625e1614d012ce5ebf703331c9871bf
283
require 'flynn-schema/version' module FlynnSchema def self.dir @dir ||= File.expand_path(File.join(__FILE__, '..', '..')) end def self.paths @paths ||= Dir[File.join(dir, '**', '*.json')].reject do |path| path.index(File.join(dir, 'lib', '')) end end end
20.214286
67
0.59364
e9e854b0928f1d89334405d0ad4a0d41aa9dd762
2,145
class Hspell < Formula desc "Free Hebrew linguistic project" homepage "http://hspell.ivrix.org.il/" url "http://hspell.ivrix.org.il/hspell-1.4.tar.gz" sha256 "7310f5d58740d21d6d215c1179658602ef7da97a816bc1497c8764be97aabea3" license "AGPL-3.0-only" livecheck do url "http://hspell.ivrix.org.il/download....
35.163934
96
0.713287
2127c787cba2144aff9161c592317d35431cf388
304
module IronWorkerNG module Code module Runtime module Mono include IronWorkerNG::Feature::Common::MergeExec::InstanceMethods def runtime_run_code(local, params) <<RUN_CODE mono #{File.basename(@exec.path)} #{params} RUN_CODE end end end end end
19
73
0.651316
ff6897e741cef54b67985b7cf8f07225172a35be
3,100
# encoding: UTF-8 # 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 sou...
44.285714
148
0.706452
e2ad06c4e52bcf23b7944b1e6394609826582aea
1,794
module Tronprint # The Statistics class is your gateway to fetching statistics about # the energy usage and footprint of your app. class Statistics attr_accessor :aggregator, :cpu_monitor def initialize(aggregator, cpu_monitor) self.aggregator = aggregator self.cpu_monitor = cpu_monitor ...
29.9
104
0.697882
abec44dc8b6ff470d3495cf25a732849fa0160e9
199
module Jinaki module Helper module Slack private def slack_webhook @slack_webhook ||= ::Slack::Incoming::Webhooks.new(ENV['SLACK_WEBHOOK_URL']) end end end end
16.583333
84
0.638191
913728a5980cfaad2eabc667004408bdead0bc88
7,038
=begin #OpenAPI Petstore #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.3.2-SNAPHOT =end...
29.696203
202
0.62262
bb52e12d8c8fde058f2fc769412a06dc185fba13
317
#!/usr/bin/env ruby $: << File.expand_path('lib') <%= run sq(<<-'rb') require 'cl' class Add < Cl::Cmd register :add opt '--to GROUP', type: :array def run p to end end rb -%> <%= run "Cl.new('owners').run(%w(add --to one --to two))" %> <%= out '["one", "two"]' %>
14.409091
60
0.463722
e9b8ee216f842b4fcc29b54c91ad23d8132d18ca
937
module Observee class Daemon class << self def run Observee.config.observers.each do |observer_data| observer_data = observer_data.map{ |k, v| [k.to_sym, v] }.to_h @supervisor = Observer.supervise(args: [observer_data]) end timers = Timers::Group.new time...
18.372549
72
0.532551
ab187f26fa31ffd6c6137c9a7998e38e35657c03
1,902
# -*- encoding: utf-8 -*- # stub: http_parser.rb 0.6.0 ruby lib # stub: ext/ruby_http_parser/extconf.rb Gem::Specification.new do |s| s.name = "http_parser.rb".freeze s.version = "0.6.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_pa...
43.227273
124
0.684543
bbf409e37d2e45dee0c61ecbbd64cf66ab9ef769
5,892
# frozen_string_literal: true require "rails_helper" describe "Signup feature" do before do create(:admin) APP_CONFIG["first_user_admin"] = { "enabled" => true } APP_CONFIG["signup"] = { "enabled" => true } visit new_user_registration_url end let!(:registry) { create(:registry) } le...
35.493976
89
0.702817
e293ea7d7fdffa3ccfbba7fa22e84a99aea46aa6
723
require_relative "boot" require "csv" require "rails/all" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module InventoryApp class Application < Rails::Application # Initialize configuration defaults for originall...
30.125
79
0.738589
b910c14989b2a2813a53a219172ef096e71032b1
390
require 'spec_helper' describe Spree::Chimpy::SubscribersController do let(:spree_chimpy_subscriber) { create(:subscriber) } let(:valid_attributes) { attributes_for(:subscriber) } context '#create' do it 'raise error when empty hash found' do expect { post :create, params: { chimpy_subscriber: {} } }...
27.857143
115
0.730769
5da70cfa38040ab4a712bb1a12f0eff690991681
51
module SpreePagarmePayment VERSION = "0.0.1" end
12.75
26
0.745098
330b3db8096db80cb6aaf1fde121a7a1740a8969
31,379
# -*- encoding: utf-8 -*- # HTTPClient - HTTP client library. # Copyright (C) 2000-2015 NAKAMURA, Hiroshi <nahi@ruby-lang.org>. # # This program is copyrighted free software by NAKAMURA, Hiroshi. You can # redistribute it and/or modify it under the same terms of Ruby's license; # either the dual license version in ...
28.974146
105
0.572899
1d5e400fee626e628b53f223d29c2130ce703210
687
cask 'cyberduck' do version '7.4.0.32960' sha256 'def0daced06d0f60e83bbb0862d71d7283c130bbc15d4e641d5769ff9de6d2e8' url "https://update.cyberduck.io/Cyberduck-#{version}.zip" appcast 'https://version.cyberduck.io/changelog.rss' name 'Cyberduck' homepage 'https://cyberduck.io/' auto_updates true app '...
31.227273
80
0.660844
abf73bfa1352efaeaca7ea36b42fd05e9382ba6f
115
class AddTitleToBooks < ActiveRecord::Migration[5.2] def change add_column :books, :title, :string end end
19.166667
52
0.730435
281bee4a1c1b44b213b95c460962c4684e037b7d
634
Given(/^I have specs that describe a single subject$/) do spec_runner_helper.spec_classes = %w[info.javaspec.example.rb.TightropeSpecs] end Given(/^I have specs that describe 2 or more subjects$/) do spec_runner_helper.spec_classes = %w[info.javaspec.example.rb.AnvilSpecs info.javaspec.example.rb.TightropeSpecs] e...
39.625
115
0.793375
b982d796189a91aa1e16a28f390b684174759544
397
# apt-get install nginx package "nginx" # define as a service service "nginx" do supports :status => true, :restart => true, :reload => true action [:enable, :start] end template "/etc/nginx/nginx.conf" do # source "nginx.conf.erb" notifies :reload, "service[nginx]" end # This tells chef to not install a versi...
19.85
68
0.685139
8774daf965d7bb322948e356896773af8de582eb
1,404
# frozen_string_literal: true # Base class for objects that take part in physics class Sprite attr_accessor :img, :zorder, :pos, :rot, :collider_radius, :velocity, :rot_velocity, :active def initialize(img, zorder) @img = img @zorder = zorder # Vector 2 position @pos = Vector[0.0, ...
25.071429
71
0.643162
380a0148fffd0a2ec57eadc38bd76cfc4bb9a4ce
336
class CreateFlags < ActiveRecord::Migration[6.1] def change create_table :flags do |t| t.belongs_to :message, null: false, foreign_key: true t.string :reason, null: false t.string :resolve_token, null: false t.string :discord_webhook_id t.timestamp :resolved_at t.timestamps ...
24
59
0.675595
1cb538a6cf68168abea5c3ed2f1971a37e565b67
13,942
RSpec.describe PostScraper do it "should add view to url" do scraper = PostScraper.new('http://wild-pegasus-appeared.dreamwidth.org/403.html') expect(scraper.url).to include('view=flat') end it "should not change url if view is present" do url = 'http://wild-pegasus-appeared.dreamwidth.org/403.html?v...
44.120253
123
0.697246
ed77ed6a0e96b4d4b0851b7a27e60332fbf7008a
1,317
module Elpresidente module Skills # Main skill that tries to find skill to execute class Start < Base ERROR_RESPONSES = [ 'Ojć', 'Nosz kurdefele', 'Co się janie pawle odpernicza', 'No i ch*j, no i cześć', 'fuuuuuuuuuuuuck', 'I co panie zrobisz, nic panie n...
26.34
103
0.515566
f7e2ec5c3cbe8c000f83b3918c67257559bed72a
1,904
require 'google/apis/cloudtrace_v1' module Cloudtracer class TraceContext < Base MIDDLEWARE_SPAN = 'Cloudtracer::Middleware'.freeze attr_accessor :traces attr_reader :parent_span_id attr_accessor :span_id, :trace_id attr_accessor :trace def initialize(ctx) parse_header(ctx) @spa...
23.506173
113
0.597164
211ea4a594bf2d4a2b3d6604609fbd869f21ad76
2,433
# frozen_string_literal: true module Stupidedi include Refinements module Builder class LoopState < AbstractState # @return [Reader::Separators] attr_reader :separators # @return [Reader::SegmentDict] attr_reader :segment_dict # @return [InstructionTable] attr_reader :i...
28.964286
79
0.588574
03335c9826fbf58ecf7aa54867afc88f7813c854
341
# frozen_string_literal: true module Ibrain # frozen_string_literal: true module Auth VERSION = '0.2.2' def self.ibrain_auth_version VERSION end def self.previous_ibrain_auth_minor_version '0.2.1' end def self.ibrain_auth_gem_version Gem::Version.new(ibrain_auth_versio...
15.5
47
0.692082
79e6e4f0897da9a2a05f71cb1848be4eb47509e8
2,094
# frozen_string_literal: true module Grumlin class Steps CONFIGURATION_STEPS = Action::CONFIGURATION_STEPS ALL_STEPS = Action::ALL_STEPS def self.from(action) raise ArgumentError, "expected: #{Action}, given: #{action.class}" unless action.is_a?(Action) shortcuts = action.shortcuts ac...
26.846154
107
0.637058
7a4cc2fa1526fe730cbf806a5321626e4c184683
109
require '..\..\..\..\..\ext\packages\ext-theme-base\sass\utils.rb' require '..\..\..\..\..\sass\config.rb'
36.333333
67
0.550459
6178c4fec3a2b5d68319ef558b39cdac89be8640
6,737
# encoding: utf-8 require File.expand_path("../../../test_helper", __FILE__) require 'yaml' #ArcServer::SOAP::MapServer.logger = $stdout class ArcServer::SOAP::MapServerTest < Test::Unit::TestCase should "be able to use map services at two different locations" do service1 = ArcServer::SOAP::MapServer.new('http:...
34.726804
149
0.635149
bfccc2e60278a5f2ab5ef85b10c33f12c7ab8092
682
Rails.application.routes.draw do devise_for :users root to: 'pages#home' get 'about', to: 'pages#about' get 'terms', to: 'pages#terms' get 'privacy', to: 'pages#privacy' resources :contacts, only: :create resources :podcasts resources :books do resources :chapters end resources :chapters do ...
23.517241
57
0.693548
1a10077277298148271a2b747b2ca9b26f7e2bbd
1,009
module JSONAPIonify::Api module Resource::Definitions::Hooks def self.extended(klass) klass.class_eval do define_callbacks( :request, :exception, :response, :list, :commit_list, :create, :commit_create, :read, :commit_read, ...
27.27027
68
0.558969
ed5e2d09740ee9529755eb7bf0e96022e27141ca
290
module ApplicationHelper def update_user_attribution object, create, update = false, delete = false, user = nil user = user || current_user object.created_by = user if create object.updated_by = (update or delete) ? user : nil object.deleted_by = user if delete end end
32.222222
88
0.72069
083875b736714435b938aaa9e76aeca4cc73aa4f
162
class Departament < ApplicationRecord has_many :tickets, dependent: :delete_all validates :name, presence: true has_many :users, dependent: :delete_all end
27
43
0.783951
28bcc778bc7736fc8fcb2fac3def5ccf7e4b199b
2,929
# # Cookbook Name:: openstack_model_t # Recipe:: neutron # # Copyright (c) 2015 The Authors, All Rights Reserved. bash "create the neutron database" do user "root" cwd "/root" creates "/root/model-t-setup/neutron-dbcreated" code <<-EOH STATUS=0 mysql -u root -p#{node[:openstack_model_t][:mariadb_pass...
33.666667
261
0.712188
1c63d35db2b725984c5d5104539c25c65ee22c57
1,080
# frozen_string_literal: true RSpec.describe Crunchbase::Models::CategoryGroup do context 'category_group' do it 'returns category_group as endpoint' do expect(described_class::RESOURCE_LIST).to eq('category_groups') end it 'returns all fields' do category_group = described_class.new ...
21.6
69
0.60463
914c7cc79d7756c0b75a3e44f7a9699567a52546
8,205
#!/usr/bin/env ruby # Copyright 2015, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
32.30315
103
0.692626
f83d51cbb2d5667e82f4d60763386319105e04d8
171
module Box module Version MAJOR = 0 MINOR = 1 PATCH = 1 def self.to_s [MAJOR, MINOR, PATCH].join('.') end end VERSION = Version.to_s end
12.214286
37
0.567251
6257b1b9f2d23c01268a74bf62715ee65059342b
5,260
require 'rails_helper' RSpec.describe Order, type: :model do let(:order) { create(:order) } let(:u) { create(:user) } let(:order_with_user_and_assignee) { create(:order_with_user_and_assignee) } let(:order_with_items) { create(:order_with_items) } before(:each) do populate_roles @u = create(:user) ...
30.760234
97
0.696768
e9f162cb440ca7ceface4f753fb2173889f7200e
24,770
# frozen_string_literal: true module Unxls::Biff8::Constants RECORD_IDS = { 6 => :Formula, # section 2.4.127 9 => :BOF, # 0x0009 used in BIFF2 streams 10 => :EOF, # section 2.4.103 12 => :CalcCount, # section 2.4.31 13 => :CalcMode, # section 2.4.34 14 => :CalcPrecision, # sect...
39.695513
177
0.558054
4a0e304546b012643f4f7bfa88a26006c7a4fdd6
133
# frozen_string_literal: true require 'db/vk_informer_link' FactoryBot.define do factory :cwlink, class: Vk::Cwlink do end end
14.777778
39
0.766917
d5e879a1f5e9f8d0fe097e7d2c61ddeb7ab04fda
658
require_relative 'boot' require 'rails/all' require 'carrierwave' require 'carrierwave/orm/activerecord' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module RailsBlog class Application < Rails::Application # In...
29.909091
82
0.772036
bb18aef2ef392d31b5c8b0fc41ba1bf989855ec4
1,864
# frozen_string_literal: true require 'integration/integration_spec_helper' require 'integration/admin/shared_examples_for_admin_page' describe 'Admin API token edit page', type: :feature do let!(:token) { create :api_token, app_name: 'Test Application', admin_email: ...
31.066667
79
0.66309
f8b9a0ae570a20bc909b1bd8d501c2dda42256b1
9,137
require 'spec_helper' describe "User pages" do subject { page } describe "index" do let(:user) { FactoryGirl.create(:user) } before(:each) do sign_in user visit users_path end it { should have_title('All users') } it { should have_content('All users') } describe "pagination"...
28.642633
117
0.590675
f85f4c20ec19cc7dad76ab38bf29245e6ade3d24
698
=begin * Created by PSU Beeminder Capstone Team on 3/12/2017. * Copyright (c) 2017 PSU Beeminder Capstone Team * This code is available under the "MIT License". * Please see the file LICENSE in this distribution for license terms. =end class RtmAdapter < BaseAdapter class << self def required_keys %i(to...
23.266667
172
0.707736
d5dbba8aa3ccecdc8836d82f39c4ea8d7bcc786f
334
#!/usr/bin/env ruby require 'deluge' arg_host = ARGV[0] arg_port = ARGV[1] arg_login = ARGV[2] arg_password = ARGV[3] # Initialize client client = Deluge::Rpc::Client.new( host: arg_host, port: arg_port, login: arg_login, password: arg_password ) client.connect puts client.core.test_listen_port() # Closing...
15.904762
44
0.724551
1d7b22bee2048bec5b97da2cd18aa822c9a9617d
338
module Omniship module DHLGM module Track class Shipment < Omniship::Base def packages [Package.new(@root)] # DHLGM only supports one package per shipment end # There is no delivery time for DHLGM def scheduled_delivery nil end end ...
18.777778
77
0.576923
edbdf62257c5b6d997a4d1479f44dc5c6e03f901
827
# frozen_string_literal: true # == Schema Information # # Table name: volunteer_trainings # # id :integer not null, primary key # volunteer_id :integer # radio :boolean default(FALSE) # ops_basics :boolean default(FALSE) # first_contact :boolean defa...
28.517241
57
0.607013
089005f15dc3f7f1de8bfdf2955477fec57b72e7
3,227
# # Fluentd # # 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, so...
24.08209
95
0.59374
61f9e5346d19d378e055477382ef918483d63eb5
471
# frozen_string_literal: true require 'spec_helper' describe Gitlab::Client do describe '.version' do before do stub_get('/version', 'version') end let!(:version) { Gitlab.version } it 'gets the correct resource' do expect(a_get('/version')).to have_been_made end it 'returns i...
20.478261
51
0.66242
acadda0e508df6ec51bcb3e08a0f465f0fb504ea
2,230
=begin Copyright 2016 SourceClear 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, softw...
25.05618
86
0.709417
21596a1e04986433969a316d0d2e0808daca779a
3,343
# encoding: UTF-8 # 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 sou...
37.988636
145
0.707748
5dfe4fbad9f395837f1c8bc103c42b83e1de66f7
286
require 'generators/cells/view_generator' module Slim module Generators class CellGenerator < ::Cells::Generators::ViewGenerator source_root File.expand_path('../../templates', __FILE__) private def handler :slim end end end end
15.888889
63
0.643357
8777bf34985bb217893979748e9c85fd8aece510
1,435
module LightService class ExpectedKeysNotInContextError < StandardError; end class PromisedKeysNotInContextError < StandardError; end class Context class KeyVerifier class << self def verify_expected_keys_are_in_context(context, action) verify_keys_are_in_context(context, action.expec...
29.895833
107
0.656446
62bb0d450a05df9c5555ed258e2b820034025200
4,400
# == Schema Information # # Table name: accounts # # id :integer not null, primary key # auto_resolve_duration :integer # domain :string(100) # feature_flags :integer default(0), not null # locale :integer default("en") # name ...
36.97479
149
0.699091
182b6310236bbe4ae41c338e2d61a23f031c34ae
1,363
# # Cookbook Name:: chef-client # Recipe:: windows_service # # Author:: Julian Dunn (<jdunn@opscode.com>) # # Copyright 2013, 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 # #...
31.697674
95
0.735143
e91bd0710db8f4fa76d340bc715f7e27e14e9a4e
1,519
class SongsController < ApplicationController before_action :set_song, only: [:show, :edit, :update, :destroy] before_action :login_user, except: [:show, :index] before_action :verify_song_user, only: [:edit, :update, :destroy] def new @song = Song.new @chords = Chord.all end def index @songs...
19.474359
69
0.640553
bb25244fb78b95c63ae0e711aac27d3c00cc46ae
1,068
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Resources::Mgmt::V2019_05_10 module Models # # HTTP message. # class HttpMessage include MsRestAzure # @return...
22.723404
70
0.530899
61347713513a3f50d2c87d6a68620df17bc87540
1,602
# == Schema Information # # Table name: groups # # id :integer not null, primary key # name :string(255) not null # slug :string(255) not null # bio :string(255) default(""), not null # about ...
34.826087
87
0.637953
1825d445d864c6f0cb9ea65862829c08d04a8890
5,582
require 'chef/provider/lwrp_base' require 'shellwords' require_relative 'helpers' extend Opscode::Mysql::Helpers class Chef class Provider class MysqlService class Suse < Chef::Provider::MysqlService use_inline_resources if defined?(use_inline_resources) def whyrun_supported? tr...
30.502732
124
0.49588
7a8d5e99b5b95b0bf3bf78ff6a4986b6caed9f05
2,912
require 'action_cable_client' require 'dotenv/load' Dotenv.load('/home/pi/pi_client/.env') PI = ENV['PLATFORM'] == 'PI' require 'rpi_gpio' if PI # cron job reboots pi nightly # cron job checks most recent ping every minute, pkill job and relaunch EventMachine.run do Dotenv.load('/home/pi/pi_client/.env') latest_p...
37.818182
159
0.690247
e26ebbacb9c42f31785b49a9928f4289bccff3f0
9,573
# typed: false # frozen_string_literal: true describe "globally-scoped helper methods" do let(:dir) { mktmpdir } def esc(code) /(\e\[\d+m)*\e\[#{code}m/ end describe "#ofail" do it "sets Homebrew.failed to true" do expect { ofail "foo" }.to output("Error: foo\n").to_stderr ...
28.661677
86
0.617257
794c02b174f76c7c57f278f9ece8bee39a222e2a
435
Rails.application.routes.draw do # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html root 'home#index' namespace :api do resources :games, only: [:index, :show, :create, :update] resources :ends, only: [:index, :create, :update] resources :shots, ...
29
102
0.671264
bff8ed55f3365cbf9d093a170354a8b413455044
873
class Hexedit < Formula desc "View and edit files in hexadecimal or ASCII" homepage "http://rigaux.org/hexedit.html" url "http://rigaux.org/hexedit-1.2.13.src.tgz" sha256 "6a126da30a77f5c0b08038aa7a881d910e3b65d13767fb54c58c983963b88dd7" bottle do cellar :any sha256 "4fd961580544c94e94e0d8099a429d94b...
33.576923
95
0.681558
e25ce025614d4550aab2d329a2c956b49da5659e
6,405
module ProfilesControllerConcern extend ActiveSupport::Concern include ProfilePathConcern include SearchConcern include LoginConcern included do before_action :set_profile, only: [:show, :edit, :update, :destroy] end def new @profile = Profile.new profile_set_flag(@profile) if is_new_us...
29.113636
112
0.697112
1d399a49202c59f8b68b531cd9c631af76246401
522
Rails::Engine.class_eval do rake_tasks do next if self.is_a?(Rails::Application) next unless has_data_migrations? namespace railtie_name do namespace :install do desc "Copy data_migrations from #{railtie_name} to application" task :data_migrations do ENV["FROM"] = railtie_...
22.695652
71
0.676245
d5083dca7457e35d2113a34dde8f470237c30634
1,001
Pod::Spec.new do |s| s.version = "2.3.1" s.source = { :http => "https://download.avoscloud.com/sdk/iOS/release-v#{s.version}/AVOSCloud.framework.zip"} s.platform = :ios, '5.0' s.name = "AVOSCloud" s.summary = "AVOS Cloud iOS SDK for mobile backend." s.homepage ...
41.708333
149
0.632368