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
4a72fca84db7c65a03ba6c2b9b0e0969a5a2b61b
769
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../shared/new', __FILE__) require 'iconv' describe "Iconv.open" do it_behaves_like :iconv_new, :open it "with a block invokes the block exactly once" do count = 0 Iconv.open "us-ascii", "us-ascii" do count += 1 ...
26.517241
94
0.671001
e842d4c66c5cf06f29cc39c5341094a7c208b055
832
# frozen_string_literal: true class Mutations::UpdateOrder < Mutations::BaseMutation field :order, Types::OrderType, null: false argument :id, Integer, deprecation_reason: "IDs are transitioning to the ID type. For the moment, please use the transitionalId field until \ all id f...
32
112
0.711538
61a368b63bc2586fc56331fed931b408c3570d2e
137
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_mayak_session'
34.25
75
0.80292
91b16ce7751f1a7a6c9e86fc3988d18688f4e45d
192
class AddMasterToBillingVersion < ActiveRecord::Migration def change add_column :billing_versions, :master_id, :integer add_column :billing_versions, :master_type, :string end end
27.428571
57
0.786458
030058fb4193fee60482144c04cd69678217c542
51
module AflierSurvey module CalcsHelper end end
10.2
20
0.803922
1d598a9bd54c943324b05c8a21e6871a5be76793
16,951
require "pathname" require "securerandom" require "set" require "vagrant" require "vagrant/config/v2/util" require "vagrant/util/platform" require File.expand_path("../vm_provisioner", __FILE__) require File.expand_path("../vm_subvm", __FILE__) module VagrantPlugins module Kernel_V2 class VMConfig < Vagrant.pl...
35.388309
92
0.586691
03ca19f07737cb93cc7ed5aa1d883a1487bfc236
16,862
require_relative "util/ssh" require "digest/md5" require "thread" require "log4r" module Vagrant # This represents a machine that Vagrant manages. This provides a singular # API for querying the state and making state changes to the machine, which # is backed by any sort of provider (VirtualBox, VMware, etc.)....
32.869396
141
0.627268
26bc87228689e321bfbaaa356abb012e4b2c1e83
4,772
module UnpackStrategy module Magic # length of the longest regex (currently Tar) MAX_MAGIC_NUMBER_LENGTH = 262 refine Pathname do def magic_number @magic_number ||= if directory? "" else binread(MAX_MAGIC_NUMBER_LENGTH) || "" end end def file...
26.364641
87
0.66052
1c161c15933feb307b4f8577eda77005b082c780
1,755
# Unless explicitly stated otherwise all files in this repository are licensed # under the Apache License Version 2.0. # This product includes software developed at Datadog (https:#www.datadoghq.com/). # Copyright 2016-2020 Datadog, Inc. # This software definition doesn"t build anything, it"s the place where we create...
46.184211
117
0.688319
ed95eb9046a66be9130aefdd42d1678ffb361dae
843
# Copyright 2021 Hewlett Packard Enterprise Development LP # # 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 ...
40.142857
106
0.775801
62b2ec58af4ff83314d1cd754afb65ffd0ee768c
698
module ApplicationHelper def fa(icon_key, additional_class = nil) content_tag :i, "", class: "fa fa-#{icon_key.to_s} #{additional_class}" end def checkmark(text = nil, state = false) out = state ? fa("check-circle", "success fa-lg") : fa(:minus, "muted fa-lg") out += content_tag(:span, text, class: ...
24.068966
81
0.600287
ab37ad431f498e2e22e15e991f4215e74b112d8a
2,136
require 'model_stubbing/extensions' require 'model_stubbing/definition' require 'model_stubbing/model' require 'model_stubbing/stub' module ModelStubbing extend self # Gets a hash of all current definitions. def self.definitions() @definitions ||= {} end # stores {stub => record_id} so that identical stubs kee...
33.904762
128
0.669944
e827e424cc5c9cac17b8f219dfa27c6c3319c56a
160
class Api::V1::LicensesController < Api::ApiController def index @licenses = License.includes(:license_options) respond_with_json(@licenses) end end
26.666667
54
0.75625
b9ef8cafa473c19940ad5ae32ce588f01c402ce9
5,163
ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' #require 'rspec' #require 'rspec/expectations' #require 'shoulda/matchers' #require 'database_cleaner' # require "bundler/setup" # Bundler.setup # require "rails" require 'reactive-record' # This file was ...
37.413043
131
0.71993
7ad061be405755eccec764e79619b460cda1c0ad
3,995
module TopologicalInventory module Amazon class Collector module ServiceCatalog def service_offerings(scope) service_catalog_connection(scope).client.search_products_as_admin.product_view_details rescue => e logger.error("Couldn't fetch 'search_products_as_admin' of servi...
45.397727
149
0.635544
336ab08ca29cfc9a8273a62a18db5d99dab0c19b
1,216
# frozen_string_literal: true require 'thor' module Churned # Handle the application command line parsing # and the dispatch to various command objects # # @api public class CLI < Thor # Error raised by this runner Error = Class.new(StandardError) desc 'version', 'churned version' def versi...
26.434783
64
0.618421
f89355418fbcecde32d6339747f3dffea5553ecd
1,454
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Healthinfos', type: :request do let(:user) { create(:user_with_healthinfo) } let(:user_id) { user.id } let(:healthinfo) { user.healthinfo } let(:headers) { valid_headers } describe 'GET /healthinfos' do context 'when healthinfo exists...
32.311111
122
0.639615
ff1168ee904ebcaba06fb7d05da459f53026469a
285
# frozen_string_literal: true class ReasonsHelperTest < ActionView::TestCase test 'should check for inactive reasons' do ReasonsHelper.check_for_inactive_reasons end test 'should calculate weights for flagging' do ReasonsHelper.calculate_weights_for_flagging end end
23.75
49
0.807018
87a5ef770f332914bbd4a9d983cbe145eb898f4d
10,497
# frozen_string_literal: true #-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. # See LICENSE.txt for permissions. #++ require 'fileutils' require 'rubygems' require 'rubygems/installer_uninstaller_utils' require 'rubygems/dependency_list' require 'rubygems/rdoc' require ...
25.540146
90
0.661332
33304dc8b90f7ad82b45b531eb5ff9b7b509fab1
70,956
# 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,...
41.325568
115
0.605347
614c6117f18920a4e292cc5b4cb3ed33519b758b
1,382
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'jortt/client/version' Gem::Specification.new do |spec| spec.name = 'jortt' spec.version = Jortt::Client::VERSION spec.authors = [ 'Bob Forma', 'Michael Franken'...
33.707317
75
0.643271
2662051e55f3349263cf99c4181f8ee01e847723
119
#\ -s thin -o 127.0.0.1 -E production -p 7007 -P muck-worker.pid require '../routes/muck-worker.rb' run MuckWorkerWeb
29.75
65
0.697479
bf34e29d65f4109839d9b17a79185e8ea08365fa
128
require 'test_helper' class PlanetReligionTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
16
50
0.71875
ed38632ab957124761608f57d14ee621ef7af1f1
666
class TaskSerializer < ActiveModel::Serializer attributes :id, :name, :user, :project, :created_at, :updated_at, :completed_at, :body, :completed, :due_on, :note #:assigned_to, :project_id, # def assigned_to # { # user_id: self.object.user.id, # user_name: self.object.user.name, # user_worksp...
24.666667
116
0.645646
031e51fa2e0fea8cbb6c76fb8a72fbfe510a7e5b
5,805
require 'rubyXL/objects/ooxml_object' require 'rubyXL/objects/simple_types' require 'rubyXL/objects/text' require 'rubyXL/objects/formula' require 'rubyXL/cell' module RubyXL # http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.cellvalues(v=office.14).aspx module DataType SHARED_STRING...
26.875
107
0.641344
112bc6db551b9a9de35f4204a80630bfe1d6581c
956
require 'jdbc_common' require 'db/postgres' class CreateSchema < ActiveRecord::Migration def self.up execute "CREATE SCHEMA test" execute "CREATE TABLE test.people (id serial, name text)" execute "INSERT INTO test.people (name) VALUES ('Alex')" execute "CREATE TABLE public.people (id serial, wrongnam...
21.244444
75
0.732218
03489f673d4d29eec331aa0535ea9101707639e5
246
class AddShowableandRemoveManagementFromChemicalSubstances < ActiveRecord::Migration def change add_column :chemical_substances, :showable, :boolean, :default => true remove_column :chemical_substances, :management, :boolean end end
30.75
84
0.800813
18503422bc718735f94c766be62b180f79b7d0a9
24,122
# Two variables, one recipe. caname = 'docker_service_default' caroot = "/ca/#{caname}" ################ # action :create ################ # create a container without starting it docker_container 'hello-world' do command '/hello' action :create end ############# # action :run ############# # This command will ...
20.459712
118
0.666653
21a638bb9b9555a184d186cf9938ce1d71993eca
6,451
module Admin module RelationshipsHelper def setup_relationship(field) @field = field @model_to_relate = @resource.reflect_on_association(field.to_sym).class_name.constantize @model_to_relate_as_resource = @model_to_relate.to_resource @reflection = @resource.reflect_on_association(field.t...
34.132275
141
0.603782
01c40e119ef0d2217916dd0f96062d42c0a32026
210
atom_feed language: 'en-GB', root_url: root_url do |feed| feed.title 'Statistics on GOV.UK' feed.author do |author| author.name 'HM Government' end documents_as_feed_entries(@statistics, feed) end
23.333333
57
0.733333
bf0f72a91953dff5e21efc3f1cc3e191fc27a1b2
566
class UpdateCodeReviewCommentsToUseStorageAppId < ActiveRecord::Migration[5.2] def change add_column :code_review_comments, :storage_app_id, :integer, null: false, after: :id add_index :code_review_comments, [:storage_app_id, :project_version], name: 'index_code_review_comments_on_storage_app_id_and_ver...
43.538462
88
0.795053
e88f73f0bbdd03cbf2240ac715e71480c6593470
154
# frozen_string_literal: true Rails.application.config.content_security_policy do |policy| policy.default_src :self policy.frame_ancestors :none end
22
60
0.824675
08bf5fbed76a92e222db9e07451d37802a95b0f8
1,583
module Filemaker module Model class Field attr_reader :name, :type, :default_value, :fm_name def initialize(name, type, options = {}) @name = name @type = type @default_value = serialize_for_update(options.fetch(:default) { nil }) # We need to downcase because Filemak...
30.442308
78
0.624131
395cc76bdde8bdfe9e634cdc465e28a61c58d2c0
2,143
# frozen_string_literal: true require 'spec_helper' describe 'solidus_virtual_gift_card:send_current_emails' do subject { task.invoke } let(:task) { Rake::Task['solidus_virtual_gift_card:send_current_emails'] } let(:purchaser) { create(:user) } before do Rails.application.load_tasks task.reenable ...
34.564516
142
0.723752
7a8d30329db52492869df1c2d28cfed1ab1ed7b4
4,886
# frozen_string_literal: true # This file is copied to spec/ when you run 'rails generate rspec:install' require 'spec_helper' ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) # Prevent database truncation if the environment is production abort('The Rails environment is running...
38.472441
113
0.744576
2830899af8c409c797cb81fd56a4d8599d126fd8
1,199
require 'puppet/confine/feature' require 'puppet/util/feature' # Confine Puppet providers based on libs (Gems) # # This implementation is functionally a super-set of Puppet::Config::Feature. # However, Puppet::Confine.inherited prevents sub-classing # Puppet::Confine::Feature so the entire class was essentially cut'n'...
29.975
98
0.707256
03f1e87bf8bd304d3139291129cc1a5e5ca24f14
1,680
Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test su...
42
85
0.778571
bb9f3519327d1fab022ba485e7c37d8687eae7ce
2,037
# This component exists only to remove all the files that are not needed in the final package. component 'cleanup' do |pkg, settings, _platform| # This component must depend on all other C++ components in order to be # executed last, after they all finish building. pkg.build_requires 'puppet-runtime' pkg.build_...
43.340426
114
0.648012
e206a2f2418f3dca368df28bc7358a788293bdb8
1,030
class SiwappHooks def invoice_generation(inv) unless Settings.event_invoice_generation_url.blank? begin invoice_json = InvoiceSerializer.new(inv).to_json response = HTTP.post( Settings.event_invoice_generation_url, :json => JSON.parse(invoice_json) ...
39.615385
140
0.649515
bb7c4311f8d50b86430aa58a2f53737dec8d2be6
151
require 'test_helper' class HeartbeatTest < ActiveSupport::TestCase # Replace this with your real tests. def test_truth assert true end end
16.777778
45
0.754967
6142af1982028fc25bdd6b9f7f9dac9d4f39c16a
3,075
require "gen_server/version" require "gen_server/signal_handler" module GenServer attr_reader :pid def initialize(*args) init(*args) start_child_process parent_setup_mailbox end def init(*args) end def start_child_process @pid = Process.fork do @pid = Process.pid # Set our own pid...
19.711538
77
0.646504
bb0b0876eca2e9cc17e5542b477dea378f5eb62a
608
class NoteObserver < BaseObserver def after_create(note) notification.new_note(note) # Skip system notes, like status changes and cross-references. unless note.system event_service.leave_note(note, note.author) # Create a cross-reference note if this Note contains GFM that names an # i...
28.952381
93
0.725329
e81566f5538a376d2ec94f188e7fc555771c1e0e
362
# frozen_string_literal: true # Copyright The OpenTelemetry Authors # # SPDX-License-Identifier: Apache-2.0 require 'opentelemetry' module OpenTelemetry module Instrumentation # Contains the OpenTelemetry instrumentation for the Koala gem module Koala end end end require_relative './koala/instrument...
19.052632
66
0.781768
ace4a87a43d16a4402d9a5b4e9f45ef018262012
1,104
cask 'unity-windows-support-for-editor@5.5.3p2' do version '5.5.3p2,f15b2772e4d0' sha256 :no_check url "https://download.unity3d.com/download_unity/f15b2772e4d0/MacEditorTargetInstaller/UnitySetup-Windows-Support-for-Editor-5.5.3p2.pkg" name 'Windows Build Support' homepage 'https://unity3d.com/unity/' pk...
30.666667
139
0.712862
33186cf50d5d81ee41a8171a8fb6c512a96c7176
3,823
require 'spec_helper' describe MembersHelper do describe '#action_member_permission' do let(:project_member) { build(:project_member) } let(:group_member) { build(:group_member) } it { expect(action_member_permission(:admin, project_member)).to eq :admin_project_member } it { expect(action_member_pe...
67.070175
212
0.738948
79cd99adfffdd96775dbe3695908d78e82e754ac
1,082
#!/usr/bin/env ruby require 'natto' # 元文章と生成したファイルの設置場所 DOCS_DIR = 'docs' DEST_DIR = 'generated' # 品詞ID NOUNS_POSID = (36..67).to_a VERBS_POSID = (31..33).to_a # テキストから名詞と動詞だけ取り出す def pick_words(text) words = [] natto = Natto::MeCab.new natto.parse(text) do |n| if !n.is_eos? && (NOUNS_POSID + VERBS_POSID)....
22.541667
66
0.641405
f86c490f90f5822efc262505d35a60f2b78213be
581
# frozen_string_literal: true module Remocon class ParameterFileDumper def initialize(parameters) @parameters = parameters.with_indifferent_access end def dump @parameters.each_with_object({}) do |(key, body), hash| hash[key] = body[:defaultValue] hash[key][:description] = bo...
25.26087
104
0.654045
ac5e3fcc75d64fe18c035f2f2c64ec2e2b5a8ab0
905
# frozen_string_literal: true module Masterfiles module Locations module LocationType class New def self.call(form_values: nil, form_errors: nil, remote: true) ui_rule = UiRules::Compiler.new(:location_type, :new, form_values: form_values) rules = ui_rule.compile la...
29.193548
89
0.605525
d5f728700e0a03dbcdfad11144b93c3143bd4889
159
Fabricator(:reviewer, from: :user) do username { Faker::Name.unique.name } email { "#{Faker::Lorem.word}@email.com" } password { Faker::Lorem.word } end
26.5
44
0.672956
1d9db81d3daf6f8db38c07a7e617aa5de2558c92
210
# frozen_string_literal: true module Refinery module Testimonials # Controller for Testimonials class TestimonialsController < ::ApplicationController respond_to :json, :html end end end
19.090909
58
0.747619
08ed0e5915d52f775481cdb2ae2142e250bcc019
59
class AccountUser def role Role.new end end
11.8
17
0.610169
26d32fff801225851ac0edf0851030e5817a2b9e
1,286
require_relative 'boot' require "rails" # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" require "action_cable/engine" # require "sprockets/railti...
32.15
82
0.764386
798ff55807508dd2788beb1c9a996888ac5fa728
457
# frozen_string_literal: true require 'schema_dot_org' # Model the Schema.org `Thing > CreativeWork > WebPage`. See https://schema.org/FAQPage # module SchemaDotOrg class FAQPage < WebPage attr_accessor :item_list_element def _to_json_struct super.merge({ "mainEntity" => item_lis...
20.772727
88
0.654267
6203d9140f8e3ad719d5d33fa17ed4a417cc111d
1,622
module HelpfulComments class ModelSchemas < Base # takes a descendant of ActiveRecord::Base def initialize(klass) unless klass < ActiveRecord::Base raise ArgumentError, 'klass must descend from ActiveRecord::Base' end @klass = klass end # builds the lines to be put ...
32.44
105
0.593711
bf6562eda599187914259d9d361abbe9bfb60118
831
cask 'forticlient' do version '6.4' sha256 'a673cc372f4caf90476e6cda4e51c8450ac58e09a8c5218bba537e86792e5d23' # filestore.fortinet.com/forticlient/ was verified as official when first introduced to the cask url "https://filestore.fortinet.com/forticlient/downloads/FortiClientVPNOnlineInstaller_#{version}.dmg" ...
36.130435
113
0.670277
5d55085c6edce73072a5c1565d56f869fbb37795
487
module Zype class LoginClient < Zype::Client def initialize(_ = '') @headers = { 'Content-Type' => 'application/json' } self.class.base_uri Zype.configuration.login_host end def execute(method:, path:, params: {}) resp = send(method, path: path, params: params) if resp.success? ...
27.055556
71
0.616016
26fa081d20fcdaf87ae01eb0e1d6236998a2eebc
379
require 'formula' class Tmpwatch < Formula homepage 'https://fedorahosted.org/tmpwatch/' url 'https://fedorahosted.org/releases/t/m/tmpwatch/tmpwatch-2.11.tar.bz2' sha1 'c578dd98e5ea64ad987a95ae55926685a0df0659' def install system "./configure", "--disable-dependency-tracking", "...
27.071429
76
0.6781
ed03b8dcf79750f53f15c9fc2d03de8a914eb3cb
352
class NomenclaturalRank::Icn::GenusGroup::Section < NomenclaturalRank::Icn::GenusGroup def self.parent_rank NomenclaturalRank::Icn::GenusGroup::Subgenus end def self.valid_parents [NomenclaturalRank::Icn::GenusGroup::Genus.to_s] + [NomenclaturalRank::Icn::GenusGroup::Subgenus.to_s] end def self.abb...
23.466667
106
0.75
1da712cf8a5f694018044dbb8a246d78f7b81a98
659
# Be sure to restart your server when you modify this file. # Your secret key is used for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to diction...
50.692308
174
0.814871
ab1cf729b702c1180005832cf739f6e9bec33ed3
5,230
class Visp < Formula desc "Visual Servoing Platform library" homepage "https://visp.inria.fr/" url "https://visp-doc.inria.fr/download/releases/visp-3.4.0.tar.gz" sha256 "6c12bab1c1ae467c75f9e5831e01a1f8912ab7eae64249faf49d3a0b84334a77" license "GPL-2.0-or-later" livecheck do url "https://visp.inria.fr...
40.542636
140
0.572467
6283c37f40b158d31130cc9edc3203a0076dc365
131
%w[ .ruby-version .rbenv-vars config/cities.yml tmp/restart.txt tmp/caching-dev.txt ].each { |path| Spring.watch(path) }
16.375
36
0.671756
61ca9f379b4d074f65bbd6d7a415ccfe55d03af7
1,891
#-- encoding: UTF-8 #-- copyright # OpenProject is an open source project management software. # Copyright (C) 2012-2020 the OpenProject GmbH # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProj...
31.516667
91
0.741407
ff8b8d8ec54136f0e7a62973ed8fed95898dafd9
12,488
# frozen_string_literal: true module EE module ProjectsHelper extend ::Gitlab::Utils::Override override :sidebar_operations_paths def sidebar_operations_paths super + %w[ oncall_schedules ] end override :project_permissions_settings def project_permissions_settings(proje...
41.765886
248
0.735586
f77bd8de75de825e1130cbd6f64eb620ac08acd9
1,655
# # Be sure to run `pod lib lint CHFoundation.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'CHFound...
38.488372
113
0.652568
f7af8050c81fb14894844cf847c2cfb2f9ad41af
57
# utility classes require 'aws-sdk-sns/message_verifier'
19
38
0.807018
b94195dc64807c8621526882b0636c8f7145fcb6
584
worker_processes Integer(ENV['UNICORN_WORKERS'] || 4) timeout 30 preload_app true listen(ENV['PORT'] || 3000, :backlog => Integer(ENV['UNICORN_BACKLOG'] || 200)) before_fork do |server, worker| Signal.trap 'TERM' do puts 'Unicorn master intercepting TERM and sending myself QUIT instead' Process.kill 'QUIT', ...
27.809524
91
0.724315
e95d50f8cf4ca68aa9a284fb32f7aa9564520679
3,461
# frozen_string_literal: true require 'optparse' require 'rubycritic/browser' module RubyCritic module Cli class Options def initialize(argv) @argv = argv self.parser = OptionParser.new end # rubocop:disable Metrics/MethodLength def parse parser.new do |opts| ...
29.581197
120
0.54753
bfc007219ffeccb2ef91b47484f031a110012a14
853
# frozen_string_literal: true # It truncates the DB. Use this always on profiles. def clean_db! ActiveRecord::Base.establish_connection ActiveRecord::Base.connection.execute("SET FOREIGN_KEY_CHECKS = 0") ActiveRecord::Base.connection.tables.each do |table| next if table == "schema_migrations" ActiveReco...
34.12
74
0.764361
91f7215e520cd3d80566bce1800c7ec5d320f46a
4,124
module AgbHandicap SCORING_SCHEMES = { 'METRIC' => 'Standard WA target face 10 -1', 'IMPERIAL' => 'Standard WA target face 9 - 1', 'INNER_TEN' => 'Standard WA target face 10-1 with x-ring counting as 10, eg compound scoring', 'TRIPLE' => 'Standard 3-spot 5-zone WA target face, eg WA18m round', 'T...
31.242424
125
0.546799
03b7a4226b34a690570a23bd08074679f75d4810
505
class UserPolicy < ApplicationPolicy def initialize(user, record_user) @user = user @record_user = record_user end def show? user.admin? || user == record_user end def update? user.admin? || user == record_user end def destroy? user.admin? || user == record_user end def permitt...
15.78125
38
0.641584
8765580cadbc54abb921389b43dcea0869860581
56
class Test2Job < Marty::CronJob def perform end end
11.2
31
0.732143
39d8ec4f6981fe21b312a9dbb1513d29c471fd38
1,329
class Tfsec < Formula desc "Static analysis powered security scanner for your terraform code" homepage "https://github.com/tfsec/tfsec" url "https://github.com/tfsec/tfsec/archive/v0.37.3.tar.gz" sha256 "1f8ea759cee78f5ca41b7cff04aacbe34d0b93cf82053f0a17e0542e18b47dd9" license "MIT" livecheck do url :s...
34.973684
122
0.771257
ab4677398bd6c3fee3863c2154ef182ae9258cda
39
module ArRedis VERSION = '0.1.0' end
9.75
19
0.666667
01d9c502ce80b82b2efb6dc524d4a2f9c040fc4a
1,143
# # Cookbook Name:: fail2ban # Resource:: fail2ban_jail # # Copyright 2015, OpenStreetMap Foundation # # 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...
30.891892
74
0.741907
1d868806f1baca43293520a4f06c3fb13bb97214
172
begin require 'syck' rescue LoadError # do nothing end require 'yaml' $test_file = tmp("yaml_test_file") $test_parse_file = File.dirname(__FILE__) + "/test_yaml.yml"
15.636364
60
0.732558
79d68837e35acc45142c727687597a5404a38dc9
618
# This file was auto-generated by lib/tasks/web.rake module Slack module Web module Api module Endpoints module TeamProfile # # Retrieve a team's profile. # # @option options [Object] :visibility # Filter by visibility. # @see https://ap...
26.869565
115
0.585761
5d97362b55dab4b01edb1b5909c47e8dbd96399d
749
# typed: true module Kuby module CertManager module DSL module CertManager module V1 class ClusterIssuerSpecAcmeSolversDns01AcmeDNSAccountSecretRef < ::KubeDSL::DSLObject value_field :name value_field :key validates :name, field: { format: :string }, p...
24.966667
95
0.551402
1c226a3fb80e0f0f284fcbb5d71a6118fa1e6b3e
16,259
require 'recursive-open-struct' RSpec.describe MiqServer::WorkerManagement::Monitor::Kubernetes do let(:server) { EvmSpecHelper.create_guid_miq_server_zone.second } let(:orchestrator) { double("ContainerOrchestrator") } let(:deployment_name) { '1-generic-79bb8b8bb5-8ggbg' } let(:pod_label) { ...
39.656098
177
0.678701
bb49c8d5c5008d5d9983d66b07174a18684f3f98
8,256
require "cases/helper" require "models/author" require "models/binary" require "models/cake_designer" require "models/chef" require "models/comment" require "models/edge" require "models/essay" require "models/post" require "models/price_estimate" require "models/topic" require "models/treasure" require "models/vertex"...
29.591398
125
0.694646
6252e4e85d8e866a1326c167a77f48bbd625e914
856
Puppet::Type.newtype(:compellent_server) do @doc = "Manage Compellent Server creation and deletion." apply_to_device ensurable newparam(:name) do desc "The server name. Valid characters are a-z, 1-9 & underscore." isnamevar validate do |value| unless value =~ /^[\w\s\-]+$/ raise Arg...
20.878049
84
0.641355
261c353eb50090efc049d24ef2ff335530e964a0
4,145
require 'spec_helper' class TestConcurrencyCache @@cache = {} def self.read(key) @@cache[key] end def self.write(key, value) @@cache[key] = value end def self.delete(key) @@cache.delete(key) end def self.clear @@cache = {} end end describe Concurrency do before :each do Tes...
37.342342
112
0.75006
878f8a69503adf93aaf88c37027a17039a4532d3
12,623
require_relative '../spec_helper' describe GCOVTOOLS::Project do describe "#name" do it "can be given in the constructor" do project = GCOVTOOLS::Project.new "Test" expect(project.name).to eq("Test") end it "is optional in the constructor" do project = GCOVTOOLS::Project.new exp...
42.076667
143
0.650083
e257bcf7553b11147c6ccd26d485a510033254d5
11,705
# frozen_string_literal: true # Copyright 2020 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...
37.041139
190
0.716531
87004873f6b082f09b2d4d1aae1b3214b6f196c5
878
require_relative '../lib/github_repository' # RUBY # Source: https://github.com/ruby/ruby class Ruby attr_reader :name, :description def initialize @name = 'Ruby' @description = 'The Ruby MRI runtime.' extract end def latest_stable @versions.sort.reverse.first end def latest_unstable ...
19.511111
65
0.603645
1d3c09a48b7ea3ae2d77febbc351a74829b298a8
3,077
# frozen_string_literal: true require 'spec_helper' RSpec.describe Issue::Metrics do let(:project) { create(:project) } subject { create(:issue, project: project) } describe '.for_issues' do subject(:scope) { described_class.for_issues([issue1, issue2]) } let(:issue1) { create(:issue) } let(:issu...
36.2
108
0.688008
e8e3d506a5a0b9fe61704b4ef04318c440ff50e7
1,838
# frozen_string_literal: true # Advent of Code 2016 # # Robert Haines # # Public Domain require 'aoc2016' module AOC2016 class InternetProtocol7 < Day def setup @input = read_input_file.split("\n") end def part1 num = @input.reduce(0) do |acc, line| acc + (supports_tls?(line) ? 1 :...
19.978261
69
0.501088
ac86d8ab23b6cdaef4b1abdf71040bae34eff3e3
141
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_mini-blog_session'
35.25
79
0.801418
1d2ee9c34fcf9b52c2a3a6d66bbcbd507c8f3454
111
# frozen_string_literal: true module Quiz class TableQuestion < Question belongs_to :question end end
13.875
32
0.765766
e2d425b609b1a69316e8fb4b82f612da2e09c206
5,660
require "logstash/inputs/threadable" require "logstash/namespace" require "logstash/plugin_mixins/aws_config" # Pull events from an Amazon Web Services Simple Queue Service (SQS) queue. # # SQS is a simple, scalable queue system that is part of the # Amazon Web Services suite of tools. # # Although SQS is similar to ...
33.099415
187
0.646466
7aad781ddcde548cbf83e68bd82a88107c965729
315
require 'file_upload_status' require 'encoding_detection' class UploadCsvFile include EncodingDetection def initialize(csv_upload) @csv_upload = csv_upload @errors = {} end def call path = Paperclip.io_adapters.for(@csv_upload.data).path initialize_data(path) @data.process end end
17.5
59
0.736508
e22b9c4109db6cc1a367418312a64de24e3dd6a0
3,113
# 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::ApiManagement::Mgmt::V2019_12_01 module Models # # List of Users Identity list representation. # class UserIdentityCollectio...
28.3
80
0.519435
796cf061e4f39a5ab03fb753a91d240b57d89dc2
807
# frozen_string_literal: true # Copyright 2016-2021 Copado NCS 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 a...
35.086957
106
0.770756
08f0ca65cf2fc7079f63c9c59559a48abfc3f23f
337
class RemoveUniqueConstraintOnPhoneNumberFromReportingParties < ActiveRecord::Migration def up remove_index :reporting_parties, :phone_number add_index :reporting_parties, :phone_number end def down remove_index :reporting_parties, :phone_number add_index :reporting_parties, :phone_number, unique...
28.083333
87
0.801187
334e5574559e361a717b5d6ad6951ce0efd554d2
1,084
class FixNamespaceDuplication < ActiveRecord::Migration def up #fixes path duplication select_all('SELECT MAX(id) max, COUNT(id) cnt, path FROM namespaces GROUP BY path HAVING COUNT(id) > 1').each do |nms| bad_nms_ids = select_all("SELECT id FROM namespaces WHERE path = '#{nms['path']}' AND id <> #{nms[...
49.272727
130
0.654982
1d342d81e2a5b31252327b956b7364d2f19f8f9e
346
module Travis::API::V3 class Renderer::Log < ModelRenderer def self.render(model, representation = :standard, **options) return super unless options[:accept] == 'text/plain'.freeze model.content end representation(:minimal, :id) representation(:standard, *representations[:minimal], :conte...
28.833333
79
0.699422
0191b935db4b25e0e7dc56cd816507f2397c5805
1,034
require "appium_lib" require "pry" def caps { caps: { deviceName: "VD", platformName: "Android", app: (File.join(File.dirname(__FILE__), "PreciseUnitConversion.apk")), appPackage: "com.ba.universalconverter", newCommandTimeout: "3600", appium_lib: { wait: 2...
28.722222
115
0.637331
d5bfa2b987b28816a1963ec2a7b40d69052c042d
10,840
require 'test/unit' require 'fileutils' # Mock out what we need from AR::Base module ActiveRecord class Base class << self attr_accessor :pluralize_table_names, :timestamped_migrations end self.pluralize_table_names = true self.timestamped_migrations = true end module ConnectionAdapters ...
33.560372
123
0.699262
acb25739678dbd558f084248fdceabe4ffa4c5ad
963
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb') class TestFakerAvatar < Test::Unit::TestCase def setup @tester = Faker::Avatar end def test_avatar assert @tester.image.match(/http:\/\/robohash\.org\/(.+)\.png/)[1] != nil end def test_avatar_with_param assert @tester.image('...
26.027027
115
0.680166
39733eef718bd427d9c5f43feaf4caa3502cc591
5,893
require 'rails_helper' RSpec.describe "hbx_admin/_edit_aptc_csr", :dbclean => :after_each do let(:person) { FactoryGirl.create(:person, :with_family ) } let(:user) { FactoryGirl.create(:user, person: person) } let(:year) { TimeKeeper.date_of_record.year } before :each do sign_in(user) ...
52.616071
253
0.698456
1853c32ce02b5cd232c9c132a739d7bad9e7c287
661
Pod::Spec.new do |s| s.name = "MTPocket" s.version = "0.6.0" s.summary = "Web request library that doesn't suck. Simple and powerful. Convenient and informative. JSON and XML to collection object conversion." s.homepage = "https://github.com/mysterioustrousers/MTPocket" s.license = ...
44.066667
154
0.632375