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
0878294a41e13cd39a1dcc1888eab490a8c9150a
52
class UsersController < Restafarian::Controller end
17.333333
47
0.846154
4a5b4df412bbf6521a9abe2269dd74ae14e05796
423,348
# Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
42.848988
151
0.635591
b91b2d7d36917443ab883c0f4866758305564216
586
module Braspag # Merchant identification on Braspag # # @attr [String] merchant_id the merchant identification number # @attr [String] merchant_key the merchant identification key class Merchant attr_accessor :merchant_id, :merchant_key # @param merchant_id [St...
32.555556
72
0.665529
33aab1f20de812ca23ad3cec01bda49216c8fa58
1,894
# gitlab.rb #external_url 'http://swarm.local/gitlab' external_url 'http://swarm.local' # Disable e-mail gitlab_rails['gitlab_email_enabled'] = false # Reduce the amount of logs logging['svlogd_size'] = 2 * 1024 * 1024 # rotate after 2 MB of log data logging['svlogd_num'] = 3 # keep 3 rotated log file...
32.655172
72
0.710665
3879bf6cedbc3e98ab14826c2f8daabda21143d1
293
# frozen_string_literal: true if RUBY_VERSION >= '2.5.0' require 'simplecov' SimpleCov.start do add_filter '/test/' enable_coverage :branch end end $LOAD_PATH.unshift File.expand_path('../lib', __dir__) require 'u-struct' require 'minitest/pride' require 'minitest/autorun'
16.277778
54
0.723549
6a6d53533eca9fff65a90e3cf5462c5a63562d99
372
class SitemapController < ApplicationController self.view_paths = Mephisto::Plugin.view_paths[:sitemap] session :off helper :sitemap layout nil def index headers['Content-Type'] = 'text/xml; charset=utf-8' @plugin = Mephisto::Plugin[:sitemap] @sections = site.sections(true) @last_article ...
26.571429
59
0.706989
e93b747b0f204473e8a31964db6a7b3940c8c177
5,036
require 'spec_helper' require 'time' require 'elasticsearch-transport' require 'faraday' require 'ddtrace' RSpec.describe 'Elasticsearch::Transport::Client tracing' do before(:each) do WebMock.enable! WebMock.disable_net_connect! end after(:each) do WebMock.allow_net_connect! WebMock.reset! ...
31.873418
102
0.599484
79a7ec744a16ed70cf85ce02cc2c52ec5bfeea30
491
cask "twine" do version "2.3.9" sha256 "b6afb15ff3f496f88a42e2f268d11875df4d206376cc851f3911bd41ddc58ec5" # github.com/klembot/twinejs/ was verified as official when first introduced to the cask url "https://github.com/klembot/twinejs/releases/download/#{version}/twine_#{version}_macos.dmg" appcast "https://...
35.071429
98
0.767821
f8a3c36bf541e916885c1342a12bef62330504da
998
cask :v1 => 'switchresx' do version '4.5.1' sha256 'b4995cb72046cc2d0ef47d81ec885ca8bc32e52fe80f5bd50f561cb00c06b212' url "http://www.madrau.com/data/switchresx/SwitchResX#{version.to_i}.zip" name 'SwitchResX' homepage 'http://www.madrau.com' license :unknown # todo: change license and remove this comme...
39.92
115
0.556112
62f5b33e8c230624fcb84aa50dd3296c7b4cb6d8
188
# frozen_string_literal: true Rails.application.routes.draw do resources :posts # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html end
31.333333
101
0.792553
b91043b7c4b30dfd0c2b0ca6fdabe49e475f02c9
2,017
# Author:: Xabier de Zuazo (<xabier@onddo.com>) # Copyright:: Copyright 2013-2016, Onddo Labs, SL. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License a...
33.065574
109
0.647992
e8a6ebcd126a64cf2a177238bc7f48ecb8e8d03f
15,205
# frozen_string_literal: true require 'spec_helper' describe Bitcoin::Builder do let(:keys) { Array.new(5) { Bitcoin::Key.generate } } let(:target) { '00'.ljust(64, 'f') } let(:genesis_block) { create_block('00' * 32, false) } let(:block) { create_block(genesis_block.hash, false, [], keys[0]) } before { Bi...
27.54529
94
0.601381
e2f3970e4d6b202b12c6f596bc2a81af121df702
33,023
# Copyright 2018 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 applicable law or agreed to in writing, ...
33.255791
168
0.557399
aba17c7ca30134b777821d931ccfc92acbba5e23
657
cask 'syncovery' do version '8.18e' sha256 '20211e88ebd073186939f8b04eb426fd41ad8687a57809b89394de96f265f9a8' url "https://www.syncovery.com/release/SyncoveryMac#{version}.dmg" name 'Syncovery' homepage 'https://www.syncovery.com/' pkg 'SyncoveryMac (double-click to install).pkg' uninstall pkgutil: 'co...
31.285714
76
0.668189
6251f0b399eadf766bd6168707bfe4ea647ea626
920
# 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...
36.8
75
0.76087
ff3f714b00f2147adce280e1385b793d206b75e3
164
# frozen_string_literal: true class AddParentIdToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :parent_id, :integer, limit: 8 end end
20.5
55
0.75
1885b293fb42e8db11e950c9dbf6ba891db261ae
621
require 'quickeebooks/online/service/service_base' require 'quickeebooks/online/model/payment' require 'quickeebooks/online/model/payment_header' require 'quickeebooks/online/model/payment_line_item' require 'quickeebooks/online/model/payment_detail' require 'quickeebooks/online/model/credit_card' require 'quickeebooks...
29.571429
58
0.813205
8754853ac855a665d73f4e2f8d217b3f39e70776
211
# frozen_string_literal: true class ResultsFileNotifierPreview < ActionMailer::Preview def file_uploaded file = StoredFile.sample_result.last ResultsFileNotifierMailer.file_uploaded(file) end end
19.181818
56
0.805687
d52b946a3e090e9f853fdcd0653f4eae06056b88
223
Rails.application.routes.draw do # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html namespace :api do namespace :v1 do resources :videos end end end
22.3
102
0.713004
6273fa94da8608396bd1d6b70441988a1b702a0b
1,651
require 'rails_helper' module Toker RSpec.describe Token, type: :model do let(:expires_at) { 1.year.from_now } let(:user) { FactoryGirl.create(:user) } subject { FactoryGirl.create(:token, user: user, expires_at: expires_at) } describe 'payload' do it 'includes token_id and exp' do ...
23.927536
78
0.59782
3992c0f8f43903345da76cfc25ac429a0fc2cf9a
1,293
require 'spec_helper' describe Spree::Preferences::Store do before :each do @store = Spree::Preferences::StoreInstance.new end it "sets and gets a key" do @store.set :test, 1 @store.exist?(:test).should be true @store.get(:test).should eq 1 end it "can set and get false values when cache re...
27.510638
86
0.688322
4a060f15fba824fbd29facafd16a2df2b06836c2
2,935
class SnipsInjection < Formula desc "Snips Words Injection" homepage "https://snips.ai" url "ssh://git@github.com/snipsco/snips-platform.git", :using => :git, :tag => "0.64.0", :revision => "6df6a46d5ccfb312163c60a0ce2b3b90d8136b54" head "ssh://git@github.com/snipsco/snips-platform.git", :using => :gi...
32.611111
106
0.646337
7aa714f18e07b5770fde26b1f230621f062b4af9
303
require 'rails_helper' RSpec.describe Incident::StudentDuty, type: :model do # Validations it { should validate_presence_of :item } # Columns it { should have_db_column :id } it { should have_db_column :item } # === Relations === it { should have_and_belong_to_many(:incidents) } end
21.642857
53
0.706271
919dd48b527fb373209e7af68e194b032f886dcd
2,690
class Minio < Formula desc "Amazon S3 compatible object storage server" homepage "https://github.com/minio/minio" url "https://github.com/minio/minio.git", :tag => "RELEASE.2019-10-02T21-19-38Z", :revision => "90bfa6260a8ac83199d522ed4c8fe1097dbd5153" version "20191002211938" bottle do c...
30.224719
108
0.586989
035cfe2336c4fd94c1970596e2587017f26cc035
1,191
# frozen_string_literal: true require "logger" require "sw/logger/version" require "sw/log_formatter/simple_formatter" require "sw/log_formatter/json_formatter" require "sw/log_formatter/default_formatter" module Sw def self.logger(*args) Sw::Logger.new(*args) end def self.json_logger(*args) Sw::Logger...
22.903846
80
0.685139
e22d6a8f9df04a7f81d15b795c8c6476b7d49f57
855
# frozen_string_literal: true lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require_relative 'lib/himekuri_rs/version' Gem::Specification.new do |spec| spec.name = 'himekuri_rs' spec.version = HimekuriRs::VERSION spec.authors = ['Takayuki Ka...
34.2
85
0.65848
03f01974725ed3c0660285a3ad8f182616318fd4
326
# frozen_string_literal: true describe Grape::Exceptions::InvalidFormatter do describe '#message' do let(:error) do described_class.new(String, 'xml') end it 'contains the problem in the message' do expect(error.message).to include( 'cannot convert String to xml' ) end en...
20.375
47
0.665644
e927f9109fd9f99ab6074124d8f1c4df97cb8d5f
4,817
require_relative '../puppet/application' require_relative '../puppet/error' require_relative '../puppet/util/at_fork' require 'timeout' # A general class for triggering a run of another # class. class Puppet::Agent require_relative 'agent/locker' include Puppet::Agent::Locker require_relative 'agent/disabler' ...
34.163121
225
0.658501
e8b39aebf381e26cf028fb4efb68f6721aba492f
1,176
# desc "Explaining what the task does" namespace :herd do task reset: :environment do Herd::Asset.destroy_all Herd::Transform.destroy_all FileUtils.rm_rf File.join(Rails.root, 'public', 'uploads', Rails.env) end desc "Remove public/assets folder" task :cleanup do FileUtils.rm_rf File.join(Rail...
26.727273
92
0.680272
87f80e0f55ca23065dc23170dfcf0aa87125019a
4,856
# Copyright © 2011-2020 MUSC Foundation for Research Development~ # All rights reserved.~ # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:~ # 1. Redistributions of source code must retain the above copyright notice, this l...
44.962963
146
0.713344
26daeced0287b359cdab0b222efcc7fb9a9ce786
338
require 'ruby_xml_nfe/icms00' module RubyXmlNfe class Icms attr_reader :xml, :icms00_params def initialize(xml, params) @xml = xml @icms00_params = params[:ICMS00] end def build xml.ICMS do icms00 = RubyXmlNfe::Icms00.new(xml, icms00_params) icms00.build end ...
16.9
59
0.633136
9154c0a3e70834e967d4d6edfd6319d78e229b68
5,743
# 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::ServiceFabric::V7_0_0_42 module Models # # A record of the times when the repair task entered each state. # # This type supp...
33.584795
78
0.55128
1a4369d5971f94907bc99695f7ecba5a1e4d4dd3
416
require 'ransack/adapters/active_record/base' ActiveRecord::Base.extend Ransack::Adapters::ActiveRecord::Base case ActiveRecord::VERSION::STRING when /^3\.0\./ require 'ransack/adapters/active_record/3.0/context' when /^3\.1\./ require 'ransack/adapters/active_record/3.1/context' when /^3\.2\./ require 'ransack/...
29.714286
63
0.769231
79742b0560d061fb73bf12cbfdd423fedcd2f697
2,333
require 'spec_helper' describe 'Puppet::Type::Group::Provider::Aix' do let(:provider_class) { Puppet::Type.type(:group).provider(:aix) } let(:resource) do Puppet::Type.type(:group).new( :name => 'test_aix_user', :ensure => :present ) end let(:provider) do provider_class.new(resource)...
25.637363
101
0.618517
6a4a35bb20e3bf141373f3d9b36c66ad991d1feb
8,751
require 'fastlane_core' require 'credentials_manager' module Sigh class Options def self.available_options user = CredentialsManager::AppfileConfig.try_fetch_value(:apple_dev_portal_id) user ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id) [ FastlaneCore::ConfigItem.new...
67.837209
202
0.44852
e83ea73f766a11faeb0b4d4b820d522c03007127
631
require 'formula' class Jetty76 < Formula homepage 'http://www.eclipse.org/jetty/' url 'http://download.eclipse.org/jetty/stable-7/dist/jetty-distribution-7.6.9.v20130131.tar.gz' version '7.6.9' sha1 '2aaad044f9fd049cf3795268f209297911c64e53' def install rm_rf Dir['bin/*.{cmd,bat]}'] libexec.instal...
23.37037
97
0.62599
61832bb960d6810ce24820b86b80d4d979ce2f50
3,764
require 'spec_helper' describe ApnClient::Connection do describe "#initialize" do it "opens an SSL connection given host, port, certificate, and certificate_passphrase" do if certificate_exists? connection = ApnClient::Connection.new(valid_config) connection.config.should == valid_config_wi...
32.17094
93
0.684378
6179e2903b618a89f1ac937d80aec544ed075c0c
2,089
module Intrigue module Issue class VulnApacheStrutsJakartaParser20175638 < BaseIssue def self.generate(instance_details={}) { name: "apache_struts_jakarta_parser", pretty_name: "Vulnerable Apache Struts Jakarta Parser (CVE-2017-5638)", identifiers: [ { type: "CVE", name: "CVE-2017-5638"...
56.459459
414
0.696984
62ed68d708a088a29b8aa44546bffa5a83739834
1,130
RSpec.describe Section, type: :model do it { is_expected.to belong_to(:journey) } describe "validations" do it { is_expected.to validate_presence_of(:title) } it { is_expected.to validate_presence_of(:contentful_id) } end describe "default_order" do it "orders by order ASC" do oldest_section...
28.974359
69
0.680531
914d7011aa3b1e09cdd5b7e3a634c19a7fd68832
826
require_relative 'rule_definition' class RuleRegistry attr_reader :rules def initialize @rules = [] end def definition(id:, type:, message:) rule_definition = RuleDefinition.new(id: id, type: type, ...
18.772727
75
0.578692
916c22a2f5269a831298bcc7d587c2feca47aaf7
25
get '/', to: 'site#main'
12.5
24
0.52
bf4da029e73aa0152d2be864f961833add2ead78
493
module BetfairNg # Declares the module for API interactions # module API # Declares the module for Data types # module DataTypes # Declares TimeRange # # TimeRange # # == Fields # - from # - to # class TimeRange < Base # from, format: ISO 8601) # @!attribute [w] ...
13.694444
44
0.56998
08308486681606a6fa3bb68801b615d56a84f95d
351
Gem::Specification.new do |s| s.name = 'dynamic_form' s.version = '1.0.0' s.author = 'David Heinemeier Hansson' s.email = 'david@loudthinking.com' s.summary = 'Deprecated dynamic form helpers: input, form, error_messages_for, error_messages_on' s.add_dependency('rails', '6.1.3') s.files = Dir['lib/**/*'...
27
99
0.680912
62ed67f385eb9b48e1cccacf4560ad63a88a13da
1,132
module Bsl class Mapper def initialize(booking_request) @booking_request = booking_request end def call # rubocop:disable MethodLength, AbcSize { first_name: booking_request.first_name, last_name: booking_request.last_name, email: booking_request.email, phone: ...
34.30303
95
0.742933
5d3fe38ab6ec3b9cb175cb8863a5112f5200fb6d
462
describe Line::Message::Base do describe '.subclasses' do it 'returns an array of the subclasses' do arr = [ Line::Message::Audio, Line::Message::Contact, Line::Message::Image, Line::Message::Location, Line::Message::RichMessage, Line::Message::Sticker, ...
25.666667
63
0.599567
1812d0b0700cd54756123e3aa90517cb791670b7
1,074
# 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::V2018_04_01 module Models # # Input values. # class OperationInputs include MsRestAzure # @return [String] The nam...
23.347826
70
0.531657
26daaa07088c77707512f4bfe49c10a734d058c6
13,636
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmat...
49.05036
154
0.751247
ed6e26b9f67a9982538d08f619aa110463f9c367
2,726
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. # It is recommended to regenerate this file in the future when you upgrade to a # newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*...
43.967742
113
0.76339
abf42625c696dc707f99073b26996d9348ce7967
22,636
# == Schema Information # # Table name: people # # id :integer not null, primary key # first_name :string(255) # last_name :string(255) # display_name :string(255) # email :string(255) not null # created_at :datetime not null ...
33.937031
265
0.700477
336d32ebfd2398ac25931dfb5f40389bd5a18b40
3,067
# frozen_string_literal: true module Homebrew module Livecheck module Strategy # The `Sourceforge` strategy identifies versions of software at # sourceforge.net by checking a project's RSS feed. # # SourceForge URLs take a few different formats: # * https://downloads.sourceforge.net...
42.597222
102
0.633192
5d463625bbb2b3cd24489cda9efa84c37695225a
130
class AddFieldToContracts < ActiveRecord::Migration[4.2] def change add_reference :contracts, :agent, index: true end end
21.666667
56
0.753846
b9ce2a37160fe0137f94ea734626b3055cfd673e
632
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe '#chart' do before { init_lastfm } it 'should return an instance of Lastfm::Chart' do @lastfm.chart.should be_an_instance_of(Lastfm::MethodCategory::Chart) end describe '#get_hyped_artists' do it 'should get hyped artists' ...
28.727273
79
0.683544
e277c13bd50a601f4dfccdb6808546a5246c97c5
5,329
%w'bigdecimal bigdecimal/util date enumerator thread time uri yaml'.each do |f| require f end %w"core_ext sql core_sql connection_pool exceptions pretty_table dataset migration schema database object_graph".each do |f| require "sequel_core/#{f}" end # Top level module for Sequel # # There are some class methods ...
38.89781
108
0.704635
acb5d9f39d7ac0a725990d5c69ae7f98b1f4bc92
3,961
class ProteinSequenceAnnotationStanza < TogoStanza::Stanza::Base property :sequence_annotations do |tax_id, gene_id| annotations = query("http://sparql-app.togogenome.org/sparql", <<-SPARQL.strip_heredoc) DEFINE sql:select-option "order" PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ...
38.456311
184
0.630144
21c47b53a0712f503cb92b98b56c1dc1e426451c
1,556
class Pnpm < Formula require "language/node" desc "📦🚀 Fast, disk space efficient package manager" homepage "https://pnpm.io/" url "https://registry.npmjs.org/pnpm/-/pnpm-6.32.2.tgz" sha256 "db76fda0fc0bae5a22652504129a0356edd8aa6e0bebb67a33d941de87bf1684" license "MIT" livecheck do url "https://re...
40.947368
123
0.758997
4a66bb45283e8b97d7c2a438c6c3fc8f4e3bf554
13,129
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmat...
49.357143
154
0.75139
62058ded418890219f36bb959c63bcba56a31d23
179
Rails.application.routes.draw do root 'cards#index' resources :cards # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html end
29.833333
102
0.776536
18d4a7074d567952fbc502e7307b9e9e53042fc8
15,339
require 'yaml' require 'restclient' require 'fileutils' require 'rake' require 'mspec' # push type: Rhoconnect Push Service (rhoconnect_push) | Google Cloud Messaging (gcm) # push_type = MSpec.retrieve(:push_type) # push_type = ((ARGV[1].nil?) ? "rhoconnect_push" : ARGV[1]) #unless push_type push_type = ENV['PUSH_TYP...
35.672093
181
0.646587
38eaf0326e1a23d31fb99fe96631bb4761672ea5
1,931
# 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::Customvisionprediction::V2_0 module Models # # Model object. # # class BoundingBox include MsR...
23.839506
70
0.456758
bbaa461419f5607c04166aff65c788fae7f74c64
1,473
module OpenIDTokenProxy class Token module Authentication extend ActiveSupport::Concern included do rescue_from OpenIDTokenProxy::Error, with: :require_authorization helper_method :current_token, :raw_token end module ClassMethods def require_valid_token(*args) ...
25.842105
83
0.65852
7a6ac5af6cb399527309d6173e9a30df0e618ace
617
class Flyway < Formula desc "Database version control to control migrations" homepage "https://flywaydb.org/" url "https://search.maven.org/remotecontent?filepath=org/flywaydb/flyway-commandline/6.3.2/flyway-commandline-6.3.2.tar.gz" sha256 "d81c8d428109e5327d110ba0f4f34d5dcb019f037035f26388fac26bffc161ab" b...
29.380952
125
0.730956
bbeab2de9e45b29c49781a0c38fc722b93ad1436
853
require 'time' module Serverspec::Type class X509PrivateKey < Base def valid? runner_res = @runner.run_command("echo | openssl rsa -in #{name} -check -noout -passin #{@options[:passin] || "stdin"}") ( runner_res.exit_status == 0 && runner_res.stdout.chomp == 'RSA key ok' ) && (!@options.has_key?(:pas...
40.619048
130
0.631887
79eaa6112ca2425ce7d69148c4eeb6431c67274e
224
Rails.application.routes.draw do resources :stocks do collection { post :import } end devise_for :users root to: 'stocks#index' get 'analytics', to: 'pages#analytics' get 'settings', to: 'pages#settings' end
22.4
40
0.700893
873fa9dac3cc73a26fba04822f7a0cc10950ef03
221
require 'rails_helper' RSpec.describe "Pages", type: :request do describe "GET /home" do it "returns http success" do get "/pages/home" expect(response).to have_http_status(:success) end end end
18.416667
52
0.674208
e2062d393cae957f33af98b00071afae311f8acd
1,511
# frozen_string_literal: true require 'capybara/rails' require 'capybara/rspec' require 'webdrivers' # default capybara/selenium configuration # https://github.com/itmammoth/capybara-bootstrap/blob/master/scrape.rb # https://thoughtbot.com/blog/headless-feature-specs-with-chrome # run as headless mode with set window...
39.763158
120
0.783587
21449af1dcc80ac9b4a685072544446b1c8bf1e9
1,138
# # Copyright 2012 Wade Alcorn wade@bindshell.net # # 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 applica...
30.756757
94
0.66696
188da471d2b27f0d5362bb375b123c4ed544db71
252
module Connect class AuthorizationRequestObject < ActiveRecord::Base belongs_to :authorization belongs_to :request_object include Join validates :authorization, presence: true validates :request_object, presence: true end end
22.909091
55
0.765873
39e46d612dfcf5e1452ab9ec8ed1c13831fc9ba1
460
def fix_dup_balances(u) u.account_lists.each(&method(:fix_dup_balance)) end def fix_dup_balance(a) balance_to_account = {} a.designation_accounts.order("CASE WHEN name LIKE '% and %' THEN 0 ELSE 1 END") .order(created_at: :desc).each do |da| next unless da.balance.present? if balance_to_account[da.bal...
25.555556
81
0.704348
7945e5b71eeee5ebaee4b28a1f6dab312d509daf
7,837
# line 1 "coordinate.rl" # coordinate.rl module Mvnizer class CoordinateLexer # line 33 "coordinate.rl" def initialize @group_found = false # line 18 "coordinate.rb" class << self attr_accessor :_coordinate_lexer_actions private :_coordinate_lexer_actions, :_coordinate_lexer_actions= end se...
20.355844
86
0.681894
6138036b0af59f3e650620ca6caa5442ad9533a8
68,630
# frozen_string_literal: true require 'spec_helper' describe API::Runner, :clean_gitlab_redis_shared_state do include StubGitlabCalls include RedisHelpers include WorkhorseHelpers let(:registration_token) { 'abcdefg123456' } before do stub_feature_flags(ci_enable_live_trace: true) stub_gitlab_call...
35.95076
154
0.555311
bb9874d64d9c7b03ff1dc03a6862b610f9f89fd3
2,168
require "spec_helper" require "cc/engine/analyzers/file_thread_pool" RSpec.describe CC::Engine::Analyzers::FileThreadPool do describe "#run" do let(:thread) { Thread.new {} } it "uses default count of threads when concurrency is not specified" do allow(Thread).to receive(:new).and_return(thread) ...
27.443038
77
0.663284
38111ad7068c0020a3ee3ea56f5d38db6287b067
2,849
# 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...
40.7
95
0.732538
ffcec183825afd0c4dd974e04de01752bc77062b
1,178
# -*- encoding : utf-8 -*- # Public: This is a simple matcher for matching text in the handler of a delayed job, # this is good enough in most cases to detect if a particuluar job was queued # # expected_job_text - Name of method or custom job handled asyncronously # # Examples # # expect { subscription.cance...
32.722222
159
0.734295
91e9da207b7239605460e076114ea0b2af2c7cda
2,264
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2015 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject, which is a fork of ...
29.025641
91
0.70318
1ca18c42c86db705e2908448d539581ba16095ec
1,240
Dir[File.join(__dir__, '../../app/validators', '*.rb')].sort.each { |file| require file } Apipie.configure do |config| config.app_name = 'LegalFrameworkApi' config.api_base_url = '/' config.doc_base_url = '/apidocs' # where is your API defined? config.api_controllers_matc...
40
113
0.594355
f833316aff2a24d5058172c31bfdcb609d124852
2,150
############################################################################################# # # # Copyright 2010-2013 Ning, Inc. # # Copyright 2014 Gro...
58.108108
108
0.362326
1d91e5b0480f8fbfb56d575f8b2d4a6820793e06
808
# frozen_string_literal: true require 'rbnacl' class Threema module E2e module PublicKey class << self def encrypt(data:, private_key:, public_key:, nonce:) box(public_key, private_key).encrypt(nonce, data) end def decrypt(data:, private_key:, public_key:, nonce:) ...
28.857143
127
0.675743
3847c094b816c29100231120f21be53aea4e1b4b
897
require 'rails_helper' module Chaskiq RSpec.describe LinkRenamer, type: :model do let(:html) { "<p><a href='http://google.com'></p>"} let(:renamer){ Chaskiq::LinkRenamer } it "will rename links" do data = renamer.convert(html, "AAA") expect(data).to include("AAA") end it "test_in...
28.03125
113
0.597547
18a63d9b6e61506c29d318a799532c20411479c0
1,159
# # Cookbook Name:: dokku # Recipe:: install # # Copyright (c) 2015 Nick Charlton, MIT licensed. include_recipe "dokku::_nginx" include_recipe "openssl" package "apt-transport-https" docker_service "default" do action %i[create start] end packagecloud_repo "dokku/dokku" do type "deb" end execute "install-dokku...
20.696429
68
0.680759
4a1a0282ec77a88a6cc455975e7e4296de959f4d
707
module Projects class CreateRepository < Base unloadable def call create_project_repository end private def create_project_repository # Create new repository repository = Repository.factory('Xitolite') repository.is_default = true repository.extra_info ...
20.794118
86
0.66761
03d540892a7934797281bcdaca41c0697c5268c9
448
require 'rails_helper' # Specs in this file have access to a helper object that includes # the StudentMcqsHelper. For example: # # describe StudentMcqsHelper do # describe "string concat" do # it "concats two strings with spaces" do # expect(helper.concat_strings("this","that")).to eq("this that") # en...
28
71
0.716518
61e090a25527f081956917f2095ff299a1667879
326
class CreateMembershipTransactionDetails < ActiveRecord::Migration def change create_table :membership_transaction_details do |t| t.integer :club_membership_detail_id t.integer :end_user_id t.integer :payment_status, default: 0 t.string :payu_id t.timestamps null: false end en...
25.076923
66
0.733129
035ce9bb01971cf9947c6c421fd24a98a8eaa88e
2,936
# Copyright (c) 2011, salesforce.com, inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided # that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this list of conditions and...
49.762712
108
0.78406
21abbe58fd3771934dc504c03cda517c0509f774
206
module Lib module Objects class Base < GraphQL::Schema::Object edge_type_class(Lib::BaseEdge) connection_type_class(Lib::BaseConnection) field_class Lib::BaseField end end end
20.6
48
0.708738
7a8fa16b7bc77cc10a285828f003b02fd27023dc
961
# 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...
41.782609
86
0.766909
1d78587041afa9e31e7e5926e00da97af7d9ed92
381
require_relative 'weather' require_relative 'forecast' require 'optparse' options = {} parser = OptionParser.new do|opts| opts.on('-c', '--city city', 'City') do |city| options[:city] = city; end end parser.parse! forecasts = Weather.for("Kathmandu") forecasts.each do |forecast| puts "#{forecast.datetime...
20.052632
84
0.695538
bf82b58f0a42978e00bf815ec237f3b0cbbe6e8b
4,393
module Spree module Admin class CompaniesController < ResourceController def index @search = Spree::Company.ransack(params[:q]) @companies = @search.result.order('name ASC').page(params[:page]) respond_with(:admin, @companies) end def new @company = Spree::Comp...
28.525974
88
0.583201
79375a4fc5442082ccbe621b0bdb2da344a32464
1,493
# 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...
37.325
86
0.736772
334bf4876c116e81b54811d40a0147b77453b1f9
362
class CreateTracks < ActiveRecord::Migration def self.up create_table :tracks do |t| t.string :persistent_id t.string :name t.string :artist t.string :album t.float :duration t.integer :rating t.boolean :enabled, :default => true t.timestamps end end def s...
18.1
44
0.629834
1d05d968b0cd3473394da6daa3fdd8303fea8b9c
708
require 'date' class Person attr_reader :first_name, :last_name, :gender, :date_of_birth, :favorite_color def initialize(args={}) @last_name = args.fetch(:last_name) @first_name = args.fetch(:first_name) @gender = standardize_gender(args.fetch(:gender)) @date_of_birth = date_to_datetime(args.fetch(:...
22.83871
79
0.675141
7a3f7992fc19097d994804426aeb6ea95f9a82f2
8,614
# # Copyright:: Copyright (c) Chef Software 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 ag...
37.615721
203
0.618992
21196d85431e0f8763ceb57f8dd8ef48d84ba275
1,489
cask "eloston-chromium" do arch = Hardware::CPU.intel? ? "x86-64" : "arm64" if Hardware::CPU.intel? version "100.0.4896.88-1.1,1649847004" sha256 "dc2ae76674b276d29325275b4481d2d4aad06085b61db0f58431c0037df581fe" else version "100.0.4896.88-1.1,1649890918" sha256 "8feeafaaf33b18424fbf6f6723b290bb...
33.088889
188
0.680994
1d6fd856be1b41485b08071b33b6b03d549c54e5
1,408
require_relative "../wrapper" require_relative "../physical_volume_segment" module LVM module Wrapper # segment output is very different in that its multi line, easier to treat as own command class PVSSEG include Reporting attr_reader :attributes attr_reader :command def initialize(...
24.701754
126
0.603693
01000c9d6d92ec2a47ffbfb608adb3c7af3ce935
1,423
# frozen_string_literal: true module Gitlab module ImportExport module Project class TreeSaver attr_reader :full_path def initialize(project:, current_user:, shared:, params: {}) @params = params @project = project @current_user = current_user ...
24.964912
112
0.58468
39b5b4bf339777651ffb9486f76d6375931dcf12
1,300
require 'beaker-rspec' require 'beaker_spec_helper' include BeakerSpecHelper hosts.each do |host| if host['platform'] =~ /^ubuntu-(15.04|15.10)-/ on host, "wget -O /tmp/puppet.deb http://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb" on host, "dpkg -i --force-all /tmp/puppet.deb" on host, "apt-g...
28.888889
100
0.681538
bbf79d1fd9c368f770531d1a622cefd3c32f583d
2,804
class Pygitup < Formula include Language::Python::Virtualenv desc "Nicer 'git pull'" homepage "https://github.com/msiemens/PyGitUp" url "https://files.pythonhosted.org/packages/6a/e5/640afbc106bb4e836228977d9593227148b1f7ba365172bd160c4d315c66/git-up-2.0.2.tar.gz" sha256 "ce1bc2285393145d0c287de271ecea9f5302...
45.225806
140
0.809558
ffb3211063354a16acc5447b87568d0d41d88256
31,842
# encoding: UTF-8 require 'library_stdnums' require 'lightly' require 'uri' require_relative 'cache_adapter' require_relative 'cache_manager' require_relative 'cache_map' require_relative 'composite_cache_map' require_relative 'electronic_access_link' require_relative 'electronic_access_link_factory' require_relative '...
35.145695
210
0.664468
f721ad0c62e910dd1afd32c8d292aabdb43c219b
175
assert 'Module#name' do module A class B end end assert_nil A::B.singleton_class.name assert_equal 'Fixnum', Fixnum.name assert_equal 'A::B', A::B.name end
15.909091
38
0.68
87dd9695c39102bbc65653ec7a7637683ffb937b
4,299
# -*- encoding: utf-8 -*- # stub: capybara 3.0.2 ruby lib Gem::Specification.new do |s| s.name = "capybara".freeze s.version = "3.0.2" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Thomas Walpole"...
51.795181
153
0.624331
873c99e499cc205dd61b7967c47d77ece43815d2
788
Gem::Specification.new do |s| s.authors = ['Eli Foster'] s.name = 'weatheruby' s.summary = 'A Ruby gem for accessing the Weather Underground API.' s.version = '1.0.0' s.license = 'MIT' s.description = 'Accessing the Weather Underground API through HTTPClient.' s.email = 'elifosterwy@gmail.com' s.homepag...
31.52
77
0.668782