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
f8e170c551e9d485905fbd8e76d9fe3d6465a16a
125
require 'TestTargetFuncElement.rb' class GeneralRegister < TestTargetFuncElement def initialize(name) super end end
15.625
45
0.792
037929d386e3767dbea03a6fb12e04fa1186721e
2,646
class ListOrdersFilter class EmptyUser < User def id 'empty' end def full_name I18n.t('users.empty') end def save(*) raise NotImplementedError end end class << self def empty_user @empty_user ||= EmptyUser.new end end module Filters extend self ...
22.615385
137
0.61678
1825971f16edb9d13a5bcfba8e608bb3a3c71fb9
54
$evm.root['method_executed'] = "evm2_missing_method"
27
53
0.759259
39eb565264de0e8dbd98e94ce0dcf08843ea7e47
1,251
# frozen_string_literal: true require 'spec_helper' RSpec.describe LiquidDiagrams::Renderers::GraphvizRenderer, :renderers do subject(:renderer) { described_class.new('content') } describe '#render' do include_examples 'render with stdin and stdout', described_class end describe '#executable' do it ...
23.166667
77
0.616307
e24595112d5bc8a2e794b093bc0852ed9a50790a
170
require 'universaltranslator.rb' puts 'Write your input path: Example--C:/code/Documents/input.txt' input = gets puts UniversalTranslator.new.get_data(input.chomp) gets
24.285714
66
0.8
ac730f9590a2e43cbaf75b4f0d3b02f963016cd6
2,603
module JdbcSpec module MissingFunctionalityHelper #Taken from SQLite adapter def alter_table(table_name, options = {}) #:nodoc: table_name = table_name.to_s.downcase altered_table_name = "altered_#{table_name}" caller = lambda {|definition| yield definition if block_given?} transacti...
35.657534
88
0.574337
18161b83e60790a2cae4035b67cb817e54895a04
1,328
Gem::Specification.new do |s| s.name = 'logstash-output-cloudwatch' s.version = '3.0.8' s.licenses = ['Apache License (2.0)'] s.summary = "Aggregates and sends metric data to AWS CloudWatch" s.description = "This gem is a Logstash plugin required to be installed on top o...
44.266667
205
0.649096
264e503ce55713955a03cd876b52ad298b311b89
3,589
require 'spec_helper' module Verify describe SmsAuthsController do describe 'GET verify/sms_auth' do let(:member) { create :verified_member } before { session[:member_id] = member.id } before do get :show end it { expect(response).to be_success } it { expect(respons...
22.291925
72
0.501532
33604a09a9333acf093536357259e5846e027f19
236
module Blockchain class Transaction def initialize(from = nil, to, amount) @from = from @to = to @amount = amount end def info {"from" => @from, "to" => @to, "amount" => @amount} end end end
16.857143
57
0.538136
03623b6e9044964193c757da864557a41cac25a0
2,888
require_relative 'Common' module Confetti #---------------------------------------------------------------------------------------------- class Database @@db = nil @@in_connect = false @@log = nil @@migration_log = nil def self.db_path Config.db_path end def self.cleanup end def self.connect retur...
21.392593
98
0.550554
1849ea79b336350b8c27bd20c4499bae1f856ddf
7,406
class Caveats extend Forwardable attr_reader :f def initialize(f) @f = f end def caveats caveats = [] begin build = f.build f.build = Tab.for_formula(f) s = f.caveats.to_s caveats << s.chomp + "\n" unless s.empty? ensure f.build = build end caveats << k...
32.915556
102
0.642992
6a4e1d44042a16f992292708c7b765966a2a27c9
68
module Mina module Secrets VERSION = '2.1.0'.freeze end end
11.333333
28
0.661765
e871c7a68addff39742cd90eaea2668b218b0cc7
10,879
module Azure module Armrest class Configuration # Clear all class level caches. Typically used for testing only. def self.clear_caches token_cache.clear end # Used to store unique token information. def self.token_cache @token_cache ||= Hash.new { |h, k| h[k] = [] } ...
33.996875
102
0.629562
bbd53a489f73fb48622ff3eebabff8aa7de31c17
5,527
module POM class Project ## # Mixin adds methods for accessing a project's gemspec and # other gem releated features. # module GemUtils public # TODO: Replace everything below here with Indexer code and tie into above. # Create a Gem::Specification from a POM::Project. Bec...
32.321637
96
0.57391
4a47090dc0a3c9bb2cd2763d6aff6a97d86e0e1d
3,156
# FriendlyId Global Configuration # # Use this to set up shared configuration options for your entire application. # Any of the configuration options shown here can also be applied to single # models by passing arguments to the `friendly_id` class method or defining # methods in your model. # # To learn more, check out...
35.460674
79
0.704689
ede9e271bd4292a52eb0aaf0120c67f9d51ebd2d
1,749
# # Be sure to run `pod lib lint Ents.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 = 'Ents' s.versi...
35.693878
97
0.632361
ac803885244be22463760343ab66e0c10afef3a2
263
# frozen_string_literal: true FactoryBot.define do factory :webauthn_registration do credential_xid { SecureRandom.base64(88) } public_key { SecureRandom.base64(103) } name { FFaker::BaconIpsum.characters(10) } counter { 1 } user end end
21.916667
46
0.714829
08f581f320c696163c144dd23f563d5ddc2f760c
750
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe 'Experience' do describe '::list' do subject { ExperiencesSpain::Experience.list } context 'when there is no experiences' do stub_experiences_api(:experience, :list, :empty) it { is_expected.to be_empty } it { i...
30
94
0.686667
213effcb283ccb46f659cd855a8603df9c7285f1
22,310
# -*- encoding: utf-8 -*- # # Author:: Fletcher Nichol (<fnichol@nichol.ca>) # # Copyright (C) 2013, Fletcher Nichol # # 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.o...
29.201571
83
0.552532
1874c985d450e001bc804523698963d6eddb0016
3,307
# frozen_string_literal: true require "extend/ENV" require "sandbox" require "timeout" require "cli/parser" module Homebrew module_function def test_args Homebrew::CLI::Parser.new do usage_banner <<~EOS `test` [<options>] <formula> Run the test method provided by an installed formula. ...
28.025424
91
0.60629
8723453d8261462f9669d7953190d554d5dc3715
997
# # Cookbook Name:: ntp # Recipe:: undo # Author:: Eric G. Wolfe # # Copyright 2012, Eric G. Wolfe # Copyright 2009, Opscode, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # htt...
26.945946
74
0.717151
b948137f0a017150bd6067db29c9811567e343f2
620
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic...
44.285714
245
0.741935
38dc911d7cbf75e9ba6d242db4f3c57b8dbb64c2
751
cask "font-iosevka-ss13" do version "5.0.5" sha256 "252f24b4d21a4c1094a298e5a47ce434d58888637aab6997cb7f36167ea7fdcd" url "https://github.com/be5invis/Iosevka/releases/download/v#{version}/ttc-iosevka-ss13-#{version}.zip" appcast "https://github.com/be5invis/Iosevka/releases.atom" name "Iosevka SS13" desc ...
35.761905
105
0.757656
f74b9d402639f2e344f4ca4fbdccd59a1de9af60
1,575
class PasswordResetsController < ApplicationController before_action :get_user, only: [:edit, :update] before_action :valid_user, only: [:edit, :update] before_action :check_expiration, only:[:edit, :update] # (1)への対応 def new end def create @user = User.find_by(email: params[:password_reset][:e...
23.863636
85
0.635556
87f45ab9be4d44c2fa858dcf1df29692b509fd8d
454
# generate tags with ripper-tags -f TAGS -R --force --extra=q . module Hello class World attr_reader :a, :b attr_writer :c, :d attr_accessor :e, :f def a_real_method p gub p Hello::World end def self.class_method p 'hi' end def gub p 'hi' end def que...
13.352941
63
0.544053
03dc4471a79d8215c59f675c3be265be9e61ca7c
543
class AddTimestampsToProjects < ActiveRecord::Migration def self.up add_timestamps :projects add_column :projects, :status, :string add_column :projects, :materials_needed, :string add_column :projects, :funding_needed, :integer add_column :projects, :overview, :text end d...
30.166667
55
0.721915
6ac818012fc482f911a18e2e3d2878a0573caaaf
3,193
# frozen_string_literal: true require "dependabot/file_updaters/base" module Dependabot module FileUpdaters module Ruby class Bundler < Dependabot::FileUpdaters::Base require_relative "bundler/gemfile_updater" require_relative "bundler/gemspec_updater" require_relative "bundler/loc...
28.256637
80
0.57125
1a175c64ff9fdc4e57f728872170e599bb0f0459
7,584
#!/usr/bin/env ruby # This class encapsulates the config data and environmental setup used # by the various Flapjack components. # # "In Australia and New Zealand, small pancakes (about 75 mm in diameter) known as pikelets # are also eaten. They are traditionally served with jam and/or whipped cream, or solely # with ...
30.829268
91
0.569752
87a7913ebbafe0a470aec747a37b0565a5ea16f6
11,635
# 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...
42.933579
117
0.7315
1a8ee5fcc624e27cbe88c3b648f094b4b35b41b4
22,842
# frozen_string_literal: true require "cases/helper" require "models/author" require "models/company" require "models/membership" require "models/person" require "models/post" require "models/project" require "models/subscriber" require "models/vegetables" require "models/shop" require "models/sponsor" module Inherit...
34.245877
165
0.753349
e9162f920a547dc5914d9fd66f8e32d5530183ff
713
#! /usr/bin/ruby # -*- coding: utf-8 -*- # # postgre_read.rb # # May/14/2019 # require 'pg' require 'dotenv' # # -------------------------------------------------------------------- puts "*** 開始 ***" # Dotenv.load user = ENV['user'] password = ENV['password'] data_base = ENV['data_base'] # connection = PG::connect...
20.371429
70
0.478261
bb8e8ccfd6ba3c2933e10553ef379abd3afcb162
214
class Buttercms::BaseController < ActionController::Base # You can of course change this layout to your main application layout # to have your blog match the rest of your site. layout 'buttercms/default' end
35.666667
72
0.775701
abd26dd9afaa957840d184fe44d11af975fa8751
243
module VirtualBox module COM module Interface module Version_4_0_X class PointingHidType < AbstractEnum map [:null, :none, :ps2_mouse, :usb_mouse, :usb_tablet, :combo_mouse] end end end end end
22.090909
79
0.641975
6aa3eb06ea8fcc77e5f72aeaad30506d2f279a1a
463
module ActionDispatch::Routing class Mapper def with_jindouyun options init_dingding_routes options end private def init_dingding_routes options notifications_controller = options[:system_notifications] ? options[:system_notifications] : 'jindouyun/dingding/system_notifications' ...
23.15
140
0.742981
f7eb794099f82a64195597a69d75fbe340ad9a38
888
# frozen_string_literal: true require "delegate" require "forwardable" require "redis" require "active_support/lazy_load_hooks" require "redi_search/configuration" require "redi_search/client" require "redi_search/model" require "redi_search/index" require "redi_search/log_subscriber" require "redi_search/document" ...
19.304348
72
0.733108
1a016aacd760f34ad098733c4ead53a5ed16e05c
5,202
# encoding: utf-8 # This is a Data Twist file # Experimental script to twist Open Data into new shapes # Copyright (c) 2013 Kana Fukuma and Shane Coughlan # Version 0.5 # # Data Twist is Free Software. You might also call it Open Source. # You can redistribute it and/or modify it under either the terms of the # 2-cla...
26.814433
388
0.592272
918c032a556b71e864ac41876a7438eb9968ae6b
3,224
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Auxiliary include Msf::Exploit::Remote::Tcp include Msf::Auxiliary::Report def initialize(info = {}) super(update_info(info, 'Name' ...
34.297872
136
0.654777
e981d50b0395a6fcd80dc4fc203369297f1fa870
1,546
require 'test_helper' class UserLoginTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) end test "login with invalid information" do get login_path post login_path, params: { session: { email: @user.email, password: 'password' } } assert_redirected_to @user follow_redirect! ...
26.655172
84
0.708926
6a8f6ab24ad3b3a100b7346afd5f9e4f4738bb25
663
describe package('vault') do it { should be_installed } end describe group('vault') do it { should exist } end describe user('vault') do it { should exist } end describe file('/etc/vault.d/vault.hcl') do it { should be_file } its('owner') { should eq 'vault' } its('group') { should eq 'vault' } its('mo...
22.1
63
0.665158
797b8347cbfcc582fc24a1a24fd4c8a239efa414
16,821
# frozen_string_literal: true require "spec_helper" require "dependabot/dependency_file" require "dependabot/npm_and_yarn/file_updater/npmrc_builder" RSpec.describe Dependabot::NpmAndYarn::FileUpdater::NpmrcBuilder do let(:npmrc_builder) do described_class.new( dependency_files: dependency_files, cr...
35.04375
80
0.507342
26e9765025920956054a7cdde9519cb4c62f04b9
356
cask 'font-redressed' do version :latest sha256 :no_check # github.com/google/fonts was verified as official when first introduced to the cask url 'https://github.com/google/fonts/raw/master/apache/redressed/Redressed-Regular.ttf' name 'Redressed' homepage 'https://www.google.com/fonts/specimen/Redressed' ...
29.666667
89
0.764045
4ad799cfc936cb288b38f02ee99bf8cc674bbadf
968
require_relative '../../test_init' context "Included Attributes" do context "Many" do hash_source = Controls::Hash.example object_source = Controls::Object.example mapping = hash_source.keys [[hash_source, 'Hash'], [object_source, 'Object']].each do |source_info| source = source_info[0] ...
24.820513
76
0.608471
f8ff350f5a581a3078f0c443295719177eca4759
621
module CoolBreeze module Mixins module Associations def self.included(base) base.class_eval <<-EOS, __FILE__, __LINE__ class_inheritable_accessor(:associations) self.associations = {} EOS base.extend(ClassMethods) end end module ClassMe...
24.84
80
0.57971
87cfec7ff9743d1f37e49c9e89d4447dcfdae165
1,349
class Avra < Formula desc "Assember for the Atmel AVR microcontroller family" homepage "http://avra.sourceforge.net/" url "https://downloads.sourceforge.net/project/avra/1.3.0/avra-1.3.0.tar.bz2" sha256 "a62cbf8662caf9cc4e75da6c634efce402778639202a65eb2d149002c1049712" bottle do cellar :any_skip_relocati...
34.589744
92
0.729429
0382f7e9ca484a28a8501baf827fd29573131d4a
133
class AddSearchNameToProvider < ActiveRecord::Migration[5.2] def change add_column :providers, :search_name, :string end end
22.166667
60
0.766917
0870081b4f6ba1b976c3847c3bc3e55e85790742
7,676
# encoding: UTF-8 require 'test_helper' class AssociationTest < ActionView::TestCase def with_association_for(object, *args) with_concat_form_for(object) do |f| f.association(*args) end end test 'builder should not allow creating an association input when no object exists' do assert_raise Argu...
37.443902
95
0.733194
39bc84a04f62140a68385fcdec5fecc5f738fc2f
615
require_relative '../automated_init' context "Read Stream Using Alternative Optimized Output Schema" do stream, batch = Controls::Write.(metadata: true) read_stream = EventStore::HTTP::ReadStream.build read_stream.embed_body read_stream.output_schema = Controls::ReadStream::OutputSchema::Optimized.example ...
26.73913
83
0.738211
e9cd63b2f9ac9d068e9e757a0ff5cef600de48da
1,717
require 'spec_helper' RSpec.describe Spree::Tax::OrderAdjuster do subject(:adjuster) { described_class.new(order) } describe 'initialization' do let(:order) { Spree::Order.new } it 'sets order to adjustable' do expect(adjuster.order).to eq(order) end end describe '#adjust!' do let(:lin...
39.022727
110
0.536401
38e4f6242e2607715b109c4bbfc2c13b9e2d9f10
1,003
module Metadata module ProcessMapping def process_mapping(xml, field, mapping) if mapping.present? if mapping.is_a?(Array) mapping.each do |mapping_item| # recurse and process each item in the array process_mapping(xml, field, mapping_item) end el...
30.393939
98
0.571286
abd2e87b1e39a66f8f46bd3ffcf3410105b2a323
492
require_relative 'boot' 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 CounterExercise class Application < Rails::Application # Settings in config/environments/* take precedence over tho...
30.75
82
0.76626
5d42f33453ec7348199a403c9f5d9605f6e89ad3
304
# encoding: utf-8 # frozen_string_literal: true require 'essay/abstract_feature' module Essay class AttributeFeatures::Base < AbstractFeature attr_reader :attribute alias this_attribute attribute def initialize(env) super @attribute = env.fetch(:attribute) end end end
17.882353
49
0.726974
bf72ec0bc77b4ae7181aa473c5f1564a5b1cff9a
1,230
Pod::Spec.new do |s| s.name = 'JustTweak' s.version = '9.0.0' s.summary = 'A framework for feature flagging, locally and remotely configure and A/B test iOS apps.' s.description = <<-DESC JustTweak is a framework for feature flagging, locally and re...
39.677419
119
0.596748
615e2cc338795d78c66832920f0c1a47a8d65577
1,703
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Compute::Mgmt::V2019_12_01 module Models # # Response after calling a manual recovery walk # class RecoveryWalkResponse include MsRestA...
28.383333
78
0.557839
7ab05cc09248c0d3d9138c49eeb1c382e901781d
6,419
require 'cgi' module Phrase class GitHubSyncApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Export from Phrase to GitHub # Export translations from Phrase to GitHub according to the .phraseapp.yml file within the GitHub repository...
43.666667
159
0.706808
7a23a05ff5efb5273437ecc2b4a2bb56a9ad901f
467
ENV["RAILS_ENV"] = 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'webmock/rspec' ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../') # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[File....
29.1875
79
0.745182
6a0c93fe8674ee964318bf6b27362d0e4d2732c6
94
class RemoveUsers < ActiveRecord::Migration[5.0] def change drop_table :users end end
15.666667
48
0.734043
d5d748d22efba8befc88830b8780d52229bc14fa
12,279
# 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| # ==> Mailer Configuration # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use yo...
49.313253
152
0.74941
bbf2bf663cc90b2ff25fcf5c9fb3c780e82dbe88
1,251
class User < ApplicationRecord attr_accessor :remember_token before_save { email.downcase! } validates :name, presence: true, length: { maximum: 50 } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i validates :email, presence: true, length: { maximum: 255 }, format: { with: VALID_EMAI...
29.785714
136
0.686651
b99a07b0d4f74ab48fbcfbefac148ad4d1b2de67
3,452
# frozen_string_literal: true # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration require 'coveralls' require 'webmock/rspec' Coveralls.wear!('rails') RSpec.configure do |config| config.filter_run_excluding(:live_aws, :live_ibm) unless ENV['CI'] == 'true' # default exclude unless on CI # rspec-exp...
45.421053
109
0.74044
b9630b00038091108929878e724e67ed3726819b
3,066
# frozen_string_literal: true module ExceedQueryLimitHelpers MARGINALIA_ANNOTATION_REGEX = %r{\s*\/\*.*\*\/}.freeze def with_threshold(threshold) @threshold = threshold self end def for_query(query) @query = query self end def threshold @threshold.to_i end def expected_count ...
21.291667
130
0.695042
e9e8905ed5e53d8b09c011f06f6b29c8073c4422
5,249
# # Be sure to run `pod spec lint RxWebClient.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...
36.2
93
0.585445
218f441f929a089d8956a7e5343955c6796e9da0
3,478
class Glib < Formula desc "Core application library for C" homepage "https://developer.gnome.org/glib/" url "https://download.gnome.org/sources/glib/2.60/glib-2.60.4.tar.xz" sha256 "2b941ec5dcb92e5ea83fe42f9eb55a827bc8a12c153ad2489d551c31d04733dd" bottle do sha256 "037cfa913d974cb0257deeb8575a6e9d7b00063...
36.229167
104
0.6659
3882813e33faf7bad526743ae760e9d2ff535de0
858
## # This file is part of WhatWeb and may be subject to # redistribution and commercial restrictions. Please see the WhatWeb # web site for more information on licensing and terms of use. # http://www.morningstarsecurity.com/research/whatweb ## Plugin.define "MistCMS" do author "Brendan Coles <bcoles@gmail.com>" # 2011...
27.677419
212
0.736597
33c1a2c3c7c0cee648a81ac6e3655c94f8010255
541
require 'ffuse' require 'ffuse/filesystem' class HelloWorld2 < FFUSE::Filesystem::AbstractFilesystem class Hello < FFUSE::Filesystem::File MESSAGE = "Hello, World.\n" def read(len, off, fh) MESSAGE.byteslice off, len end def size MESSAGE.bytesize end end def initialize @root...
19.321429
57
0.678373
1cdcc7a2e5dbaea42c0e37a50333e7b57013fdc0
113
class AddBodyToItems < ActiveRecord::Migration[5.2] def change add_column :items, :body, :string end end
18.833333
51
0.725664
bb9e8824b1aafcfa1b809a8e51d2afbaf62a4722
3,516
=begin #Signing Today Web #*Signing Today* is the perfect Digital Signature Gateway. Whenever in Your workflow You need to add one or more Digital Signatures to Your document, *Signing Today* is the right choice. You prepare Your documents, *Signing Today* takes care of all the rest: send invitations (`signature ticke...
40.883721
540
0.761661
030242fbc9db71e02464005d2f90f530ecbeae89
24,227
#!/usr/bin/env rspec require 'spec_helper' require 'augeasproviders/provider' describe AugeasProviders::Provider do context "empty provider" do class Empty include AugeasProviders::Provider attr_accessor :resource end subject { Empty } describe "#lens" do it "should fail as defaul...
37.678072
176
0.603748
798f7b0ac816ce3f489d44bd9fb1b85c5def08d0
1,715
require "rubygems" require "rails" require "rails/test_help" require "active_support/core_ext" require "set_builder" require "shoulda/context" require "pry" require "support/fake_connection" require "timecop" require "minitest/reporters" Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new # Sample class us...
23.819444
90
0.678134
1cfa0f7e4f3092e0306b701e5562bcd26b431258
303
module EnglishWords def hello return "hello" end def world return "world" end end class Greeting include EnglishWords def message return hello end end class HelloWorld < Greeting def message return super + " " + world + "!" end end
13.772727
40
0.590759
ffdd1991dd17dcdc272ea4eb1ea3e5c764e6a8cb
262
require_relative '../../automated_init' context "Data Source" do context "Hash" do hash_source = Controls::DataSource::Hash.example data = hash_source.get_data test "Converts the data to a Hash" do assert(data.is_a? Hash) end end end
20.153846
52
0.687023
7957c326c5713539b23c75ba271a62e7381b83b6
469
require 'spec_helper' describe 'roles::logging' do on_os_under_test.each do |os, facts| context "on #{os}" do let(:facts) { facts } context 'with defaults for all parameters' do it { is_expected.to contain_class('roles::logging') } it { is_expected.to contain_class('roles::node') } ...
31.266667
62
0.641791
1db033348e76eaefaaa0d6a42b4142dc7833b563
3,993
# **************************************************************************** # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution. If # you ...
35.651786
133
0.541197
5d389bd2d5d057bb65e0bfe3a4d56bd3d7c03aae
1,171
# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'aws-sdk-core' require 'aws-sigv4' require_relative 'aws-sdk-codestar/types' require_relative 'aws-sdk-...
24.395833
80
0.743809
4ab734474a78c4cb02a55e0e25c5670f4568cb50
244
module Job module Mail class CommentOnPost < Base @queue = :mail def self.perform(recipient_id, sender_id, comment_id) Notifier.comment_on_post(recipient_id, sender_id, comment_id).deliver end end end end
20.333333
77
0.688525
1a2bba519d7e7aacb38556a316f631122366a9b9
17,308
# encoding: utf-8 # # Jekyll categories pages generator # http://www.ekynoxe.com/ # Version: 0.0.1 (2014-01-25) # # Copyright (c) 2014 Mathieu Davy - ekynoxe - http://ekynoxe.com/ # Licensed under the MIT license # (http://www.opensource.org/licenses/mit-license.php) # # Initially based on https://github.com/mwotton/la...
48.481793
295
0.635544
1d6d58805440a771050294bae94392b484c36f8f
2,282
# #-- # Copyright (c) 2007-2008, John Mettraux, OpenWFE.org # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # . Redistributions of source code must retain the above copyright notice, this # ...
30.026316
79
0.716915
d55a2181d22c3634f2ad90ddc5d2439d7cf586fe
2,426
# -------------------------------------------------------------------------- # # Copyright 2019-2020, OpenNebula Systems S.L. # # # # Licensed under the OpenNebula Software License # # (t...
42.561404
149
0.489695
333fa074ee752ed8e36f40c3c2a2c9266057c110
2,777
# frozen_string_literal: true require 'slack-ruby-client' module PWN module Plugins # This plugin is used for interacting w/ Slack over the Web API. module SlackClient @@logger = PWN::Plugins::PWNLogger.create # Supported Method Parameters:: # PWN::Plugins::SlackClient.login( # ap...
26.447619
72
0.589125
1d6cfd00c59ba09cddc343973c1eadfcb63a146f
890
describe ChargebackRateDetailCurrency do it "has a valid factory" do expect(FactoryGirl.create(:chargeback_rate_detail_currency_EUR)).to be_valid end it "is invalid without a code" do expect(FactoryGirl.build(:chargeback_rate_detail_currency_EUR, :code => nil)).not_to be_valid end it "is invalid witho...
42.380952
104
0.775281
5dc09a3ca6ba72f496efb7ec20c875905ab5e223
2,815
module Refinery class PagesController < ::ApplicationController include Pages::RenderOptions before_action :find_page, :set_canonical before_action :error_404, :unless => :current_user_can_view_page? # Save whole Page after delivery after_action :write_cache? # This action is usually access...
29.946809
97
0.650799
28a5c7855a8bb28cea732df05790bf8217488bfc
1,018
require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require(*Rails.groups) require "i18n_o7r" module Dummy class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/i...
37.703704
99
0.730845
626af94021818bdb1ea6d774af9b20cfcadff6e1
7,677
=begin #The Plaid API #The Plaid REST API. Please see https://plaid.com/docs/api for more details. The version of the OpenAPI document: 2020-09-14_1.58.1 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.1.0 =end require 'date' require 'time' module Plaid # An object representing the e-w...
29.413793
214
0.624332
87653562997c2fc5dabe1e5813eb270848b13183
5,015
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
44.380531
114
0.762512
5db98f03d2abdea9e07fcf4c7607ce2319f22e64
1,946
describe "Quickeebooks::Windows::Service::SyncActivity" do before(:all) do FakeWeb.allow_net_connect = false qb_key = "key" qb_secret = "secreet" @realm_id = "9991111222" @base_uri = "https://qbo.intuit.com/qbo36" @oauth_consumer = OAuth::Consumer.new(qb_key, qb_key, { :site ...
45.255814
119
0.709661
914f5733abb529ea61110f4e7e4bfb5ddb747c5b
5,024
#! /usr/bin/env ruby # frozen_string_literal: true # # check-azurerm-virtual-network-gateway-failover-connected # # DESCRIPTION: # This plugin checks that at least one of the specified Virtual Network Gateways is connected. # Firing a Critical alert if both are not in the Connected state. # # OUTPUT: # plain-tex...
37.214815
131
0.650279
d56ef3bea399b75c9b8744a5736806159a2e2d39
39,636
#! /usr/bin/env ruby require 'spec_helper' require 'puppet/util/package' provider_class = Puppet::Type.type(:augeas).provider(:augeas) describe provider_class do before(:each) do @resource = Puppet::Type.type(:augeas).new( :name => "test", :root => my_fixture_dir, :provider => :augeas ...
38.631579
184
0.614896
28e0ada602ae3a673cf5fab40e27df6be60ec575
301
class CreateUsersInGames < ActiveRecord::Migration[6.0] def change create_table :users_in_games do |t| t.belongs_to :game, null: false, index: true t.belongs_to :user, null: false, index: true t.timestamps end add_index :users_in_games, %i[game_id user_id] end end
23.153846
55
0.69103
38000531e6d7c2acc1edad387981757c12460624
1,452
class Kvazaar < Formula desc "Ultravideo HEVC encoder" homepage "https://github.com/ultravideo/kvazaar" url "https://github.com/ultravideo/kvazaar/releases/download/v1.2.0/kvazaar-1.2.0.tar.xz" sha256 "9bc9ba4d825b497705bd6d84817933efbee43cbad0ffaac17d4b464e11e73a37" bottle do cellar :any sha256 "cdd...
33
93
0.734848
e9a1844ea94edc4c0f4c47ddecd7424a65b7e6f6
2,241
# 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...
37.35
119
0.668452
e2196ce683865de8d24d9c3a16def1ad5a58c8ad
41
class Interview < ActiveRecord::Base end
13.666667
36
0.804878
e82ba7c8ef349e001c177af24ab01534e0299806
539
cask 'trufont' do version '0.5.0' sha256 'bdc20b8e11f51b58595a8ed2ff2e6a9684a581c739ed5c1fd500ca8b8cd05fcb' # github.com/trufont/trufont was verified as official when first introduced to the cask url "https://github.com/trufont/trufont/releases/download/#{version}/TruFont.app.zip" appcast 'https://github.com...
35.933333
89
0.77551
7a180f8edf9d12a8ff3735328636bb1218896136
14,153
#-- # Author:: Adam Jacob (<adam@opscode.com>) # Author:: Thom May (<thom@clearairturbulence.org>) # Author:: Nuo Yan (<nuo@opscode.com>) # Author:: Christopher Brown (<cb@opscode.com>) # Author:: Christopher Walters (<cw@opscode.com>) # Copyright:: Copyright (c) 2009, 2010 Opscode, Inc. # License:: Apache License, Ver...
36.012723
160
0.636685
5d2adaa93f302f6598cb44ec7c6b3a08bafbd80e
1,249
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::IotHub::Mgmt::V2017_07_01 module Models # # The JSON-serialized leaf certificate # class CertificateVerificationDescription include MsR...
26.574468
77
0.583667
626e0a043f390530c4389c4ab6c9afe2e8426b6c
779
Как эффективно использовать сирень в дизайне сада? Ирина Окунева отвечает на наши вопросы: Так сирень теряют хороший внешний вид, когда они упали свои цветы, это хорошая идея, чтобы посадить их вместе с другими кустарниками. Они подходят очень хорошо с многих растений. Кроме того, можно и нужно сажать сирень рядом обои...
86.555556
200
0.817715
abe82b8f2fe94a2e1f8162d686c387b66293e818
2,187
module Dyph module Support module SanityCheck extend self # rubocop:disable Metrics/AbcSize def ensure_no_lost_data(left, base, right, final_result) result_word_map = {} final_result.each do |result_block| blocks = case result_block when Outcome::Resolved t...
29.958904
106
0.621399
e26f9f9cc366574baa3ec219033fe8ac19a40237
3,624
module Address class Transfer include ActiveModel::Model attr_accessor :cpf, :observation, :unit_id validates :cpf, cpf: true, presence: true validates :observation, presence: true validate :cpf_allow? def transfer! #clone cadastre address #add new cadastre address 'transferid...
29.704918
114
0.671909
ac81beeca50c1df9c52bc7394f2d7e23c4fc788e
77
# -*- frozen_string_literal: true -*- module RSplit VERSION = "0.1.3" end
12.833333
37
0.649351
08ae88e7085ce004597f8c3d34c202929171bf00
700
require File.expand_path('../../../spec_helper', __FILE__) describe "Float#round" do it "returns the nearest Integer" do 5.5.round.should == 6 0.4.round.should == 0 -2.8.round.should == -3 0.0.round.should == 0 0.49999999999999994.round.should == 0 # see http://jira.codehaus.org/browse/JRUBY-5048...
30.434783
90
0.657143
edc5e3ca79f93c635239260239f2a540b4a9279a
498
require_relative '../embed_objects/embed_field' module RedmineDiscord class WrappedJournal def initialize(journal) @journal = journal end def to_notes_field notes = @journal.notes if notes.present? block_notes = "```#{notes.to_s.gsub(/`/, "\u200b`")}```" EmbedField.new...
21.652174
78
0.640562
bfb153b09c4dee5eca69610f1a1ae19d041d152c
1,851
# frozen_string_literal: true module RuboCop module Cop module Security # This cop checks for the use of `Kernel#open`. # # `Kernel#open` enables not only file access but also process invocation # by prefixing a pipe symbol (e.g., `open("| ls")`). So, it may lead to # a serious secu...
25.356164
78
0.551053