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
ed2e5f4e09eca80de7a3bdc7e73c6294b6cfb033
77
class Show < ActiveRecord::Base belongs_to :artist belongs_to :venue end
15.4
31
0.766234
ab38a5c3d8a8b2b27c5030a7d89a3e4fee49f750
689
module Intrigue module Ident module SmtpCheck class Mailchimp < Intrigue::Ident::SmtpCheck::Base # 220-cp01.netmouser.com ESMTP Exim 4.92 #2 Fri, 30 Aug 2019 16:02:53 -0700 def generate_checks [ { :type => "fingerprint", :category => "service", :tags => ["SM...
23.758621
80
0.521045
612ec3b22bcae9603b62a3ce27f9181733e994d8
29,145
# -*- encoding: us-ascii -*- class Array include Enumerable # The flow control for many of these methods is # pretty evil due to how MRI works. There is # also a lot of duplication of code due to very # subtle processing differences and, in some # cases, to avoid mutual dependency. Apologies. def self...
21.636971
118
0.590256
083a18a34cfa0535d4bed34e263ad978a4b8f062
20,321
# 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. # # This file is the source Rails uses to define your schema when running `bin/rai...
42.512552
142
0.727376
6af212f5680448c562912bac1af19eba113e69d0
615
module Puppet::Parser::Functions newfunction(:assert_empty_hash, :type => :rvalue, :doc => <<-EOS This function checks an input struct for undefined hashes in key => hash and assigns {}. This is only a helper function to make a hash.each work if one of the values is undefined EOS )do |args| fail "Must receive one ar...
29.285714
178
0.658537
87188256aa38e5bb1f64d238925d860558433361
1,720
class AddDeviseToUsers < ActiveRecord::Migration[5.0] def self.up change_column :users, :email, :text, null: false, default: '' change_table :users do |t| ## Database authenticatable t.string :encrypted_password, null: false, default: '' ## Recoverable t.string :reset_password_token...
34.4
104
0.676163
3880e21048b58fbea155ad414143f45e4641e769
561
# frozen_string_literal: true module Strainer module Behaviors class ActionViewImageTagChanges < Strainer::RuntimeBehavior module HandleNilImageTagSrc include Strainer::Logable def image_tag(source, options={}) if source.nil? strainer_log('IMAGE_TAG_SOURCE_NIL', cust...
21.576923
94
0.632799
b90268d2656787202c94eb89c426afdacb3306a2
13,129
# The MIT License (MIT) # # Copyright (c) 2016 Juan M. Merlos, panatrans.org # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # t...
38.276968
119
0.562495
62fdd8e06897ecfeded8c75e42312b498859b3e9
3,894
require 'formula' class Ruby < Formula homepage 'https://www.ruby-lang.org/' url "http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2" sha256 "6948b02570cdfb89a8313675d4aa665405900e27423db408401473f30fc6e901" revision 3 bottle do revision 2 sha1 "43b7f90a5329fd4a5afb7dce9fceff8d8d8e1ac8" => :...
27.814286
88
0.592707
117bc6c81c126021bb0aac4d315409ea1d36d587
2,580
puts "# monitor/category" def create_monitor_category(data) create_item(Gws::Monitor::Category, data) end @mon_cate = [ create_monitor_category(name: '設備', color: '#FF4000', order: 10), create_monitor_category(name: 'システム操作', color: '#FFF700', order: 20), create_monitor_category(name: 'アンケート', color: '#00FFEE...
34.864865
97
0.69186
6a2410837394856c47809f8b8de75d9c24e39c05
8,077
require File.expand_path("../Abstract/abstract-osquery-formula", __FILE__) class Gcc < AbstractOsqueryFormula desc "GNU compiler collection" homepage "https://gcc.gnu.org" url "https://ftp.heanet.ie/mirrors/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2" mirror "https://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2" ...
35.581498
119
0.651727
ac7ff270668c105141ef1b6bd8f717ba78cc6f6a
2,449
# # Cookbook Name:: sensu # Recipe:: _linux # # Copyright 2014, Sonian Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
26.912088
107
0.721519
615bbfd6e7e0ef2100d1afc6d24292c4ac995e4e
128
# Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do factory :late_policy do end end
18.285714
68
0.789063
9146aa047b8a63fc6946ab38b04526810c439bcc
997
class Wgcf < Formula desc "Generate WireGuard profile from Cloudflare Warp account" homepage "https://github.com/ViRb3/wgcf" url "https://github.com/ViRb3/wgcf/archive/v2.2.4.tar.gz" sha256 "518ab709692bd87e2d6e4c3baff1cc09e5239f942ae1762fdb19dcb664d475fe" license "MIT" head "https://github.com/ViRb3/wgcf.g...
38.346154
122
0.772317
03920f715360027121ac908f13de5951236470d4
796
# Be sure to restart your server when you modify this file. # Your secret key for verifying cookie session data integrity. # If you change this key, all old sessions will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. Act...
49.75
148
0.788945
3379f2ee966279d81fcb2e0df92385dd0e2bfb89
7,060
require 'awesome_spawn' require 'pathname' require 'linux_admin' RAILS_ROOT ||= Pathname.new(__dir__).join("../../../") class PostgresAdmin def self.data_directory Pathname.new(ENV.fetch("APPLIANCE_PG_DATA")) end def self.mount_point Pathname.new(ENV.fetch("APPLIANCE_PG_MOUNT_POINT")) end def self...
27.364341
114
0.661473
03d8de2de781e45b2b72205e890dd163693caead
6,052
# Bundler and rubygems maintain a set of directories from which to # load gems. If Bundler is loaded, let it determine what can be # loaded. If it's not loaded, then use rubygems. But do this before # loading any puppet code, so that our gem loading system is sane. if not defined? ::Bundler begin require 'rubygem...
32.537634
124
0.620621
1aa6489791345be1e4fa3c938776cb9c2ce5c8e5
907
require 'json' package = JSON.parse(File.read(File.join(__dir__, './', 'package.json'))) Pod::Spec.new do |s| s.name = package['name'] s.version = package['version'] s.summary = package['description'] s.requires_arc = true s.author = { 'dzhuowen' => 'dzhuowen@fb.com' } s.licens...
29.258065
84
0.596472
ac4d704cf6f0ba505cbb07d44efffc89a598e570
1,239
require File.expand_path('../boot', __FILE__) require 'action_controller/railtie' require 'action_mailer/railtie' require 'rails/test_unit/railtie' require 'sprockets/railtie' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups...
42.724138
99
0.74657
28d08421a418cf4e2d7659211622b4efabdfbcc8
205
class CreateViewableText < ActiveRecord::Migration def change create_table :viewable_texts do |t| t.string :title t.text :text t.timestamps null: false end end end
18.636364
50
0.643902
874f9abf9681cbaf2822da965ce65a119b02ac08
24,709
require 'rdf/sesame' require 'omf_common/lobject' require 'omf-sfa/am/am_manager' require 'omf-sfa/am/am_liaison' require 'active_support/inflector' require 'rufus-scheduler' require 'data_objects' require 'rdf/do' require 'do_sqlite3' #$repository = Spira.repository = RDF::DataObjects::Repository.new uri: "sqlite3:./t...
41.458054
213
0.662512
e20bc67e7c216eaa3e37fb785cfaf3cbba8dfb40
659
cask 'black-screen' do version '0.2.93' sha256 'f22217696997aa67833fd9bf6a888c748d4d743e18068d1bf4d8cc87e087a9bc' url "https://github.com/vshatskyi/black-screen/releases/download/v#{version}/black-screen-#{version}-mac.zip" appcast 'https://github.com/vshatskyi/black-screen/releases.atom', checkpoint...
43.933333
161
0.795144
33bc749a1b2f1f8a2dac8407b38719b1d5af6d54
1,699
# Copyright (c) 2010 Thiago Arrais # # This file is part of rODF. # # rODF is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # rO...
23.597222
76
0.675103
5d0b1e1c058f8b5c67d17a66734803828f297535
2,163
# frozen_string_literal: true # Copyright (c) 2018 by Jiang Jinyang <jjyruby@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation t...
33.276923
93
0.717522
abc686d5aacb066afdb8574678c029cf05e4cbc7
93
class ApiController < ActionController::Base protect_from_forgery with: :null_session end
18.6
44
0.827957
3872c85346257c0ae3b28633aacad0ac3433c0be
1,616
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The # ASF licenses this file to you under the Apache License, Version 2.0 (the # "License"); you may not use...
32.979592
81
0.746906
876dd38b0d4d7dc4724a27fbc55667cdb2b24fec
409
class AccountActivationsController < ApplicationController def edit user = User.find_by(email: params[:email]) if user && !user.activated? && user.authenticated?(:activation, params[:id]) user.activate log_in user flash[:success] = "Account activated!" redirect_to user else ...
27.266667
80
0.672372
f8babedb9f29a1f76fc78f489515afc250189784
1,787
class GoJira < Formula desc "Simple jira command-line client in Go" homepage "https://github.com/go-jira/jira" url "https://github.com/go-jira/jira/archive/v1.0.27.tar.gz" sha256 "c5bcf7b61300b67a8f4e42ab60e462204130c352050e8551b1c23ab2ecafefc7" license "Apache-2.0" livecheck do url :stable strateg...
43.585366
137
0.765529
915919af44d477fb9c14af595dd395c42763d430
10,998
# frozen_string_literal: true require 'rails_helper' require AppealsApi::Engine.root.join('spec', 'spec_helper.rb') describe AppealsApi::HigherLevelReview, type: :model do include FixtureHelpers let(:higher_level_review) { default_higher_level_review } let(:default_higher_level_review) { create :higher_level_r...
32.157895
113
0.634024
e87850a2ce8c44d387903df919a308a8e692afcf
249
require 'spec_helper' klass = OneviewSDK::EnclosureGroup RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do let(:current_client) { $client } include_examples 'EnclosureGroupDeleteExample', 'integration context' end
31.125
79
0.787149
1dae2e3831109e321c6be8c67c77286fe49e93c0
711
RSpec::Matchers.define :have_opts do |opts| match do |obj| opts.nil? ? obj.opts.any? : obj.opts == opts end failure_message do |obj| <<~msg Expected #{obj.inspect} to have the opts #{opts.inspect} but instead it has: #{obj.opts.inspect} msg end fail...
13.941176
48
0.511955
3829f4e9bf38e4b72bdc4d2b5ee3479d0aae3c6c
2,073
class Ncmpcpp < Formula desc "Ncurses-based client for the Music Player Daemon" homepage "https://rybczak.net/ncmpcpp/" url "https://rybczak.net/ncmpcpp/stable/ncmpcpp-0.9.2.tar.bz2" sha256 "faabf6157c8cb1b24a059af276e162fa9f9a3b9cd3810c43b9128860c9383a1b" license "GPL-2.0-or-later" revision 3 bottle do ...
31.409091
122
0.691269
6a0b77abb00499a4fae767c90441f06f0306b873
8,476
=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-ap...
25.22619
198
0.6168
ac86f2571a7fc13c5664e38591eaf066c9f614a2
4,394
module Profile def Profile.get(params) Profile.set_defaults(params) madlib(File.read("/mij/src/res/bare.html"), { 'domain' => params[:domain], 'favicon' => params[:favicon], 'tatl' => params[:tatl], 'title' => "#{CGI.unescape(params[:user]).downcase}'s profile", 'content' => Profile.content(params), }) en...
23.751351
90
0.654074
1c94ac9b1d21c63683389d4a22611845c79bcb50
16,431
# 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. # # This file is the source Rails uses to define your schema when running `bin/rai...
40.272059
129
0.713286
9147ef401da53653243be3c01ef8bbbc1d48492e
3,003
module Gitlab module CurrentSettings class << self def current_application_settings if RequestStore.active? RequestStore.fetch(:current_application_settings) { ensure_application_settings! } else ensure_application_settings! end end def fake_applicati...
34.517241
106
0.697969
793cae8f752f33daae3e6417baf48d21f66002e3
250
# frozen_string_literal: true class CreateAssignments < ActiveRecord::Migration[5.2] def change create_table :assignments do |t| t.references :task, null: false t.references :user, null: false t.timestamps end end end
19.230769
54
0.692
8724fa5df99cab94bdf43ce057a7a2f632e69335
290
class AddGenderLocationAndMottoToUsersTable < ActiveRecord::Migration def change add_column :users, :gender, :string add_column :users, :city, :string add_column :users, :state, :string add_column :users, :country, :string add_column :users, :motto, :string end end
29
69
0.724138
87cc33d5ff161802b8c9baeae5f49e57bd2c0cc1
3,016
require 'set' file = 'input' #file = 'example1' #file = 'example2' input_rules, input_msgs = File.read(file).strip.split("\n\n").map do |block| block.split("\n") end @rules = {} input_rules.each do |line| if line =~ /\A(\d+): (((\d+|\|)( |\z))+|"(.+)"\z)\z/ rule = Regexp.last_match(1).to_i if Regexp.last...
24.128
126
0.613064
33329acd5f2c9f9d4de26c0da30821a05b91254c
1,069
require 'test_helper' # => https://github.com/brandonweiss/rack-minitest describe "when a user registrate" do it 'wont registrate if a user has the same name' do user = User.create(username: 'juan', password:'12345') post '/players', params = {'username'=>'juan', 'password'=> '12345'} User.find(user.id).destroy...
35.633333
70
0.734331
ed7c8ff987a916cf7e258de3a8f77cbc91edd698
1,939
class GuardiansController < ApplicationController before_action :set_guardian, only: [:show, :edit, :update, :destroy] # GET /guardians # GET /guardians.json def index @guardians = Guardian.all end # GET /guardians/1 # GET /guardians/1.json def show end # GET /guardians/new def new @gua...
25.853333
95
0.668386
39b75e81de6dba69a1000a86083bfacc607bfffe
145
class Article < ActiveRecord::Base has_many :comments, dependent: :destroy validates :title, presence: true, length: {minimum: 5} end
24.166667
40
0.710345
03ccafe111860a74b343aae262b96fdd10564b5c
23
module CaptsHelper end
7.666667
18
0.869565
38a8584dde4e79eac4cd7a10c83b23b8e80dd52e
6,782
# == Schema Information # # Table name: storage_locations # # id :integer not null, primary key # address :string # latitude :float # longitude :float # name :string # created_at :datetime not null # updated_at :datetime not null # ...
36.659459
175
0.676054
33f832fa9b69d7487779b79fd31f660a0519cf25
2,355
require 'fog/bluebox/core' module Fog module Bluebox class BLB < Fog::Service requires :bluebox_api_key, :bluebox_customer_id recognizes :bluebox_host, :bluebox_port, :bluebox_scheme, :persistent model_path 'fog/bluebox/models/blb' model :lb_application collection :lb_applica...
28.373494
124
0.598726
bfd81256aa0b27dc475d58c4e453cfe4406cbd1d
4,081
require 'google/api_client' require 'google/api_client/client_secrets' require 'google/api_client/auth/installed_app' require 'google/api_client/auth/storage' require 'google/api_client/auth/storages/file_store' require 'date' require 'fileutils' APPLICATION_NAME = 'Google Calendar API Ruby Quickstart' CLIENT_SECRETS_...
30.22963
78
0.636854
ff9b3afcdde947fb991ef4ab67e2184de47d9629
21,860
require "utils/json" class AbstractDownloadStrategy include FileUtils attr_reader :meta, :name, :version, :resource def initialize(name, resource) @name = name @resource = resource @url = resource.url @version = resource.version @meta = resource.specs end # Download and cache the resou...
24.479283
133
0.649451
1c60b11811afacd839983aa6fa9fbf0d6de58885
1,942
class Admin::CategoriesController < ApplicationController before_action :set_category, only: %i[show edit update destroy] # GET /categories # GET /categories.json def index @categories = Category.all end # GET /categories/1 # GET /categories/1.json def show; end # GET /categories/new def new ...
26.243243
96
0.679197
edf9f57485e614688a03b58d4c4a9be829ed5081
829
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'saisoku/version' Gem::Specification.new do |spec| spec.name = "saisoku" spec.version = Saisoku::VERSION spec.authors = ["tsukasaoishi"] spec.email = ["tsukasa...
33.16
74
0.634499
4a1f0034d3441e53a5739980cb299db9c8d0ca48
7,253
require "spec_helper" describe Swagger::Docs::ApiDeclarationFile do let(:apis) do [ { :path=>"sample/{id}", :operations=>[ { :summary=>"Updates an existing User", :parameters=>[ {:param_type=>:path, :name=>:id, :type=>:integer, :description=>"...
36.084577
123
0.575348
e8b563b668fd49f400bca66525676f8a136348d0
6,030
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic...
36.325301
245
0.674793
61582d82525d401aede87cdefeb780b194e71640
715
require_relative "../../test/support/taxonomy_helper" module AdminTaxonomyHelper include TaxonomyHelper def select_taxon(label) check label end def select_taxon_and_save(label) select_taxon(label) click_button "Save topic changes" end def stub_taxonomy_data redis_cache_has_taxons [root_ta...
20.428571
67
0.767832
08970727aace49d7ea5abb7fca46757814059c4c
1,191
require_relative '../../load_helper' module WebTest module Pm module CostManage class ChangableCostManageSpec describe 'changable cost manage page' do before :all do driver = Support::Login.login @page_container = WebDriver.create_page_container :pm,driver ...
31.342105
86
0.628044
5d7b0c3ab03ac71a26d0c7be066cfef229c45f90
453
# frozen_string_literal: true ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' require 'rails/test_help' class ActiveSupport class TestCase # Run tests in parallel with specified workers parallelize(workers: :number_of_processors) # Setup all fixtures in test/fixtures/* # .yml f...
22.65
50
0.715232
795cc7347cf305a7e3b688ff6fea963512e8ce30
2,442
require 'spec_helper' describe "gws_workflow_files", type: :feature, dbscope: :example, js: true do context "crud along with approve path" do let(:site) { gws_site } let(:user) { gws_user } let(:index_path) { gws_workflow_files_path(site, state: 'all') } let!(:file) { tmp_ss_file(contents: '012345678...
30.525
77
0.616298
01dcab59b20c209d0aa9859938afee63e31c2615
171
class AddCreatorIdToDocuments < ActiveRecord::Migration[4.2] def change add_column :documents, :creator_id, :integer add_index :documents, :creator_id end end
24.428571
60
0.760234
7abe07c9abbdc9eb42d7d813374c5b7f901d402a
123
class AddContentMdToArticles < ActiveRecord::Migration def change add_column :articles, :content_md, :text end end
20.5
54
0.772358
d552b6853696dc62c9932689879114719af5da99
600
class User < ApplicationRecord devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable validates :name, presence: true, length: { maximum: 20 } has_many :posts has_many :comments, dependent: :destroy has_many :likes, dependent: :destroy has_many :friendships, ->...
42.857143
114
0.708333
621cae5d80d3098306556f14a7cf489cf1065e0e
12,522
# coding: utf-8 class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps include SharedAuthentication include SharedProject include SharedPaths include RepoHelpers include WaitForRequests step "I don't have write access" do @project = create(:project, :repository, name: "Other Project"...
27.281046
200
0.691263
e23fab6f137a283bb2d5708ae215b80086532f59
31
print "Hello,", "Ruby",".","\n"
31
31
0.483871
e20242d302a3901772feb39280e59e6113e738ae
401
# ----------------------------------------------------------------------------- # Draws an image for a gauge # # Author:: Fernand Galiana # ----------------------------------------------------------------------------- require 'ziya/gauges/support/base' module Ziya::Gauges::Support class Image < Base has_attri...
33.416667
84
0.413965
3978371abb1e120f3fb8219bb099d80ef83657a8
197
GOVUKDesignSystemFormBuilder.configure do |conf| conf.default_error_summary_title = "There is a problem" conf.default_legend_tag = "h3" conf.default_legend_size = "s" end
32.833333
58
0.71066
1802073f469fd955882b5c880ef8f207929d4016
1,698
# # tk/macpkg.rb : methods for Tcl/Tk packages for Macintosh # 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp> # # ATTENTION !! # This is NOT TESTED. Because I have no test-environment. # # require 'tk' module Tk def Tk.load_tclscript_rsrc(resource_name, file=None) # Mac ...
22.945946
78
0.670789
62ea4cd3b1b1346d0fc465e9ee780d28c55ba5f0
878
class Flash < Formula # cite Magoc_2011: "https://doi.org/10.1093/bioinformatics/btr507" desc "Merge mates from overlapping fragments" homepage "https://ccb.jhu.edu/software/FLASH/" url "https://downloads.sourceforge.net/project/flashpage/FLASH-1.2.11.tar.gz" sha256 "685ca6f7fedda07434d8ee03c536f4763385671c45...
32.518519
94
0.753986
61df6686e508bfd33962e83574aee0b08bb7733c
2,089
require 'active_support' require 'active_record' require 'sham' require 'machinist/active_record' module Machinist # A Lathe is used to execute the blueprint and construct an object. # # The blueprint is instance_eval'd against the Lathe. class Lathe def self.run(object, *args) blueprint = ob...
29.013889
86
0.648636
ffee62dced1c3d157638113607ddc5094c33dce8
253
# encoding: utf-8 require 'isolated_spec_helper' RSpec.describe 'ActiveType', type: :isolated do it 'can be used without explicitly using ActiveRecord::Base first' do require 'active_type' expect(ActiveType).to respond_to(:cast) end end
19.461538
71
0.743083
87ef40b5206371c67237917e27f210f45afd2b6d
18,722
# frozen_string_literal: true # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
49.010471
128
0.535359
e90603668d86c5bb0e77606b7fee653a00a6938f
1,157
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'omniauth/saml/multi_provider/version' Gem::Specification.new do |spec| spec.name = 'omniauth-multi-provider-saml' spec.version = OmniAuth::SAML::MultiProvider::VERSION spec.a...
35.060606
96
0.689715
5dfd53ad71d63f80b4af5025d496ab16b4f2bee1
2,355
class PushRule < ActiveRecord::Base belongs_to :project validates :project, presence: true, unless: "is_sample?" validates :max_file_size, numericality: { greater_than_or_equal_to: 0, only_integer: true } FILES_BLACKLIST = YAML.load_file(Rails.root.join('lib/gitlab/checks/files_blacklist.yml')) def self.gl...
24.53125
93
0.720594
266fbafc3484f33c13a8d595c1d22fd656b51561
1,984
require 'puppet' require 'puppet/type/heat_config' describe 'Puppet::Type.type(:heat_config)' do before :each do @heat_config = Puppet::Type.type(:heat_config).new(:name => 'DEFAULT/foo', :value => 'bar') end it 'should require a name' do expect { Puppet::Type.type(:heat_config).new({}) }.to r...
30.523077
95
0.669355
7a62a6d2e52a0b54d9f7a83f34a924aed65286fc
666
require 'test_helper' class ParagraphTest < Minitest::Test include Pukiwiki2md::TestHelper def setup @parser = ::Pukiwiki2md::Parser.new @trans = ::Pukiwiki2md::Transform.new end def test_parse result = @parser.paragraph.parse(sample_paragraph) assert_tree({:paragraph_lines => [ {:line ...
18
54
0.660661
bbda9e711833f55d8348be9141a18dd7284bc9a3
10,935
require "csv" module Article::Export extend ActiveSupport::Concern def category_name_tree id_list = categories.where(route: /^category\//).pluck(:id) ct_list = [] id_list.each do |id| name_list = [] filename_str = [] filename_array = Cms::Node.where(_id: id).pluck(:filename).first.s...
35.38835
113
0.624417
8757a1f7b5bf6bedf2a157bbad2f0dc9708fc0e4
2,967
# frozen_string_literal: true require 'bigdecimal' require File.dirname(__FILE__) + '/spec_helper' module Banano RSpec.describe Unit do let(:one_ban_raw) { BigDecimal('100000000000000000000000000000') } let(:one_raw_ban) { BigDecimal('0.00000000000000000000000000001') } let(:max_ban) { BigDecimal('340...
35.746988
95
0.658578
3927660e95d5877646d63f749b0835f59ffa79af
491
FactoryBot.define do factory :group do name { Faker::Lorem.word } process_specimen_retrieval { true } process_sample_size { true } display_patient_information { true } trait :with_source do after :create do |group, evaluator| create(:source, group: gr...
23.380952
53
0.608961
1ac4aae7eadcc5b8e51cff225ae0ebd1d58bb9bd
1,579
module UsersHelper def full_name(user) # user.first_name + " " + user.last_name if user.first_name && user.last_name user.full_name end def default_avatar_url ActionController::Base.helpers.asset_path("avatar.png", type: :image) end def avatar_image_tag(user, size = :medium, opts = {}) klas...
27.224138
94
0.630146
39835aae62de383fa18b4ee9ef961324bb7ada55
1,350
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'datadog/appsec/waf/version' Gem::Specification.new do |spec| spec.name = 'libddwaf' spec.version = Datadog::AppSec::WAF::VERSION::STRING spec.required_ruby_v...
32.926829
92
0.624444
1a4a9a6abb2f706678bd7deacfa23b249395002f
665
# frozen_string_literal: true class SquareLite::Search::Catalog class Query < SquareLite::Search::Base include ForTypes include WithRelated include WithDeleted include Since include Limit expected_params << :object_types expected_params << :query def with_deleted params[:inclu...
19
82
0.673684
018c4b0f84e560ce4a13fecb743269a9a20f4d35
2,887
require 'fileutils' require 'erb' require 'jammit' module Rubonic::Build class BuildTemplate class << self def build(*args) begin test_create_command clean create_cordova_project jammit_package_assets build_index_html copy_assets_into_bui...
28.029126
103
0.604434
e8adfe9287b5d5388dfe2c92345c7fad693b7059
1,340
require 'formula' class Sonar < Formula homepage 'http://www.sonarqube.org/' url 'http://dist.sonar.codehaus.org/sonarqube-4.1.1.zip' sha1 '3a6f2effb67104bfc90b88b0627c105cf6089f8b' def install # Delete native bin directories for other systems rm_rf Dir['bin/{aix,hpux,linux,solaris,windows}-*'] i...
26.8
106
0.629104
33335cfeaf91577f53ef144927c9eb45773d7cd3
4,996
# frozen_string_literal: true RSpec.describe RuboCop::Cop::RSpec::SubjectStub do subject(:cop) { described_class.new } it 'complains when subject is stubbed' do expect_offense(<<-RUBY) describe Foo do subject(:foo) { described_class.new } before do allow(foo).to receive(:bar)....
25.620513
91
0.536829
1db7f51f8328562c962186b83ef3292411c25a74
1,101
FactoryGirl.define do factory :solr_document do skip_create initialize_with do new( { id: id, format_ssm: format, unittitle_ssm: unittitle, abstract_ssm: abstract, repository_ssi: repository, ead_ssi: ead, bioghist_ssm: bioghist, cust...
26.853659
53
0.574932
874eb17b231f6783f694d67d686058ec1d3ff878
34,167
require 'rubyXL/objects/ooxml_object' require 'rubyXL/objects/simple_types' require 'rubyXL/objects/extensions' require 'rubyXL/objects/relationships' require 'rubyXL/objects/sheet_common' require 'rubyXL/objects/text' require 'rubyXL/objects/formula' require 'rubyXL/objects/sheet_data' require 'rubyXL/objects/column_r...
45.677807
113
0.694998
1a96356fa87b08d239dc284d4da9b320e11c4c03
8,639
#-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. # See LICENSE.txt for permissions. #++ ## # Gem::ConfigFile RubyGems options and gem command options from ~/.gemrc. # # ~/.gemrc is a YAML file that uses strings to match gem command arguments and # symbols to match RubyGe...
25.865269
94
0.671606
7ac0383262ab038f3d3d2847397f159e4c223d61
767
require './config/environment' class ApplicationController < Sinatra::Base configure do set :public_folder, 'public' set :views, 'app/views' enable :sessions set :session_secret, "password_security" end get '/' do if logged_in? erb :'/boardgames' else redirect '/login' ...
17.837209
59
0.617992
26ff3e161dee0da70a9ac76f905ebc6b69124e58
1,081
cask 'lilypond-dev' do version '2.19.82-1' sha256 '558ffac7ba7543b39f2f87ed4a4141a29951d44772893c9af89a89ed33f16176' url "http://lilypond.org/downloads/binaries/darwin-x86/lilypond-#{version}.darwin-x86.tar.bz2" name 'LilyPond' homepage 'http://lilypond.org/' app 'LilyPond.app' binaries = [ ...
28.447368
96
0.612396
0804b0d455baf728ee30b238de82f4ea1bd50b03
1,558
require 'date' require './lib/rmagick/version' Gem::Specification.new do |s| s.name = 'rmagick' s.version = Magick::VERSION s.date = Date.today.to_s s.summary = 'Ruby binding to ImageMagick' s.description = 'RMagick is an interface between Ruby and ImageMagick.' s.authors = ['Tim Hunter', 'Omer Bar-or', 'Be...
43.277778
172
0.673941
1db2957630471b9e98571fc6de58a5c776d43d89
3,986
module RegistrationSH def fill_in_registration_form(email, client = Fabricate.build(:client), prefix = 'client') fill_in('Email', with: email) fill_in "#{prefix}_first_name", with: client.first_name fill_in "#{prefix}_last_name", with: client.last_name fill_in "#{prefix}_phone", with: client.phone ...
32.406504
110
0.740592
d575d0c61224d094703f2e9dd6e5fb27e1096816
2,071
require 'spec_helper' describe Spree::ContactUs::ContactMailer do describe "#formcontact_email" do before do SpreeContactUs.mailer_to = "contact@please-change-me.com" @formcontact = Spree::ContactUs::Formcontact.new(:email => 'test@email.com', :message => 'Thanks!') end it "should render s...
31.378788
149
0.687591
e9d22b4bf6505c5ab36adea365beeaddc8fe415f
102
require 'rails_helper' module Genova module Logger describe MongodbLogger do end end end
11.333333
29
0.735294
b9558f8013541b1a9288ef0367b4b7bed5aeb45e
1,122
class OrdersController < ApplicationController before_action :set_order, only: [:update, :attribute, :destroy] def construct sanitised_params = create_params @order = Order.create(meal_id: sanitised_params[:meal_id], user_id: sanitised_params[:user_id]) render :partial => 'order_form', status => :crea...
21.576923
99
0.680036
91adc36749bdb7a6605819a4200feb4b2aefeb53
603
# frozen_string_literal: true module RegistrationsHelper def signup_username_data_attributes { min_length: User::MIN_USERNAME_LENGTH, min_length_message: s_('SignUp|Username is too short (minimum is %{min_length} characters).') % { min_length: User::MIN_USERNAME_LENGTH }, max_length: User::MAX_...
37.6875
144
0.754561
e948471e095d38daaaeeae73c2ec2e53a2cf17d8
206
class CreateTasks < ActiveRecord::Migration[5.2] def change create_table :tasks do |t| t.string :title t.date :due_date t.integer :user_id t.string :priority end end end
18.727273
48
0.640777
e8bbcda1f6c4dcfce40f3f34864616afa07a5d78
223
class AddDurationToProposals < ActiveRecord::Migration[5.0] def change add_column :proposals, :duration, :integer, default: 1 add_column :proposals, :is_month_long, :boolean, null: false, default: false end end
31.857143
80
0.748879
1c6f0c516f07e2e95360d578366dba3dab87de97
3,515
require 'erb' require 'logger' module Angelia # exception for corrupt message files class Angelia::CorruptMessage < RuntimeError end # exception to be raised when a plugin can't connect to its transport class Angelia::PluginConnectionError < RuntimeError end # Simple utility class, these are all just c...
28.577236
117
0.639829
e2518d83f2b30ca0541349313769fcd23153e6ea
180
# frozen_string_literal: true FactoryBot.define do factory :localization do name { "name" } locale { "nb" } association :localizable, factory: :blank_page end end
18
50
0.694444
f75a48b024b53bd4e61b2b94dd830241e8d4ea19
300
module Spec module Support module MigrationStubs def self.reserved_stub Class.new(ActiveRecord::Base) do self.table_name = "reserves" self.inheritance_column = :_type_disabled # disable STI serialize :reserved end end end end end
21.428571
65
0.63
4af9e0a5d7548910307c2862d246c25634147513
1,518
#encoding: utf-8 #encoding: utf-8 # -*- encoding: utf-8 -*- lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'jquery/form/validator/rails/version' Gem::Specification.new do |gem| gem.name = "jquery-form-validator-rails" gem.version = Jquery:...
52.344828
434
0.70751
ff8f78c724a0610350ac7d91642ddc9ba9e0678c
2,718
module ViewModel module SapSchemaNi112 class Rdsap < ViewModel::SapSchemaNi112::CommonSchema def main_dwelling_construction_age_band_or_year sap_building_parts = @xml_doc.xpath("//SAP-Building-Parts/SAP-Building-Part") sap_building_parts.each do |sap_building_part| identi...
22.840336
78
0.620309
ed5c390f9824b018fbc28bee851e04dd6ac7c050
556
# Get twilio-ruby from twilio.com/docs/ruby/install require 'rubygems' # This line not needed for ruby > 1.8 require 'twilio-ruby' # Get your Account Sid and Auth Token from twilio.com/user/account account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' auth_token = 'your_auth_token' @client = Twilio::REST::Client.new acco...
39.714286
78
0.78777
6a3330b6063886bc4f3d69112194654b172787a4
1,513
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::CognitiveServices::TextAnalytics::V2_1 module Models # # Model object. # # class MultiLanguageBatchInput include ...
26.54386
71
0.510905