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
f7ab2f338729668d1ad10607251df960e38a9c8b
2,732
require_relative 'scraper.rb' module Connect4Strategy class Game attr_reader :current_turn, :board, :game_over def initialize print "\n Welcome to Connect Four! Player 1 will be X and Player 2 is O!\n\n" @current_turn = 'X' @board = [ %w[_ _ _ _ _ _ _], %w[_ _ _ _ _ _ _...
26.784314
106
0.468521
210ce9e852689a15c8726136614cbab01450b0f7
513
require 'dotenv' Dotenv.load require 'open-uri' require 'mimemagic' require 'faraday' require 'pipeline_deals' require 'hubspot-ruby' require_relative 'hubspot_file_migration/deals' require_relative 'hubspot_file_migration/engagement' require_relative 'hubspot_file_migration/file' require_relative 'hubspot_file_migr...
22.304348
52
0.832359
ed62b5beb02cacc579aa7fa2433bc0f1a97e28e4
249
# frozen_string_literal: true class Tag < ApplicationRecord has_and_belongs_to_many :links scope :publicly_visible, -> { joins(:links).where('links.published_at IS NOT NULL').distinct } scope :used, -> { joins(:links).distinct } end
24.9
77
0.714859
28a060fb8153a302c24c5f775e3f0a98a156d9d6
439
cask "font-sitara" do version :latest sha256 :no_check # github.com/google/fonts/ was verified as official when first introduced to the cask url "https://github.com/google/fonts/trunk/ofl/sitara", using: :svn, trust_cert: true name "Sitara" homepage "https://fonts.google.com/specimen/Sitar...
25.823529
87
0.703872
1ad087df986a9f088fdb17fbee89995311e0d8c7
1,139
# frozen_string_literal: true # 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 Gem::Specification.new do |spec| spec.name = 'aws-sdk-mq' spec.vers...
35.59375
103
0.657594
f8325fe5e5bef5311c2b1c198922eac47f067553
447
require 'cgi' module Koyori class Excerpt def initialize(text) @text = text end def format buffer = "<div class='excerpt'>\n" @text.each_line do |line| line.chomp! if line.sub!(/\A\s+/, '') buffer << Regexp.last_match[0].gsub(/ /, '&nbsp;') end ...
18.625
60
0.503356
1a28dff2ce285f2ae259e2eed3fc5875a93b267e
383
require 'rails_helper' describe V1::QuickpostMessagesController do describe 'DELETE /quickpost_messages/:id', version: 1 do it_behaves_like 'a destroyable and permissible model' do let(:record) { create(:quickpost_message) } let(:record_url) { "/v1/quickpost_messages/#{record.id}" } let(:record...
31.916667
64
0.720627
f794a086fcdd8a8b474966dbf5a43f395f1d459d
4,293
test_name "(SERVER-1268)/(TK-293) TK-AUTH uses certificate extensions for authentication" do confine :except, :platform => 'windows' server = master.puppet['certname'] ssldir = master.puppet['ssldir'] confdir = master.puppet['confdir'] teardown do # restore the original tk auth.conf file on master, 'cp /etc/pu...
29.8125
108
0.652457
b979ce5f0fb78496e502f55cc230a0128f9bbbe9
1,109
=begin #Selling Partner API for Merchant Fulfillment #The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping for non-Prime and Prime orders using Amazon’s Buy Shipping Services. OpenAPI spec version: v0 Generated by: https://github.com/swagger-api/swagger-cod...
31.685714
182
0.798918
d5b9546c37a5e8fff1c57ca690ecffa0cbfdd479
857
# === COPYRIGHT: # Copyright (c) Jason Adam Young # === LICENSE: # see LICENSE file class TeamsController < ApplicationController def index @standings = Standings.new(@season) @team_display = {} ['American','National'].each do |league| @team_display[league] = {} ['East','West'].each do |divi...
19.930233
81
0.624271
032633d5f61f68d7f660afb36b7ecef15d7cb139
811
name "S3" description "AWS S3" version "0.1" maintainer "OneOps" maintainer_email "support@oneops.com" license "Apache License, Version 2.0" grouping 'default', :access => "global", :packages => [ 'base', 'mgmt.cloud.service', 'cloud.service' ], :namespace => true att...
22.527778
66
0.579531
2845d574d1c931003684936903590e4048fe12ec
28,909
## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Api < Domain class V2010 < Version class AccountContext < InstanceContext class ApplicationList < ListResource ...
47.547697
409
0.571933
1c87b26defdc1748756a79d9a3bf9325d019cd12
2,773
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::IotHub::Mgmt::V2017_07_01 module Models # # The JSON-serialized array of JobResponse objects with a next link. # class JobResponseListResult ...
28.010101
80
0.521818
abb726f783a68e723341f9bbbe0014b5348dcc93
828
# frozen_string_literal: true # == Schema Information # # Table name: alerts # # id :integer not null, primary key # course_id :integer # user_id :integer # article_id :integer # revision_id :integer # type :string(255) # email_sent_at :datetime # created_at ...
23
75
0.624396
62e042efba03cda06d8743260f328d4f0e12b6a0
1,108
# # Copyright 2011 Red Hat, 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 required by applicable law or agreed...
39.571429
99
0.75722
91eb1a242c7e1b8ae75c0cedc0e6606ac2d30cec
1,576
class ApplicationController < ActionController::Base # Prevent CSRF attacks by raising an exception. # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception def preferences @preferences ||= UserPreferences.new( params ) end def time_period preferences.time_peri...
28.654545
86
0.693528
6abf430c8fbdee285f5cc7a20036cd46b2458169
3,199
require "net/http" require "net/https" require "cgi" require "openssl" # This module contains a set of utility methods related to the HTTP protocol. module OmniContacts module HTTPUtils SSL_PORT = 443 module_function def query_string_to_map query_string query_string.split('&').reduce({}) do |me...
31.362745
142
0.661457
f7792037050ddcbba903368eb91bbb8f4900f09b
112
module Phctitleseo class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end end
18.666667
47
0.741071
081d359737e4ed02977a30cc80a037be152f8bef
100
require 'rails_i18n/common_pluralizations/other' ::RailsI18n::Pluralization::Other.with_locale(:ig)
33.333333
50
0.83
4ab629d7327d0b54efe4e9eeccfdda8032c1c3ba
186
nozomi "Install Twitter bootstrap" do gem_group_add :assets do gem 'bootstrap-sass' end run "echo '//= require bootstrap' >> app/assets/stylesheets/application.css" end
18.6
78
0.704301
ed94d7661e5736219fc1a29240eaf69bd67371d7
1,748
require_relative 'spec_helper' require_relative 'common_steps' describe MouseMelon do it 'has a version number' do expect(MouseMelon::VERSION).not_to be nil end end feature 'MouseMelon features' do include CommonSteps scenario 'Without gherkin' do given_is_defined when_is_defined then_is_defi...
18.795699
49
0.673341
f7518cf156e6d6cfe92ee2e7285d4de03cb34080
3,545
# bandwidth # # This file was automatically generated by APIMATIC v2.0 # ( https://apimatic.io ). require 'date' module Bandwidth # ConferenceDetail Model. class ConferenceDetail < BaseModel # TODO: Write general description for this method # @return [String] attr_accessor :id # TODO:...
32.522936
87
0.599154
7a4e384712fb163c406620ac4144b62a183eaa4a
1,009
require "formula" class Fakeroot < Formula homepage "https://tracker.debian.org/pkg/fakeroot" stable do url "https://mirrors.kernel.org/debian/pool/main/f/fakeroot/fakeroot_1.18.4.orig.tar.bz2" mirror "http://ftp.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.18.4.orig.tar.bz2" sha1 "60cdd12ea3a72f...
29.676471
93
0.67889
010e9b1d3fbc3fd29f2fe38fb64a5f8042e65378
4,096
unless defined? JRUBY_VERSION Process.maxgroups = 1024 end module RDoc def self.caller(skip=nil) in_gem_wrapper = false Kernel.caller.reject { |call| in_gem_wrapper ||= call =~ /#{Regexp.escape $0}:\d+:in `load'/ } end end require "yaml" require "puppet/util/zaml.rb" class Symbol def to_z...
23.676301
152
0.658936
1830ed3b584222ccf0f9b12dd5961f6a37ccc094
9,837
# # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # class Hhvm412 < Formula desc "JIT compiler and runtime for the Hack language" homepage "http://hhvm.com/" head "h...
35.384892
125
0.703467
0804bb334b16f4373de8e416d9f0f98f5f4363c3
208
module Telegram module Bot module Types class GameHighScore < Base attribute :position, Integer attribute :user, User attribute :score, Integer end end end end
17.333333
36
0.625
ff2ac6f70dbd59a73fa501b40bc0505cd744bb81
42
module DateToWord VERSION = "0.1.7" end
10.5
19
0.690476
1168264f52e8f8852ce7df87d7c6ddde783bced9
923
cask "elgato-stream-deck" do version "4.9.2.13193" sha256 "24a7913d337cba95bdb9e1c148dbeaf4ccfc58a42a118251ca61372bc76998cd" url "https://edge.elgato.com/egc/macos/sd/Stream_Deck_#{version}.pkg" appcast "https://macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://gc-updates.elgato.com/mac/sd-u...
36.92
151
0.726977
21276903d5b2eb4f5c42d49ea3cf38869a870fa3
2,142
require 'rails_helper' RSpec.describe ReviewsController, type: :controller do let(:valid_attributes) { :id } let(:invalid_attributes) do skip("Add a hash of attributes invalid for your model") end let(:client) { Gush::Client.new } let(:review) { instance_double(ReviewWorkflow) } before(:each)...
28.184211
78
0.655462
08e653a47b637f7248142e654836aef1ef238271
122
shared_examples_for 'Msf::DBManager::Import::Spiceworks' do it { is_expected.to respond_to :import_spiceworks_csv } end
30.5
59
0.803279
ff066b69124f4ad13739bddde3efa018f6614255
568
ENV['SINATRA_ENV'] ||= "development" require 'bundler/setup' Bundler.require(:default, ENV['SINATRA_ENV']) configure :development do set :database, 'sqlite:///dev.db' set :show_exceptions, true end configure :production do db = URI.parse(ENV['DATABASE_URL'] || 'postgres:///localhost/mydb') ActiveRecord::Base.es...
21.846154
68
0.667254
e9adb598ec36810f104eecce3c9b54acdc04e647
273
module ApiHandler def render_error(message, status) render json: { error: message }, status: status end def render_no_content render_success({}, :no_content) end def render_success(data = {}, status = :ok) render json: data, status: status end end
21
51
0.692308
08c462da15030a7df0d30a8b1c0ce8c3322adca2
12,935
require 'sinatra' require 'stripe' require 'dotenv' require 'json' require 'encrypted_cookie' $stdout.sync = true # Get puts to show up in heroku logs Dotenv.load Stripe.api_key = ENV['STRIPE_TEST_SECRET_KEY'] use Rack::Session::EncryptedCookie, :secret => 'replace_me_with_a_real_secret_key' # Actually use somethi...
30.724466
141
0.682799
7a0c838ef6a724c8850565db95ab46632be14daf
430
require 'rails_helper' # Specs in this file have access to a helper object that includes # the SitesHelper. For example: # # describe SitesHelper do # describe "string concat" do # it "concats two strings with spaces" do # expect(helper.concat_strings("this","that")).to eq("this that") # end # end # ...
26.875
71
0.704651
e8fcdabecd6ccfe17e755eb2bc5b68f485ec5c0e
217
class Api::V1::Merchants::MostItemsController < ApplicationController def index number_of_merchants = params[:quantity].to_i render json: Merchant.merchants_with_most_items(number_of_merchants) end end
21.7
72
0.792627
876c479bff630a2736fd8451f1080b07335c84b3
769
class Antigen < Formula desc "Plugin manager for zsh, inspired by oh-my-zsh and vundle." homepage "http://antigen.sharats.me/" url "https://github.com/zsh-users/antigen/releases/download/v2.2.1/v2.2.1.tar.gz" sha256 "fb3b79ea5cb5f00644d2f352c4d17c4e67b76d050aadda830198315e8ed96873" head "https://github.com/zs...
30.76
85
0.706112
28acb3f928db4835cdcfbdeac22757646d395879
3,428
# typed: false # frozen_string_literal: true class QtWebkitAT23 < Formula desc "Qt port of WebKit (insecure, don't use for Web browsing)" homepage "https://trac.webkit.org/wiki/QtWebKit" url "https://download.kde.org/stable/qtwebkit-2.3/2.3.4/src/qtwebkit-2.3.4.tar.gz" sha256 "c6cfa9d068f7eb024fee3f6c24f5b8b72...
37.26087
132
0.718786
f7509ecefae0cf45a1cf67c3ba95c3bb35ef9795
70
platform "fedora-34-x86_64" do |plat| plat.inherit_from_default end
17.5
37
0.785714
18ad68fc9fce7f5e5b0742131789251b86449399
1,267
class Neofetch < Formula desc "Fast, highly customisable system info script" homepage "https://github.com/dylanaraps/neofetch" url "https://github.com/dylanaraps/neofetch/archive/7.1.0.tar.gz" sha256 "58a95e6b714e41efc804eca389a223309169b2def35e57fa934482a6b47c27e7" license "MIT" head "https://github.com/dy...
38.393939
95
0.753749
62d8417dfcfc62daddda03770b96aa0bc194a6f0
1,368
class Simgrid < Formula desc "Studies behavior of large-scale distributed systems" homepage "http://simgrid.gforge.inria.fr" url "https://gforge.inria.fr/frs/download.php/file/37148/SimGrid-3.17.tar.gz" sha256 "f5e44f41983e83f65261598ab0de1909d3a8a3feb77f28e37d38f04631dbb908" bottle do sha256 "25156b23d0...
30.4
94
0.684211
d5cf6b6bbd56251942b84eef7f713a121a0c3c13
939
class MultiSchema def active? ENV['DATABASE'] == 'postgresql' end def create(schema_name) unless connection.schema_exists? schema_name connection.execute %Q{CREATE SCHEMA "#{schema_name}"} end switch schema_name silence_stream(STDOUT) { load Rails.root.join('db', 'schema.rb') } end ...
19.978723
75
0.676251
87f53d7c5583360afb8296c3088c8b242839b198
144
class CompetitionsPublished < ActiveRecord::Migration def change add_column :competitions, :published, :boolean, default: false end end
24
66
0.777778
e86cbe6bfe15bf513c6732aeea0e6e6d9072e78a
274
# frozen_string_literal: true require "#{Rails.root}/app/lib/omni_auth/strategies/wild_apricot" Rails.application.config.middleware.use OmniAuth::Builder do provider :wildapricot, ENV['WA_OAUTH_ID'], ENV['WA_OAUTH_SECRET'], :callback_path => "/callback/wildapricot" end
34.25
110
0.788321
4a1f24f8536e27c835d9c32025186f731c0e09a5
1,394
require 'refinerycms-core' require 'mobility' module Refinery autoload :PagesGenerator, 'generators/refinery/pages/pages_generator' module Pages require 'refinery/pages/engine' require 'refinery/pages/tab' require 'refinery/pages/type' require 'refinery/pages/types' # Load configuration last ...
25.814815
74
0.67934
33646ad54f5a3f3243bd77d7ed1151182deced7f
21,079
# frozen_string_literal: true module ActiveRecord # = Active Record Autosave Association # # AutosaveAssociation is a module that takes care of automatically saving # associated records when their parent is saved. In addition to saving, it # also destroys any associated records that were marked for destructi...
38.748162
134
0.661464
8752cb954bc0122fb5009930962c1a8a76c2d864
556
require 'spec_helper' describe OmniAuth::Strategies::Crunch do subject do OmniAuth::Strategies::Crunch.new({}) end context 'client options' do it 'should have correct name' do subject.options.name.should eq('crunch') end it 'should have correct site' do subject.options.client_option...
23.166667
80
0.685252
4a256ec24ec3ed8f6debe46b07155740a165c58e
2,852
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::DeploymentManager::Mgmt::V2019_11_01_preview module Models # # Defines the properties of a rollout. # class RolloutPropertiesModel incl...
30.021053
79
0.497195
f70e955634b05caed3f96aa7433b9b28bd5eab83
172
# encoding: utf-8 require 'mlk/version' require 'mlk/utils' require 'mlk/result_set' require 'mlk/document' require 'mlk/model' module Mlk # Your code goes here... end
14.333333
26
0.726744
1a7501518f6e1cc254bab6c89443c05887a9a424
7,714
class Subversion < Formula desc "Version control system designed to be a better CVS" homepage "https://subversion.apache.org/" url "https://www.apache.org/dyn/closer.lua?path=subversion/subversion-1.14.0.tar.bz2" mirror "https://archive.apache.org/dist/subversion/subversion-1.14.0.tar.bz2" sha256 "6ba8e218f9f...
35.385321
118
0.652969
1d99ec93e258ea8fbe89006c4610577b705da1bb
2,122
# frozen_string_literal: true require 'fast_spec_helper' require_relative '../../../../rubocop/cop/gitlab/const_get_inherit_false' RSpec.describe RuboCop::Cop::Gitlab::ConstGetInheritFalse do subject(:cop) { described_class.new } context 'Object.const_get' do it 'registers an offense with no 2nd argument and...
27.558442
73
0.618756
e89f72f4f521250884371ed8c5328fb059bdaf0a
1,488
class RestartWorkerException < RuntimeError end class WebhookWorker include Sidekiq::Worker sidekiq_options queue: :webhooks, retry: 4, unique: :until_and_while_executing, unique_args: :unique_args def self.unique_args(args) [args[3]] # batch_id end sidekiq_retry_in do |count| # retry between 15-2...
28.615385
107
0.713038
d5c14a5b65b37ec09a75db1e815bf6a64bae454f
2,711
# -*- encoding: utf-8 -*- # stub: ast 2.3.0 ruby lib Gem::Specification.new do |s| s.name = "ast".freeze s.version = "2.3.0" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["whitequark".freeze] s.d...
45.183333
112
0.637772
6168d281f2b986b65ab5d87b4b1f470534ac4d28
1,248
require "spec_helper" describe Apress::Api::V1::TokensController, type: :controller do render_views let!(:client) { create "api/client" } describe "#create" do context "when client doesn't exist" do it do post :create, client_id: "no-name" expect(response.status).to eq 404 end ...
27.130435
86
0.653846
6a44a1e4f8030eed45a5c7f76dd1e4b3400c54fa
2,463
module Admin::BaseHelper include ActionView::Helpers::DateHelper def toggle_element(element, label = t('generic.change')) link_to label, "##{element}", data: { toggle: :collapse } end def class_for_admin_state(sidebar, this_position) case sidebar.admin_state when :active return 'active alert...
27.988636
153
0.660171
1cbe03f1ccfd7570310f2c7acfc12595c8214ef0
1,170
# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE require 'aws-sdk-core' require 'aws-sigv4' require_relative 'aws-sdk-codestar/types' require_relative 'aws-sdk-...
24.375
80
0.74359
11437f8192e655b19edee4237422ced1fdfe139e
1,325
module SessionsHelper # 渡されたユーザーでログインする def log_in(user) session[:user_id] = user.id end # ユーザーのセッションを永続的にする def remember(user) user.remember cookies.permanent.signed[:user_id] = user.id cookies.permanent[:remember_token] = user.remember_token end # 現在ログインしているユーザーを返す (いる場合) def current...
22.457627
62
0.669434
edaf27b6ea37d3cffc0b0ecf185d34534af329b5
5,413
class Admin::AttachmentsController < Admin::BaseController before_action :limit_attachable_access, if: :attachable_is_an_edition? before_action :check_attachable_allows_attachment_type before_action :forbid_editing_of_locked_documents, if: :attachable_is_an_edition? rescue_from Mysql2::Error, with: :handle_dup...
26.665025
119
0.739701
39bf8598f045ee72bb2927bee744c6c51f25422d
501
# frozen_string_literal: true class Profile < ApplicationRecord belongs_to :user, inverse_of: :profile after_initialize :remove_at_from_twitter_username validates :github_username, format: { with: /\A([a-z0-9-]+-)*[a-z0-9]+\Z/i, allow_blank: true } validates :twitter_username, format: { with: /\A@?\w{1,15}\Z...
29.470588
97
0.724551
264dd475fc0ad054e9a1be057c64b493e50fafd5
1,783
class Nanopolish < Formula # cite Loman_2015: "https://doi.org/10.1038/nmeth.3444" desc "Signal-level algorithms for MinION data" homepage "https://github.com/jts/nanopolish" url "https://github.com/jts/nanopolish.git", tag: "v0.12.0", revision: "6a1333c0106e0969a13ed8fc40153c18e8da4790" lice...
35.66
107
0.710039
bb8977b963b9b5c1c55ec392f84289e163160947
220
# frozen-string-literal: true # Simple controller for showing the changelog class ChangelogController < ApplicationController def index @view_state = LanguageState.new(UserLanguageSelection.new(params)) end end
24.444444
70
0.8
1db735ef026e4af1845585f0b2203a74a703ae59
1,875
require 'shouty' DEFAULT_RANGE = 100 Before do @people = {} @network = Shouty::Network.new(DEFAULT_RANGE) @messages_shouted_by = Hash.new([]) end Given "the range is {int}" do |range| @network = Shouty::Network.new(range) end Given "a person named {word}" do |name| @people[name] = Shouty::Person.new(@netw...
25.684932
89
0.713067
6abc6d409f81ac8bc0027d303095956b967b3ba0
2,177
module Spree class Promotion module Actions class CreateAdjustment < PromotionAction include Spree::CalculatedAdjustments include Spree::AdjustmentSource has_many :adjustments, as: :source delegate :eligible?, to: :promotion before_validation :ensure_action_has_cal...
34.555556
97
0.631603
bf358ff08085a18c0c46f597a0e62fd68b2864da
1,741
require "restforce" require "active_force" require "openstax/salesforce/active_force" require "openstax/salesforce/engine" require "openstax/salesforce/client" require "openstax/salesforce/remote/term_year" require "openstax/salesforce/remote/book" require "openstax/salesforce/remote/school" require "openstax/salesf...
31.089286
96
0.750144
e9d549168a42e08c21b6c60cc40d147bc0291340
3,902
module ApplicationHelper # # The OmniAuth path for the given +provider+. # # @param [String, Symbol] provider # def auth_path(provider) "/auth/#{provider}" end # # Returns a possessive version of the string # # @param name [String] # # @return [String] # def posessivize(name) retu...
28.071942
140
0.591748
870e5fdfe24992f8cea6c3925417bcdcfecc04ba
5,064
## # 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 = NormalRanking include Msf::Exploit::Remote::HttpServer::HTML #include Msf::Exploit::Remote::BrowserAut...
31.849057
126
0.583728
7a8f09ceacba133aec244efa0d3c43f8ada60813
7,932
# frozen_string_literal: true # Copyright (c) 2017-present, BigCommerce Pty. Ltd. All rights reserved # # 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 l...
32.11336
120
0.675744
d5f3f9bb659b2945a485841398a980ee2d105ada
18,369
require 'rails_helper' RSpec.describe ActiveAdmin::Filters::ViewHelper do # Setup an ActionView::Base object which can be used for # generating the form for. let(:helpers) do view = action_view def view.collection_path "/posts" end def view.protect_against_forgery? false end ...
36.591633
127
0.652676
bb0eeb5d5014d8db6c5ccfa59f301c869ec06ed0
483
module Specifier # Configures a definition (used for let statements). # # Usage: # # definition = Specifier::Definition.new("...") do # # ... # end # # definition.define(object) # class Definition def initialize(name, &block) @name = name @memoizer = Memoizer.new(&block...
16.655172
54
0.592133
e9b39a5c917d7eb8a5978458dff5ab35d08a77bb
799
#!/usr/bin/env ruby require 'librets' require 'pp' include Librets begin session = RetsSession.new("http://demo.crt.realtors.org:6103/rets/login") puts "Logging into #{session.login_url}" if !session.login("Joe", "Schmoe") puts "Invalid login" exit 1 end puts "Member name: " + sess...
23.5
77
0.669587
edbc53eb731052f1c3c47ff92b9678b59677508a
137
class AddIsAdminToUsers < ActiveRecord::Migration[5.1] def change add_column :users, :is_admin, :boolean, default: false end end
22.833333
58
0.744526
bb3429586e47dcc2b9e2f1f3cfc7e8d87ea37bf5
1,150
name 'jira' maintainer 'KLM Royal Dutch Airlines' maintainer_email 'martijn.vanderkleijn@klm.com' license 'Apache 2.0' description 'Installs/Configures Atlassian JIRA.' version '10.0.4' source_url 'https://github.com/afklm/jira' issues_url 'https://github.com/afklm/jira/issues' recipe 'jira', 'Installs/configures Atla...
37.096774
97
0.769565
1d880292672da3a27ee8f86ecee73007cd40ecbd
29,939
require "minitest/autorun" require "testutil" require "openid/consumer/associationmanager" require "openid/association" require "openid/dh" require "openid/util" require "openid/cryptutil" require "openid/message" require "openid/protocolerror" require "openid/store/memory" require "util" require "time" module OpenID ...
32.684498
79
0.613848
aca15b093eb7a17c8dbc83628c036a9f18bf3dfc
4,579
# frozen_string_literal: true require 'rails_helper' require 'pdf_info' describe PdfInfo::Metadata do let(:result) do <<~STDOUT Title: Subject: Author: Creator: Producer: CreationDate: Tagged: no UserProperties: no Suspects: no Form: ...
27.920732
117
0.566499
21e6f4030fa54124f27a2bca0345c6e68e4e3a8f
18,119
# Copyright 2017 Masaki Hara. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your # option. This fil...
34.446768
105
0.569789
11132617cf11a7442ee5cb0c6215c5cce6af540f
1,719
# coding: utf-8 # frozen_string_literal: true lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'handshaker/version' Gem::Specification.new do |spec| spec.name = 'handshaker' spec.version = Handshaker::VERSION spec.authors = ['Alessan...
40.928571
120
0.696335
e9f463f19914d4659f94ded395a4f03d221a5d10
105
module ActiveAdmin module Xls # ActiveAdmin XLS gem version VERSION = '2.0.3'.freeze end end
15
33
0.685714
e84a386d315ceac1b3a28a8448ed34f3f3976874
10,468
class ProjectsController < ApplicationController before_action :set_project, only: [:show, :edit, :update, :destroy] before_action :set_project_for_team, only: [:team, :add_team_member, :remove_team_member] before_action :check_project_view_active, only: [:index, :search, :public] before_action :check_project_c...
38.485294
223
0.668514
28c96ec71f706b4ccf95de3017462ba0bc4cd5b3
250
module OregonDigital::ControlledVocabularies class License < ActiveFedora::Rdf::Resource include OregonDigital::RDF::Controlled configure :rdf_label => RDF::DC11.title use_vocabulary :cclicenses use_vocabulary :ccpublic end end
22.727273
45
0.764
e2343f19063dae6c75418fd2aeeffe5be6799622
656
require 'rails_helper' RSpec.describe Admin::DashboardsAttributesController, type: :controller do let(:user) { FactoryBot.create(:user) } before { sign_in user } describe 'POST create' do let(:dashboards_attribute_group) { FactoryBot.create(:api_v3_dashboards_attribute_group) } let(:valid_attr...
29.818182
98
0.734756
f8d528ff9919144df6fda1f75114466f029266b2
2,132
class QualificationsController < ApplicationController before_action :set_qualification, only: [:show, :edit, :update, :destroy] # GET /qualifications # GET /qualifications.json def index @qualifications = Qualification.all end # GET /qualifications/1 # GET /qualifications/1.json def show end ...
28.426667
105
0.698405
4a542132e9ee7cab3b1465c08bd2f63a85fd671b
1,333
# # a language data file for Ruby/CLDR # # Generated by: CLDR::Generator # # CLDR version: 1.3 # # Original file name: common/main/uz_Cyrl.xml # Original file revision: 1.4 $ # # Copyright (C) 2006 Masao Mutoh # # This file is distributed under the same license as the Ruby/CLDR. # private def init_data @hourfo...
27.204082
217
0.72168
876539130d4a4cc98323fa5e9d01d45aef9b135e
760
require 'test_helper' module CryptoProviderTest class Sha1Test < ActiveSupport::TestCase def test_encrypt assert Authlogic::CryptoProviders::Sha1.encrypt("mypass") end def test_matches hash = Authlogic::CryptoProviders::Sha1.encrypt("mypass") assert Authlogic::CryptoProviders::Sha1...
33.043478
88
0.726316
38872cc4cea07cd85265b1a7fdd20bef8267e8af
12,162
# encoding: utf-8 # # Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "Li...
38.85623
128
0.624322
f7c9f955b1800537967996f9c1decba3ac760c80
179
# Bullshit fix for 1.8.7 begin require 'rubygems' rescue LoadError # oh well! end require 'nice-sigint' module LicenseGenerator autoload :App, "license-generator/app" end
13.769231
40
0.743017
4a976ea318268183a38055ece8ef08e975ae3079
1,413
require 'clockwork' require 'cloud_controller/clock/distributed_scheduler' module VCAP::CloudController class Clock FREQUENT_FUDGE_FACTOR = 1.second.freeze DAILY_FUDGE_FACTOR = 1.minute.freeze HIGH_PRIORITY = 0 MEDIUM_PRIORITY = 1 LOW_PRIORITY = 100 def schedule_daily_job(name:, at:...
22.790323
72
0.607219
7a5b87f7aa2116ab6e43752fa29c79daac859908
403
require 'json' require 'warden' require 'octokit' require 'warden/github/sso' require 'warden/github/user' require 'warden/github/oauth' require 'warden/github/version' require 'warden/github/strategy' require 'warden/github/hook' require 'warden/github/config' require 'warden/github/membership_cache' require 'warden/...
23.705882
41
0.808933
3352336acda41dbb7885cc98c8c304536e54477e
295
namespace :security do task :brakeman do sh "brakeman -q -z --report-direct" end task :rails_best_practices do path = File.expand_path("../../../", __FILE__) sh "rails_best_practices #{path}" end end task :security => ['security:brakeman', 'security:rails_best_practices']
22.692308
72
0.681356
bb9e23e3a9a8ced32ac302c285625bd2da20ac1d
927
# Define/extend global data type classes to provide data validation methods # specific to/for the DataValidator module require 'log_wrapper' require 'data_validator/validation_result' require 'data_validator/classes/base' class IntegerOrNull include LogWrapper extend DataValidator::Base def self.builder in...
21.55814
75
0.636462
f7c0549a53dc4843c6d74c0e7ebe51bf37d9953a
2,345
# Copyright (c) 2009-2012 VMware, Inc. require 'spec_helper' describe Bosh::AwsCloud::Cloud do let(:volume) { double(AWS::EC2::Volume, id: 'v-foo') } let(:cloud) do mock_cloud do |ec2| allow(ec2.volumes).to receive(:[]).with('v-foo').and_return(volume) end end before do allow(Bosh::AwsCloud...
32.123288
106
0.690405
6a24186d26db425917af759f5dc4cb4c2097c01d
80
module RspecInit class MisteryModel def self.where(params); end end end
13.333333
31
0.7375
b94344b1f7507164b090daba9990e930cf1dbcac
62
json.partial! "admin/locations/location", location: @location
31
61
0.790323
382dc378d491889bd929a9f867cf1d445792c9e2
1,807
module ShoppingCart class Order < ActiveRecord::Base include AASM aasm column: :state do state :in_progress, initial: true state :in_queue state :in_delivery state :delivered state :canceled event :queue do transitions from: :in_progress, to: :in_queue end ...
23.467532
70
0.634754
b977c1ee55e7bf3e53cc8d6c1385a81bfff441f5
19,942
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details. require 'mongo' require 'newrelic_rpm' require 'new_relic/agent/datastores/mongo' require 'helpers/mongo_metric_builder' if NewRelic::Agent::Datas...
34.205832
114
0.581787
f76427ef4a540baaddf70e5856254a278fe80f71
15,092
# frozen_string_literal: true require 'yaml' require 'open3' require 'json' module PuppetlabsSpecHelper; end module PuppetlabsSpecHelper::Tasks; end module PuppetlabsSpecHelper::Tasks::FixtureHelpers # This is a helper for the self-symlink entry of fixtures.yml def source_dir Dir.pwd end # @return [Stri...
32.596112
186
0.639279
edeceb7db5862821793bad0ed8634b35132b5640
210
require 'spec_helper' describe RedisMirroring do it 'has a version number' do expect(RedisMirroring::VERSION).not_to be nil end it 'does something useful' do expect(false).to eq(true) end end
17.5
49
0.72381
085aacbaeb99195eba7d5d04a6b8338d86cc233e
784
cask 'unity@2018.1.0b4' do version '2018.1.0b4,003615bcffde' sha256 :no_check url "http://beta.unity3d.com/download/003615bcffde/MacEditorInstaller/Unity.pkg" name 'Unity 2018.1.0b4' homepage 'https://unity3d.com/unity/' pkg 'Unity.pkg' preflight do if File.exist? "/Applications/Unity" File...
26.133333
82
0.683673
28b4c3dcdff32bb2ded8333b71b22f422c945452
196
#!/usr/bin/env ruby # by Andronik Ordian def gcd(a, b) # fix me a * b end def lcm(a, b) # fix me a * b end if __FILE__ == $0 a, b = gets.split().map(&:to_i) puts "#{lcm(a, b)}" end
10.888889
33
0.540816
1893111dd51287a81096c403cb78d97067cc51c6
2,543
=begin The MIT License Copyright (c) 2010 Adam Kapelner and Dana Chandler 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 to use, copy...
37.955224
104
0.788832
610e4116ebe3cce6e2093b45f46d9bdb5d083c8d
873
module Antlr4::Runtime class Triple attr_accessor :a attr_accessor :b attr_accessor :c def initialize(a, b, c) @a = a @b = b @c = c end def eql?(obj) if obj == self return true else return false unless obj.is_a? Triple end ObjectEqua...
21.292683
185
0.557847
ac9a1883f97edb2970d30d0a0a9f1be264425d30
12,150
# base experiment configuration # TrailGuide::Experiment.configure do |config| # the default algorithm to use for new experiments config.algorithm = :distributed # whether or not experiments must be started manually # # true experiments must be started manually via the admin UI or console # false expe...
44.505495
118
0.728724