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
eda16903b0600aaea0da7fd896baa25efd126521
28,716
# encoding: utf-8 require 'active_support/core_ext/big_decimal/conversions' require 'active_support/core_ext/float/rounding' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/string/output_safety' module ActionView # = Action View Number Helpers module Helpers #:nodoc: # Provide...
53.177778
175
0.552201
4a2d7be902f48bb78fe3de8e82a8dc0a58fac776
182
class RoutineTraining < ApplicationRecord belongs_to :routine # routine_id in routine_trainings join table belongs_to :training # training_id in routine_trainings join table end
36.4
68
0.835165
623a605400630c9a5cf743bc517fa66162f96880
423
class Servetome < Cask version '3.9.0.3053' sha256 '87bf1184b7656a96088b25880e7e1c772f30d8dfa1e602f9b43ccbdd0608fdf2' url "http://downloads.zqueue.com/ServeToMe-v#{version}.dmg" appcast 'http://zqueue.com/servetome/stm3_mac_appcast.xml', :sha256 => '48cc93d336da8f71ab2a804d609e54d2e81ce4cd17f626e57aa...
32.538462
87
0.77305
ed61e975e1bc9f4362fedb23e9ae52ffa6c4b29e
600
class OrdersController < ApplicationController before_action :set_order, only: :show def create order = Order.new(order_params) if order.save render json: order, status: :created else render json: order.errors, status: :unprocessable_entity end end def show render json: @order...
19.354839
92
0.66
26155c45c31bae4f08c2cf6340d110d9ab11c549
68
module SortIndex class ApplicationJob < ActiveJob::Base end end
13.6
40
0.779412
330bdf13d4d8975e1424c01db4137edf50ca59f6
26,810
require 'test_helper' class BarclaysEpdqExtraPlusTest < Test::Unit::TestCase def setup @credentials = { :login => 'pspid', :user => 'username', :password => 'password', :signature => 'mynicesig', :signature_encryptor => 'sha512' ...
36.42663
366
0.735546
ff2fb4042956c9979267754ac597e3e1c220c837
714
# frozen_string_literal: true require 'rails_helper' RSpec.describe UsersController do let(:user) { Fabricate(:user) } before do SiteSetting.desktop_push_notifications_enabled = true end describe '#update' do describe 'updating custom fields to prefer push on desktop' do it 'should update the ...
23.8
77
0.652661
f8cdc3b272ff2698ea7bfbe7a0d2e8328f08cc35
10,962
class Hardware < ApplicationRecord belongs_to :vm_or_template belongs_to :vm, :foreign_key => :vm_or_template_id belongs_to :miq_template, :foreign_key => :vm_or_template_id belongs_to :host belongs_to :computer_system belongs_to :physical_switch, :foreign_key => :switch_id, :inverse_of =>...
41.680608
205
0.650976
08dc788812a06d9554b14f162e7ea0d20c92150a
34,176
# 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 'seahorse/client/plugins/content_length.rb' require 'aws-sdk-core/plugins/credentials_configuration.rb' ...
43.042821
302
0.65821
f882964577e61a755a2e460dcc8046cc0650c304
224
require 'puppet/provider/shinken_file' Puppet::Type.type(:shinken_host).provide :file, :parent => Puppet::Provider::Shinken_file do def base_path '/etc/shinken/hosts/' end def object_type 'hosts' end end
16
92
0.709821
b970d054c4253ae8bd5ffe2e02acf5e98e6c3f3f
21,817
require 'abstract_unit' require 'fixtures/tag' require 'fixtures/tagging' require 'fixtures/post' require 'fixtures/item' require 'fixtures/comment' require 'fixtures/author' require 'fixtures/category' require 'fixtures/categorization' require 'fixtures/vertex' require 'fixtures/edge' require 'fixtures/book' require '...
38.958929
133
0.755603
e2f441d83cc791a3e8b04ed13c078497aacfe62c
913
# Be sure to restart your server when you modify this file. # Your secret key is used for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to diction...
53.705882
176
0.823658
624f06aee6708999bca1c374c3e1a186c742a8d8
841
# frozen_string_literal: true require 'spec_helper' describe RubyRabbitmqJanus::RRJAdmin, type: :request, level: :admin, name: :pcap do before { helper_janus_instance_without_token } let(:type) { 'admin::start_pcap' } let(:number) { '1...
28.033333
95
0.609988
389265a02348bf16a3f774cc9b4d67590694d958
295
FactoryGirl.define do # Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them. # # Example adding this to your spec_helper will load these Factories for use: # require 'solidus_payment_method_by_zone/factories' end
42.142857
130
0.8
bfa9fa16b5fffec3a036190603af042a06963913
653
Pod::Spec.new do |s| s.name = 'DrawableView' s.version = '0.0.4' s.summary = 'A UIView subclass that allows the user to draw on it.' s.homepage = 'https://github.com/EthanSchatzline/DrawableView' s.license = { type: 'MIT', file: 'LICENSE' } s.author = { 'ethanschatzline' =>...
38.411765
108
0.621746
28723b5c2370f95747a2389d840cd3fcf3ee4d33
64
require File.join(File.dirname(__FILE__), '..', 'spec_helper')
21.333333
62
0.703125
089d7f1e9f816153dc842335c50f2c5d09ef9c7c
31,481
require 'fastlane_core/configuration/config_item' require 'credentials_manager/appfile_config' require_relative 'module' # rubocop:disable Metrics/ClassLength module Scan class Options def self.verify_type(item_name, acceptable_types, value) type_ok = [Array, String].any? { |type| value.kind_of?(type) } ...
68.288503
297
0.44484
6aa867b2c38d3adf6a5346ea25769c055b5c1365
5,545
class UsersController < ApplicationController before_action :load_showing_user, :only => [:show, :standing] before_action :require_logged_in_moderator, :only => [:enable_invitation, :disable_invitation, :ban, :unban] before_action :flag_warning, only: [:show] before_action :require_logged_in_use...
29.811828
99
0.639675
1a6243a5afaf0c1962e64513fc4a161ec0fbe7d8
992
# frozen_string_literal: true # @api private # @since 0.3.0 module SmartCore::Initializer::InstanceAttributeAccessing # @return [Hash<Symbol,Any>] # # @api public # @since 0.3.0 def __params__ __collect_params__ end # @return [Hash<Symbol,Any>] # # @api public # @since 0.3.0 def __options__ ...
19.076923
66
0.66129
edc5ea0d356d76a0fba62cc62ea045c6e8e414b1
482
# frozen_string_literal: true print 'enter a starting year: ' year1 = gets.to_i print 'enter an ending year: ' year2 = gets.to_i # leap years are divisible by 4 # except when they are divisible by 100 # EXCEPT when they are divisible by 400 # puts all_years # then, we'll make a function to find if it's a leap year ...
20.083333
57
0.692946
7a89ece6b5b8c7bbbe22c3e69968a314a1d2c806
1,128
describe 'User resets her/his password' do it 'with valid email and password', js: true do forgot_password do |email, url| expect(email.to).to include 'john@doe.net' expect(email.subject).to include 'Reset password instructions' visit url fill_in 'Your new password', with: 'newpassword'...
30.486486
100
0.670213
f857b936a0df254b96343c3514a3098177803f71
1,968
require('spec_helper') describe(Stylist) do describe(".all") do it("starts off with no stylists") do expect(Stylist.all()).to(eq([])) end end describe(".find") do it("returns a stylist by their ID number") do test_stylist = Stylist.new({:name => "Joan Rivers", :id => nil}) test_sty...
31.238095
98
0.614837
5d8cd8b5805e3a0b318fd0057a17606b2991057f
186
class AddDetailToTvSeasonCasts < ActiveRecord::Migration[5.2] def change add_column :tv_season_casts, :character, :text add_column :tv_season_casts, :order, :decimal end end
26.571429
61
0.763441
d56974d4f4a15c567a6bd6621074f40882f70a70
1,188
# 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...
39.6
86
0.751684
4a8605311fa41ce2de6a62025a86f0299a8923cc
291
class CreateInsideJobs < ActiveRecord::Migration def change create_table :inside_jobs do |t| t.string :title t.string :salary_form t.string :salary_end t.string :url t.string :post_date t.string :effective_date t.timestamps end end end
19.4
48
0.656357
619c4d089d5bf9a3f2dd70241f58203a7e677173
12,348
require "cases/helper" require 'models/club' require 'models/member_type' require 'models/member' require 'models/membership' require 'models/sponsor' require 'models/organization' require 'models/member_detail' require 'models/minivan' require 'models/dashboard' require 'models/speedometer' require 'models/category' r...
34.881356
149
0.755912
33cdbff90fbca740d3205faba0841f5e92881993
1,631
# 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...
33.979167
86
0.717351
2118daf362d92d88dac92017dd276faf87e4b0ca
487
class VolunteerLabel < ApplicationRecord # Associations belongs_to :label belongs_to :volunteer belongs_to :user, foreign_key: :created_by_id, optional: true # Validations validates :volunteer_id, uniqueness: { scope: :label_id } # Delegations delegate :name, to: :label # Scopes scope :managable_...
28.647059
114
0.718686
e91744c3254804bfbbf36c947997e494ba3ec6cd
1,778
# frozen_string_literal: true class MultiDateForm < TraineeForm attr_accessor :day, :month, :year, :date_string validate :date_valid PARAM_CONVERSION = { "date(3i)" => "day", "date(2i)" => "month", "date(1i)" => "year", }.freeze def date return unless date_string { today: Time.z...
19.538462
93
0.652418
7a8ba1e4fdad8aaa41553e02bfda4eca0bff95d4
7,706
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this f...
37.77451
186
0.642097
11029e15d488968412381521538c4680654fc840
1,624
require 'spec_helper' RSpec.describe Eyeson, type: :class do it 'should use correct config in post' do RestClient::Request.expects(:new).with( method: :post, url: 'https://api.localhost.test/test', payload: {}, headers: { authorization: '123', accept: 'application/json', ...
27.066667
74
0.646552
4a05c6db3d8bcfa3852d406fe8255f917a953ab1
850
When /^I successfully use the "([^"]*)" (?:option|command|argument)?$/ do |cmd| run_simple("rubulage #{unescape(cmd)}") assert_exit_status(0) end When /^I use the "([^"]*)" (?:option|command|argument)?$/ do |cmd| run_simple("bundle exec rubulage #{unescape(cmd)}", fail_on_error=false) end Then /^the exit status...
29.310345
79
0.672941
ed3c754857a3b8e45c030b8d12faad4b95f6a3f1
1,002
class Cjdns < Formula desc "Advanced mesh routing system with cryptographic addressing" homepage "https://github.com/cjdelisle/cjdns/" url "https://github.com/cjdelisle/cjdns/archive/cjdns-v20.2.tar.gz" sha256 "b114f4e89c971d2c288e3d8265396248a37134895b0e0468bf55030de84b4d2a" head "https://github.com/cjdelisl...
35.785714
93
0.780439
08b7103c78ef69752a8b075f384bde518b0498ee
227
class CreateWalls < ActiveRecord::Migration def change create_table :walls do |t| t.string :name t.belongs_to :state t.belongs_to :area t.belongs_to :subarea t.timestamps end end end
18.916667
43
0.643172
e24b7604ed2592481dff4710ea1724bd3c82a28a
7,846
## # 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::Remote::HttpClient include Msf::Exploit::FileDropper def initializ...
33.67382
144
0.585266
ac0721b6d6bbd641c9bcd6f8ed17a5c8625d2c64
182
class LibraryFunction include Mongoid::Document belongs_to :user validates_presence_of :name, :definition field :name, type: String field :definition, type: String end
15.166667
42
0.758242
bbc4edf54f26b41fe6cdbe78431da309d0d94ff3
557
Pod::Spec.new do |s| s.name = 'skpsmtpmessage' s.version = '0.0.1' s.license = 'Public Domain' s.platform = :ios s.summary = 'Quick SMTP client code for the iPhone.' s.homepage = 'https://github.com/jetseven/skpsmtpmessage' s.author = 'jetseven' s.source = { :git => "https://g...
30.944444
134
0.64991
bb2690ad678c0453557dabf42d85c9ebd948c370
5,418
module SPARQL; class Client ## # A read-only repository view of a SPARQL endpoint. # # @see RDF::Repository class Repository < RDF::Repository # @return [SPARQL::Client] attr_reader :client ## # @param [String, #to_s] endpoint # @param [Hash{Symbol => Object}] options def i...
27.927835
109
0.599852
18b16cbbbaee9ac73b21be74f43437aa3df9d2ab
144
class AddSolvedToProblems < ActiveRecord::Migration[6.0] def change add_column :problems, :solved?, :boolean, :default => false end end
24
63
0.729167
ace24ed35f38e3ea8d0aa6526a1e259425d35d56
2,854
require 'formula' class Llvm < Formula homepage 'http://llvm.org/' bottle do sha1 "8136d3ef9c97e3de20ab4962f94a6c15ce5b50b2" => :mavericks sha1 "15d12d15f17c3fa12f2b7e87ac1f70ae3eaa7e35" => :mountain_lion sha1 "50e1d0c4a046ea14fb8c4bbd305bc7c8ccaac5bb" => :lion end stable do url "http://llvm....
28.828283
114
0.665032
113ed09fc64d02297212380cbf959a1066c89491
58
require './app' require './Cat' run Sinatra::Application
11.6
24
0.706897
21c42f2d2dbb2009d57dc8ceb1869a0c9bc34a5e
489
ENV['RAILS_ENV'] = 'test' require "./config/environment" require "rspec/rails" require 'rack/test' require 'database_cleaner' require 'faker' Dir[Rails.root.join('features/steps/common/**/*.rb')].each { |f| require f } Spinach.hooks.before_scenario do DatabaseCleaner.clean end class Spinach::FeatureSteps include...
23.285714
76
0.773006
5d854838feba058900aec5dfdbcb816b06c4fa30
6,054
# Special Orders class ASF::Board::Agenda parse do orders = @file.split(/^ \d. Special Orders/,2).last. split(/^ \d. Discussion Items/,2).first pattern = / \n+(?<indent>\s{3,5})(?<section>[A-Z])\. \s(?<title>.*?)\n (?<text>.*?) (?=\n\s{4}[A-Z]\.\s|\z) /mx people = [] ...
32.724324
77
0.511563
ac7220991682d3f89c1efc24d72505e458d9e73d
1,581
class Lxsplit < Formula desc "Tool for splitting or joining files" homepage "https://lxsplit.sourceforge.io/" url "https://downloads.sourceforge.net/project/lxsplit/lxsplit/0.2.4/lxsplit-0.2.4.tar.gz" sha256 "858fa939803b2eba97ccc5ec57011c4f4b613ff299abbdc51e2f921016845056" license "GPL-2.0" bottle do ...
58.555556
139
0.810247
f73f873517eaf019b82e3c1c60a2d1b494bee696
255
module Coprl::Presenters::WebClient::Helpers module HtmlSafe def html_safe(string) # This is for rails ... it requires that html safe strings be marked as safe string.respond_to?(:html_safe) ? string.html_safe : string end end end
28.333333
82
0.709804
396719b3cfdbb514d1413a5d88555edaf6a26afc
118
module Ecm module Courses class Engine < ::Rails::Engine isolate_namespace Ecm::Courses end end end
14.75
36
0.677966
f88a462e34803e8e0ad2b68e8d62b3805adafbaa
260
class Api::V1::ApiController < ApplicationController before_action :doorkeeper_authorize! private # Find the user that owns the access token def current_resource_owner User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token end end
23.636364
69
0.796154
87d580e980b54df8bf984ad1152e5135268e208e
2,942
class Sbcl < Formula desc "Steel Bank Common Lisp system" homepage "http://www.sbcl.org/" url "https://downloads.sourceforge.net/project/sbcl/sbcl/2.0.0/sbcl-2.0.0-source.tar.bz2" sha256 "90369256805d437c82ab9bdab9a410076f57810a50bb2b228de4e6c892692fcf" bottle do sha256 "f82280dbc14d90e9fbe4f7ad922a4882c...
36.775
111
0.698165
7a177f14176dd5d74eb01e19037c2384c4a4e753
4,340
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class MetasploitModule < Msf::Exploit::Remote Rank = GoodRanking include Msf::Exploit::Remote::Tcp include Msf::Exploit::Remote::BruteTargets def init...
24.24581
82
0.479263
4af597bf5fa3a2e3a3505ed132e0af1d8c2d93c4
15,945
require 'rails_helper' describe TwoFactorAuthentication::OtpVerificationController do describe '#show' do context 'when resource is not fully authenticated yet' do before do sign_in_before_2fa end context 'when FeatureManagement.prefill_otp_codes? is true' do it 'sets code_valu...
34.364224
99
0.63048
0839d1d52593db514d4458a92c19b57c4c6c7b1a
51,052
#-- vim:sw=2:et #++ # # :title: RFC 2821 Client Protocol module # # This module defines the Irc::Client class, a class that can handle and # dispatch messages based on RFC 2821 (Internet Relay Chat: Client Protocol) class ServerMessageParseError < ServerError end module Irc # - The server sends Replies 001 to 004 t...
31.072428
176
0.611318
4aa495832106fca22fdf929c54604cfd552b5088
371
require "bundler/setup" require "tracker_spec.rb" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! config.expect_w...
24.733333
66
0.754717
28047faee3f44996ef5508c5b81740e057f1bdb6
3,717
## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # web site for more information on licensing and terms of use. # http://metasploit.com/ ## require 'msf/core' class Metasploit3 < Msf::Post include Post::Windows::Servi...
34.738318
162
0.644875
ed18cdca391742ec08cb9da4002d53454c2685b7
3,682
require File.expand_path('../../../spec_helper', __FILE__) ruby_version_is "2.0.0" do require File.expand_path('../fixtures/classes', __FILE__) require File.expand_path('../fixtures/string_refinement', __FILE__) describe "main.using" do it "requires one Module argument" do lambda do eval('usin...
27.274074
86
0.577404
5d8e0c96f7521834234938b7bd1a19a308b5eb6e
231
require_relative '../../ext/xor_swap/seans_xor_swap' class String def seans_slow_reverse arr = split '' (arr.length / 2).times do |i| arr[i], arr[-(i + 1)] = arr[-(i + 1)], arr[i] end arr.join '' end end
19.25
52
0.575758
384329dda18b13f1717934b3778544329e2452f8
1,892
require 'spec_helper' describe Gitlab::Ci::Build::Artifacts::GzipFileAdapter do describe '#initialize' do context 'when stream is passed' do let(:stream) { File.open(expand_fixture_path('junit/junit.xml.gz'), 'rb') } it 'initialized' do expect { described_class.new(stream) }.not_to raise_err...
33.192982
105
0.64482
385d3976da4823bd7211ecc9f19017f62ebb6187
2,169
# frozen_string_literal: true require "active_support" require "rails/command/helpers/editor" module Rails module Command class CredentialsCommand < Rails::Command::Base # :nodoc: include Helpers::Editor no_commands do def help say "Usage:\n #{self.class.banner}" say ""...
27.1125
96
0.665284
f70d6091f47cab6c37771e4ce5a493620b6a1a91
783
# see https://github.com/chef/omnibus/blob/master/lib/omnibus/project.rb for more detailed class doc name "cartodb-sql-api" maintainer "CartoDB team" homepage "https://github.com/CartoDB/omnibus-cartodb/blob/master/README.md" build_version Omnibus::BuildVersion.semver build_iteration 1 package_user ENV['OMNIBUS_PAC...
32.625
102
0.763729
283a9bf6f6412a349f81329a50ce3cca5f4b9e60
1,342
# frozen_string_literal: true module EacRubyUtils # A formatter like [String.sprintf]. class CustomFormat TYPE_PATTERN = /[a-zA-Z]/.freeze SEQUENCE_PATTERN = /(?<!%)%(#{TYPE_PATTERN})/.freeze attr_reader :mapping def initialize(mapping) @mapping = mapping.map { |k, v| [k.to_sym, v] }.to_h.f...
24.851852
96
0.598361
1140a64a380fc3a757ad261d1aefa017a996bb07
865
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'bencher/version' Gem::Specification.new do |spec| spec.name = "bencher" spec.version = Bencher::VERSION spec.authors = ["Miguel Camba"] spec.email = ["miguel....
34.6
74
0.652023
bb42aaa1963f0dc906aaef506aabb643267d9506
1,071
# # Cookbook:: my_cookbook # Spec:: default # # Copyright:: 2018, The Authors, All Rights Reserved. require 'spec_helper' describe 'my_cookbook::panrepodb002' do context 'When all attributes are default, on Ubuntu 16.04' do let(:chef_run) do # for a complete list of available platforms and versions see: ...
29.75
82
0.70028
110cc72296a6ec703451a0ec5501df170ae92d7f
4,042
# # This file is part of the pinterest-ruby gem. Copyright (C) 2017 and above Shogun <shogun@cowtech.it>. # Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit. # require "spec_helper" describe Pinterest::Endpoints::Authentication, vcr: true do subject { Pinterest::Clie...
49.901235
233
0.739485
abc9f70f050350e477c6548c20e75d32ba2b34c0
600
# frozen_string_literal: true module Types module Scalar class CountryValue < Types::Base::BaseScalar description <<~EOS A country represented by a string that comes form `Country.value` EOS def self.coerce_input(input, _context) if Rails.configuration.countries ...
24
81
0.62
b91245b7d786542a7f106aba9aaff06354cf72cf
1,358
module Fog module AWS class DataPipeline class Real # Queries a pipeline for the names of objects that match a specified set of conditions. # http://docs.aws.amazon.com/datapipeline/latest/APIReference/API_QueryObjects.html # ==== Parameters # * PipelineId <~String> - The ID ...
32.333333
95
0.553019
08bf3c38f041492ebf3dfada2d904bb1fab40bb4
1,311
require "formula" class Hadoop < Formula homepage "http://hadoop.apache.org/" url "http://www.apache.org/dyn/closer.cgi?path=hadoop/common/hadoop-2.5.0/hadoop-2.5.0.tar.gz" sha1 "de15a14ed4c0cc31ed80e6f5c9f0fd923faf75bb" def install rm_f Dir["bin/*.cmd", "sbin/*.cmd", "libexec/*.cmd", "etc/hadoop/*.cmd"] ...
35.432432
96
0.658276
79ff91c7450819058e8256f1687af78774e7b7b4
226
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb') describe "Comments Controller", "index action" do before(:each) do @controller = Comments.build(fake_request) @controller.dispatch('index') end end
28.25
65
0.716814
035a51309f6f3f13af37d31e9b5aaf4010404a5f
980
def concatenate_example(string) # use concatenation to format the result to be "Classic <string>" "Classic " << string end def concatenate(string) # use concatenation to format the result to be "Hello <string>!" "Hello #{string}!" end def substrings(word) # return the first 4 letters from the word using sub...
19.6
67
0.737755
3838928a5c2c77009cfc9b9bf6119eb2d1def3c4
7,772
require 'spec_helper' describe Songkick::OAuth2::Model::Authorization do let(:client) { Factory :client } let(:impostor) { Factory :client } let(:owner) { Factory :owner } let(:user) { Factory :owner } let(:tester) { Factory(:owner) } let(:authorization) do create_authorization(:owner => ...
32.518828
112
0.663922
18566c1aaeecc30ec9073be46f2286e285784f84
1,274
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) Gem::Specification.new do |spec| spec.name = 'capistrano-docker-copy' spec.version = '0.1.1' spec.authors = ['Yann Lugrin'] spec.email = ['yann.lugrin@yalty.io'] sp...
36.4
96
0.661695
bf7ac343386a3e3a69ea556d4c03f0d9c72adf9d
804
# == Schema Information # # Table name: paypal_accounts # # id :integer not null, primary key # person_id :string(255) # community_id :integer # email :string(255) # payer_id :string(255) # created_at :datetime not null # updated_at :datetime not null # activ...
27.724138
71
0.691542
3925ad55606b076b9f1dd2b802935340501d9669
1,752
require 'administrate/base_dashboard' class AttachmentDashboard < Administrate::BaseDashboard # ATTRIBUTE_TYPES # a hash that describes the type of each of the model's fields. # # Each different type represents an Administrate::Field object, # which determines how the attribute is displayed # on pages thro...
26.149254
76
0.69863
33c9f3323637e09b0f914580db0a5a9023d143d1
467
require 'formula' class Lpc21isp < Formula homepage 'http://lpc21isp.sourceforge.net/' url 'http://downloads.sourceforge.net/project/lpc21isp/lpc21isp/1.85/lpc21isp_185.tar.gz' sha1 '5548874c88b0b34c253e12a36f3df04c8768309e' version '1.85' def install # Can't statically link on OSX, so we'll remove that...
29.1875
91
0.719486
bb5a9728a8b5060f94ba2c3fdd35e6cb9fa09197
1,174
# Be sure to restart your server when you modify this file # Uncomment below to force Rails into production mode when # you don't control web/app server and can't set it the proper way # ENV['RAILS_ENV'] ||= 'production' # Specifies gem version of Rails to use when vendor/rails is not present RAILS_GEM_VERSION = '2.3...
37.870968
150
0.782794
f8494c5fad31735ebfae6f5bd9eff883f559158d
1,114
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 Destiny class Application < Rails::Application # Settings in config/environments/* take prece...
41.259259
99
0.733393
38a63761ab6534579d48be0375bec4fa27a896ee
509
module TransactionDesk class TransactionStatusMapping include Kartograph::DSL kartograph do mapping TransactionStatus scoped :read do property :id property :name property :owner_id, key: 'ownerId' property :date_created, key: 'dateCreated' property :...
18.178571
52
0.611002
62388182369d3e95cb976e7b4f6061c22b62fbdd
1,783
# list 100 active students - starting with the second 100 kids page_number = 2 api_path = "/ws/v1/district/student" options = { query: { "q"=>"school_enrollment.enroll_status==a", "pagesize"=>"100", "page"=> "#{page_number}" } } kids = ps.run( command: :get, api_path: ap...
49.527778
176
0.655637
010e29c463c6517758932b29ec2c84a494400f93
814
# frozen_string_literal: true module EE module Ci module PipelinePresenter extend ActiveSupport::Concern extend ::Gitlab::Utils::DelegatorOverride def expose_security_dashboard? return false unless can?(current_user, :read_security_resource, pipeline.project) batch_lookup_repo...
28.068966
119
0.710074
3956ea3b4602a1c5352163ec00270be79a66449c
1,713
require 'rake' module Hanami # Install Rake tasks in projects # # @since 0.6.0 # @api private class RakeHelper include Rake::DSL # @since 0.6.0 # @api private def self.install_tasks new.install end # @since 0.6.0 # @api private def install desc "Preload project c...
24.826087
80
0.607706
6a9778f9214953b020312080b26de97d2076f496
81
module JRubyFX # Current gem version. Used in rake task. VERSION='2.0.0' end
16.2
43
0.703704
abf7ecea5883089da7e8514757353ebaf3d3e9a5
9,698
=begin Copyright 2010, Roger Pack This file is part of Sensible Cinema. Sensible Cinema is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option)...
30.401254
167
0.617344
d5244c4ac59a47a2158d8151b6a3b522fd471721
2,532
# frozen_string_literal: true RSpec.describe SidekiqPublisher::MetricsReporter do let(:event) { instance_double(ActiveSupport::Notifications::Event, payload: payload) } describe "PublisherSubscriber" do describe "#enqueue_batch" do let(:instance) { described_class::PublisherSubscriber.new } let(:p...
30.142857
92
0.648894
6a2d6ef37b66b0549058f30c9076e717812db08a
1,538
# title: game title # author: game developer, email, etc. # desc: short description # site: website link # license: MIT License (change this to your license of choice) # version: 0.1 # script: ruby $t=0 $x=96 $y=24 def TIC $y-=1 if btn 0 $y+=1 if btn 1 $x-=1 if btn 2 $x+=1 if btn 3 cls 13 spr 1+(($t%...
29.018868
138
0.825748
ffbe84f939928ac6b94056f6531f4dd029bf3d14
132
require 'test_helper' class Admin::PublicationTest < ActiveSupport::TestCase # test "the truth" do # assert true # end end
16.5
54
0.712121
08f119091b5fb38b8d943602b73d225b766afce6
8,439
# frozen_string_literal: true require "rails_helper" RSpec.describe DmpIdService do include ConfigHelper before(:each) do Rails.configuration.x.enable_dmp_id_registration = true # Using Datacite for these tests Rails.configuration.x.datacite.active = true Rails.configuration.x.datacite.name = "d...
47.145251
93
0.719161
b9877955127122ae356090a51a226fe1a7d6045d
2,206
module Paperclip class ContentTypeDetector # The content-type detection strategy is as follows: # # 1. Blank/Empty files: If there's no filepath or the file is empty, # provide a sensible default (application/octet-stream or inode/x-empty) # # 2. Calculated match: Return the first result th...
27.234568
79
0.665458
6a68c47f755c66a2875cc0f83a375c410d63c933
204
class Admin < User after_initialize :set_default_role, :if => :new_record? def self.all User.where(role: :admin).all end private def set_default_role self.role = :admin end end
12.75
57
0.671569
21736e1245f1bc6280ca4c86ceb911c5f5985ea9
526
require_relative 'boot' require 'rails/all' Bundler.require(*Rails.groups) require "enju_circulation" require "enju_leaf" module Dummy class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 6.1 # Settings in config/enviro...
26.3
82
0.771863
116e33b1a0ccd4c9faaed7576bb8a4ade26e3d42
3,914
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. require 'net/http' module NewRelic module Agent module Utilization class Vendor class << self def vendor_name vendor_name = nil ...
26.993103
100
0.561829
33c0fb1639184ea814b168373018cb90bd205433
721
require 'gitsh/argument_list' require 'gitsh/commands/error_handler' module Gitsh module Commands class Factory def initialize(command_class, context) @command_class = command_class @context = context end def build ErrorHandler.new(command_instance, env) end ...
17.166667
54
0.61165
625ccc7404e37bfa19ba172a50ad0463e42c9314
1,244
=begin #OpenAPI Petstore #This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.2.2-SNAPSHOT =en...
25.916667
157
0.732315
6ac10e859bc94a41ab2a6f7255f1966a9bdac376
40
class User < ActiveRecord::Base end
5.714286
31
0.7
b9c287938d4eb3848d67372be8fb8994f4d1b911
50,080
require 'spec_helper' RSpec.describe TypedDag::Node, 'included in Message' do include TypedDag::Specs::Helpers let(:message) { Message.create } let(:other_message) { Message.create } let(:child_message) { Message.create parent: message } let(:grandchild_message) { Message.create parent: child_message } le...
22.98302
96
0.416134
33db9515a59fe5c8c1f025a93806ab0cf436434c
3,207
class LogstashOss < Formula desc "Tool for managing events and logs" homepage "https://www.elastic.co/products/logstash" url "https://artifacts.elastic.co/downloads/logstash/logstash-oss-7.16.3-darwin-x86_64.tar.gz?tap=elastic/homebrew-tap" version "7.16.3" sha256 "8392257298a06d20ae32ee4d6c83d2663a12447857ce...
33.40625
121
0.599314
ff7ff873565abb1605edb449eb580bb58b2e90df
224
module AuthenticationHelper private def authenticate_request @current_user = AuthorizeApiRequest.call(request.headers).result render json: { error: 'Not Authorized' }, status: 401 unless @current_user end end
24.888889
78
0.767857
38c27691f831e2575f73b5510a7b4b01355c48f9
3,181
require 'vump/vump' require 'git' require 'vump/modules/base_module' class TestModule < Vump::BaseModule def initialize(base_dir, opts = {}); end def relevant? true end def read '0.0.0' end def name self.class.name end def write(version) @@last_write = version true end def ...
25.448
83
0.64005
e8f0dbedfd4c858d8b03af81566b6a10f460c72e
3,306
class BoardController < ApplicationController before_filter :require_login, :except=>[:index, :view] def index @public_boards = Board.getPublicBoards @own_boards = false if @isLogin then @own_boards = Board.getOwnBoards @user end end def create @board = Board.new end def list return unless has_b...
23.446809
112
0.692377
ed4af3f4a43cf2a67e1d8a82aece1188b48f2df5
5,006
# frozen_string_literal: true require_relative 'teammate' module Gitlab module Danger module Roulette ROULETTE_DATA_URL = 'https://gitlab-org.gitlab.io/gitlab-roulette/roulette.json' HOURS_WHEN_PERSON_CAN_BE_PICKED = (6..14).freeze INCLUDE_TIMEZONE_FOR_CATEGORY = { database: false ...
34.763889
151
0.65002
6229b37143c3ffed2306dedcd7671471cea59c12
2,487
require 'spec_helper' describe 'cis_hardening::maint::usergroups' do on_supported_os.each do |os, os_facts| context "on #{os}" do let(:facts) { os_facts } # Check fr default class it { is_expected.to contain_class('cis_hardening::maint::usergroups') } # Ensure accounts in ...
37.119403
93
0.553277
1c6c85bf4d8e48ba36bf8443e22fb632ecb5447d
233
require 'action_view' class ActionView::Helpers::FormBuilder include ActionView::Helpers::AssetTagHelper def t_date_field(method, options = {}) @template.render 'tax_jp/common/date_field', f: self, method: method end end
23.3
72
0.755365
28796d0944d376135186ad504cab0fb26046c672
360
require 'spec_helper' describe 'loggly_github::proxy' do describe command("curl -v --data '' --proxy '' -k http://www.cm.dev:1235") do its(:stderr) { should match('< Location: https://www.cm.dev:1235/') } end describe command("curl --data '' --proxy '' -k https://www.cm.dev:1235") do its(:stdout) { sho...
25.714286
79
0.627778