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
267eaace3df2ec80274b48db7d52280879eb37a5
619
require 'xcpretty/term' module XCPretty describe Term do it "marks unicode as unavailable" do Encoding.stub(:default_external).and_return(Encoding::ASCII) Term.unicode?.should be false end it "marks unicode as available" do Encoding.stub(:default_external).and_return(Encoding::UTF_8) ...
22.925926
66
0.678514
014044329a20df7ba91f3f11076bba2e51ad0812
46
require 'action_dispatch' require 'rack/test'
15.333333
25
0.804348
acbe8a45cc68e9793c847ccb860e149a84cd82b6
22,836
# frozen_string_literal: true shared_examples 'initializer with url' do context 'with simple url' do let(:address) { 'http://sushi.com' } it { expect(subject.host).to eq('sushi.com') } it { expect(subject.port).to eq(80) } it { expect(subject.scheme).to eq('http') } it { expect(subject.path_pref...
31.282192
107
0.606148
7aca756a7c4d22673b96a9fee343c7aa767c1a2a
264
FactoryGirl.define do factory :search, class: KatSearch::Search do search 'suits s05e16' initialize_with { new(search) } end factory :search_failed, class: KatSearch::Search do search 'suits s05e72' initialize_with { new(search) } end end
22
53
0.708333
38f526d91a4b0d89a0614d948f919145206cb3e9
2,755
# 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::V2020_06_01 module Models # # Network Intent Policy resource. # class NetworkIntentPolicy < Resource i...
27.828283
76
0.427223
1d9cc707aafd4ca0675bd4d004171fb15aed33a5
1,330
class Libraw < Formula desc "Library for reading RAW files from digital photo cameras" homepage "https://www.libraw.org/" url "https://www.libraw.org/data/LibRaw-0.19.0.tar.gz" sha256 "e83f51e83b19f9ba6b8bd144475fc12edf2d7b3b930d8d280bdebd8a8f3ed259" bottle do cellar :any sha256 "3304c2735f53a0967fd6...
31.666667
93
0.712782
ed60164d214402859269f7bf195f8996c97f7744
282
cask 'hashbackup' do version '2125' sha256 '462a6f5c1d0194712ea2c6ebba0480fdbe17aafaf3735f009595e0bdf98daf6c' url "http://www.hashbackup.com/download/hb-#{version}-mac-64bit.tar.gz" name 'hashbackup' homepage 'http://www.hashbackup.com/' binary "hb-#{version}/hb" end
25.636364
75
0.751773
6a605d3ce17e0b2f5e0bad730606c6f2bb989ad1
1,167
require "bundler/setup" require "pressy" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! config.expect_with :rspe...
26.522727
76
0.703513
9187a71d1fa6090ff66040507d12540ee510b70d
1,333
class Nettoe < Formula desc "Tic Tac Toe-like game for the console" homepage "https://nettoe.sourceforge.io/" url "https://downloads.sourceforge.net/project/nettoe/nettoe/1.5.1/nettoe-1.5.1.tar.gz" sha256 "dbc2c08e7e0f7e60236954ee19a165a350ab3e0bcbbe085ecd687f39253881cb" license "GPL-2.0" livecheck do ...
43
120
0.770443
397b758fafc6bcbe8eb58c83547b0eb625c57c9d
448
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'ruby-jmeter' test do threads count: 10 do visit name: 'Home Page', url: 'https://flooded.io' end end.rsync( remote_host: 'xxx.xxx.xxx.xxx', remote_user: 'user', remote_path: '/path/to/remote', rsync_bin_path: '/usr/bin/rsync', ...
26.352941
66
0.642857
388f6430b190f2dc6b037220d2ad2a78dd722147
5,573
=begin #YNAB API Endpoints #Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com OpenAPI spec ...
29.331579
277
0.625695
91756df754bd4c55d61412f67a680914f8a43272
657
module Fog module Cloudstack class Compute class Real # Create a virtual router element. # # {CloudStack API Reference}[http://cloudstack.apache.org/docs/api/apidocs-4.4/root_admin/createVirtualRouterElement.html] def create_virtual_router_element(*args) options = ...
25.269231
130
0.578387
7a82c106b1c8a10ab8f53eaa973e21ff67237675
512
require('rspec') require('hangman') describe(Hangman) do describe('#answer') do it("gives a six letter answer") do test_word = Hangman.new(answer: "horses") expect(test_word.answer()).to(eq(["h", "o", "r", "s", "e", "s"])) end end describe('#user_guess') do it("checks to see if the lett...
24.380952
81
0.583984
d54e3d21f324b396c8c0abcb37b3eeb698b05a1d
1,458
require 'spec_helper' describe "Uploads" do if Settings.file_uploads_engine != :carrierwave pending "paperclip not detected, skipped. To run use UPLOADS=carrierwave rspec" else before :each do f = "#{File.dirname(__FILE__)}/../uploads/1024x768.gif" if File.file?(f) File.unlink(f) ...
34.714286
121
0.673525
4a74b122a360c8d8421e238cbe0e0593b6a6593f
2,079
# 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 #...
35.237288
86
0.720539
1c57c35cac0688f38994f8deecb1e019aafc2501
1,770
require 'test_helper' class UsersEditTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) end test "unsuccessful edit" do log_in_as(@user) get edit_user_path(@user) assert_template 'users/edit' patch user_path(@user), params: { user: { name: "", ...
31.607143
78
0.50113
1107b28f3fe9bc717cbd860a02988ab8c7cdd72c
885
# # SmartRails # Ruby on Rails Project # (C) Alessio Saltarin 2021 # MIT License # class SessionsController < ApplicationController # # Called on Login GET # def new logger.info('Sessions controller - new') end # # Create new session: called on Login POST # def create @errors = false lo...
19.23913
89
0.647458
793ffbbfad9605b4569bba960be32d0ba3ca8eca
8,531
# frozen_string_literal: true require 'spec_helper' RSpec.describe Projects::SnippetsController do include Gitlab::Routing let_it_be(:user) { create(:user) } let_it_be(:other_user) { create(:user) } let_it_be(:project) { create(:project_empty_repo, :public) } before do project.add_maintainer(user) ...
26.493789
150
0.619974
28d7ab7ecabe91430de9bb0c218a225d9aa63ea1
4,555
require 'minitest_helper' describe Fog::Compute::XenServer::Models::StorageRepository do let(:storage_repository_class) do class Fog::Compute::XenServer::Models::StorageRepository def self.read_identity instance_variable_get('@identity') end end Fog::Compute::XenServer::Models::Storag...
49.51087
94
0.380022
bb30605d7103a6c6e96739bb0f94c22c57d59000
385
# 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::DataMigration::Mgmt::V2017_11_15_preview module Models # # Defines values for ResourceSkuRestrictionsType # module ResourceS...
24.0625
70
0.74026
386a7705104a4a797325a117229b957a1d783bb0
851
# Copyright 2022 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, ...
38.681818
110
0.73678
bfcd3ff1cf11a3ff61dbfea88cb6b865fd2153e9
2,782
module Polaris class FormBuilder < ActionView::Helpers::FormBuilder include ActionView::Helpers::OutputSafetyHelper attr_reader :template delegate :render, :pluralize, to: :template def errors_summary return if object.blank? return unless object.errors.any? model_name = object.cl...
31.613636
96
0.649173
7922c0553d38d29ebefa1a856561ff732fd0366c
464
# # encoding: utf-8 # Inspec test for recipe sudo::panavaserver3 # The Inspec reference, with examples and extensive documentation, can be # found at http://inspec.io/docs/reference/resources/ unless os.windows? # This is an example test, replace with your own test. describe user('root'), :skip do it { shoul...
24.421053
73
0.724138
6a7d6f203b5a7951a5c6bd6a2bb3b05ccd513758
1,023
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') class EmailAfterBeingDeliveredTest < ActiveSupport::TestCase def setup ActionMailer::Base.deliveries = [] @email = new_email( :subject => 'Hello', :body => 'How are you?', :sender => create_email_address(:spec => 'web...
34.1
70
0.68915
1cfd643480cab7aaf289805e85dc07aa9cbb542a
9,981
require 'cgi' require 'uri' require 'httparty' require 'hashie' require 'json' module CreateSend USER_AGENT_STRING = "createsend-ruby-#{VERSION}-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}-#{RUBY_PLATFORM}" # Represents a CreateSend API error. Contains specific data about the error. class CreateSendError < StandardErr...
34.536332
103
0.65244
5d9e8ff45123e15f428808aef7b89b30e8c15824
2,005
# ------------------------------------------------------------------------- # Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. # ------------------------------------------------------------------------- class Wso2amMicroGw320 < Formula desc "WSO2 API Micro Gateway 3.2.0" homepage "https://w...
37.830189
181
0.616958
1d0a91ca7027f3b5489c39422d4e9157438b42a1
1,576
Puppet::Type.newtype(:dism) do @doc = 'Manages Windows features via dism.' ensurable newparam(:name, :namevar => true) do desc 'The Windows feature name (case-sensitive).' end newparam(:answer) do desc 'The answer file for installing the feature.' end newparam(:source) do desc "The source ...
23.522388
85
0.663706
e96f336f846a795b108552b5f631dfa324c866ac
178
module EcwidApi class ProductType < Entity self.url_root = "classes" ecwid_reader :id, :attributes, :name, :googleTaxonomy ecwid_writer :attributes, :name end end
19.777778
57
0.724719
219b6b8a22cba56faf423e3ebcd01f3dd65eb745
1,793
# 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...
36.591837
95
0.740658
3803558128a003a7c09163614cb94385995c45a3
5,708
# # rm-macl/lib/rm-macl/xpan/grid/grid3.rb # by IceDragon require 'rm-macl/macl-core' module MACL class Grid3 CELL_ORDER_COLS = 1 CELL_ORDER_ROWS = 2 CELL_ORDER_LAYS = 3 @default_cell_order = CELL_ORDER_LAYS attr_accessor :columns, :rows, :layers attr_accessor :cell_width, :cell_height, :...
27.180952
83
0.544849
eda6670c31358d3cc660ae9100ca61fa0de24e37
175
RSpec.describe Tippy do it "has a version number" do expect(Tippy::VERSION).not_to be nil end it "does something useful" do expect(false).to eq(true) end end
17.5
40
0.691429
ff7f884c0892d69f8080b249c3a697b2d2497416
146
# frozen_string_literal: true RSpec.configure do |config| config.mock_with :rspec do |mocks| mocks.verify_partial_doubles = true end end
18.25
39
0.760274
4a38134473c6d2b0cd93a24b89c1696c5b91d3e0
1,337
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'vagrant-qienv/version' Gem::Specification.new do |spec| spec.name = "vagrant-qienv" spec.version = VagrantPlugins::Cienv::VERSION spec.authors = ["Alfredo Matas"] spe...
39.323529
85
0.673897
ac473d9ba655926e50f20f50239aabd18348ed09
74
class <%= class_name %> < Less::Interaction def run end private end
12.333333
43
0.662162
33fc1f76cd7e446aadcfd77aedef1fb8ef345b07
117
require 'ecm/version' module Ecm module Files module Backend VERSION = ::Ecm::VERSION end end end
11.7
30
0.649573
1acb9036a441a7d8e3f1e08597346dd1957a77a2
134
class AddAdminToUsers < ActiveRecord::Migration[5.2] def change add_column :users, :admin, :boolean, :default => false end end
22.333333
57
0.723881
260c2386f743453515539a3e4bfb09d5e727eacb
2,316
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :omniauthable, :registerable, :recoverable, :validatable devise :database_authenticatable, :rememberable, :trackable belongs_to :data_center belongs_to :user_role after_initiali...
30.077922
159
0.736615
1d5b8b237756b14438c82fe2c50b1ceabaa07983
1,795
# frozen_string_literal: true require 'aws_backend' class AwsSecurityGroups < AwsResourceBase name 'aws_security_groups' desc 'Verifies settings for AWS Security Groups in bulk' example " # Verify that you have security groups defined describe aws_security_groups do it { should exist } end ...
29.916667
88
0.641226
abfff5adfb558fbd296ae533a8514b163a0d7bf7
1,009
require 'formula' class Luabind < Formula homepage 'http://www.rasterbar.com/products/luabind.html' url 'http://downloads.sourceforge.net/project/luabind/luabind/0.9.1/luabind-0.9.1.tar.gz' sha1 '2e92a18b8156d2e2948951d429cd3482e7347550' depends_on 'lua' depends_on 'boost' depends_on 'boost-build' => :bui...
27.27027
96
0.682854
bf304d79bf63a40f849d730ea17843406065c5fa
876
FactoryBot.define do factory :document_hash, class: Hash do sequence :title, 1 do |n| "document_title_#{n}" end sequence :link, 1 do |n| "path/to/document_#{n}" end content_id { SecureRandom.uuid } sequence :description, 1 do |n| "description_#{n}" end public_timestam...
26.545455
65
0.616438
ed77b970c768f6a5ab313a902176ba488e92015d
1,068
module Poser class Comment def self.positive(name=nil) if name ["#{name.capitalize}! Let's hang out some time.", "#{name.capitalize} is my favorite person on this platform.", "#{name.capitalize} is doing an amazing job."].sample else ["I couldn't agree more.", "This is why I downloade...
35.6
177
0.621723
bf831027c886e092c9c91cfa303e94983e62fdb8
739
module Spree class File < Spree::Base belongs_to :line_item #has_attached_file :image, styles: { medium: "300x300>", thumb: "100x100>" }, default_url: "/images/:style/missing.png" has_attached_file :image, styles: { thumb: "100x77" , medium: "500x385"} #validates_attachment_content_type :image, conte...
41.055556
135
0.722598
e863d82e1b768a9571c16ee5e82794d299881e86
945
cask "canon-ijscanner4" do version "4.0.0a,19_2" sha256 "abf852e335ee47947becd99eddece2159fa293225096b083578a174ec1f08778" # gdlp01.c-wss.com/gds/ was verified as official when first introduced to the cask url "https://gdlp01.c-wss.com/gds/1/0100006581/02/misd-mac-ijscanner4-#{version.before_comma.dots_to_unde...
67.5
179
0.77672
abf67189e2f0f31924c13b6c4aa1fa5ed9196dd6
5,477
# frozen-string-literal: true module Rodauth Feature.define(:login_password_requirements_base, :LoginPasswordRequirementsBase) do translatable_method :already_an_account_with_this_login_message, 'already an account with this login' auth_value_method :login_confirm_param, 'login-confirm' auth_value_method...
33.601227
123
0.738908
bfc8a4a524f0af99bd5ee24226a69d31057ada81
309
module Fog module KeyManager class TeleFonica class Real def delete_container(id) request( :expects => [204], :method => 'DELETE', :path => "containers/#{id}" ) end end class Mock end end end end
16.263158
42
0.459547
bb5bd6a061f379d45697c086d0836099d2c196fa
2,082
module Spree module PromotionHandler # Decides which promotion should be activated given the current order context # # By activated it doesn't necessarily mean that the order will have a # discount for every activated promotion. It means that the discount will be # created and might eventually bec...
39.283019
174
0.695965
b9819bccffacc399cab91b4cab8cf283dcfadfd6
14,457
# frozen_string_literal: true # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render inv...
48.19
154
0.751262
33b165b2f8140b9686f84bca80f073205f24dc14
1,796
require 'test_helper' class UserTest < ActiveSupport::TestCase # test "the truth" do # assert true # end def setup @user=User.new(name:"Teresia Muiruri" ,email: "teresia@example.com",password: "foobar", password_confirmation: "foobar") end test "should be valid" do assert @user.valid? end ...
30.440678
124
0.668708
1cb085049080d0ff2f1e7849c95457f2dd6b9b58
1,251
require 'commands' # Holds positional arrays in relation to cardinal directions module Direction NORTH = [0, -1] SOUTH = [0, 1] EAST = [1, 0] WEST = [-1, 0] STILL = [0, 0] # Returns all contained items in each cardinal # :return: An array of cardinals def self.all_cardinals return [NORTH, SOUTH, ...
21.568966
79
0.670663
6a9e42a2b1ea9b99fbe8a4d2e829262943a842a7
1,534
Pod::Spec.new do |s| s.name = "SGLog" s.version = "0.0.4" s.summary = "ObjectiveC logging macros" s.description = <<-DESC SGLog is a macro based logger which allows you to embed significant logging code in your projec...
51.133333
105
0.552151
e8c8205946c0d87f05bb03a1396338c56e9a55da
1,728
# Cookbook Name:: varnish # Recipe:: default # Author:: Joe Williams <joe@joetify.com> # Contributor:: Patrick Connolly <patrick@myplanetdigital.com> # # Copyright 2008-2009, Joe Williams # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
29.793103
77
0.720486
d5fdb642a88578722f8b1ed4cf8bf8a0fda23d34
1,780
# -*- ruby -*- # encoding: utf-8 require File.expand_path("lib/google/area120/tables/v1alpha1/version", __dir__) Gem::Specification.new do |gem| gem.name = "google-area120-tables-v1alpha1" gem.version = Google::Area120::Tables::V1alpha1::VERSION gem.authors = ["Google LLC"] gem.email ...
46.842105
348
0.674157
e82f91f08767d45602ae5790b909c897ece6c622
25,837
# -*- coding: binary -*- module Msf ### # # This module provides methods for brute forcing authentication # ### module Auxiliary::AuthBrute def initialize(info = {}) super register_options([ OptString.new('USERNAME', [ false, 'A specific username to authenticate as' ]), OptString.new('PASSWORD...
36.338959
213
0.672446
1a63be73f39cc52c74e99e2a4d6db935ada47a16
7,789
require "digest/md5" require "securerandom" require "set" require "log4r" require "vagrant/util/counter" require_relative "base" module VagrantPlugins module Chef module Provisioner # This class implements provisioning via chef-zero. class ChefZero < Base extend Vagrant::Util::Counter ...
37.090476
102
0.596482
28c820c74a941a41c79bf98f2fa2518a5faa366d
1,543
lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'improved_jenkins_client/version' Gem::Specification.new do |s| s.name = "improved_jenkins_client" s.version = ::JenkinsApi::Client::VERSION s.required_rubygems_version = Gem::Requirement.new(">= 0") if s....
42.861111
107
0.687622
793ffd7bc513828831a9557c579d0d5243b72ae2
116
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) require "uk_companies_house" require "minitest/autorun"
23.2
58
0.767241
87e5dd58ab509689c2e3e005cbbacb20f343b06f
1,076
require "hand_helper" require "rspec/its" Hand.deck = CardDeck::Deck.new RSpec.describe Hand do describe "::MDHV" do subject {Hand::MDHV} it {is_expected.to eq 16} end describe ".deck" do subject {Hand.deck} it {is_expected.to be_an_instance_of Array} its(:sample) {is_expected.to be_an_instanc...
30.742857
103
0.631041
26688ec330adaa668668f9ab48100a7276333382
1,377
# Copyright 2009 ThoughtWorks # # 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...
36.236842
78
0.734931
79bb901d3488d2eb52fc22fbb1b904d938020e89
4,981
module Facebook module Messenger module Incoming # # Message class represents an incoming Facebook Messenger message event. # @see https://developers.facebook.com/docs/messenger-platform/reference/webhook-events/messages # class Message include Facebook::Messenger::Incoming::...
28.791908
115
0.563541
03835ca54f50c89e3e13366368ccfc5da99ac545
6,654
# typed: strict # frozen_string_literal: true begin require "google/protobuf" rescue LoadError return end module Tapioca module Compilers module Dsl # `Tapioca::Compilers::Dsl::Protobuf` decorates RBI files for subclasses of # [`Google::Protobuf::MessageExts`](https://github.com/protocolbuffers/...
31.535545
115
0.537872
21f9ecd200672e8bca804aa5f287ffffa98b8648
6,559
# VL 2014 -- VL Verilog Toolkit, 2014 Edition # Copyright (C) 2008-2015 Centaur Technology # # Contact: # Centaur Technology Formal Verification Group # 7600-C N. Capital of Texas Highway, Suite 300, Austin, TX 78731, USA. # http://www.centtech.com/ # # License: (An MIT/X11-style license) # # Permission is here...
26.554656
79
0.700412
b99c02351d0c2514b50fdd58eeff28cf0984bebe
1,403
# frozen_string_literal: true require 'spec_helper' describe Banzai::ReferenceParser::MentionedProjectParser do include ReferenceParserHelpers let(:group) { create(:group, :private) } let(:user) { create(:user) } let(:new_user) { create(:user) } let(:project) { create(:project, group: group, creator: user)...
29.851064
85
0.659301
f7fb59642a894e1f47fcd83a354b60161c873fb8
1,146
class Urweb < Formula desc "Ur/Web programming language" homepage "http://www.impredicative.com/ur/" url "http://www.impredicative.com/ur/urweb-20170105.tgz" sha256 "2ad3aea2c4851c9b18f752d38c7127af8293fbbbbdb3dd06b73a4603fe399b67" bottle do sha256 "5f406928ad3e00bc835b7b04e29a9a3edad0e727ebc5e16c650a72b...
28.65
92
0.719895
fffd71d69f5a53aa6b1cc690685cbfa2e6f6208b
979
# frozen_string_literal: true module LabelPrintingApp # Apply an instance's values to a label template's variable rules and produce a preview image of it. class PreviewLabel < BaseService include LabelContent attr_reader :label_name, :instance def initialize(label_name, instance, supporting_data = {}...
27.194444
102
0.716037
0896142d2e067ee8f0e9a22d2da60271e009dbad
140
require 'test_helper' class BigosMenuBoxTest < ActiveSupport::TestCase test "truth" do assert_kind_of Module, BigosMenuBox end end
17.5
48
0.778571
1df0623bedb70ffdd1234dc1c1c05c353ea6d253
1,726
require 'pathname' module JSON class Schema attr_accessor :schema, :uri, :validator def initialize(schema,uri,parent_validator=nil) @schema = schema @uri = uri # If there is an ID on this schema, use it to generate the URI if @schema['id'] && @schema['id'].kind_of?(String) ...
27.396825
94
0.615875
ab23f29387a604c76805fb361f82f35843743a61
1,793
# require_dependency "pack/application_controller" module Pack class Admin::PackagesController < Admin::ApplicationController def index respond_to do |format| format.html{ @q_form = OpenStruct.new(q_param) search = PackSearch.new(@q_form.to_h, 'packages') @packages = s...
23.906667
107
0.615728
6af378b27f84544f50723663634a274833d6d0d9
56
require 'spec_helper' describe Tradier::Balance do end
11.2
28
0.803571
6a7c42b3abcea87e3ab80e4f929a9f79c0c78a16
910
module Spree module Api module V2 module Storefront module Account class CreditCardsController < ::Spree::Api::V2::ResourceController before_action :require_spree_current_user private def model_class Spree::CreditCard end ...
25.277778
84
0.605495
4ae067763d8f06b5c4a30bd6963f4601d9f435fb
1,356
# Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: MIT # DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN. # vapi - vAPI is an extensible API Platform for modelling and delivering APIs/SDKs/CLIs. require 'spec_helper' require 'json' require 'date' # Unit tests...
30.818182
102
0.758112
bb70fb52a0473a8d1143332a749fac2621d498bd
317
cask "fantasy-grounds" do version :latest sha256 :no_check url "https://www.fantasygrounds.com/filelibrary/FantasyGrounds.dmg" name "Fantasy Grounds" homepage "https://www.fantasygrounds.com/home/home.php" app "Fantasy Grounds.app" zap trash: "~/Library/Saved Application State/Fantasy Grounds*" end
24.384615
69
0.750789
aba56e11a20be0c57e819a95fb2c92421762f307
421
ENV["RAILS_ENV"] ||= 'test' require 'minitest/spec' require 'minitest/autorun' require "minitest/reporters" MiniTest::Reporters.use! require 'debugger' require './lib/readouts' Dir[File.join(APP_ROOT,"spec/support/**/*.rb")].each {|f| require f } Dir.glob(File.join(APP_ROOT, 'lib/**/*.rb')).each {|f| require f} inclu...
23.388889
69
0.72209
e819316b5a61e5a36245817bb4a124358a0d3eeb
100
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require_relative "../lib/tic_tac_toe.rb"
33.333333
58
0.74
084d3f794eb5cc10bcd3380192a268f10eb42592
1,657
# -*- encoding: utf-8 -*- # rubocop:disable all $LOAD_PATH.push File.expand_path("../lib", __FILE__) author_name = "PikachuEXE" gem_name = "active_record_tweaks" require "#{gem_name}/version" Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = gem_name s.version = Active...
34.520833
84
0.648763
115656b7d761ff64b7df318f38bb2d7c4d8d7112
7,730
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
23.711656
77
0.623933
1ac1319a8c04079d5380df467717c30f1f8aeb24
820
# frozen_string_literal: true require 'test_helper' class DailiesControllerTest < ActionDispatch::IntegrationTest setup do @daily = dailies(:one) end test "should get index" do get dailies_url, as: :json assert_response :success end test "should create daily" do assert_difference('Daily.co...
20
63
0.673171
916a85f15dec5de211e71dc6639f5bffd691826f
732
#Fedena #Copyright 2011 Foradian Technologies Private Limited # #This product includes software developed at #Project Fedena - http://www.projectfedena.org/ # #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 ...
34.857143
73
0.784153
eddccdeff57e6862804a57ff7592832c98294234
130
class AnnotationParsedType < ActiveRecord::Base belongs_to :annotation validates_presence_of :parsed_type, :annotation end
21.666667
49
0.815385
6a98398a1d4644d9adad2122645fd8a9dc80ad6a
10,844
#!/usr/bin/env ruby # # -*- coding: binary -*- require 'rex/post/meterpreter/extensions/android/tlv' require 'rex/post/meterpreter/packet' require 'rex/post/meterpreter/client' require 'rex/post/meterpreter/channels/pools/stream_pool' module Rex module Post module Meterpreter module Extensions module Android ### # An...
32.178042
99
0.680284
bf88e8cc101929e1242bd2b205d071a2eec4d734
1,992
module WebConsole # A session lets you persist an +Evaluator+ instance in memory associated # with multiple bindings. # # Each newly created session is persisted into memory and you can find it # later by its +id+. # # A session may be associated with multiple bindings. This is used by the # error pages...
27.666667
77
0.657129
5d632c04f7e8b8b48056299bae04bd70689f3079
2,888
require 'fitting/statistics/not_covered_responses' require 'fitting/statistics/analysis' require 'fitting/statistics/measurement' require 'fitting/records/unit/request' require 'fitting/storage/white_list' require 'fitting/records/documented/request' module Fitting class Statistics class Template def initi...
30.723404
116
0.649931
3336fed8e5b6de64b0ef329ef768d8937807aae7
2,347
class OsrmBackend < Formula desc "High performance routing engine" homepage "http://project-osrm.org/" url "https://github.com/Project-OSRM/osrm-backend/archive/v5.8.0.tar.gz" sha256 "305cc6182b4eac54af3e796534c0b43ca137edd64f71aafacfe6cc8772916ebf" head "https://github.com/Project-OSRM/osrm-backend.git" b...
37.854839
153
0.677887
913b228087c1439503ccebdd58972ab3255fbee5
41
module OptClient VERSION = "0.1.0" end
10.25
19
0.682927
389a364824714c97a72a0dbbbb0851438fba4f63
1,558
# frozen_string_literal: true # Indexing provided by ActiveFedora class DataIndexer attr_reader :last_modified, :cocina def initialize(metadata:, cocina:, **) @last_modified = metadata.fetch('Last-Modified') @cocina = cocina end def to_solr {}.tap do |solr_doc| Rails.logger.debug "In #{self...
29.961538
92
0.714377
38cef2ce422cf97580a420feeb5a8bc641193178
151
# frozen_string_literal: true class IndexBrandsOnName < ActiveRecord::Migration[6.1] def change add_index :brands, :name, unique: true end end
21.571429
54
0.754967
33b367fbbf9aab7709043d849c90e2ce5934adc4
125
FactoryBot.define do factory :announcement do lecture { nil } announcer { nil } details { "MyText" } end end
15.625
26
0.64
1abd0e0818119a8e7006fa16978c615a20232034
342
require 'json' module Jekyll module ToJsonFilter def to_json(input) input.to_json end end module AddToHashFilter def add_to_hash(input, key, value) input[key] = value input end end end Liquid::Template.register_filter(Jekyll::ToJsonFilter) Liquid::Template.register_filter(Jek...
18
57
0.719298
38fd3e6c1afcad0d49080dae2f2b41f2ce2e4c6a
404
module Check def check_input_letter(letter) if @q_letter.include?(letter) input_true_letter(letter) else input_error_letter(letter) end input_all_letter(letter) end def check_win? if print_true_letter.uniq.size == print_quest_letter.uniq.size true else ...
17.565217
67
0.641089
e8be5e61b51d4b3bcc2aafbbfa0eff04e60b183a
1,542
score = rand(25) * 1000 a = 0 b =0 puts "Please enter Name:" @name = gets.chomp #initializes array of file contents arr = IO.readlines("myfile.txt") scores = Array.new(10) names = Array.new(10) #Splits File into Two arrays, one of scores, the other of Names for i in 0..20 if i%2 == 1 then sco...
18.141176
64
0.541505
fff3db132eba3993052350943da1a501807c1517
5,164
# # Be sure to run `pod spec lint Rvs_Viewer.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 http://docs.cocoapods.org/specification.html # To see working Podspecs in the CocoaPods repo see https://github....
37.151079
96
0.594888
01dc2643ef8b39daf29488f7f966776b8e634270
66
FactoryGirl.define do factory :dropbox_token do end end
9.428571
27
0.712121
ffcaad18b5d41fb7aabd85ae39745ef625daf8c9
199
class CreatePets < ActiveRecord::Migration[5.2] def change create_table :pets do |t| t.string :name t.string :species t.integer :user_id t.timestamps end end end
16.583333
47
0.633166
ab7fd31305381ef52737b59db0e57c1ba72bf32c
1,379
class FranchiseProfileSearch < ActiveRecord::BaseWithoutTable column :phrase, :string, "" column :page, :integer, 1 column :per_page, :integer, 25 column :franchise_id, :integer def self.per_page_select_options [["25", "25"], ["50", "50"], ["100", "100"], ["250", "250"], ["500", "500"], ["1000", "1000...
26.018868
137
0.631617
21955e147ea5a2897864a41c3b7909a2fa7afb4a
4,957
# copyright: 2015, Vulcano Security GmbH module Inspec::Resources class Postgres < Inspec.resource(1) name "postgres" supports platform: "unix" desc "The 'postgres' resource is a helper for the 'postgres_conf', 'postgres_hba_conf', 'postgres_ident_conf' & 'postgres_session' resources. Please use those i...
32.398693
173
0.611862
87a214b25a03961409477db67b31a0babd77e3a2
990
# Blatantly stolen from somewhere! require 'ansi/code' require "minitest/reporters" module Minitest module Reporters class LocalReporter < BaseReporter include ANSI::Code include RelativePosition def start super end def report super puts('Finished in %.5fs...
22.5
78
0.570707
030fe6dea3fa8d1c7ee879e59c02ee1e6f9cb698
319
class Band < ActiveRecord::Base validates(:band_name, :presence => true) validates(:band_name, :uniqueness => true) before_save(:capitalize_first_letter) has_and_belongs_to_many :venues private define_method(:capitalize_first_letter) do self.band_name=(band_name().downcase().capitalize) end end
26.583333
56
0.755486
388b883829c6fcf18794f5313a8aa65a553eb864
3,157
# see the URL below for information on how to write OpenStudio measures # http://nrel.github.io/OpenStudio-user-documentation/measures/measure_writing_guide/ # start the measure class EnergyPlusMeasure < OpenStudio::Ruleset::WorkspaceUserScript # human readable name def name return "NAME_TEXT" end ...
33.946237
101
0.65727
01bb9d06d5fedcf35e35743543ef7a1de28c63a4
1,702
class TabularFormBuilder < ActionView::Helpers::FormBuilder def select(field, select_options = nil, options = {}) select_options ||= [] super field, select_options, options end ['text_field', 'text_area', 'password_field', 'date_select', 'check_box', 'file_field'].each do |selector| src = <<-E...
31.518519
109
0.668038
289a126a3edef2a170fdd9f95fe7815a0dcd5060
3,558
# Run Coverage report require 'simplecov' SimpleCov.start do add_filter 'spec/dummy' add_group 'Controllers', 'app/controllers' add_group 'Helpers', 'app/helpers' add_group 'Mailers', 'app/mailers' add_group 'Models', 'app/models' add_group 'Views', 'app/views' add_group 'Libraries', 'lib' end # Configur...
32.345455
124
0.760821
e9d288bc96c8b3d9469d5e06a7d4298830230e6e
1,236
# 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 command (or created alongside the database with db:setup). # # Examples: # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Ch...
29.428571
111
0.700647