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
6ae190393962b8ea7eb1d6e8849720d223987eae
958
require './lib/SassyLists' Gem::Specification.new do |s| # Release Specific Information s.version = SassyLists::VERSION s.date = SassyLists::DATE # Gem Details s.name = "SassyLists" s.rubyforge_project = "SassyLists" s.description = %q{Advanced Sass list functions} s.summary = %q{A collection of power...
23.95
89
0.643006
1863e37395b4a773705a8906dbff5ac663680bb3
4,341
require 'spec_helper' require 'arbre/rails/layouts' Arbre::Context.send :include, Arbre::Rails::Layouts::ContextMethods describe Arbre::Rails::Layouts do # Layouts are also integration-specced in integration/rails_spec.rb. let(:controller) { double() } before do allow(helpers).to receive(:controller).and_...
34.181102
106
0.665284
01982936c706fdad5c7745209632cc36026eb0f5
1,085
module GameData class Plots < Base include GameEngine::PlotRequirements @@data = nil def initialize super @@data ||= @data remove_instance_variable(:@data) end def get( code ) code = code.to_i @@data[code][:influence] = OpenStruct.new( @@data[code][:influence] ) ...
28.552632
133
0.632258
ac80080cdc25ad9b8863f22b4d447504beb716bd
336
# frozen_string_literal: true require 'loxxy' require_relative '../../spec_helper' describe 'Variable (non-std):' do include LoxFileTester let(:my_path) { __FILE__.sub(/\/[^\/]+$/, '/') } context 'Invalid cases:' do it "passes 'unknown_variable_expr.lox'" do run_negative_test end end # context...
19.764706
50
0.669643
1ceb0b591bd753730c55c823ca9363e4a80633c9
624
######################################################## # Copyright IBM Corp. 2016, 2017 ######################################################## # # Cookbook Name:: wasliberty ############################################################################### actions :start, :stop default_action :start attribute :name, ...
39
80
0.504808
61117b19e0c81239ec1221ecb03ce656d7284377
381
require 'spec_helper_acceptance' # Ensure message of the day (MOTD) is properly configured - Section 1.7.1.1, # Ensure permisisons on /etc/motd are configured - Section 1.7.1.4 describe file('/etc/motd') do it { should be_file } it { should be_owned_by 'root' } it { should be_grouped_into 'root' } it {...
34.636364
76
0.690289
6ab14f5c57f975f537295f9395638dc5b57e503d
98
class Grievance < ApplicationRecord validates :name, :aggriever, :grievance, presence: true end
24.5
57
0.785714
26ae918f82da81f7b1ea492ff7d5204bf5419632
2,038
#!/usr/bin/env ruby $LOAD_PATH.unshift('../../lib') require 'objectifier' require 'pp' require 'money' # # To run this example you will have to install the 'money' gem # # # Money objectifier example to show how custom transformers can be created # to deserialize types that Objectifier does not know about # # We have...
19.226415
96
0.661433
f73ebcade56161ac03abd491e999f312342ac633
1,828
RSpec.describe Calculators::TakeWholePotForm, type: :model do subject(:form) { described_class.new(params) } let(:pot) { 100_000 } let(:income) { 1_00 } let(:params) { { pot: pot, income: income } } it { is_expected.to validate_presence_of(:pot) } it { is_expected.to validate_numericality_of(:pot).is_grea...
29.015873
118
0.665755
acda75bddab2e36a28c2a3871e6ab38422e1f0e3
137
module Schools module Startups class EditForm < Reform::Form property :name, validates: { presence: true } end end end
17.125
51
0.671533
87b6597c302ed2243ca06ca59de74fc175e159eb
674
# frozen_string_literal: true module LabelApp class PublishStep < BaseStep def initialize(user) super(user, :lbl_publish_steps) end def step_2_desc current_step = read [ "Printer: #{current_step[:chosen_printer]}", "Targets: #{current_step[:chosen_targets].map { |t| cur...
24.962963
107
0.605341
21bdf1d9c7cc3579148172305f04d53f23997659
2,919
# 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::Network::Mgmt::V2019_07_01 module Models # # A list of application security groups. # class ApplicationSecurityGroupListResu...
28.90099
80
0.540254
183e0fa7b17f060f681ed3c2877bb3fc4158660f
604
require 'person' require 'address' require 'postal_address' require 'phone_number' class UpdatePhoneNumbers < ActiveRecord::Migration def self.up # Go through the people and extract those that have a phone number in their address people = Person.where('postal_addresses.phone is not null').includes(:postal_ad...
25.166667
91
0.703642
331d86e34a8d40ecd5ef2d68d182deac4bc1d004
73
module Vvm VIM_URI = 'https://bitbucket.org/vim-mirror/vim'.freeze end
18.25
57
0.739726
d5c7da1c87f74f9282081467f7e4907d26a31b4a
133
Before("@dlm") do @service = Aws::DLM::Resource.new @client = @service.client end After("@dlm") do # shared cleanup logic end
14.777778
35
0.661654
f8d1212db32238dd3811945eeed39063b3f0db3b
2,664
class Zabbix < Formula desc "Availability and monitoring solution" homepage "https://www.zabbix.com/" url "https://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.9/zabbix-3.4.9.tar.gz" sha256 "31582c712527ecd67ffd3ecc840c5ed308f46aa0aeb6e6b9cfa2ca079eda1f64" bottle do sha256 "3f550...
31.341176
107
0.665541
d50ae74e3523649e198e1fbeff00a1d98952b230
5,831
require "cases/helper" require "models/book" require "support/schema_dumping_helper" module ViewBehavior include SchemaDumpingHelper extend ActiveSupport::Concern included do fixtures :books end class Ebook < ActiveRecord::Base self.primary_key = "id" end def setup super @connection = ...
26.870968
127
0.716344
edf719d14a4656b07b91e6e09dafea01e010ec7a
14,636
# -*- coding: utf-8 -*- module Axlsx require 'axlsx/workbook/worksheet/sheet_calc_pr.rb' require 'axlsx/workbook/worksheet/auto_filter/auto_filter.rb' require 'axlsx/workbook/worksheet/date_time_converter.rb' require 'axlsx/workbook/worksheet/protected_range.rb' require 'axlsx/workbook/worksheet/protected_ranges.rb' re...
36.959596
161
0.715291
ed6cd5a9caaa8ac5e10640eadd1cbfd6ae39aea7
46,904
system("clear") require 'tty-spinner' #for some reason it wasnt working or formatting with three requirements def wincat puts '[+] Loading Readme file' puts ''' this tool is inspired by one of my first ruby frameworks for ethical hacking and web/host discovery that tool was named Rube-Ster whi...
30.378238
155
0.457509
1a46a7fafc72e4de9c4f24a5349a2f2c61fbaa68
1,796
module Cryptoexchange::Exchanges module Coinstock module Services class Market < Cryptoexchange::Services::Market class << self def supports_individual_ticker_query? false end end def fetch output = super ticker_url adapt_all(outpu...
33.259259
81
0.5451
2641aba1135a6ca245a8d043220f7a6f52848c25
9,599
=begin #Selling Partner API for Retail Procurement Orders #The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data. OpenAPI spec version: v1 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.26 =end require 'date' module ...
34.039007
146
0.665069
e8ed8de144da155fc2def32a8b74eeb79a1c26f4
3,281
require (File.expand_path('./../../../spec_helper', __FILE__)) # For Ruby > 1.9.3, use this instead of require # require_relative '../../spec_helper' describe TheTvdb::Show do before do VCR.insert_cassette 'shows', record: :new_episodes end after do VCR.eject_cassette end describe ".search" ...
32.81
346
0.656202
1a167e6695d8acf174f93eabcc935fc4eafa0eef
1,219
require 'hyperstack-config' require 'rails/generators' # remove these once lap29 is released ... Hyperstack.js_import 'react/react-source-browser', client_only: true, defines: ['ReactDOM', 'React'] Hyperstack.js_import 'react/react-source-server', server_only: true, defines: 'React' #Hyperstack.js_import 'hyper-router...
32.945946
111
0.780148
795a518500182f9d1ebb6ef3ef9a055e91cbaff1
1,494
class Minced < Formula desc "Mining CRISPRs in Environmental Datasets" homepage "https://github.com/ctSkennerton/minced" url "https://github.com/ctSkennerton/minced/releases/download/0.3.0/minced.jar" sha256 "16bdaa1fea625d1ce2f87d24e68eeb5bd733d8d04dda83c6ff74ee8d15fb8fe9" bottle do root_url "https://li...
39.315789
97
0.807898
1d9396035f99312c5026d9af561fc5370247d69f
1,964
# frozen_string_literal: true module RailsBestPractices module Reviews # Review model files to make sure finders are on their own model. # # See the best practice details here https://rails-bestpractices.com/posts/2010/07/23/keep-finders-on-their-own-model/ # # Implementation: # # Review ...
37.056604
122
0.661405
d5ea9614e76e2f63e05b1e9d31b3dbb84c146a42
1,050
# 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. # # This file is the source Rails uses to define your schema when running `rails #...
42
86
0.758095
6255fc076a5ad484a804d2c856a080dcfd6dd83d
245
# frozen_string_literal: true describe Aws::Lex::Conversation::Response::Base do describe '#dialog_action' do it 'raises NotImplementedError' do expect { subject.dialog_action }.to raise_error(NotImplementedError) end end end
24.5
74
0.75102
5df1dc17bc10881f16fb11deeb6e01a5414063c5
496
rand(33..99).times do rand_title = [ Faker::Quote.famous_last_words, Faker::Books::CultureSeries.book, ].sample rand_body = [ Faker::Lorem.paragraphs(number: rand(3..13)).join(" "), Faker::Lorem.sentences(number: rand(8..25)).join(" "), Faker::TvShows::AquaTeenHungerForce.quote, Faker::T...
26.105263
74
0.683468
5d24ce3b54097017b5fe75d93301f78d90dbab69
11,649
## # This module requires Metasploit: http//metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking HttpFingerprint = { :pattern => [ /Apache.*(Coyote|Tomcat)/ ] } CSRF_VAR = 'CSRF_NONCE=' ...
27.28103
158
0.580994
ac172f7c80336e5266b89593d80dd03d3770371c
18,583
class Template::TypescriptSource < Template::Base CONTENT = <<-CONTENT |import { | <%= callback_props_group_type_name(:base) %>, | MessageEventData, | Metadata, | PostMessageFieldDecodeError, | PostMessageUnknownTypeError, | assertMessageProp, |} from "./lib" | |export en...
34.540892
206
0.641662
ed224827c2fe8983a2a0779148024aa4b1db42b5
341
module WinFFI module Comctl32 buffer = [ :PLAY, 0x0465, :STOP, 0x0466, :ISPLAYING, 0x0468, ] buffer += WinFFI.ascii? ? [:OPENA, 0x0464] : [:OPENW, 0x0467,] AnimateControlMessage = enum :animate_control_message, buffer define_prefix(:ACM, AnimateContro...
24.357143
67
0.595308
f76eb7952e391242201be11e0c06224eb2c08b0d
288
module Types class LinkType < BaseNode field :created_at, DateTimeType, null: false field :url, String, null: false field :description, String, null: false field :posted_by, UserType, null: false, method: :user field :votes, [Types::VoteType], null: false end end
28.8
58
0.697917
26b35383d348d4cac5298c1b788e7c785bf861b3
294
# frozen_string_literal: true module CloudPayments class Secure3D < Model property :transaction_id, required: true property :pa_req, required: true property :acs_url, required: true def id transaction_id end def required_secure3d? true end end end
17.294118
44
0.693878
d51ca80926263956ace92c32c113b8875fac0ba9
4,302
# CoursesController class CoursesController < ApplicationController before_action :set_course, only: [:take_random_quiz, :render_question_counter] before_action :set_course_admin, only: [:edit, :update, :destroy] before_action :check_if_enough_questions, only: [:take_random_quiz] before_action :check_for_consen...
31.632353
96
0.619944
390ccd952abaeb69d600093c77c6b2a0d89ac1cc
106
json.array!(@worlds) do |world| json.extract! world, :id json.url world_url(world, format: :json) end
21.2
42
0.698113
2625117918646f4b9f66f2ed43d491f24a84622c
997
require('capybara/rspec') require('./app') Capybara.app = Sinatra::Application set(:show_exceptions, false) describe('button adds artists to list', {:type => :feature}) do it('takes text input and adds it to a list') do visit('/') fill_in('artist', :with => 'Radiohead') click_button('Submit') expect(...
27.694444
81
0.652959
bbf3744b4d35f923b19b5cd24cf687446ab09541
1,540
class AddVmwareRoDatastoresToHostsStorages < ActiveRecord::Migration class HostsStorage < ActiveRecord::Base; end def up rename_table :hosts_storages, :host_storages add_column :host_storages, :read_only, :boolean # Find the sequence_start value for our region, if the region is # 0 then start at 1...
40.526316
81
0.73961
ac5f6762bc7fa4fd776ca9067408c2a777c9a608
7,511
# frozen_string_literal: true require './spec/spec_helper' require 'engine' module Engine describe Hex do let(:game) { GAMES_BY_TITLE['1889'].new(%w[a b]) } subject { game.hex_by_id('H7') } describe '#neighbor_direction' do it 'is a neighbor' do expect(subject.neighbor_direction(game.hex...
30.53252
99
0.46798
38167f429cf03ccf7009f232f172702795f702c7
142
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_amingilani_session'
35.5
80
0.809859
1a8b088d46f30a5de3b669cb9a4816d3089f192d
4,295
require File.expand_path('../../../lib/rdf/qualified_dc', __FILE__) require File.expand_path('../../../lib/rdf/bibo', __FILE__) require File.expand_path('../../../lib/rdf/nd', __FILE__) class ArticleMetadataDatastream < ActiveFedora::NtriplesRDFDatastream map_predicates do |map| map.title(in: RDF::DC) do |index|...
27.532051
95
0.648661
39f6026d91cd04b5de755a1100d8df18837fa60c
667
# frozen_string_literal: true module SnapshotsHelper def list_item_snapshot_list(resource) content_tag :p, class: :list_item_attribute do content = content_tag(:b, 'Snapshots: ') content << if resource.snapshots.any? resource.snapshots.collect do |snapshot| sna...
31.761905
90
0.622189
334931bbd615cc82692c11321450283d0074e889
1,969
# -*- encoding: utf-8 -*- # stub: actioncable 6.1.3 ruby lib Gem::Specification.new do |s| s.name = "actioncable".freeze s.version = "6.1.3" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.metadata = { "bug_tracker_uri" => "https://github.com/ra...
50.487179
414
0.700356
081d6474d16f13e670a0588e3e3a00896c7b44d7
178,992
# -*- coding: binary -*- # Check Rex::Parser.nokogiri_loaded for status of the Nokogiri parsers require 'rex/parser/nmap_nokogiri' require 'rex/parser/nexpose_simple_nokogiri' require 'rex/parser/nexpose_raw_nokogiri' require 'rex/parser/foundstone_nokogiri' require 'rex/parser/mbsa_nokogiri' require 'rex/parser/acunet...
28.081581
175
0.654219
917e6b244c521ffb05562b958b1a445d030c5dcc
154
class AddSentAtToCourseUserInvitations < ActiveRecord::Migration[4.2] def change add_column :course_user_invitations, :sent_at, :datetime end end
25.666667
69
0.798701
ed5c99dadcef1c1f35463e1ab8858f81cf19291c
2,568
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. require File.expand_path(File.join(File.dirname(__FILE__),'..','..','test_helper')) class NewRelic::Agent::WorkerLoopTest < Test::Unit::TestCase def setup ...
25.939394
83
0.693146
e832ca7ccf4ea91a4707163cca61f868d3fe1387
1,472
require_relative "boot" require "rails" # Pick the frameworks you want: require "active_model/railtie" require "active_job/railtie" require "active_record/railtie" require "active_storage/engine" require "action_controller/railtie" require "action_mailer/railtie" require "action_mailbox/engine" require "action_text/en...
33.454545
79
0.763587
ab333f1a81e4c86ad1ad7eb53fd7e3f7ea57dcf3
2,607
require('spec_helper') describe(Stylist) do describe('#name') do it('returns a stylists name') do test_stylist = Stylist.new({:name => 'Megan'}) expect(test_stylist.name()).to(eq('Megan')) end end describe('#id') do it('returns the id of the stylist') do test_stylist = Stylist.new...
28.648352
104
0.616801
5deba21dca14d39effba495d8b33f9a88bcd6be6
592
Pod::Spec.new do |s| s.name = 'GRMustache' s.version = '5.5.2' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'Flexible and production-ready Mustache templates for MacOS Cocoa and iOS.' s.homepage = 'https://github.com/groue/GRMustache' s.author = { 'Gwendal Roué' => 'gr@pierlis.com...
39.466667
90
0.638514
333d5adaa9ec6e7ea9767b94ee3df3805cdfda6d
7,938
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed (or created alongside the db with db:setup). # users = [ { :email => "admin@metacorp.com", :admin => true, :password => "admin1234", ...
24.728972
188
0.49874
33a8052ca7feed09599629c5415b763b1e5ae66a
1,399
require 'digest/md5' module DBLock extend self autoload :Adapter, 'db_lock/adapter' class AlreadyLocked < StandardError; end attr_accessor :db_handler def db_handler # this must be an active record base object or subclass @db_handler || ActiveRecord::Base end module Lock extend self ...
25.436364
116
0.644746
333d6378a7194fe6694b363dfd37c607968f34ce
2,651
require 'rspec' require './lib/git_commit' mock_log_response = '{"id":"'+SpecUtils::MockResponse.commit_hash+'","shortId":"80b0f9e","authorName":"'+SpecUtils::MockResponse.committer_name+'","committerName":"'+SpecUtils::MockResponse.committer_name+'","committerEmail":"'+SpecUtils::MockResponse.committer_email+'","subj...
33.556962
337
0.723878
39330f53d9a9600813998c16104821cfb6915507
1,531
# frozen_string_literal: true module Nylas # Ruby representatin of a Nylas Draft object # @see https://docs.nylas.com/reference#drafts class Draft include Model self.resources_path = "/drafts" allows_operations(creatable: true, showable: true, listable: true, updatable: true, destroyable: true) ...
26.396552
106
0.700196
032ea80c7d114ecbb9a48d46c7c6962c059d4343
872
module Categorizable module ClassMethods def self.extended(base) base.has_many :categorizations, :class_name => 'Categorizable::Categorization', :as => :categorizable, :dependent => :delete_all base.has_many :categories, :through => :categorizations base.named_scope :wild_s...
31.142857
73
0.677752
4a4ecf98977bc8dd76efc1a2de14b3704a46b317
980
require 'spec_helper' require 'generators/doorkeeper/install_generator' describe 'Doorkeeper::InstallGenerator' do include GeneratorSpec::TestCase tests Doorkeeper::InstallGenerator destination ::File.expand_path('../tmp/dummy', __FILE__) describe 'after running the generator' do before :each do pr...
30.625
153
0.726531
87f515415c40aea2507446ee50296dabe8d8c9cc
757
module FileUtil def self.read_three_parts(filename, begin_middle, begin_after) lines_before = [] lines_middle = [] lines_after = [] File.open(filename, 'r') do |f| state = :BEFORE f.each_line do |line| case line.strip when begin_middle lines_before << line ...
23.65625
64
0.52576
e2b00b098e32e6baaed094ff00483d96e1f4b668
251
class CreateFavorites < ActiveRecord::Migration[5.2] def change create_table :favorites do |t| t.references :user, foreign_key: true t.references :like, foreign_key: { to_table: :houses } t.timestamps end end end
20.916667
60
0.661355
b9e11d5fef4051c206c184a774557e38468054d0
469
name 'sinopia' maintainer 'Barthelemy Vessemont' maintainer_email 'bvessemont@gmail.com' license 'Apache 2.0' description 'Install a sinopia NPM server (cache & private repo) See : https://github.com/rlidwka/sinopia/' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.3.0' supports 'ub...
24.684211
72
0.746269
288ea56de8f64ab7db7f637351073a33dda1a22c
121,453
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
45.11627
142
0.64574
79bdcec7944ef20b260566a996c1519ddce6d232
11,383
# frozen_string_literal: true require 'spec_helper' RSpec.describe 'Creation of a new release' do include GraphqlHelpers include Presentable let_it_be(:project) { create(:project, :public, :repository) } let_it_be(:milestone_12_3) { create(:milestone, project: project, title: '12.3') } let_it_be(:milestone...
30.764865
171
0.637969
18eb1427d75f429dc25661b5043c476d201d5a40
2,628
#! /usr/bin/env ruby -S rspec require 'spec_helper' require 'puppet/settings' require 'puppet/settings/string_setting' describe Puppet::Settings::StringSetting do StringSetting = Puppet::Settings::StringSetting before(:each) do @test_setting_name = :test_setting @test_setting_default = "my_crazy_default...
34.578947
114
0.578006
e2155e7e8cd28c2e903cbb86a3e1014937ae8112
302
class AddOmniauthToTeachers < ActiveRecord::Migration[5.2] def change add_column :teachers, :provider, :string add_column :teachers, :uid, :string add_column :teachers, :token, :string add_column :teachers, :expires_at, :integer add_column :teachers, :expires, :boolean end end
30.2
58
0.725166
e2a8fd9d312ce82b53a3d57ab0fe647b2e0fce26
266
require "sass/globbing" require "compass" paths = Compass.sass_engine_options[:load_paths].select { |v| v.is_a?(Sass::Importers::Filesystem) } ENV["SASS_PATH"] = "#{ENV["SASS_PATHS"]}#{File::PATH_SEPARATOR}#{paths.map{ |v| v.root }.join( File::PATH_SEPARATOR )}"
33.25
100
0.706767
d599165461991c50b5dc532902aba0eedbf5dd34
5,296
require 'json' require './constants' Z = ENV['Z'].to_i def tippecanoe(layer) case Z when 8 case layer when 'm50100-150' { layer: layer, minzoom: 5, maxzoom: 8 } when 'm50100-140' { layer: layer, minzoom: 7, maxzoom: 8 } when 'm50100-344' { layer: layer, minzoom: 5, maxzoom: 8 } ...
29.752809
73
0.563066
21de8d281da0ea8b635d867f02348306cd71032e
6,961
require 'discordrb' puts '[Discord bot]: Initializing' if !ENV['EXCEPTION_BOT_TOKEN'].blank? $discord_bot = Discordrb::Bot.new token: ENV['EXCEPTION_BOT_TOKEN'], client_id: 717812663761240117 end $discord_bot_channel_code = 717989750421848115 $discord_bot_channel_notifications = 742414195928203296 $discord_bot_docu...
40.707602
116
0.744577
61679087b228de10bfba007e5430a82765012d21
1,823
# Copyright (c) 2017-present, Facebook, Inc. All rights reserved. # # You are hereby granted a non-exclusive, worldwide, royalty-free license to use, # copy, modify, and distribute this software in source code or binary form for use # in connection with the web services and APIs provided by Facebook. # # As with any so...
42.395349
138
0.749314
21c938d8ca2b907b4dfd79474b669acae2885ddb
1,048
# frozen_string_literal: true # rubocop-performance # Performance/Detect # see https://github.com/rubocop-hq/rubocop-performance/blob/master/manual/cops_performance.md#performancedetect require 'benchmark_driver' output = :gruff versions = ['2.3.8', '2.4.6', '2.5.4', '2.6.3', '2.7.0-preview1'] Benchmark.driver(outp...
21.387755
112
0.630725
7a5062d4b51908271a356a06feeda82825d1985e
525
# typed: true class PlatformPolicy < ApplicationPolicy attr_reader :user, :platform def initialize(user, platform) @user = user @platform = platform end def index? true end def show? true end def create? user_is_moderator_or_admin? end def update? user_is_moderator_or_ad...
13.125
44
0.67619
870f05be3a7acaea35eab07945c936b01fa604b5
388
class AddPlatformIdToTasks < ActiveRecord::Migration[5.1] def change change_table :tasks do |t| t.belongs_to :platform, foreign_key: true end migrate_sql = <<-SQL UPDATE tasks SET platform_id=test_cases.platform_id FROM test_cases WHERE tasks.test_case_id=test_cases.id S...
24.25
57
0.708763
080394744e2b45c2bd6f9b17f7f98f585960d0e8
124
require_relative '../../../../test/support/rspec/configurer' AMA::Entity::Mapper::Test::RSpec::Configurer.configure(:unit)
31
61
0.717742
91037450b1c3725af490f1b749cc8ef4fef607fd
1,465
class Osm < Formula desc "Open Service Mesh (OSM)" homepage "https://openservicemesh.io/" url "https://github.com/openservicemesh/osm.git", tag: "v0.11.1", revision: "c01aefae509d59735d7908a32a359327ff3f2322" license "Apache-2.0" bottle do sha256 cellar: :any_skip_relocation, arm64_monte...
44.393939
123
0.751536
f8f558d6469c1b31fb4cabf847cb144e6657a5c8
1,168
require 'spec_helper_acceptance' describe 'feature' do it 'enable features' do pp = <<-EOS netscaler_feature { 'Responder': ensure => 'present', } netscaler_feature { 'SSL Offloading': ensure => 'present', } netscaler_feature { 'SSL VPN': ensure => 'present', } netscaler_feature { 'Content S...
20.857143
42
0.643836
edfce9ac42c1dee39969e96f423c6a7c60464f81
3,135
require 'extend/module' require 'extend/fileutils' require 'extend/pathname' require 'extend/ARGV' require 'extend/string' require 'extend/symbol' require 'utils' require 'exceptions' require 'set' require 'rbconfig' ARGV.extend(HomebrewArgvExtension) HOMEBREW_VERSION = '0.9.4' HOMEBREW_WWW = 'http://brew.sh' def ca...
31.039604
114
0.739713
03df7becddebcdc603d4c9d47b0e9b8ede828982
3,443
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
36.62766
118
0.674121
395b1aef281afff87bde545196d59d34ca1baf4b
861
ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require "minitest/reporters" Minitest::Reporters.use! class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. fixtures :all include Applicatio...
23.916667
82
0.672474
f8aeb38e888c769078caf2de91e23855b770e5b8
2,862
class Mono < Formula version "3" desc "Cross platform, open source .NET development framework" homepage "http://www.mono-project.com/" url "http://download.mono-project.com/sources/mono/mono-3.12.1.tar.bz2" sha256 "5d8cf153af2948c06bc9fbf5088f6834868e4db8e5f41c7cff76da173732b60d" bottle do rebuild 1 ...
33.27907
128
0.683788
f8e39a41cdc3fe6754b436e9551a8206bad38956
351
require_relative 'boot' require 'rails/all' Bundler.require(*Rails.groups) module SampleApp class Application < Rails::Application config.load_defaults 6.0 config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] config.i18n.available_locales = [:en, :vi] config.i18n....
21.9375
90
0.695157
286eebcd0a620caabfe4c21c1ab657a253d60c79
748
require 'serverspec' # Required by serverspec set :backend, :exec describe package('httpd'), :if => os[:family] == 'redhat' do it { should be_installed } end describe package('apache2'), :if => os[:family] == 'ubuntu' do it { should be_installed } end describe service('httpd'), :if => os[:family] == 'redhat' do...
20.216216
71
0.664439
b9b1cb79c5bd6ca2dd22c8feef2665dfdf6924b9
355
module HttpVanilli module NetHttp class StubSocket #:nodoc: def initialize(*args) end def closed? @closed ||= true end def readuntil(*args) end end module ResponseMixin #:nodoc: def read_body(*args, &block) yield @body if block_given? ...
13.653846
35
0.55493
01cd6c0c067de7a4f442b8de704f1a00c9151f38
876
## # = Observation model # # This class provides observation-specific logic, particularly for parsing # observations from FHIR-formatted data. class Observation ## # Parses a list of observations from FHIR-formatted data # # Params: # +fhir+:: FHIR-formatted data # # Returns: # +Array+:: ...
23.675676
84
0.646119
d592dd3770f721aad47faffb201128ca5c66e507
573
require_relative "../lib/php_pecl_formula" class PhpAT80Mongodb < PhpPeclFormula extension_dsl "MongoDB driver" url "https://pecl.php.net/get/mongodb-1.11.1.tgz" sha256 "838a5050de50d51f959026bd8cec7349d8af37058c0fe07295a0bc960a82d7ef" license "Apache-2.0" bottle do root_url "https://kabel.jfrog.io/art...
30.157895
87
0.804538
bfd871962311035d430547e77b3ac64eaf568d23
3,347
class Curve < Array attr_accessor :cr def initialize(cr) @cr = cr end def draw draw_control_points(self) end def draw_control_points(control_points) cr.move_to(*control_points.first.point) cx1, cy1 = control_points.first.leading_point control_points[1..-1].each do |point| cx2, c...
27.661157
135
0.629519
87fffaa8d02c5cc4649ec8e8fc6039d9b637df00
35
module Mti VERSION = "0.0.1" end
8.75
19
0.628571
398179b86e7aa624a5a248866ee9973d8a79119d
3,535
# frozen_string_literal: true require_relative 'controller_resource_finder.rb' require_relative 'controller_resource_name_finder.rb' require_relative 'controller_resource_builder.rb' require_relative 'controller_resource_sanitizer.rb' module CanCan module ControllerResourceLoader include CanCan::ControllerResour...
28.97541
107
0.700707
019b8082c1b1ab56796d915304999b389922befb
1,046
# == Schema Information # # Table name: case_workers # # id :integer not null, primary key # created_at :datetime # updated_at :datetime # location_id :integer # roles :string # deleted_at :datetime # uuid :uuid # FactoryBot.define do factory :case_worker do transient do ...
21.791667
168
0.632887
5d9c35b6e6fe40cdbc7467f8fbf6fe864c9f3508
1,442
require 'spec_helper' class Kalc::Stdlib end describe Kalc::Stdlib do before(:each) do @grammar = Kalc::Grammar.new @transform = Kalc::Transform.new end describe 'PLUS_ONE' do it { expect(evaluate('PLUS_ONE(1)')).to eq(2) } it { expect(evaluate('PLUS_ONE(101)')).to eq(102) } it { expect(eva...
24.862069
62
0.610957
6172a23de9c42bade5769ecd88a427bf9bd524d1
263
Rails.application.config.x.imageproxy.host = ENV["IMAGEPROXY_HOST"] || Rails.application.credentials.imageproxy&.fetch(:host) Rails.application.config.x.imageproxy.secret_key = ENV["IMAGEPROXY_KEY"] || Rails.application.credentials.imageproxy&.fetch(:secret_key)
87.666667
136
0.809886
61b18a1c7a5093a7d794a3f42a5eb7a98b1134d6
658
module Mutations module Language class Delete < Mutations::AuthorisedMutation graphql_name 'DeleteLanguage' argument :id, String, required: true field :errors, [String], null: true field :message, String, null: false def resolve(id:) language = current_account.languages.fi...
21.933333
62
0.553191
b91b52fa0f0a23603741eb6d653fba1507971d03
13,281
require_relative '../spec_helper' require_relative 'fixtures/rescue' class SpecificExampleException < StandardError end class OtherCustomException < StandardError end class ArbitraryException < StandardError end exception_list = [SpecificExampleException, ArbitraryException] describe "The rescue keyword" do before...
25.738372
109
0.655975
393a2d04231b9d7ef769ec3545060ba862ab442b
240
# frozen_string_literal: true require 'rails_best_practices/reviews/review' module RailsBestPractices module Plugins module Reviews class NotUseRailsRootReview < RailsBestPractices::Reviews::Review end end end end
18.461538
71
0.766667
ff2c770b8ad86238c9bf844dcbceb22780457b8c
1,219
cask "microsoft-edge" do version "87.0.664.75" sha256 "a4929b986cdd2daa73389b41a9088888a160075170c04b090c70e7ca5156c863" url "https://officecdn-microsoft-com.akamaized.net/pr/C1297A47-86C4-4C1F-97FA-950631F94777/MacAutoupdate/MicrosoftEdge-#{version}.pkg", verified: "officecdn-microsoft-com.akamaized.net/"...
32.078947
137
0.706317
5d5022e64aafc609ec0c8bdfb96861fe153a7593
571
require "audit_history" class AuditsController < ApplicationController def index @history = AuditHistory.new(audit_log) end private def audit_log case when params.key?(:hour_id) return hour_log when params.key?(:mileage_id) return mileage_log when params.key?(:project_id) ...
16.794118
52
0.698774
0139b0ebbf7af3332d4c20ca9134838c99617d29
31
TVC::Engine.routes.draw do end
10.333333
26
0.774194
e96d5b672eef69a13a854cfaa5c6c73551503417
57
module ActsAsIdBankCertification VERSION = "0.1.0" end
14.25
32
0.77193
6afc45f5b322abacd81a21a3f61c91c68945c58c
3,049
# frozen_string_literal: true module Wallaby # Helper methods to build custom elements module StylingHelper # backforward compatible with FontAwesome 4 # @see this fa migration document https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4 FONT_AWESOME_MAPPING = { 4 => { ...
31.43299
114
0.622171
ab2f10c4f72139a9844b291d10112c06682b0052
2,919
=begin #BitbarCloud API #BitbarCloud API. OpenAPI spec version: 2.100.0 Contact: damian.sniezek@smartbear.com Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.13 =end require 'spec_helper' require 'json' require 'date' # Unit tests for BitbarCloudApiClient::APIListOfAPI...
28.617647
102
0.722165
5daa83442ac8121edb777b28ce475be82cfa400e
1,569
require File.dirname(__FILE__) + "/../../spec_helper" describe Admin::UsersController do scenario :users test_helper :logging it "should be a ResourceController" do controller.should be_kind_of(Admin::ResourceController) end it "should handle Users" do controller.class.model_class.should == User ...
31.38
87
0.601657
e2b372e6f2605cec9c95aa5c808893e10955c139
396
# frozen_string_literal: true require 'is_this_used/cruft_tracker' module Fixtures class ExampleCruft7 include IsThisUsed::CruftTracker attr_accessor :name def initialize(name) @name = name end def self.hello 'Hi' end def hello "Hi, #{name}" end is_this_use...
15.230769
80
0.676768
7afc4149f2b5c9ef705513669af4475d386d2196
8,167
# # Be sure to run `pod spec lint YTDevelopTools.podspec' to ensure this is a # valid spec and to remove all comments including this before submitting the spec. # # To learn more about Podspec attributes see https://guides.cocoapods.org/syntax/podspec.html # To see working Podspecs in the CocoaPods repo see https:/...
37.292237
112
0.633403
1daa4be02da24b28b1ddf9f85653fd37b03befc0
353
module BookKeeping VERSION = 4 end class Complement @@dnaToRna = { 'C' => 'G', 'G' => 'C', 'T' => 'A', 'A' => 'U' } def self.of_dna(dna) dnaChars = dna.chars if (dnaChars - @@dnaToRna.keys).empty? rnaMap = dnaChars.map { |nucleotide| @@dnaToRna[nucleotide] } rnaMap.join() ...
16.045455
67
0.526912
e2072e180327c112fcc8f3efa776ccbafc47ed74
331
module Formatter class Model def initialize(attributes) @attributes = attributes.fetch('attributes', []) end def attributes build_code end private def build_code @attributes.map do |att| "#{att.first}:#{(att.last || 'string')}" end.compact.join(' ') end ...
15.045455
54
0.586103