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
1804a9139335a32fdcd1baf91ea8b2ea02454b55
2,499
require('spec_helper') describe(Client) do describe('#name') do it('will return the name of the client') do test_client = Client.new({:name => "John", :id => nil, :stylist_id => nil}) expect(test_client.name()).to(eq("John")) end end describe('#id') do it('will return the id of the client') ...
32.038462
85
0.613445
3953957789aa079e0b83488391eddab3b78d64a0
1,034
# Implement a binary heap class BinaryHeap attr_accessor :size, :heap_array def initialize @size = 0 @heap_array = [] end # returns the index of the parent of i if 0 < i < @size; otherwise returns -1 def parent(i) if i <= 0 || i >= @size return -1 else return (i - 1) / 2 end ...
18.8
79
0.605416
0842fd466356daf25e9f4b7e1a422a7f34be8b2c
3,053
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Expl...
28.268519
93
0.612512
38757040a6242bb04d31abc9b38cb24bcffb76ff
3,633
# encoding: utf-8 require 'cassandra_migrations/migration/table_definition' module CassandraMigrations class Migration # Module grouping methods used in migrations to make table operations like: # - creating tables # - dropping tables module TableOperations # Creates a new table in the keysp...
29.536585
106
0.654555
01b21566507a4aeaa89d6634c743b6ca38b0eb8d
1,106
module SmartAttributes class AttributeFactory extend ActiveSupport::Autoload AUTO_MODULES_REX = /\Aauto_modules_([\w]+)\z/.freeze class << self # Build an attribute object from an id and its options # @param id [#to_s] id of attribute # @param opts [Hash] attribute options # @ret...
28.358974
89
0.596745
e223383732240a1fb0969eb29966ead5ca244e29
9,372
# -*- encoding: utf-8 -*- module Brcobranca module Remessa module Cnab400 class Unicred < Brcobranca::Remessa::Cnab400::Base # codigo da beneficiario (informado pelo Unicred no cadastramento) attr_accessor :codigo_beneficiario validates_presence_of :agencia, :conta_corrente, :docume...
36.046154
76
0.544494
e94d4dc0cdf0a6f3839723cff539fce966a0b538
232
require 'rails_helper' RSpec.describe ArticlesController, :type => :controller do describe 'GET index' do it 'returns http success' do get :index expect(response).to have_http_status(:success) end end end
17.846154
58
0.698276
e9bf8eb58fb58dbea8e5fba6cff51d95f40ee3b0
2,875
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # web site for more information on licensing and terms of use. # http://metasploit.com/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank...
27.380952
87
0.617043
ffb426366891935e68c33f8f26f6054badd68b0d
2,986
# # Copyright Peter Donald # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
31.765957
107
0.669792
e9b20d356a6d4f71308b35c0f389f61813d1df13
6,023
require 'rubygems' require 'rake' require 'rdoc/rdoc' module RDoc class CodeInfo class << self def parse(wildcard_pattern = nil) @info_for_corpus = parse_files(wildcard_pattern) end def for(constant) new(constant).info end def info_for_corpus ...
28.545024
126
0.558028
f868d1746caa90de515f0a53f025d7f3293babd3
14,749
ENDLESS X ========= GAE+DJANGO ---------- * Home * Blog Sign ---- Login Labels ------ 1981s ActionScript Ajax Apache CodeIgniter Django FULLTEXT Fedora Flex Free GoogleAppEngine Gundam HeavyMetal Information Ludia Mac Mecab Mobile Music MySQL Objective-C PHP PostgreSQL Python RSS Ruby RubyonRails S...
19.254569
173
0.600108
1de297e88f6fb06abe4ff700133466921958fdb3
345
require 'fastlane_core/ui/ui' require 'java-properties' module Fastlane UI = FastlaneCore::UI unless Fastlane.const_defined?("UI") module Helper class GradlePropertiesHelper def self.load_property(path, key) properties = JavaProperties.load(path) value = properties[key] value ...
20.294118
60
0.686957
e9eccce1919e4f81253fef7af51dc8e7e66118ed
994
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| spec.name = "jcdecaux-client" spec.version = "0.0.1" spec.authors = ["eTnDev"] spec.email = ["etienne.lamydlc@gmail.com"] spec.descr...
41.416667
121
0.672032
bbd10fc28b3f1039e7c14d053cfd56c6c278128d
662
# # Cookbook Name:: openswan # Recipe:: default # # Copyright 2013, Wanelo, 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 ...
31.52381
74
0.750755
01857b6bfe6744d3671f787cb513c125c2b40707
5,556
# frozen_string_literal: true # # Copyright 2019- TODO: Write your name # # 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...
29.242105
134
0.603672
e916c426b3d5ae8a7fcfd2eeabf272cac37afe51
1,022
# encoding: UTF-8 # frozen_string_literal: true lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'weather_parser/version' Gem::Specification.new do |spec| spec.name = 'weather_parser' spec.version = WeatherParser::VERSION spec.authors ...
35.241379
104
0.651663
edcb597281ddbd783e66b5ad7a810bec51e04e11
2,639
# frozen_string_literal: true lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) # Maintain your gem's version: require 'curator/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |spec| spec.name = 'curator' spec.version = ...
44.728814
164
0.700265
339bba89a9e44e82f134b682a60b65d41feefc3d
316
require 'rails_helper' RSpec.describe AdSizesController, type: :routing do describe 'routing' do it 'routes to #index' do expect(get: '/ad_sizes').to route_to('ad_sizes#index') end it 'routes to #show' do expect(get: '/ad_sizes/1').to route_to('ad_sizes#show', id: '1') end end end
22.571429
70
0.655063
ffa1e6e9af3e80dee037e0943072c7eba34d724d
489
#!/usr/bin/env ruby require 'drb' uri = ARGV.shift || "druby://localhost:9300" DRb.start_service db = DRbObject.new(nil, uri) db['foo'] = {:zap => 1} db['bar'] = "BAR" p db['foo'] p db['bar'] db.edit 'foo' do |foo| foo[:zap] = 2 # This has no effect because it is operating on a local copy. end p db['foo'] db....
17.464286
77
0.640082
916efbca394c63cde9c501991b6576ca562212cc
162
module Runcible module Extensions class DockerTag < Runcible::Extensions::Unit def self.content_type 'docker_tag' end end end end
16.2
48
0.660494
d548066206287209d83a44f5bfc9f857601ff9ee
352
# Usage (from the repo root): # env FLIPPER_CLOUD_TOKEN=<token> bundle exec ruby examples/cloud/basic.rb require 'bundler/setup' require 'flipper/cloud' Flipper[:stats].enable if Flipper[:stats].enabled? puts 'Enabled!' else puts 'Disabled!' end Flipper[:stats].disable if Flipper[:stats].enabled? puts 'Enable...
16.761905
74
0.732955
ffdc3f63aab51423dda5994021c30547c95301b4
5,051
# # Be sure to run `pod spec lint XMGTestThree.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://githu...
36.338129
103
0.589982
ffb914f7966056c14e5bf9429a5462e8b89164fb
420
# frozen_string_literal: true require 'spec_helper' RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' } do include_context 'connected client' describe '#ping' do before do allow(client).to receive(:next_id).and_return(42) end it 'sends message' do expect(socket...
23.333333
82
0.683333
d5ad4672fb19ea7f79b4118aab035d180080dc09
1,574
class Freetype < Formula desc "Software library to render fonts" homepage "https://www.freetype.org/" url "https://downloads.sf.net/project/freetype/freetype2/2.7/freetype-2.7.tar.bz2" mirror "https://download.savannah.gnu.org/releases/freetype/freetype-2.7.tar.bz2" sha256 "d6a451f5b754857d2aa3964fd4473f8bc5c...
35.772727
95
0.72554
1d70f9a3ccdb252b98d1095a2dfdc193130cdc5b
5,420
# frozen_string_literal: true # rubocop:disable Lint/MissingCopEnableDirective require 'spec_helper' RSpec.describe Gurke::Reporters::CompactReporter do subject(:out) do reporter = described_class.new(StringIO.new) reporter.send(*action) reporter.io.string end let(:feature) { instance_double('Gurk...
26.568627
79
0.607749
4a030d8e18d240870ec6886cd176cb9a7675d4be
401
class CreateNotificationDelivers < ActiveRecord::Migration[5.1] def change create_table :notification_delivers do |t| t.references :notification, foreign_key: true t.references :smtp_setting, foreign_key: true t.references :notification_content, foreign_key: true t.string :delivery_method ...
28.642857
63
0.72818
79ce6dcc297e2a15e058f9cdf745b5723a31a310
3,180
module Committee # StringParamsCoercer takes parameters that are specified over a medium that # can only accept strings (for example in a URL path or in query parameters) # and attempts to coerce them into known types based of a link's schema # definition. # # Currently supported types: null, integer, numbe...
31.8
78
0.564465
39a14b48d852ae934968340aa5f23cd5acf16c29
414
require 'base_kde_formula' class KdeL10nBs < BaseKdeFormula homepage 'http://www.kde.org/' url 'http://download.kde.org/stable/4.10.2/src/kde-l10n/kde-l10n-bs-4.10.2.tar.xz' sha1 '572f0b347577ed702d4fc4acc2eaac9b19e7b3d9' devel do url 'http://download.kde.org/stable/4.10.2/src/kde-l10n/kde-l10n-bs-4.10.2....
27.6
86
0.743961
01812be9501cdf42e5625ccdbcb8850a7d4a48d6
2,032
# 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 suite and is wiped # and recreated between test runs. Don't rely on the data there! Rails.application.configure do # Verifies...
39.843137
97
0.77313
9133fc2ddd66c728b47fb7bab966ee7d2e12df27
5,498
class RemoveMoreUnstandardLocales < ActiveRecord::Migration # Redefine all Active Record models, so that the migration doesn't depend on the version of code module MigrationModel class Community < ApplicationRecord has_many :categories, class_name: "::RemoveMoreUnstandardLocales::MigrationModel::Category...
32.532544
149
0.71335
0858463d3b7f477e4c7144040d569395d898bc75
536
require File.expand_path(File.join(File.dirname(__FILE__), 'image_processor_test_common')) require 'processors/gdk_pixbuf' class GdkPixbufProcessorTest < ActiveSupport::TestCase class GdkPixbufTestModel include AttachmentSaver::InstanceMethods include AttachmentSaver::Processors::GdkPixbuf include ImageP...
21.44
90
0.804104
1167e5c9e02d6ccfde804ff9b98bffc115d8a59e
640
require File.join(File.dirname(__FILE__), "..", "..", "test_helper") require 'mocha/parameter_matchers/kind_of' require 'mocha/inspect' class KindOfTest < Test::Unit::TestCase include Mocha::ParameterMatchers def test_should_match_object_that_is_a_kind_of_specified_class matcher = kind_of(Integer) asser...
24.615385
72
0.767188
61b934bb49a1601ee2675996a8fac8c4f6c395ac
541
cask 'memory-tracker-by-timely' do version '1.2.3' sha256 '8795e6d411b47a06c40807789d95a5994f697e9d334db389dcf9c118ab1bff4e' # timelytimetracking.s3.amazonaws.com was verified as official when first introduced to the cask url 'https://timelytimetracking.s3.amazonaws.com/mac_tracker/Memory%20Tracker%20by%20Time...
36.066667
98
0.794824
1d8df107963a4f977ca8eb5d65bd008ee9617b48
590
class MavenCompletion < Formula desc "Bash completion for Maven" homepage "https://github.com/juven/maven-bash-completion" url "https://github.com/juven/maven-bash-completion/archive/20200420.tar.gz" sha256 "eb4ef412d140e19e7d3ce23adb7f8fcce566f44388cfdc8c1e766a3c4b183d3d" license "Apache-2.0" head "https:/...
29.5
78
0.749153
d5ea36fa28aa249610cdfb64953a15baccf2e9ab
1,155
cask 'unity-facebook-games-support-for-editor@2019.1.0a13' do version '2019.1.0a13,3de2277bb0e6' sha256 :no_check url "https://download.unity3d.com/download_unity/3de2277bb0e6/MacEditorTargetInstaller/UnitySetup-Facebook-Games-Support-for-Editor-2019.1.0a13.pkg" name 'Facebook Gameroom Build Support' homepag...
32.083333
150
0.722078
1c0420c13a96c56df524faf59f5f5b213d3f2004
494
# This migration comes from refinery_copywriting (originally 4) class AddRefineryPrefixToTables < ActiveRecord::Migration def self.up rename_table :copywriting_phrases, :refinery_copywriting_phrases rename_table :copywriting_phrase_translations, :refinery_copywriting_phrase_translations end def self.dow...
35.285714
92
0.84413
180a213c4032874041e281ee314f4f9a4a82b104
2,658
# frozen_string_literal: true describe Balance, type: :model do describe 'Scopes' do describe 'should_be_notified' do subject { described_class.should_be_notified } let(:user) { create(:user) } context do before { create(:balance, notified_at: nil, user: user) } it { is_expec...
31.270588
105
0.698646
f7d75c09e30eea8fc418029b0f9f3025ceb2bb19
2,676
module ColumnPack # Arranges elements into bins using a simple one dimensional bin packing algorithm. class BinPacker # Uses a fixed number of bins (total_bins). # # Options: # :algorithm specify a different bin packing algorithm (default :best_fit_decreasing) # availa...
25.009346
101
0.616218
1d3074705ad4acd2b9cd81ed9a2db22f18ff7b4a
3,915
require 'rubygems' require 'puppetlabs_spec_helper/module_spec_helper' fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) RSpec.configure do |c| c.hiera_config = File.join(fixture_path, 'hiera/hiera.yaml') end RSpec.configure do |c| c.before do @ubuntu_facts = { :kernel ...
37.285714
99
0.403831
91f117f319e8cd2bd4890590d2abe1eb38b61dc0
16,767
# coding: utf-8 require_relative "../spec_helper" require 'tempfile' require 'tmpdir' require 'webrick' describe Razor::Data::Repo do include TorqueBox::Injectors let :queue do fetch('/queues/razor/sequel-instance-messages') end context "name" do (0..31).map {|n| n.chr(Encoding::UTF_8) }.map(&:to_s).each do...
33.005906
149
0.578458
abe5bf8c25c83ddb41c08fc88119b8f6eae01df9
1,260
cask 'macdown' do version '0.7.1' sha256 '4b26fb70b399cd998f226a78f81cd74348da19a8953aca80169fd7d00667496c' # github.com/MacDownApp/macdown was verified as official when first introduced to the cask url "https://github.com/MacDownApp/macdown/releases/download/v#{version}/MacDown.app.zip" appcast 'https://mac...
45
152
0.707143
395b783fd24132b3accb32e6bee9ccba36fc5d4a
7,514
# frozen_string_literal: true require 'rails_helper' require 'shared_examples/calculator_shared_examples' RSpec.describe Spree::Calculator::DefaultTax, type: :model do let(:address) { create(:address) } let!(:zone) { create(:zone, name: "Country Zone", countries: [tax_rate_country]) } let(:tax_rate_country) { a...
28.789272
96
0.595555
bb6c475b66cd83de1f0708e715536ae15b71a517
299
require 'logger' require 'sequel' DB = Sequel.sqlite('db/test.sqlite') DB.loggers << Logger.new($stdout) Sequel.default_timezone = :utc Sequel.datetime_class = DateTime Sequel::Model.plugin :timestamps, :update_on_create => true Dir[File.dirname(__FILE__) + '/models/*.rb'].each { |f| require f}
24.916667
66
0.732441
6a7d13b610f8a9ca483c2ae8e796f05f66fa4198
1,307
module SpreePayfastPayment module Generators class InstallGenerator < Rails::Generators::Base class_option :auto_run_migrations, :type => :boolean, :default => false def add_javascripts append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/spree_payfast_p...
40.84375
166
0.680184
f802986b96931cfff1ee8d74b9d945cf013bea96
2,027
class Zbackup < Formula desc "Globally-deduplicating backup tool (based on ideas in rsync)" homepage "http://zbackup.org" url "https://github.com/zbackup/zbackup/archive/1.4.4.tar.gz" sha256 "efccccd2a045da91576c591968374379da1dc4ca2e3dec4d3f8f12628fa29a85" revision 8 bottle do cellar :any # sha256 ...
32.693548
110
0.733103
e92d8c5bed48d19c65f7af18539d33b2b4461241
1,955
module Shipit class DeploysController < ShipitController include ChunksHelper before_action :load_stack before_action :load_deploy, only: %i(show rollback revert) before_action :load_until_commit, only: :create helper_method :short_commit_sha def new @commit = @stack.commits.by_sha!(pa...
26.780822
118
0.686957
f7bb2059d0e41df37938a020a1c6ebea9eede0b6
714
require 'active_support/core_ext/string' require 'core_extensions/hash' require 'sidekiq/cli' require 'simplekiq/version' require 'simplekiq/config' require 'simplekiq/datadog' require 'simplekiq/job_retry' require 'simplekiq/metadata_server' require 'simplekiq/metadata_client' require 'simplekiq/processor' require 'si...
21.636364
56
0.752101
d5b762df75b7dbe2601b38f199e0bd726350685e
239
module Apress module Api module Callbacks class RepeatCallbackError < StandardError def initialize(message, backtrace) super(message) set_backtrace(backtrace) end end end end end
18.384615
47
0.631799
1aa4c2e84e2d0796db071a237a0095178b62991e
2,911
require "ide_prefs_test_support/contracts/basic_prefs_repo_contract" def assert_works_like_user_prefs_repo(pref_factory: nil, user_prefs_repo_factory: nil) describe "User Prefs Repo" do assert_works_like_basic_prefs_repo(pref_factory: pref_factory, prefs_repo_factory: user_prefs_repo_factory) describe "Que...
34.654762
125
0.652697
bbc038c6f0043554a9e195f9de7ed023ef421dc9
57
FactoryGirl.define do factory :miq_priority_worker end
14.25
30
0.842105
edf01ff73f3414de3b44203217f5c2ece56611b4
5,315
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. require 'date' # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength module OCI # Log entries related to a specific work request. class Integration::Models::WorkRequestLogEntry # **[Required]** The description of a...
33.21875
115
0.662277
7a3477a8ef890cda60bbdf67f71400e0e0c78811
1,603
class FileUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: # include CarrierWave::RMagick # include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: storage :aws # storage :fog # Override the directory where uploaded files will be stored. ...
29.685185
112
0.700561
bb4e5a6712a099e84e4c522fb9ee3e7f195d32cf
343
#encoding: utf-8 require 'rubygems' require 'sinatra' require 'sinatra/reloader' require "sinatra/activerecord" set :database, "sqlite3:pizzashop.db" class Product < ActiveRecord::Base # создание сущности end get '/' do @products = Product.all erb :index end get '/about' do erb :about end post '/cart...
13.72
54
0.702624
f8e27187e163ba534342f780449f088c1d363ba0
404
module Support class PercentageTileComponent < ViewComponent::Base attr_reader :percentage, :label, :colour def initialize(percentage:, label:, colour: :default, size: :regular) @percentage = percentage @label = label @colour = colour @size = size end def count_class @s...
23.764706
73
0.658416
621861487b986fdba9ad443cdf246ea95bc8e5fe
2,515
# 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 source for your # dat...
31.4375
86
0.705368
d5cb02f1994e26a99c9efee602658612cabdce64
2,100
# frozen_string_literal: true ActiveRecord::Schema.define(version: 20_191_005_094_551) do create_table "admins", force: :cascade do |t| t.integer "user_id" t.integer "user_type_id" t.string "user_name" t.string "password" t.datetime "last_login_date" t.string "title" end add_inde...
43.75
119
0.661429
3321546aa2ffe5b791b5b55f4f08ff9adbacaa12
1,255
class Fifechan < Formula desc "C++ GUI library designed for games" homepage "https://fifengine.github.io/fifechan/" url "https://github.com/fifengine/fifechan/archive/0.1.3.tar.gz" sha256 "0b3dc9821a6f2acfc65299235e39b7fa5dc4c36bd9c50153d0debd8c27497e1e" bottle do cellar :any sha256 "5d9d9cca51acebba...
29.880952
104
0.690837
1c90c38d45cf689e8760eca902bc052c0400070d
5,722
module React module Generators class ComponentGenerator < ::Rails::Generators::NamedBase source_root File.expand_path '../../templates', __FILE__ desc <<-DESC.strip_heredoc Description: Scaffold a React component into `components/` of your Webpacker source or asset pipeline. ...
30.275132
99
0.545439
d5e8113638dc418c773534ec046f2f3b671a7e93
38
module Git module Command end end
7.6
16
0.736842
61e4b0546df76ee5952d0822b5dccce3a883ec55
1,691
require 'octokit' require './lib/helpers.rb' module Github def Github.get_open_pull_requests_ids(config) begin $LOGGER.info('Github') { "starting to get open pull requests ids" } client = Octokit::Client.new(:login => config[:github_login], :password => config[:github_password]) repository_id =...
36.76087
106
0.703134
87c6f85c5dea500db93b7362f3233f62de77265f
848
module Intrigue module Ident module Check class Tridium < Intrigue::Ident::Check::Base def generate_checks(url) [ { type: 'fingerprint', category: 'application', tags: %w[Administrative Networking], vendor: 'Tridium', ...
26.5
66
0.444575
38894de5dd0f1a507951bab556544f87ddf3f2ee
6,839
# frozen_string_literal: true require 'timeout' require 'tinyci/log_viewer' require 'tinyci/multi_logger' require 'tinyci/scheduler' RSpec.describe TinyCI::LogViewer do let(:log_viewer) { TinyCI::LogViewer.new(**{ working_dir: repo.path }.merge(opts)) } let(:opts) { {} } let(:regex) do r = <<~REGEX ^....
27.576613
96
0.513672
6a65f999fd6f3569670836bb14964fd53ef15fa8
61,805
require "abstract_unit" require "active_support/core_ext/hash" require "bigdecimal" require "active_support/core_ext/string/access" require "active_support/ordered_hash" require "active_support/core_ext/object/conversions" require "active_support/core_ext/object/deep_dup" require "active_support/inflections" class Has...
34.858996
169
0.692679
014fd3fcdd7f388295201b65d454f97d748e59d1
260
require "./spec/spec_helper" describe NDB do describe ".configuration" do it "allow confugiration of an api_key" do NDB.configure do |config| config.api_key = "abc123" end expect(NDB.api_key).to eq("abc123") end end end
18.571429
45
0.646154
f850cbdbecd4f4229e45d270414cda3668b040b0
273
name 'vagrant_repo' maintainer 'Teemu Matilainen' maintainer_email 'teemu.matilainen@iki.fi' license 'Apache v2.0' description 'Maintains package manager repositories for Vagrant' version '0.1.0' depends 'nginx', '~> 2.0'
30.333333
69
0.6337
799d5d1cfbf0351ea4e50181b5fb7a089a6e124e
5,145
require 'spec_helper' describe "Mutations::StringFilter" do it "allows valid strings" do sf = Mutations::StringFilter.new filtered, errors = sf.filter("hello") assert_equal "hello", filtered assert_equal nil, errors end it "allows symbols" do sf = Mutations::StringFilter.new filtered, e...
28.425414
65
0.678328
bfd3ec97047f2bc82a1ddcd10de38d3c22bb9172
705
Pod::Spec.new do |s| s.name = "commonios" s.version = "0.1.0" s.summary = "common library for swift" s.homepage = "https://github.com/codemonarch/swift-common" s.license = "MIT" s.author = { "rarnu" => "rarnu1985@gmail.com" } s.platform = :ios, "8....
41.470588
126
0.520567
913eded2293d39967539af0b545fcb2958ee63d5
6,761
require "sequel" require "pact_broker/repositories/helpers" require "pact_broker/verifications/latest_verification_for_pact_version" require "pact_broker/verifications/latest_verification_id_for_pact_version_and_provider_version" module PactBroker module Pacts class PactVersion < Sequel::Model(:pact_versions) ...
44.189542
227
0.654785
b9c478acefbd5ebe5bcfbeddc286f4f7de0df365
2,070
class MultifactorAuthsController < ApplicationController before_action :redirect_to_root, unless: :signed_in? before_action :require_mfa_disabled, only: %i[new create] before_action :require_mfa_enabled, only: :update before_action :seed_and_expire, only: :create helper_method :issuer def new @seed = R...
27.236842
85
0.704348
bf3f453413d56ce1497b1bfab763b89c78e43a6b
776
class DeviseInvitableAddToUsers < ActiveRecord::Migration[7.0] def up change_table :users do |t| t.string :invitation_token t.datetime :invitation_created_at t.datetime :invitation_sent_at t.datetime :invitation_accepted_at t.integer :invitation_limit t.references ...
33.73913
141
0.704897
6186bd4714b929ab76426e8ff036c99c23e0aa38
70
name 'themis-finals-customize-default' description '' version '1.0.1'
17.5
38
0.757143
1884167427d0ad8b3fd78bbcd95b436fa5f1821b
135,929
# frozen_string_literal: true # Copyright 2021 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...
57.62145
159
0.596856
5d25a507ca88b052ffaa611f8b2130af48609460
1,118
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module GoalTracker class Application < Rails::Application # Settings in config/environments/* take p...
41.407407
99
0.734347
1d0435d1cf3d61b9bebe933bf2c8cb4159b43a00
928
require 'color-block' include ColorBlock color( :white, :blue ) { puts "white on blue?" } color( :green ) { puts "green?" } color( :white, :green, :dim ) { puts "white on dark green?" } color( :blue ) { puts "blue?" } color( :red ) { puts "red?" color( :cyan ) { puts " cyan?" puts " (this is inside a n...
23.794872
81
0.579741
188b94cea1b72e3cfd696d35917129172da14c92
159
require 'rails_helper' RSpec.describe "Teams", type: :request do describe "GET /index" do pending "add some examples (or delete) #{__FILE__}" end end
19.875
55
0.704403
bf635a052692a06bc5d0180dcbf11e0c8586843a
2,136
RSpec.describe SettingsReader::VaultResolver::RefresherObserver do let(:observer) { described_class.new(config) } let(:config) { SettingsReader::VaultResolver::Configuration.new } let(:success_listener) { instance_double(Proc, call: true) } let(:error_listener) { instance_double(Proc, call: true) } before do...
35.016393
109
0.71676
abe490d5df54dbfb12e444e68f1af2618dfb609a
1,247
require 'spec_helper' RSpec.shared_examples 'a class loader' do |method| context 'when creating from array' do it 'returns the expected class' do expect(subject.public_send(method)).to eq(Data::Transpose::Binomial::Experiment) end end context 'when creating from string' do let(:arguments) { 'd...
24.45098
86
0.657578
d5095cd02fb21c5d2a54b2a7c75dcf1342242933
14,245
require 'yaml' require 'bosh/dev/sandbox/main' require 'bosh/dev/legacy_agent_manager' require 'bosh/dev/verify_multidigest_manager' require 'bosh/dev/gnatsd_manager' module IntegrationExampleGroup def logger @logger ||= current_sandbox.logger end def director @director ||= Bosh::Spec::Director.new( ...
30.967391
127
0.690067
5d000aaf78150c6d1906d28a8c93a8c4b7c5a94e
2,637
require "rails_helper" include Warden::Test::Helpers feature "Admin view application", js: true do scenario "As an admin I can only see the application in read only mode" do application = create_application login_admin(create(:admin)) visit admin_form_answer_path(application) expect(page).to have_c...
38.217391
91
0.729238
1d13e102a411b26e24861ff4b081c7040914fe20
1,137
# 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::Kusto::Mgmt::V2018_09_07_preview module Models # # Model object. # # class TrustedExternalTenant include MsRestAz...
23.6875
70
0.549692
acebba2c161e57a372bcb5e692f346afed6e3133
123
# frozen_string_literal: true module EveOnline module Exceptions class InternalServerError < Base end end end
13.666667
36
0.756098
b9630afd7dd7ad4d17669c22c5d60bad5179c9ff
355
require "formalist/element" require "formalist/elements" module Formalist class Elements class CheckBox < Field attribute :question_text def initialize(*) super # Ensure value is a boolean (also: default to false for nil values) @input = !!@input end end regis...
17.75
75
0.650704
d526f4ed8b1494e8e8aeb7a16e6089e09c099021
122,119
# 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, ...
40.815174
121
0.606007
5d609508ae49a78459a355fb93c4f949fc62c1dc
2,536
# # Be sure to run `pod lib lint ${POD_NAME}.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 = 'KSOMedia...
46.962963
373
0.695978
6a36051c2e1867235342f08510285ecf4e2f5d92
332
class CreateTasksTable < ActiveRecord::Migration def change create_table :tasks do |t| t.string :title t.text :description t.boolean :complete, default: false t.integer :user_id end end end # eventually put in sub-tasks logic # will need to add a way to keep track of sub-tasks and p...
23.714286
68
0.695783
d5ecb5fb4bf213243ff168733bd6844aaf223538
918
class Ripmime < Formula desc "Extract attachments out of MIME encoded email packages" homepage "https://pldaniels.com/ripmime/" url "https://pldaniels.com/ripmime/ripmime-1.4.0.10.tar.gz" sha256 "896115488a7b7cad3b80f2718695b0c7b7c89fc0d456b09125c37f5a5734406a" bottle do cellar :any_skip_relocation s...
41.727273
93
0.798475
7acf1fd697111fd7c11f3c239017d638da4ddda1
171
class AddArticleRefToArticleCategory < ActiveRecord::Migration[6.0] def change add_reference :article_categories, :article, null: false, foreign_key: true end end
28.5
79
0.789474
873cefb78ea18a2e15efce076f606e1fb31bd132
104,242
# frozen_string_literal: true require 'spec_helper' require 'capybara/apparition/driver' require 'base64' require 'os' # require 'self_signed_ssl_cert' describe 'Capybara::Apparition::Driver' do include AppRunner def visit(path, driver = self.driver) driver.visit(url(path)) end def url(path) "#{AppR...
31.995703
189
0.581253
382bbd9ec91eedacdfabb821a4982edb34f46a38
636
Pod::Spec.new do |s| s.name = "BRHJoyStickView" s.version = "2.1.2" s.summary = "A custom UIView in Swift that presents a simple, configurable joystick interface." s.homepage = "https://github.com/bradhowes/Joystick" s.license = { :type => "MIT" } s.authors = { "bradhowes" => "brad...
39.75
101
0.638365
d5a42f5a0ed9e54d1b698f9b72f36a670abe4135
1,818
require 'test_helper' describe Hanami::Validations do describe 'combinable validations' do before do address = Class.new do include Hanami::Validations validations do required(:city) { filled? } end end customer = Class.new do include Hanami::Validati...
27.134328
101
0.619912
d5bf853aff514c3927fbc833c9fde276cb6c0bc9
8,703
#-- # Copyright: Copyright (c) 2010-2016 RightScale, Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # 'Software'), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify...
35.234818
118
0.624497
380f344ef0c6839e95e6b9953c63d16a662ac980
536
require 'rails_helper' RSpec.describe CreatePeriodicReportReceivedWebAccessMessageWorker do let(:user) { create(:user, with_credential_token: true) } let(:worker) { described_class.new } describe '#perform' do subject { worker.perform(user.uid) } before { allow(PeriodicReport).to receive(:access_interva...
33.5
126
0.746269
3390f022c1e112df1042f10122777155b9a86116
409
cask 'fauxpas' do version '1.6' sha256 '6a5d518df5a67ffef360cdcaef41dd10365bc90390354d5cde19e310d6ad9da6' url "http://files.fauxpasapp.com/FauxPas-#{version}.tar.bz2" appcast 'http://api.fauxpasapp.com/appcast', :sha256 => '478477793b0b317edeae2cda359bc0d180e8749ac72d11a5c71a5d9dab4a0f93' name 'Fau...
29.214286
87
0.757946
4af471195885dfc70a6072e56687e33c57d1e96d
73
json.array! @relatorios, partial: 'relatorios/relatorio', as: :relatorio
36.5
72
0.767123
617a8fe9921bd239cb4438426a92ecebe5c9bdb2
562
# Add Monit configuration file via the `monitrc` definition # begin monitrc "elasticsearch" do template_cookbook "elasticsearch" source "elasticsearch.conf.rb" end rescue Exception => e Chef::Log.error "The 'monit' recipe is not included in the node run_list or the 'monitrc' resource is not defined" rai...
31.222222
116
0.729537
010b884451db05fdbfe8a2c2d41dcd06d8956318
8,326
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::MachineLearning::Mgmt::V2017_01_01 module Models # # Properties specific to a Graph based web service. # class WebServicePropertiesForGraph < ...
31.657795
76
0.417607
d5ffd1baee4494a15206e37980229a38d68c7bb3
1,100
#!/usr/bin/env ruby require 'csv' require_relative './book' require_relative './magazine' module Echocat class ImportCsv def self.import_data import_books import_magazines end def self.import_books books_csv = File.join(File.expand_path('../data', __dir__), 'books.csv') CSV.fore...
25
86
0.57
ffff1301fffd969280839aec9e36b0e90f9c18d2
1,016
include Warden::Test::Helpers Given(/^I have logged in as a GDS Editor$/) do @user = create(:gds_editor) login_as(@user) end Given(/^I have logged in as an admin$/) do user = create(:admin) login_as(user) end Given(/^I have logged in as a member of DCLG$/) do dclg = create( :organisation, title: "D...
23.627907
70
0.698819
ede6e0084006a98729105ea70d919c08ccb54dda
46
module Unidom::Product::ApplicationHelper end
15.333333
41
0.847826
08bc27bd380bc5a7e6cd4c002b7da2dbbe9607e6
328
class AddCompositeIndexesForPoliticanJoins < ActiveRecord::Migration def up add_index :tweets, [:politician_id, :created] add_index :deleted_tweets, [:politician_id, :created] end def down remove_index :tweets, [:politician_id, :created] remove_index :deleted_tweets, [:politician_id, :created] ...
27.333333
68
0.746951