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
0160ee72c937ca326f92a17d34d1995f47a390ca
576
maintainer "GoTime Inc." maintainer_email "ops@gotime.com" license "Apache 2.0" description "Installs/Configures zookeeper" long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) version "0.1" recipe "zookeeper::ebs_volume", "Attaches or creates an EBS volume for zookee...
32
87
0.723958
1d83b0cfbd838a9e771006be250897e85f48b794
100
# frozen_string_literal: true module HTML class Pipeline VERSION = '2.11.1'.freeze end end
12.5
29
0.71
6aeebdf31c07653df6e7b3758b31b0facd6fbb39
911
require 'folder_zipper/version' require 'zip' module Zip class FolderZipper attr_reader :output_file, :input_folder def initialize(input_folder, output_file = nil) # Delete last '/' from path if it present. @input_folder = input_folder.sub(/\/$/, '') @output_file = output_file || "#{@input...
26.028571
67
0.628979
1a80ef5f64ee5ec12eea8ece5294235fae8de94e
468
require 'spec_helper' require 'tomograph/tomogram/action' RSpec.describe Tomograph::Tomogram::Action do describe '#find_responses' do let(:status) { '' } let(:responses) { [{ 'status' => status }] } subject do described_class.new(path: '', method: '', content_type: '', request: '', responses: resp...
26
114
0.660256
1822217d7d09495feceaf50e247476bd8d29f626
4,153
class UnivsController < ApplicationController #before_action :authenticate_user!, except: [:index, show] load_and_authorize_resource before_action :set_univ, only: [:show, :edit, :update, :destroy] # 조회수 impressionist actions: [:show] # GET /univs # GET /univs.json def index @univs = Univ.a...
21.518135
469
0.579581
2669ec98526347374d669d85c9b20aaa7e6046b4
812
#!/usr/bin/env ruby -rubygems %w(hpricot open-uri).each(&method(:require)) fields, genres = (Hpricot(open("http://www.rubyquiz.com/quiz136.html")) / "p.example").map{|e| e.inner_html} fields = fields.split genres = genres.split "<br />" unpacktypes=Hash.new("A30") unpacktypes["TAG"]="A3" unpacktypes["year"]="A4" unp...
22.555556
108
0.674877
f836ff8fc8f8eb482fca6bbc7a360d41fbc0f0a6
2,965
# License:: Apache License, Version 2.0 # # 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 i...
34.08046
107
0.765261
62cc6f5c7e208d32cc510dbd7507be90f335af44
6,690
=begin #Swagger Petstore #This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. OpenAPI spec version:...
30.135135
271
0.650224
f8027247ee140cd1189aa547a6cdd05904c2047e
1,040
# # Be sure to run `pod spec lint MUCycleScrollView.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://...
26
108
0.649038
abc184d60be9191f227577552ed865913c81f5f9
5,148
#!/usr/local/bin/ruby # -*- coding: utf-8 -*- # # 予約一覧 # class ReservationListOld Base = "/rsv_list_old" def initialize( params, page ) @serach = nil if params["search"] != nil @serach = params["search"] end if page == nil @page = 1 else @page = page.to_i end @...
25.485149
90
0.449301
6ae3e8ce1aa31d750ee58273b4e6bc1e2e93b79d
991
Pod::Spec.new do |spec| spec.name = 'mokoSocketIo' spec.version = '0.2.0' spec.homepage = 'https://github.com/icerockdev/moko-socket-io' spec.source = { :git => "https://github.com/icerockdev/moko-socket-io.git", :tag => "release/#{s...
43.086957
133
0.532795
9105000ee885e941c9668815c3a0836588fed0c3
124
class AddEventSeatGeekId < ActiveRecord::Migration def change add_column :events, :seatgeekeventid, :string end end
20.666667
50
0.774194
91d664a0e49fc2210229ff539d3ea4cd7640ee35
17,763
# frozen_string_literal: true RSpec.describe Blacklight::FacetsHelperBehavior do let(:blacklight_config) { Blacklight::Configuration.new } before do allow(helper).to receive(:blacklight_config).and_return blacklight_config end describe "has_facet_values?" do let(:empty) { double(items: [], name: 'emp...
44.96962
244
0.690199
11604b38bf29ff6257d5d4edb1e84cdbbf5783e0
1,777
# frozen_string_literal: true require_relative '../../helper' describe Bade::Parser do include ASTHelper context 'static text detection' do it 'detects normal text' do source = <<~BADE | abc BADE ast = n(:root, n(:static_text, value: 'abc'), newline) ...
28.206349
105
0.544176
ed9267d1fd9f30915d29ff4d7c41e10d82ce88d6
5,515
require 'set' module Volt class Computation @@current = nil @@flush_queue = Set.new def self.current=(val) @@current = val end def self.current @@current end # @param [Proc] the code to run when the computation needs to compute def initialize(computation) @com...
23.568376
86
0.599093
ff16637d5dc07a424a0814873156bc15c1bd3588
100
module Kaui class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end end
16.666667
46
0.76
5df95677611503d2d31ec49e69b0144d64e29dcd
19
george "washington"
19
19
0.842105
4a59e053938126fd62f2e15f65d5dae13ba77d84
1,306
maintainer "Opscode, Inc." maintainer_email "cookbooks@opscode.com" license "Apache 2.0" description "Sets up a local gem server repository or mirror" long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) version "0.8.3" recipe "gems", "Empty, use one o...
34.368421
84
0.667688
2660ac688dcf2f17297ed6fd9333fa594d86846b
5,401
require 'net/http' require 'net/https' require 'pathname' # Copyright (c) 2008 Caio Chassot # with parts from Exception Notifier plugin, Copyright (c) 2005 Jamis Buck # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"...
39.713235
134
0.654694
03198dad65d93106d9084149cb195492165aa1a9
511
module SpreeGopayIntegration::OrdersControllerDecorator def self.prepended(base) base.before_action :check_payment_status, only: :show end def check_payment_status order = Spree::Order.find_by!(number: params[:id]) payment = order.payments.last if payment.payment_method.kind_of?(Spree::Payme...
26.894737
83
0.765166
791189728e33c9c42485cb82ef9cb5655cdb13d5
183
activate :blog do |blog| end activate :ogp do |ogp| ogp.namespaces = { fb: data.ogp.fb, og: data.ogp.og } ogp.base_url = 'http://myblog.foo.tld/' ogp.blog = true end
15.25
41
0.617486
abf0c1c92430948ec4c5bc3cb6452446c24ef3af
47
module Microsoft VERSION = "0.1.0.alpha" end
11.75
25
0.702128
d5ee94746f97e271f180caea6734bafbb11a22e4
59
json.partial! "blog_posts/blog_post", blog_post: @blog_post
59
59
0.813559
1c9b1fa6975feb7b031d296c344520bbd23d5df4
126
class RenameFirstNameToName < ActiveRecord::Migration def change rename_column :employees, :first_name, :name end end
21
53
0.777778
2875e10d349127c75355692261aec61d389c8806
72
require 'builder' require_relative 'rodf/spreadsheet' module RODF end
10.285714
35
0.805556
1d0a61364b01634d379f917ebe9d4f027b972300
2,158
# frozen_string_literal: true # == Subscribable concern # # Users can subscribe to these models. # # Used by Issue, MergeRequest, Label # module Subscribable extend ActiveSupport::Concern included do has_many :subscriptions, dependent: :destroy, as: :subscribable # rubocop:disable Cop/ActiveRecordDependent ...
24.804598
111
0.734013
5daa863a32522d9714f0ecac2d7cce1f7c430f9b
5,523
#!/usr/bin/env ruby $: << '.' $: << '..' $: << '../lib' $: << '../ext' if __FILE__ == $0 while (i = ARGV.index('-I')) x = ARGV.slice!(i, 2) $: << x[1] end end require 'optparse' require 'ox' require 'perf' require 'files' begin require 'nokogiri' rescue Exception => e end begin require 'libxml' rescu...
29.222222
125
0.620677
39a3a598048ba418140b374a671ca01733f68d7c
2,978
###################################### ## 은행 개인 대출 거래내역 ###################################### require 'net/http' require 'uri' require 'json' require 'base64' require 'uri' # ========== HTTP 기본 함수 ========== def http_sender(url, token, body) uri = URI.parse(url) puts('url = ' + url) puts('uri.request_uri...
25.237288
88
0.640698
ff46ffcb035806dee78a0f302d9e4f881d71fdd1
1,082
require 'uri' require_relative 'http_method' module MicrosoftKiotaAbstractions class RequestInfo attr_reader :uri, :content, :http_method @@binary_content_type = 'application/octet-stream' @@content_type_header = 'Content-Type' def uri=(arg) @uri = URI(arg) end def http_method=(me...
24.590909
75
0.68207
e8c7af1c8d280306a796edd1ff6acd8364433926
1,398
class CodingQuestion < ActiveRecord::Base attr_accessible :creator_id, :description,:max_grade, :staff_comments, :data, :include_sol_qn_id, :is_auto_grading, :title include Assessment belongs_to :creator, class_name: "User" has_many :std_coding_answers, foreign_key: "qn_id", dependent: :destroy has_many ...
24.103448
124
0.677396
2105101fceb012be291163180a949d14d5921fe8
7,068
# Cookbook:: wordpress # Resource:: wordpress_site # # Copyright:: 2015, OpenStreetMap Foundation # # 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...
34.144928
144
0.707414
1c855dd0acdae69836ba85027784ac1761cce6bc
1,020
module Aliyun module Verify class Client VERIFY_URL = 'http://aliyunverifyidcard.haoservice.com/idcard/VerifyIdcardv2' attr_accessor :card_no, :name def initialize(card_no, name, app_code = ENV['app_code']) @name = name @card_no = card_no @app_code = app_code end...
26.842105
102
0.568627
1ae9b05459f8e04b09ef3730afeea268f6e478d2
2,319
require 'test_helper' require 'enumerize/integrations/rspec' describe Enumerize::Integrations::RSpec do class Should include Enumerize::Integrations::RSpec end let(:klass) do Class.new do extend Enumerize end end let(:should) { Should.new } let(:object) { klass.new } describe '#descr...
30.116883
103
0.667098
e284f31f7ee46a8d02cdb0b43d5029650134385d
9,747
require 'gon' class ApplicationController < ActionController::Base include Gitlab::CurrentSettings include GitlabRoutingHelper PER_PAGE = 20 before_filter :authenticate_user_from_token! before_filter :authenticate_user! before_filter :reject_blocked! before_filter :check_password_expiration before_fi...
29.27027
131
0.706987
bbb11b8f310a035de1aa981b07e82ecf9b586b4e
5,428
require_relative '../../spec_helper' require 'stringio' describe "StringIO#initialize when passed [Object, mode]" do before :each do @io = StringIO.allocate end it "uses the passed Object as the StringIO backend" do @io.send(:initialize, str = "example", "r") @io.string.should equal(str) end it...
29.182796
105
0.687915
bb9b0472e256dd0aa5046e01ccc926ca65c1f537
90
class Article < ActiveRecord::Base acts_as_archive :indexes => [ :id, :deleted_at ] end
22.5
50
0.722222
5d116a1cf279628a0e1d1d1e1164df20a89d675b
1,782
# frozen_string_literal: true # typed: strict require 'sorbet-runtime' require_relative 'expression' module MonkeyLang # The main interface for visitors of the AST module Visitor extend T::Sig extend T::Helpers extend T::Generic interface! sig { abstract.params(expr: BinaryExpression).void } ...
29.213115
60
0.731762
b956360527d34bf58048638ee4a859285bc975a7
7,539
# 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.026022
100
0.651545
91054aa02bafb0a25534f4a6100b6edb8819d72e
1,135
######################################################################## # AwsIamUser +aws_iam_user+ terrform resource, # # {https://www.terraform.io/docs/providers/aws/r/iam_user.html Terraform Docs} ######################################################################## class GeoEngineer::Resources::AwsIamUser < Geo...
26.395349
78
0.580617
0178fc0a07f8675240d606dee6b980ef16dd0166
551
# frozen_string_literal: true require 'spec_helper' describe Types::PermissionTypes::Vulnerability do it do expected_permissions = %i[read_vulnerability_feedback create_vulnerability_feedback destroy_vulnerability_feedback update_vulnerability_feedback create_vulnerability create_v...
34.4375
118
0.758621
21440359d99576396b9c0ef8ea8fe53e8a6f7714
2,855
=begin vim: set sw=2: Copyright (c) 2009, Gennady Bystritsky <bystr@mac.com> Distributed under the MIT Licence. This is free software. See 'LICENSE' for details. You must read and accept the license prior to use. Author: Gennady Bystritsky (gennady.bystritsky@quest.com) =end module SK class Numeral ...
32.816092
155
0.603503
e91c053980ea80388a06e3727b768d1c1e5f250a
6,230
# MdTranslator - minitest of # reader / mdJson / module_metadata # History: # Stan Smith 2018-06-20 refactored to use mdJson construction helpers # Stan Smith 2017-01-16 added parent class to run successfully within rake # Stan Smith 2016-10-21 original script require_relative 'mdjson_test_parent' require 'adiwg/m...
33.675676
77
0.712039
628785aec0f9c56e15d7c0b85c8f37b9c12fcd7f
6,238
# frozen_string_literal: true require 'case_transform' require 'simple_schema_serializers/declaration_error' require 'simple_schema_serializers/serializable' require 'simple_schema_serializers/hash_schema_generator' require 'simple_schema_serializers/hash_dsl' require 'simple_schema_serializers/array_dsl' require 'sim...
36.479532
119
0.6874
e29d022f9f61f23ac1611f810e2cb4efdea0828c
1,438
require 'rails_vue_js_spec_helper' require_relative "../support/test_controller" include VueJsSpecUtils describe "Action Component", type: :feature, js: true do before :each do class ActionTestController < TestController def test render json: { }, status: 200 end end allow_any_insta...
25.22807
102
0.614047
1dbfa5a1df4258dd2d9ab1be39d2100bdda74c39
1,176
require 'helper' class TestVars < Test::Unit::TestCase context "a lua jit" do setup do @lua = Language::Lua.new() end should "create a string variable" do @lua.var("str", "This is a string") assert_equal "This is a string", @lua.var("str") end should "create a number variable"...
24
54
0.583333
0808cdd92172c370cd7f5670b6cfce873f9c0995
326
require 'rubygems' require 'rspec' require 'pathname' require 'tempfile' require 'engines' module RSpec module Core module SharedExampleGroup def summary(url, &block) describe "(#{url})" do subject { Engines.create(url) } instance_eval(&block) end end end end...
16.3
41
0.622699
338501e8b12656468ca5dc2597ccf938933a8485
1,459
require 'minitest/autorun' require_relative '../lib/tenji_maker' class TenjiMakerTest < Minitest::Test # ここから下�?��?スト�?�変更不可 ===================== def setup @tenji_maker = TenjiMaker.new end def test_a_hi_ru tenji = @tenji_maker.to_tenji('A HI RU') assert_equal <<~TENJI.chomp, tenji o- o- oo...
19.453333
48
0.544894
e9c09e00790dd65d25d5d142e808d926356e1295
906
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' # Add additional assets to the asset load path # Rails.application.config.assets.paths << Emoji.images_path # Precompile additional ...
26.647059
76
0.718543
2614a40caabcc04d0db5be5cf9f8f7b5adf9fb18
1,637
# frozen_string_literal: true # Cloud Foundry Java Buildpack # Copyright 2013-2019 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....
30.314815
115
0.682346
b912a0c9a5cd7d7fdea64ca5223f2db33e8daeb2
974
class ImageUpload < ApplicationRecord belongs_to :user, optional: true belongs_to :content, polymorphic: true # This is the old way we uploaded files -- now we're transitioning to ActiveStorage's has_one_attached has_attached_file :src, path: 'content/uploads/:style/:filename', styles: { thumb: '...
26.324324
104
0.676591
ab536965c467b95486996f9f08e7cc01ad261a98
1,193
require 'integration_test_helper' include Warden::Test::Helpers class SignInFlowTest < ActionDispatch::IntegrationTest setup do Warden.test_mode! set_default_settings end teardown do Capybara.reset_sessions! Warden.test_reset! end def sign_out visit '/' within("div#above-header") d...
22.509434
90
0.704107
b9d52249bbb6f6cf17538cb74872cf34f33b69fd
1,991
require 'time' require_relative 'accessible' require_relative 'linked_list' require_relative 'stats' module Caches class TTL include Accessible prepend Stats attr_accessor :ttl, :refresh attr_accessor :data, :nodes, :max_keys private :data, :nodes, :max_keys def initialize(options = {...
18.961905
62
0.566047
287b9504fe37eff5fc4d2b624cdbfe23b4b86b68
611
# frozen_string_literal: true module Algebra module CoreExt # Namespace of modules, which extend core numeric classes module Numeric # Module to prepend to classes of numerics. Provides ability to multiply # on monomials. module Multiplication # Returns result of multiplication on m...
29.095238
79
0.659574
87130ffeaecb649c01262d22108605423f65e8c6
90
Then("I should see {string}") do |content| expect(page).to have_content content end
22.5
42
0.7
6a623ea90b2613f8de18af7723291de4f2f48e44
691
# Copyright 2012, Dell # # 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, software ...
34.55
74
0.771346
0395cd893334baa142ae84a8fc0b8571060dbdf0
658
class User < ApplicationRecord has_many :entries def self.max_user max = User.maximum(:db) max.nil? ? 0 : max end def self.find_or_create_user_by_jwt_token(token) begin decoded_token = JWT.decode(token, nil, false) user_data = decoded_token.find do |el| el['iss'] == "accounts.g...
20.5625
51
0.553191
034e90d67cf543b8a756ffad7e05a44c14397fdb
865
cask "drawio" do version "13.9.8" sha256 "854d8c3a964d0f6317a433201317562dfae258038f0b58ae52d0965f5979e0be" # github.com/jgraph/drawio-desktop/ was verified as official when first introduced to the cask url "https://github.com/jgraph/drawio-desktop/releases/download/v#{version}/draw.io-#{version}.dmg" appcas...
37.608696
101
0.732948
b95d5982003e03e78eef6aae44df640f37ec0cb9
3,148
class Isync < Formula desc "Synchronize a maildir with an IMAP server" homepage "https://isync.sourceforge.io/" revision 1 head "https://git.code.sf.net/p/isync/isync.git" stable do url "https://downloads.sourceforge.net/project/isync/isync/1.3.1/isync-1.3.1.tar.gz" sha256 "68cb4643d58152097f01c9b3ab...
31.48
115
0.658513
082db41712fef7208508ded608837c55439700d8
79
require 'test_helper' class EducationalsHelperTest < ActionView::TestCase end
15.8
51
0.835443
01f3b533e7a9f1cff9fab6147fa97b53e226d416
4,356
module Rules class RuleProcessor attr_accessor :applied_rules def initialize @rule_builder = RuleBuilder.new @applied_rules = [] end def define_rules add_rule_a add_rule_b add_rule_unlock_unsuccessful end def add_rule_a rule_attributes = {...
44
87
0.55326
6211eead6f7cc5baca4b4ada6b62e5565c08f74d
1,515
# rubocop: disable Metrics/CyclomaticComplexity class Game attr_reader :switch_player attr_reader :who_won WINNING_COMBINATIONS = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [1, 4, 7], [2, 5, 8], [3, 6, 9], [1, 5, 9], [3, 5, 7]].freeze def initialize reset end def valid_movement?(first_player, second_player, n...
22.61194
120
0.671947
6a9e2aef30f75d6b9a60c97019e16b0033e2ef71
2,513
# encoding: UTF-8 # frozen_string_literal: true describe PaymentAddress do context '.create' do let(:member) { create(:member, :level_3) } let!(:account) { member.get_account(:btc) } let!(:wallet) { Wallet.joins(:currencies).find_by(currencies: { id: :btc }) } let(:secret) { 's3cr3t' } let(:deta...
30.277108
133
0.615201
f8a8c9b8e2278c7dc8af87f28524dcbdbe949426
209
FactoryBot.define do factory :assessment_section_properties do association :assessment, factory: :assignment association :section due_date { 1.minute.from_now } is_hidden { false } end end
23.222222
49
0.741627
010a890179c81173b4f0ed547a1ae2a3c5053e75
15,242
=begin #NSX-T Manager API #VMware NSX-T Manager REST API OpenAPI spec version: 2.3.0.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.3.1 =end require 'date' module NSXT class TelemetryProxy # Link to this resource attr_accessor :_self # The server wi...
32.849138
508
0.628198
110c1ecf6207aaab76c4f4f4ba5c7cc29f543bca
523
module WebpackDriver class Asset attr_reader :id, :files, :size def initialize(attrs) @id = attrs['id'].to_sym @size = attrs['size'] @files = attrs['files'] end def file files.first end def has_source_map? ...
18.678571
60
0.478011
03f1b1e962d0c193544511290f1bf380ca2909b6
2,318
# frozen_string_literal: true require "action_cable" require "motion" module Motion class Channel < ActionCable::Channel::Base include ActionCableExtentions::DeclarativeStreams include ActionCableExtentions::LogSuppression ACTION_METHODS = Set.new(["process_motion"]).freeze private_constant :ACTIO...
26.643678
78
0.715272
f827e488f18b1561c9067cb89eb714a2261122c6
84
json.array! @d_dungeoneers, partial: 'd_dungeoneers/d_dungeoneer', as: :d_dungeoneer
84
84
0.809524
1ac732d87666bd0d4592e81a2e1f1a1a30a2c07f
1,186
class System::TimeController < ApplicationController def index system_info.timezone = Timezone.new @timezone = system_info.timezone @ntp = Ntp.new if request.post? if params[:timezone] @timezone.attributes = params[:timezone] if @timezone.save flash[:notice] = "Saved s...
25.234043
77
0.625632
62062d0ad3ba53f4f8e6fb7ba911225f8007bcee
1,731
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class Metasploit3 < Msf::Auxiliary include Msf::Exploit::Remote::Tcp include Msf::Auxiliary::Scanner include Msf::Auxiliary::Report def initialize s...
25.455882
82
0.586366
6a65d369eb6fbc4ce94f9c3fda4f20c369d9a72e
11,172
module ::JdbcSpec module ActiveRecordExtensions def sqlite3_connection(config) parse_sqlite3_config!(config) config[:url] ||= "jdbc:sqlite:#{config[:database]}" config[:driver] ||= "org.sqlite.JDBC" jdbc_connection(config) end def parse_sqlite3_config!(config) config[:datab...
32.011461
182
0.596849
5da48780c2cfb64d08ca1c06e3c5230ceac7a62f
5,196
# # Author:: Tim Dysinger (<tim@dysinger.net>) # Author:: Christopher Brown (cb@opscode.com) # Copyright:: Copyright (c) 2008 Opscode, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You...
40.913386
129
0.659546
ed26de58833937ededacbca18feac2249c530da8
550
class Item attr_accessor :productCode, :name, :price def initialize(productCode, name, price) @productCode = productCode @name = name @price = price end def validate! check_data_valid return true end private def check_data_valid raise InvalidItemError, 'product code must be ...
25
99
0.7
f84b00907fa5d4cf0c5bfdc9a2c5c851e8453483
1,953
def create_api_conn(&block) host = Rails.configuration.genieacs_api_host port = Rails.configuration.genieacs_api_port use_ssl = Rails.configuration.genieacs_api_use_ssl if block_given? Net::HTTP.start(host, port, {use_ssl: use_ssl}, &Proc.new) else http = Net::HTTP.new(host, port) http.use_ssl =...
27.507042
96
0.582181
ab35f172d125c3b783cd6ffcd470a359c35d00ae
1,842
# # Author:: Doug MacEachern <dougm@vmware.com> # Cookbook:: windows # Resource:: shortcut # # Copyright:: 2010-2017, VMware, 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...
34.111111
89
0.762758
7a0616a8d7784585d77951f864df8f23993076c6
8,630
=begin #Xero Payroll UK #This is the Xero Payroll API for orgs in the UK region. Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 =end require 'time' require 'date' module XeroRuby::PayrollUk require 'bigdecimal' class LeaveEarningsLine # Xero identifier ...
31.845018
216
0.632097
ac418bca7f989d7399528dde7e825086dbf97254
3,591
require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require require "ponzu" module Dummy class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # ...
42.75
100
0.687274
215c1478087086642bb61592337bd9ad52df2f87
580
module FH class Company::Lodging attr_reader :name, :is_self_lodging, :url, :phone, :address, :pk, :is_pickup_available def initialize(lodging) @name = lodging[:name] @is_self_lodging = lodg...
26.363636
58
0.484483
7a9c02dca615325d38fe0929ec6e5bd844114588
313
require 'rails_helper' RSpec.describe Game, type: :model do it { should have_one(:favourite).dependent(:destroy) } it { should validate_presence_of(:name) } it { should validate_presence_of(:description) } it { should validate_presence_of(:price) } it { should validate_presence_of(:image) } end
26.083333
51
0.728435
ab4f3ebc74402a381a10eca7694ff3185d2f393f
3,864
#! /usr/bin/env ruby require 'spec_helper' require 'puppet/pops' require 'puppet_spec/pops' # relative to this spec file (./) does not work as this file is loaded by rspec require File.join(File.dirname(__FILE__), '../parser/parser_rspec_helper') describe "validating 4x" do include ParserRspecHelper include Puppe...
30.425197
105
0.586439
e2fc907fd05df64b957dac0f5e10c9ccebda5dc7
16,684
# frozen_string_literal: true require 'fast_spec_helper' require 'rspec-parameterized' require_relative '../../support/stub_settings_source' require_relative '../../../sidekiq_cluster/cli' require_relative '../../support/helpers/next_instance_of' RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true...
35.347458
147
0.581335
ed34b89f9ff3162d1d807067a0300be7d826456f
2,091
########################################################################## # Copyright 2017 ThoughtWorks, 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/li...
33.725806
165
0.634146
bf94a9a93d714f4b288ce247197bd75439a4b4c0
1,117
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 MovieStore class Application < Rails::Application # Settings in config/environments/* take pr...
41.37037
99
0.734109
3857ae2684603f78bbf3d4183e1a207fcc20410d
169
class TagsController < ApplicationController def index @tags = Tag.all end def show @tag = Tag.find(params[:id]) @destinations = @tag.destinations end end
13
44
0.704142
d59dacbae0b973c380a1e047d378bad5be22fc13
1,058
require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper') describe "the do_refund paypal payment model" do it "should set PAYMENTPRODUCTID to '1040' when not provided" do model = GlobalCollect::RequestModels::DoRefund::PaypalPayment.new( "ORDERID" => "1234", "MERCHANTREFERENC...
36.482759
81
0.619093
1dd3ee4f396593650d1f7bc6776e42192e7c279f
3,416
require 'spec_helper_acceptance' describe 'postgresql_psql', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do it 'should always run SQL' do pp = <<-EOS class { 'postgresql::server': } -> postgresql_psql { 'foobar': db => 'postgres', psql_user => 'postgres', ...
29.196581
90
0.548009
186876e454fd8c5b1f1211e2b057e0c0344f80f4
1,045
require 'spec_helper' feature 'Download buttons in tags page', feature: true do given(:user) { create(:user) } given(:role) { :developer } given(:status) { 'success' } given(:tag) { 'v1.0.0' } given(:project) { create(:project) } given(:pipeline) do create(:ci_pipeline, project: project, ...
23.75
96
0.611483
18faa134661804a245bcb0bd29fbf156c49196fa
252
class Mountain < Cask version :latest sha256 :no_check url 'http://appgineers.de/mountain/files/Mountain.zip' appcast 'http://appgineers.de/mountain/files/mountaincast.xml' homepage 'http://appgineers.de/mountain/' app 'Mountain.app' end
22.909091
64
0.742063
089798a3ce41d44a020308833943acd972b10dd7
3,131
# frozen_string_literal: true module Audit class Details ACTIONS = %i[add remove failed_login change updated_ref custom_message].freeze def self.humanize(*args) new(*args).humanize end def initialize(details) @details = details end def humanize if @details[:with] ...
26.091667
97
0.641967
08fffc1cc421f88e0036a0254b5e680ee70fc27b
573
require 'spec_helper' describe Scolh::CheckCommand do before do @c = Scolh::CommandFactory.new @ch = Scolh::CheckCommand.new end it "should error when only one party" do list = [@c.parse("party joe has payment address 00100101")] expect(@ch.run(list)).to eq(false) expect(@ch.errors).to inc...
28.65
68
0.677138
ac17ba644d3476f524d6981b7935b404d97d7960
5,005
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::StorageSync::Mgmt::V2019_02_01 module Models # # The parameters used when creating a server endpoint. # class ServerEndpointCreateParameters <...
31.28125
79
0.489111
625fb709eb0d6961032c4478b817c52aa5b8a10d
34,123
require './test/helper' require 'aws' class S3Test < Test::Unit::TestCase def rails_env(env) silence_warnings do Object.const_set(:Rails, stub('Rails', :env => env)) end end def setup AWS.config(:access_key_id => "TESTKEY", :secret_access_key => "TESTSECRET", :stub_requests => true) end d...
31.771881
112
0.523166
bb6392e0720c8809ecbff95cfacdd7557de4bc57
3,195
# frozen_string_literal: true require 'spec_helper' RSpec.describe AppleAuth::JWTConditions do let(:user_identity) { '1234.5678.910' } let(:jwt_sub) { user_identity } let(:jwt_iss) { 'https://appleid.apple.com' } let(:jwt_aud) { 'com.apple_auth' } let(:jwt_iat) { Time.now.to_i } let(:jwt_exp) { (jwt_iat +...
28.274336
94
0.638811
390c23999b9d7b528f278dae3ba0740352fa5fc0
162
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application MailmanExampleCode::Application.initialize!
27
52
0.814815
7a8a9578094652c98b1b0bb92c697c1a00b3c76c
1,679
Rails.application.routes.draw do get 'home/index' root 'home#index' get 'honolulu' => 'honolulu#index' # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". # You can have the root of your site routed with "root" # root ...
27.080645
84
0.646218
03803efd77e86defbf479f05d079d86edfe19728
877
class MinefieldPrinter module STRINGS CLOSED = "⬜️" EMPTY = "🔲" MINE = "💣" HINTS = { 1 => "1️⃣ ", 2 => "2️⃣ ", 3 => "3️⃣ ", 4 => "4️⃣ ", 5 => "5️⃣ ", 6 => "6️⃣ ", 7 => "7️⃣ ", 8 => "8️⃣ " ...
18.659574
59
0.462942
1aff4005f4ff98d6b523ddadda4f449c222c63ff
3,293
require_relative '../../spec_helper' describe "Hash#transform_keys" do before :each do @hash = { a: 1, b: 2, c: 3 } end it "returns new hash" do ret = @hash.transform_keys(&:succ) ret.should_not equal(@hash) ret.should be_an_instance_of(Hash) end it "sets the result as transformed keys with...
26.991803
88
0.616155
019854ab03ef2027fbc4cd5bee199d149a3dba71
21
require "searchlogic"
21
21
0.857143
620117f51b2697d2aea6392f2947a079e8c499a0
476
module TD::Types # Represents a part of the text that needs to be formatted in some unusual way. # # @attr offset [Integer] Offset of the entity in UTF-16 code points. # @attr length [Integer] Length of the entity, in UTF-16 code points. # @attr type [TD::Types::TextEntityType] Type of the entity. class Tex...
36.615385
81
0.710084
abd1467859bf2291a332335da0418f4c862a147d
1,411
module Vacuum module Response # An Amazon Web Services (AWS) API response. class Base # Gets/Sets the String response body. attr_accessor :body # Gets/Sets the Integer HTTP response code. attr_accessor :code # Initializes a new Response. # # body - The String respon...
24.327586
78
0.560595
e9e2b7a6f0b539e7ce36d5332f21b87b5223adc7
639
# frozen_string_literal: true class AddUserAccuracyBonusToReviewableScores < ActiveRecord::Migration[6.0] def up # Add user_accuracy_bonus to reviewable_scores add_column :reviewable_scores, :user_accuracy_bonus, :float, default: 0, null: false # Set user_accuracy_bonus = score - user.trust_level - 1 ...
29.045455
88
0.757433