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
e9ddaaf2d8cae6a5c7539f2225cc4ef19a5ed16a
85
FactoryGirl.define do factory :candidate do person nil active false end end
10.625
23
0.741176
1d5aa882c14fc5f6759ee462360f4cef0627995a
412
def output_relative(input_file_path, template_file, contents, output_file = nil) real_out_file = output_file if !output_file full_path = File.expand_path(input_file_path) dir = File.dirname(full_path) name = File.basename(template_file, '.erb') real_out_file = File.join(dir, nam...
27.466667
80
0.667476
1aa899f0790b4d8975fe6fe2bf153956512fd3b5
487
cask 'hexels' do version '3.1.5' sha256 '65ae3d445036588100ef82fb077a72ca7b2afd4752ca7d1e1b43a28ea1da8023' # mset.s3.amazonaws.com/download/release was verified as official when first introduced to the cask url "https://mset.s3.amazonaws.com/download/release/hexels_install_#{version.no_dots}.dmg" appcast 'ht...
34.785714
101
0.755647
5db963fefd84a7953b68e8b87a05c3677a79d8c0
1,541
class AttachmentsController < ApplicationController before_action :set_attachment, only: [:show, :edit, :update, :destroy] respond_to :html, :json # GET /attachments # GET /attachments.json def index @attachments = Attachment.all end # GET /attachments/1 # GET /attachments/1.json def show end...
24.460317
100
0.704737
5d556e65d8a62c61687112304a7a6b996e7d2a4f
2,914
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::CmdStager include Msf::Exploit::Remote::Tcp include ...
25.787611
163
0.552162
87181ccf01d4d515bf8f410ca3a98f82f394abac
1,315
class OtherController < ApplicationController def test_locals render :locals => { :input => params[:user_input] } end def test_object render :partial => "account", :object => Account.first end def test_collection users = User.all partial = "user" render :partial => partial, :collection =...
18.013699
66
0.660076
ab20f3465d3be67e61fe39a1ecdb7311e00bec90
839
module Txdb module Handlers module Triggers class Handler include ResponseHelpers class << self def handle_request(request) new(request).handle end end attr_reader :request def initialize(request) @request = request ...
19.97619
75
0.52801
01c1d98c61330f7584eb4f9deba233791b24092e
13,507
# frozen_string_literal: true require "helper" class TestUtils < JekyllUnitTest context "The \`Utils.deep_merge_hashes\` method" do setup do clear_dest @site = fixture_site @site.process end should "merge a drop into a hash" do data = { "page" => {} } merged = Utils.deep_m...
33.186732
89
0.613386
21d12f7cbc8dd0979fe1d5bafe5937ebe9404cb3
958
cask 'microsoft-lync' do version '14.2.1_150923' sha256 'da1264855e3a7b372639862ed1b35a8e03c49ee5f26a440ac74daced5a743449' url "https://download.microsoft.com/download/5/0/0/500C7E1F-3235-47D4-BC11-95A71A1BA3ED/lync_#{version}.dmg" name 'Microsoft Lync 2011' homepage 'https://www.microsoft.com/en-us/download...
39.916667
110
0.584551
1a9c73494f57d2fae56a0162c98118bb9defae8f
1,073
class Darkhttpd < Formula desc "Small static webserver without CGI" homepage "https://unix4lyfe.org/darkhttpd/" url "https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2" sha256 "a50417b622b32b5f421b3132cb94ebeff04f02c5fb87fba2e31147d23de50505" bottle do cellar :any_skip_relocation sha256 "9fbb24a5...
39.740741
93
0.807083
d5eb37abbc61799bf72c4bc69782e4dc3ffedd7b
10,995
class QAE2014Forms class << self def mobility_step1 @mobility_step1 ||= proc do header :company_information_header, "" do context %( <p> We need this information to ensure we have some basic information about your organisation, which will help us to undertake due ...
34.684543
219
0.581264
1ca9973c9f858900922d9c6ba52cd487e503e108
395
# -*- coding: utf-8 -*- require "sixarm_ruby_date_time_random_test" class DateTimeTest < Minitest::Test def test_random x = DateTime.random assert_kind_of(DateTime, x) end def test_random_with_range now = DateTime.now range = (now - 10)..(now + 10) x = DateTime.random(range) assert_kind...
19.75
46
0.665823
39159dc965765467e425fff20d767c0b621e626b
264
# frozen_string_literal: true require 'tencentcloud-sdk-common' require_relative 'v20181225/client' require_relative 'v20181225/models' require_relative 'v20210331/client' require_relative 'v20210331/models' module TencentCloud module Organization end end
17.6
35
0.829545
e86fcae524068061abed0a18f960df7253e10fb2
36
module Zoku VERSION = "0.0.1" end
9
19
0.638889
6168a96d7179138567816edeac06726bc85b6287
4,427
#!/usr/bin/env ruby # THIS SCRIPT IS FOR TESTING PURPOSES ONLY. # # We use Docker to run tomo deploy tests. Docker is not able to run systemd, but # tomo needs systemd for starting long-lived processes (e.g. puma). This script # simulates the behavior of systemctl commands so that a tomo deploy can succeed # in a Dock...
23.547872
80
0.679467
1c18880e467d48a107647a4caa4e894fe664362d
1,858
class Liblo < Formula desc "Lightweight Open Sound Control implementation" homepage "https://liblo.sourceforge.io/" url "https://downloads.sourceforge.net/project/liblo/liblo/0.31/liblo-0.31.tar.gz" sha256 "2b4f446e1220dcd624ecd8405248b08b7601e9a0d87a0b94730c2907dbccc750" license "LGPL-2.1" bottle do s...
32.596491
123
0.688375
263b8e464d13a171f25a6f554076ded6d477e410
1,982
class Newt < Formula desc "Library for color text mode, widget based user interfaces" homepage "https://fedorahosted.org/newt/" url "https://fedorahosted.org/releases/n/e/newt/newt-0.52.18.tar.gz" sha256 "771b0e634ede56ae6a6acd910728bb5832ac13ddb0d1d27919d2498dab70c91e" revision 1 bottle do cellar :any...
33.033333
105
0.687689
e98a9880ab1b1a1bdbc27b02c5c88140d899f04a
1,008
{ matrix_id: '1360', name: 'Si2', group: 'PARSEC', description: 'Real-space pseudopotential method. Zhou, Saad, Tiago, Chelikowsky, Univ MN', author: 'Y. Zhou, Y. Saad, M. Tiago, J. Chelikowsky', editor: 'T. Davis', date: '2005', kind: 'theoretical/quantum chemistry problem', problem...
29.647059
94
0.641865
1cc5e6fc8de2359a33acb8084faf7416aa241305
1,361
module CPP module Helpers def self.generateWrapperText(lineStart, extraFnName, inArgs, initArgs, call, ret, resVar) ls = lineStart olLs = lineStart + " " returnVal = "" if (resVar) returnVal = "\n#{olLs}return #{resVar};" end extra = "" if (initArgs.length !=...
18.902778
93
0.528288
5d56866a65160d649d63c2643161aa14cf2c7dcd
3,840
class Opencv < Formula desc "Open source computer vision library" homepage "https://opencv.org/" url "https://github.com/opencv/opencv/archive/4.5.0.tar.gz" sha256 "dde4bf8d6639a5d3fe34d5515eab4a15669ded609a1d622350c7ff20dace1907" license "Apache-2.0" revision 5 livecheck do url :stable regex(/^v...
29.767442
106
0.678385
337e9a32752640809fa3b0988a3ffb5aaf6d098c
1,912
class Picture < ApplicationRecord # Callbacks before_save :unset_current_profile_or_cover, if: Proc.new { |picture| picture.picture_type.present? && Picture::PictureType::ALL.include?(picture.picture_type) } # Scopes # Associations belongs_to :imageable, polymorphic: true # Constants module PictureType...
33.54386
163
0.733264
3875dc39e0109ce89398d260aa4847da810a2f8d
84
class ShortArtworkSerializer < ActiveModel::Serializer attributes :title, :id end
21
54
0.809524
38f16ac318968be33f0cdf5ca5f203b0e338a402
58
class Dashboard::HomeController < DashboardController end
19.333333
53
0.862069
1a8398a01c1ef922b35009969286185dec5963ce
199
class FixErrorInRegion < ActiveRecord::Migration[5.2] def change remove_column :regions, :adminstration_id change_table :regions do |t| t.references :administration end end end
22.111111
53
0.728643
62f3a1c2156bd3b9107351ddcb046539cdaf44c9
1,634
require "test_helper" class UsersLoginTest < ActionDispatch::IntegrationTest def setup @user = users(:michael) end test "login with invalid email/invalid password" do get login_path assert_template 'sessions/new' post login_path, params: { session: { email: @user.email, ...
29.709091
72
0.670747
2860913301809b1cd121c434fe1e1794d5ddf45b
1,098
module C100App class ChildrenDecisionTree < BaseDecisionTree def destination return next_step if next_step case step_name when :add_another_name edit(:names) when :names_finished edit(:personal_details, id: next_record_id) when :personal_details edit(:orders,...
23.361702
89
0.648452
87c97cced9a4e2445e7d929a5bdb109397140813
320
class SecureHeadersWhitelister def self.extract_domain(url) url.split('//')[1].split('/')[0] end def self.csp_with_sp_redirect_uris(action_url_domain, sp_redirect_uris) csp_uris = ["'self'", action_url_domain] csp_uris |= sp_redirect_uris.compact if sp_redirect_uris.present? csp_uris end end
22.857143
73
0.734375
790f1eb224c76ab2f29719b99a8dd68d30c7243e
24,011
#!/usr/bin/env ruby # -*- coding: binary -*- # # Check (recursively) for style compliance violations and other # tree inconsistencies. # # by jduck, todb, and friends # require 'fileutils' require 'find' require 'time' CHECK_OLD_RUBIES = !!ENV['MSF_CHECK_OLD_RUBIES'] SUPPRESS_INFO_MESSAGES = !!ENV['MSF_SUPPRESS_INFO_M...
30.862468
201
0.599517
038eed7b9f17fc55ac5d0507ec2924a0e2a573cf
998
# frozen_string_literal: true require 'spec_helper' RSpec.describe ::JiraConnect::SyncFeatureFlagsWorker do include AfterNextHelpers include ServicesHelper describe '#perform' do let_it_be(:feature_flag) { create(:operations_feature_flag) } let(:sequence_id) { Random.random_number(1..10_000) } let...
26.972973
115
0.711423
18c06a2d3c12b8e717f26e757129e703d41e63ac
1,169
require 'minitest/autorun' require_relative 'grains' # Common test data version: 1.1.0 f079c2d class GrainsTest < Minitest::Test def test_1 # skip assert_equal 1, Grains.square(1) end def test_2 skip assert_equal 2, Grains.square(2) end def test_3 skip assert_equal 4, Grains.square(...
17.447761
61
0.718563
26b20e97b6d21cb529aea5786854cf2dc689903e
7,698
=begin The Trust Payments API allows an easy interaction with the Trust Payments web service. 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 requ...
31.809917
164
0.640036
7a0fcda9d843862479540bab494eba976da06c8a
264
# frozen_string_literal: true module Lastfm class Query attr_reader :user def initialize(from:, to:, user:) @from = from @to = to @user = user end def from @from.to_i end def to @to.to_i end end end
12.571429
37
0.55303
28fa866e78eb27a9dd8964ad9d13d567b521eb54
1,547
module BusinessProcesses class AffectedMember attr_accessor :policy attr_accessor :member_id FROM_PERSON = [ :name_first, :name_last, :name_middle, :name_pfx, :name_sfx] FROM_MEMBER = [ :gender, :ssn, :dob] FROM_PERSON.each do |prop| class_e...
20.090909
73
0.543633
4aba8e07816bb8693433bab8d64ffdfd8f7b8287
483
module CangarooUI class RetryJobsController < ApplicationController def update @tx = CangarooUI::Transaction.find(params[:id]) respond_to do |format| if CangarooUI::TransactionRetrier.retry(@tx) flash.now[:notice] = "Job #{@tx.job_class} queued" else flash.now[:al...
24.15
72
0.625259
1d3faea4ebc0dc09a9b84feae2cc1bcd35d8c019
574
# encoding: utf-8 # Numeric class Numeric # return is binary table # # ==== Examples # # 1 to 3 case # # Numeric.to_binary_table(1, 3) # # result # # |10digit|2digit | # |1 |00000001| # |2 |00000010| # |3 |00000011| # def self.to_binary_table(from = 1, to = 10)...
19.133333
71
0.5
185f4be2e5e670940001174b05374c8b48d27d75
201
module Datadog module VERSION MAJOR = 0 MINOR = 31 PATCH = 0 PRE = nil STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.') MINIMUM_RUBY_VERSION = '2.0.0'.freeze end end
15.461538
57
0.60199
1cc856dd7b35e9614204d8e3d534e3ce48230c88
202
require 'minitest' require 'minitest/autorun' require 'minitest/pride' require 'minitest-spec-context' require 'pry' require 'awesome_print' require_relative '../lib/github_copier' include GithubCopier
22.444444
39
0.811881
f84c4e0cfeceba63cd00a3495c9dc63ab41003ce
1,530
module Kana::Convertor @@mecab = nil if SS.config.kana.disable == false require "MeCab" @@mecab = MeCab::Tagger #require "natto" #@@mecab = Natto::MeCab end class << self public def kana_html(html) return html unless @@mecab text = html.gsub(/[\r\n\t]/, " ") ...
27.321429
88
0.452941
eda0d8916c09ffc563a14883ac76fc1cfde55b0a
81
module Beaglebone # Current Gem Version # VERSION = "0.1.3" end
9
24
0.567901
336a4c0956613b3a8a60369fcd34d153881f42c7
6,204
namespace :github do desc 'Create a specific set of labels that are mapped to waffle.io' task :create_sensu_plugins_labels do acquire_label_list STD_PLUGIN_LABELS.each do |s| @github.issues.labels.create name: s[:name], color: s[:color], ...
39.265823
152
0.542553
3389467dc1605affe63d7f6a6d49beaf91debce6
451
class Tenancy::Contact < Tenancy::Resource # FIXME: must always CGI.escape() the :tenancy_id as it contains a slash and # is passed into the URL. Maybe active_resource should be escaping this # properly but certainly the API shouldn't be using such problematic # identifiers self.prefix = "#{site.path}/tenanci...
30.066667
78
0.733925
390cf7e997a88e299d8a1fa2abff82a4bec4c0ea
272
# encoding: utf-8 ### # to run use # ruby -I ./lib -I ./test test/test_version.rb require 'helper' class TestVersion < MiniTest::Test def test_version pp DateFormats::VERSION pp DateFormats.banner pp DateFormats.root end end # class TestVersion
14.315789
50
0.680147
acb2f1569ba880e10e77e33305de247d6e5fe006
495
class UsersController < ApplicationController before_action :require_signed_in!, only: [:show] before_action :require_signed_out!, only: [:new, :create] def new @user = User.new end def create @user = User.new(user_params) if @user.save sign_in(@user) redirect_to subs_url else ...
19.038462
59
0.670707
ace6bf584c77dcba4bdd8dba212f0069bcedcc98
1,134
# # Cookbook Name:: nova # Recipe:: consoleauth-monitoring # # Copyright 2009, Rackspace Hosting, 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/L...
33.352941
77
0.696649
b9b3310e3234fc2b18a0a3281a778c0b568d49e1
567
# encoding: utf-8 require 'spec_helper' class BancoBrasil < BoletoBancario::BancoBrasil def self.valor_documento_tamanho_maximo 100 # Default 99999999.99 end def self.carteiras_suportadas %w[12 17] # Default %w[12 16 17 18] end end describe BancoBrasil do describe "on validations" do it { shoul...
24.652174
68
0.710758
62bbdae33287e42faa66efeb1c3a174026bc4aed
1,363
# # Be sure to run `pod spec lint JXFMDBMOperator.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://gi...
37.861111
105
0.610418
e9cf368fb470fb343cd9d1d184f930d4d411e255
1,418
# frozen_string_literal: true # Kerning is the process of adjusting the spacing between characters in a # proportional font. It is usually done with specific letter pairs. We can # switch it on and off if it is available with the current font. Just pass a # boolean value to the <code>:kerning</code> option of the text...
36.358974
77
0.684062
f7f626ac71c25a7d4ea238e62116eee7b06d9c3c
245
# frozen_string_literal: true require "falkor/version" require "falkor/download" require "falkor/extract/gem" require "falkor/extract/tar_gz" require "falkor/yard/documentation" require "falkor/ruby" require "falkor/gem" module Falkor end
14.411765
35
0.787755
acc946463aae504bc9646a006b488c1b4444824b
980
require 'facets/range/within' require 'test/unit' class TestRangeWithin < Test::Unit::TestCase def test_within? assert( (4..5).within?(3..6) ) assert( (3..6).within?(3..6) ) assert(! (2..5).within?(3..6) ) assert(! (5..7).within?(3..6) ) end def test_umbrella_aligned assert_equal( [0,0], (3...
26.486486
53
0.587755
e9f0b6eba40521f2ace7263365f304ab6f5e0d4c
36,202
# encoding: utf-8 $:.unshift File.dirname(__FILE__) require 'test_helper' require 'tmail' require 'tmail/header' require 'kcode' require 'time' class UnstructuredHeaderTester < Test::Unit::TestCase def test_s_new %w( Subject SUBJECT sUbJeCt X-My-Header ).each do |name| h = TMail::HeaderField.new(na...
33.992488
251
0.675267
ac3ed049e975e6137936d48f61cbefb046a3e6ac
1,754
class AwsEsProxy < Formula desc "Small proxy between HTTP client and AWS Elasticsearch" homepage "https://github.com/abutaha/aws-es-proxy" url "https://github.com/abutaha/aws-es-proxy/archive/v0.9.tar.gz" sha256 "c5a2943c79737874b7fc84ee298925e33aeece58fcf0e2b8b7d2f416bc872491" bottle do cellar :any_skip...
33.09434
98
0.704675
878f9d8d1c8bb5808567bdd856ad039bd114e84d
624
class Mutations::FulfillAtOnce < Mutations::BaseMutation null true description 'Fulfill an order with one Fulfillment, it sets this fulfillment to each line item in order' argument :id, ID, required: true argument :fulfillment, Inputs::FulfillmentAttributes, required: true field :order_or_error, Mutations::...
34.666667
116
0.746795
08b5749c63cabcd5000632fc94137586113a2a11
757
# frozen_string_literal: true module RoutesLazyRoutes class RoutesReloaderWrapper delegate :paths, :eager_load=, :run_after_load_paths=, :updated?, :route_sets, :external_routes, to: :@original_routes_reloader def initialize(origi...
23.65625
94
0.642008
03b1fec0e1a41997391843a377747b9faeb95e48
2,174
class CoursesController < ApplicationController before_action :set_course, only: [:show, :edit, :update, :destroy, :students] # GET /courses # GET /courses.json def index @courses = Course.all if params[:title] @courses = @courses.where("lower(title) like ?", "%#{params[:title]}%") end end...
25.27907
91
0.643054
91cd28da75e194e68b5d6b91fe330246ed3c8467
1,392
#!/usr/bin/env ruby # paint.rb require "rubygems" require "opencv" include OpenCV window = GUI::Window.new("free canvas") canvas = CvMat.new(500, 500, 0, 3).fill!(0xFF) # create white canvas window.show canvas colors = CvColor::constants.collect{|i| i.to_s } usage =<<USAGE [mouse] drag - draw right butto...
19.333333
68
0.621408
e27db8f126765cdfa3a4677007f89d3c1182197c
1,971
# -*- coding: utf-8 -*- $LOAD_PATH.unshift "../lib" require "normalizer" Normalizer.logger = ActiveSupport::Logger.new(STDOUT) Normalizer.normalize("ruby on rails", :hankaku => true) # => "ruby on rails" Normalizer.normalize("ドラえもん", :katakana => true) # => "ドラエモン" Normalizer.normalize("ドラえもん", :hiragan...
65.7
90
0.562659
e2bf1ea0c04d00b0a5a54a5ee2436298a242f1c7
530
class SshAudit < Formula desc "SSH server auditing" homepage "https://github.com/arthepsy/ssh-audit" url "https://github.com/arthepsy/ssh-audit/archive/v1.7.0.tar.gz" sha256 "cba29cc19ec2932e4f43c720b2c49a7d179219e23482476aeb472f7463713b68" revision 1 head "https://github.com/arthepsy/ssh-audit.git" bott...
26.5
75
0.720755
b977cd9ff9332e590689053eabddd4c5f1a13274
1,676
require 'spec_helper' describe "Zohax::Api" do before :all do @username = "test@terracoding.com" @password = "zohotest" @token = "c9515d642d1557bf354f082c23e86a5f" end describe "without auth token" do before :all do @api = Zohax::Api.new(@username, @password, @token) end it ...
28.896552
149
0.629475
5d30d8ddae647b5cc06116f80538e04f5f01a3cb
30,748
module MachO # load commands added after OS X 10.1 need to be bitwise ORed with # LC_REQ_DYLD to be recognized by the dynamic linder (dyld) LC_REQ_DYLD = 0x80000000 # association of load commands to symbol representations # @api private LOAD_COMMANDS = { 0x1 => :LC_SEGMENT, 0x2 => :LC_SYMTAB, 0...
30.686627
102
0.680792
e848e4ecd1db467655a9f69d507c09f52075565b
52
fput 'unlock door' fput 'open door' move 'go door'
17.333333
18
0.692308
91751d54603db594b512f3d739176952ecc8aa32
48,911
# encoding: utf-8 require 'spec_helper' module Adhearsion module Translator class Asterisk module Component describe MRCPPrompt do include HasMockCallbackConnection let(:ami_client) { double('AMI') } let(:translator) { Translator::Asterisk.new ami_client, conne...
38.664822
565
0.534829
398d5525a263140f63a2f8b54e6b1e05016208cc
348
cask 'moneymoney' do version '2.3.24' sha256 'd20e74baba6c164ffd793c52d5b566a7fc134deb8e8e10aa1076fbd770b927d0' url 'https://service.moneymoney-app.com/1/MoneyMoney.zip' appcast 'https://service.moneymoney-app.com/1/Appcast.xml' name 'MoneyMoney' homepage 'https://moneymoney-app.com/' auto_updates true ...
24.857143
75
0.764368
1a0e59ea61cb58c9d6c0a4f4215b413460e26e14
931
$:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "archivesspace-api-utility/version" require "archivesspace-api-utility/helpers" Gem::Specification.new do |s| s.name = 'archivesspace-api-utility' s.version = ArchivesSpaceApiUtility::VERSION s.date = '2014-04-...
40.478261
104
0.713212
b920498140af5ef8d74727830cfc2980900f50de
3,244
array = [] array2 = [] for num in 1..20 recipe_string = RestClient.get("http://www.recipepuppy.com/api/?p=#{num}") recipe_hash = JSON.parse(recipe_string) array << recipe_hash["results"] array[0..-1][0..-1].each do |item| array2 << item end end new_array = array2.flatten new_array[0..-1].map do |reci...
22.84507
87
0.594945
08af05c8d71cccf2e34137010958c2d68d86eee9
1,796
require 'sinatra' require 'sinatra/reloader' # The secret number to guess. This will start as an invalid value number = -1 # Generate a secret number from 1 to 100 def secret_num rand(1..100) end def get_test_num(init_test) final_test = init_test.to_i if final_test <= 0 || final_test > 100 final_test = 50...
23.324675
83
0.664811
bb063a4e208c256dd71bb7420412f9c29c5d3383
526
require 'serverkit/resources/base' module Serverkit module Resources class VagrantPlugin < Base attribute :name, required: true, type: String # @note Override def apply run_command("vagrant plugin install #{name}") end # @note Override def check has_plugin? ...
19.481481
69
0.617871
e868f8a94125c9b9e91e512458442259a51870db
697
require "#{File.dirname(__FILE__)}/abstract_note" module Footnotes module Notes class EnvNote < AbstractNote def initialize(controller) @env = controller.request.env.dup end def content env_data = @env.to_a.sort.unshift([:key, :value]).map do |k,v| case k wh...
25.814815
151
0.583931
089e79bdf736ca364e82034b7ccd7f557ceba355
1,804
module KucoinRuby module Market def self.tick(symbol = nil) endpoint = "/v1/open/tick" endpoint += "?symbol=#{symbol}" if symbol KucoinRuby::Net.get(endpoint) end def self.orders(symbol) KucoinRuby::Net.get("/v1/open/orders?symbol=#{symbol}") end def self.buy_orders(symbo...
29.096774
110
0.648004
1cd25738299d7d35025178804193dc9e6f52d35e
684
require 'test_helper' require 'bbq/core/util' class User module Commenter end end module Commenter end class UtilTest < Minitest::Test def test_find_module_in_object_namespace assert_commenter(User.new, User::Commenter) end def test_find_module_in_class_namespace assert_commenter(User, User::Comm...
18.486486
71
0.755848
e20531e522e3972d09d60afd35ce5f17d07cb54b
1,767
# frozen_string_literal: true # a person in Scoutplan. Most business logic, however # is handled in the UnitMembership class class User < ApplicationRecord include Flipper::Identifier include Contactable # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :trackabl...
25.242857
77
0.704018
6a9e3613b69575331a6660bfe6bde8d803780956
1,548
# frozen_string_literal: true # Copyright (c) 2008-2013 Michael Dvorkin and contributors. # # Fat Free CRM is freely distributable under the terms of MIT license. # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------...
37.756098
79
0.679587
f7a1231a4c6fea23226619d73360ffadab72275c
726
require 'spec_helper' describe SportsDataApi::Mlb::Team, vcr: { cassette_name: 'sports_data_api_mlb_team', record: :new_episodes, match_requests_on: [:host, :path] } do let(:teams) do SportsDataApi.set_key(:mlb, api_key(:mlb)) SportsDataApi.set_access_level(:mlb, 't') SportsDataApi::Mlb.teams...
29.04
65
0.661157
0351ed21b8f1e536b3123e344fded85366b60ee7
2,377
class Libphonenumber < Formula desc "C++ Phone Number library by Google" homepage "https://github.com/googlei18n/libphonenumber" url "https://github.com/googlei18n/libphonenumber/archive/v8.8.7.tar.gz" sha256 "68c45ab16e090b31c506d542aad7cab10264b9c92c342537d7b7262c960344fb" revision 1 bottle do cellar...
33.013889
93
0.699201
7a909c15eb552e495c86b88f848ca926c6b8951a
1,029
require 'ingenico/direct/sdk/declined_transaction_exception' module Ingenico::Direct::SDK # Indicates that a refund is declined by the Ingenico ePayments platform or one of its downstream partners/acquirers. class DeclinedRefundException < DeclinedTransactionException # Create a new DeclinedRefundException ...
31.181818
119
0.724976
6156a7d2666a98368468cc90fdacdb8f593d630e
521
# 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_relative '../../aws-sdk-core/spec/shared_spec_helper' $:.unshift(File.expand_path('../../lib', __FILE__...
30.647059
74
0.71977
61b82f864722f60a6ae5851e63958732ed39bc08
2,584
# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/ads/googleads/v7/services/conversion_upload_service.proto for package 'Google.Ads.GoogleAds.V7.Services' # Original file comments: # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use...
37.449275
184
0.621904
62d6dc70d436c2874965e9d3554b5a477fd78c89
325
class CreateProperties < ActiveRecord::Migration[6.0] def change create_table :properties do |t| t.references :neighborhood, null: false, foreign_key: true t.references :user, null: false, foreign_key: true t.string :address t.float :lat t.float :lgn t.timestamps end end...
23.214286
64
0.664615
ab24852302850d96e0e178f83780037034cac2ec
1,736
# frozen_string_literal: true module API module Entities class IssueBasic < IssuableEntity format_with(:upcase) do |item| item.upcase if item.respond_to?(:upcase) end expose :closed_at expose :closed_by, using: Entities::UserBasic expose :labels do |issue, options| ...
31.563636
112
0.647465
f74ccd7092d701e31ee591687ae5263b66e6c46c
9,045
=begin #Datadog API V2 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://openapi-generator.tech Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product...
30.352349
220
0.621117
b925f566a1f1b910b56a5f2cd03b092356fe0501
8,099
# TL;DR: YOU SHOULD DELETE THIS FILE # # This file was generated by Cucumber-Rails and is only here to get you a head start # These step definitions are thin wrappers around the Capybara/Webrat API that lets you # visit pages, interact with widgets and make assertions about page content. # # If you use these step defin...
28.318182
100
0.635881
217dc0289df6cc7397efc68d92a0c4fdb52f3564
591
#--- # Excerpted from "Agile Web Development with Rails", # published by The Pragmatic Bookshelf. # Copyrights apply to this code. It may not be used to create training material, # courses, books, articles, and the like. Contact us if you are in doubt. # We make no guarantees that this code is fit for any purpose. # ...
39.4
83
0.71066
1db362c023dd3ee1ecaf3d533de6afee1c2c4d26
5,191
require 'spec_helper' provider_class = Puppet::Type.type(:rabbitmq_user).provider(:rabbitmqctl) describe provider_class do let(:resource) do Puppet::Type.type(:rabbitmq_user).new( ensure: :present, name: 'rmq_x', password: 'secret', provider: described_class.name ) end let(:provid...
29.327684
115
0.628781
1cdcfddcdb0f7fd55925c0e1190a190882f4f514
106
class Behavior < ApplicationRecord has_many :conditions accepts_nested_attributes_for :conditions end
21.2
43
0.849057
f796a47f434ab06167f626497a3b524a62e1357d
138
class OdptCommon::Factory::Decorate::Settings < RailsDecorateFactory::Settings include ::OdptCommon::Factory::Decorate::CurrentPath end
34.5
78
0.811594
613b5a05e34f4b435133a1ea672712cec93cd8b5
27,565
# Encoding: utf-8 # IBM Liberty Buildpack # Copyright 2014 the original author or authors. # # 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 # # U...
42.212864
150
0.603845
2631060d899f0b8c3118c554266cddd8feb9ed69
868
class ReplaceEnvironmentIdWithEnvironmentNameDeploys < ActiveRecord::Migration RENAMES = {"dev" => "Staging", "master" => "Production"} class Environment < ActiveRecord::Base; end def up add_column :deploys, :environment_name, :string, null: false, default: "Production" add_index :deploys, :environment_...
33.384615
109
0.745392
ff8505b4a46c62e43ee423e2cdd9c6de50641402
695
class IfanrSpider < Flute::SpiderBase include RssMiddleware set_name 'ifanr' start_urls ['http://www.ifanr.com/feed'] def before_parse(items) items.map {|item| WebItem.new url: item.url, title: item.title } end def parse(items) items.map do |item| request = net...
19.305556
44
0.623022
e204e0a515dfa00905d13711fa635cd506cd73ea
722
# frozen_string_literal: true require 'spec_helper' describe 'admin visits dashboard' do include ProjectForksHelper before do sign_in(create(:admin)) end context 'counting forks' do it 'correctly counts 2 forks of a project' do project = create(:project) project_fork = fork_project(proje...
24.896552
79
0.722992
0808960b62d0cc2a7a65e2a3bd80b5ad90f95ac9
590
# frozen_string_literal: true sumo_dir = node['platform_family'] == 'windows' ? 'c:\sumo' : '/opt/SumoCollector' # install a blank collector sumologic_collector sumo_dir do action :install end sumologic_collector sumo_dir do collector_name 'test-instance' host_name 'example.com' description 'A Test Kitchen i...
24.583333
82
0.766102
26eff95b52b611597e2ca033f27fc9657d8f9a40
7,477
#require 'api_constraints' Rails.application.routes.draw do get 'subscribe/new' devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks", :registrations => "users/registrations", :confirmations => "confi...
28.109023
97
0.683429
87b438aefc56bf9489d1f07a03d9be00ead21d4d
1,229
class XcbUtilCursor < Formula desc "XCB cursor library (replacement for libXcursor)" homepage "https://xcb.freedesktop.org" url "https://xcb.freedesktop.org/dist/xcb-util-cursor-0.1.3.tar.bz2" sha256 "05a10a0706a1a789a078be297b5fb663f66a71fb7f7f1b99658264c35926394f" revision 1 bottle do root_url "https...
30.725
94
0.690806
1cb4043c26600cae8c83f399fff54d48862d2345
94
json.extract! @role, :id, :role_name, :role_description, :is_active, :created_at, :updated_at
47
93
0.755319
e8005af4f2b38f66dfcba541960cc8c58d9586e2
1,762
######################################################################### ######################################################## # Copyright IBM Corp. 2016, 2018 ######################################################## # <> Pre-Requisite recipe (prereq.rb) # <> Pre-Requisite recipe to install packages, create users...
28.885246
143
0.507378
bfcf2c4049a5cd9a93f34668302a75259f3b2a0e
156
# encoding: utf-8 class FirmPageImage < Image mount_uploader :image, FirmPageImageUploader belongs_to :firm_page validates :image, presence: true end
22.285714
46
0.788462
260c6a61c93a144b1f915bb5fba5ce7639fc643a
3,690
module Authlogic module Session # Sort of like an interface, it sets the foundation for the class, such as the # required methods. This also allows other modules to overwrite methods and call super # on them. It's also a place to put "utility" methods used throughout Authlogic. module Foundation ...
34.811321
90
0.605962
878bfeaa19f1fa05766c467699d2f1727a1a1dfa
43
module Presentable VERSION = "0.1.0" end
10.75
19
0.697674
61435fcac1584ca64a2be73af52ff7fc0e3710ff
10,361
module MysqlCookbook module HelpersBase require 'shellwords' def el6? return true if platform_family?('rhel') && node['platform_version'].to_i == 6 false end def el7? return true if platform_family?('rhel') && node['platform_version'].to_i == 7 false end def fedora? ...
31.302115
121
0.615578
ac4dc9e541486c424eeead607e4c5e2b5f586724
8,933
require 'active_record' require 'active_record/base' module CASServer::Model module Consumable def consume! self.consumed = Time.now self.save! end def self.included(mod) mod.extend(ClassMethods) end module ClassMethods def cleanup(max_lifetime, max_unconsumed_lifetime)...
33.208178
91
0.625658
ab6d5d756beb0f0c3f5bf1297d8c99bf9defc8e2
928
class Floor < HeatingCircuit attr_reader :temperatures def business_logic unless turn_off? enable(:pump) if overheating? puts "Overheating!" shutdown else enable(:mixer) if difference < @mixer.turn_on_temperature disable(:mixer) if (difference > @mixer.turn_off_temperat...
20.173913
91
0.644397
18e7bf60bc5cb8b5b54f34b05150783bb4ca910a
138
require 'test_helper' class UserCoursesControllerTest < ActionController::TestCase # test "the truth" do # assert true # end end
17.25
60
0.73913