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
f85f1bdd7ddd3b54033a6345ab67b414ec099594
1,926
# frozen_string_literal: true lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "prometheus_exporter/version" Gem::Specification.new do |spec| spec.name = "prometheus_exporter" spec.version = PrometheusExporter::VERSION spec.a...
40.978723
101
0.672897
e2e2a74d794db16012aee746f7d9f0beed3398e4
1,568
module Seek module Roles ADMIN = 'admin' # Roles that stand alone, and are not linked to anything, for example Project or Programme class StandAloneRoles < Seek::Roles::Roles class InvalidCheckException < Exception; end def self.role_names [Seek::Roles::ADMIN] end def add...
32.666667
140
0.669005
61ea93635ce3d363498bd4991cccb7022893c78f
12,271
if RUBY_VERSION < '1.9' require 'uuid' else require 'securerandom' end module OneLogin module RubySaml # SAML2 Auxiliary class # class Utils @@uuid_generator = UUID.new if RUBY_VERSION < '1.9' DSIG = "http://www.w3.org/2000/09/xmldsig#" XENC = "http://www.w3.org/2001/04/...
41.738095
126
0.626762
1df3c29997b0bab36a5bfd8486e3a48401059671
1,848
# frozen_string_literal: true require "bristle/types" require "bristle/util/dry_extensions" require "bristle/util/dsl" using Bristle::Util::DryExtensions module Bristle module Util module Dsl # Accessor base class class Accessor attr_reader :name attr_reader :type attr_reade...
25.666667
79
0.589286
188cfde92cb32373cd128e59f7e8c7a75226d6af
1,484
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup). # # Examples: # # movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }]) # Ch...
37.1
123
0.646226
e987d368a5b160d3475fe4003db7ab46f17266fc
234
class CreatePosts < ActiveRecord::Migration[5.2] def change create_table :posts do |t| t.integer :user_id t.integer :category_id t.string :content t.integer :uplifts t.timestamps end end end
18
48
0.645299
ffe5f009dc6b0d55102a484af60453d16138d883
3,879
require 'gh' require 'uri' module Travis::API::V3 class GitHub def self.config @config ||= Travis::Config.load end EVENTS = %i(push pull_request issue_comment public member create delete repository) DEFAULT_OPTIONS = { client_id: config.oauth2.try(:client_id), client_secret: ...
29.165414
108
0.610724
b9af883d16508e83cca1ae287abe0a776e3d3031
361
# Copyright (c) Facebook, Inc. and its affiliates. name 'cpe_bluetooth' maintainer 'Facebook' maintainer_email 'noreply@facebook.com' license 'Apache-2.0' description 'Manages Bluetooth settings / profile' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.1.0' supports 'mac_os_x' dep...
25.785714
72
0.781163
1d4ec031bf27eba585ea45ca9c7e58ca5b9ed086
245
require 'Gosu' require_relative '../lib/tree.rb' require_relative '../lib/calendar.rb' require_relative '../lib/cursor.rb' require_relative '../lib/maple.rb' require_relative '../lib/menu.rb' require_relative '../lib/menu_item.rb' require 'pry'
27.222222
38
0.746939
1d884acfc6bf65f3cde169f714afda357fe81dfd
3,906
share_examples_for 'A semipublic Property' do before :all do %w[ @type @name @value @other_value ].each do |ivar| raise "+#{ivar}+ should be defined in before block" unless instance_variable_defined?(ivar) end module ::Blog class Article include DataMapper::Resource property :...
28.933333
140
0.604199
f70700b525f9329bee7db8fd46aaff2b9ca7555a
23,346
module ActiveRecord module ClassMethods alias _new_without_sti_type_cast new def new(*args, &block) _new_without_sti_type_cast(*args, &block).cast_to_current_sti_type end def base_class unless self < Base raise ActiveRecordError, "#{name} doesn't descend from ActiveRecord" ...
53.792627
158
0.702262
f866827d73520c8b8e1967f17f31ded003edcd13
271
# encoding: utf-8 module Mutx module Support module Clean def self.start Mutx::Results.reset! Mutx::Support::FilesCleanner.delete_all_mutx_reports Mutx::Support::FilesCleanner.delete_all_console_output_files end end end end
22.583333
68
0.693727
f7a5b978045c97850a8c0162fb0a3c3143076143
2,014
require 'spec_helper' describe Squib::Deck do context '#xlsx' do it 'loads basic xlsx data' do expect(Squib.xlsx(file: xlsx_file('basic.xlsx')).to_h).to eq({ 'Name' => %w(Larry Curly Mo), 'General Number' => %w(1 2 3), # general types always get loaded as strings with no conversio...
30.059701
113
0.510924
39f1ed128ebf0dae1d6779d57267f8c15340271a
917
lib = File.expand_path('../lib/', __FILE__) $:.unshift lib unless $:.include?(lib) require 'peregrin/version' spec = Gem::Specification.new do |s| s.name = 'peregrin' s.version = Peregrin::VERSION s.summary = "Peregrin - ebook conversion" s.description = "Peregrin converts EPUBs, Zhooks and Ochooks." s.auth...
27.787879
64
0.643402
5d8663a28f7d2645daceaf3198162f30a796d200
1,235
class Ability include CanCan::Ability def initialize(user) user ||= User.new # guest user (not logged in) if user.admin? can :manage, :all else #creator can manage list/chores/invites #list admin can manage chores can :manage, List, creator_id: user.id can ...
28.72093
80
0.568421
4a69846171a052210950f2f8eb62a32a8babfd2d
182
class City < ActiveRecord::Base has_many :trips has_many :users, through: :trips belongs_to :country validates :name, :travel_advice, :tourist_rating, :presence => true end
22.75
69
0.741758
e8afec0511ec65346fa51938350ec29231feca54
53,023
# Copyright 2015 Google 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 to in writing,...
41.882306
118
0.608377
ff4577edc7498600a60bf5706a7efbda79b6f06c
1,155
#-- # Ruby Whois # # An intelligent pure Ruby WHOIS client and parser. # # Copyright (c) 2009-2018 Simone Carletti <weppos@weppos.net> #++ require_relative 'base_afilias2' module Whois class Parsers # Parser for the whois.nic.xxx server. class WhoisNicXxx < BaseAfilias2 self.scanner = Scanners::Ba...
18.934426
119
0.600866
ac03d7ee10f49c2c7666fc266ee4fdd7bf3c9d92
1,333
module SimpleAudioPlayerHelper class NotImplemented < Exception; end def simple_audio_player(dom_id, file, config = {}) result = content_tag(:p, 'Alternative content', :id => dom_id) result += javascript_tag("AudioPlayer.embed('#{dom_id}', { soundFile: '#{file}' });") end # Load WPAudioPlayer files an...
37.027778
137
0.750188
08dceb7cf10f17b444c27b684e70369b3313b579
636
# typed: ignore require "test_helper" module Ektar class MembershipTest < ActiveSupport::TestCase test "membership role is member by default improved" do membership = ektar_memberships(:alternate_membership) assert_equal membership.role, "member" end test "membership is active by default" ...
21.2
59
0.715409
1c7aacbffba1fd415b550447d3c94709d7e7209d
719
module FactoryTestHelper # # If these aren't defined, autotest can hang indefinitely # and you won't know why. # # I think that there is a way to tell Factory Bot to use # "save" instead of "save!" which would have removed the # need for this MOSTLY. There are a few exceptions. FactoryBot.factories.collect(&...
28.76
68
0.72879
e2addcb8af9e98e4a583535eaeb5ff453e88bec1
1,493
module Fix module Protocol # # Maps the FIX message type codes to message classes # module MessageClassMapping # The actual code <-> class mapping MAPPING = { '0' => :heartbeat, 'A' => :logon, '1' => :test_request, '2' => :resend_request, '3' => :rej...
29.27451
91
0.558607
034b2effee8a3cc89703f90d67b44a78ede6c0b2
9,042
# frozen_string_literal: true # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
36.459677
168
0.710905
1a2184ea3c528e7b54b1d7b27deaea510d013b94
623
require File.expand_path("../Abstract/abstract-php-extension", __dir__) class Php71Opcache < AbstractPhp71Extension init desc "OPcache improves PHP performance" homepage "https://php.net/manual/en/book.opcache.php" revision 20 url PHP_SRC_TARBALL sha256 PHP_CHECKSUM[:sha256] depends_on "pcre" def ex...
21.482759
71
0.693419
ff19ccad86b4df79564392b4a95eb0926d7c16a3
283
=begin Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification OpenAPI spec version: 1.1.1 Contact: blah@cliffano.com Generated by: https://github.com/openapitools/openapi-generator.git =end class SwapSpaceMonitorMemoryUsage2 < ApplicationRecord end
17.6875
67
0.812721
795c763c1cd838704be78d5ba5650be94f58c37b
1,189
# frozen_string_literal: true require 'opal/nodes/base' require 'opal/nodes/literal' require 'opal/nodes/variables' require 'opal/nodes/constants' require 'opal/nodes/call' require 'opal/nodes/csend' require 'opal/nodes/call_special' require 'opal/nodes/module' require 'opal/nodes/class' require 'opal/nodes/singleton_...
28.309524
37
0.79058
03971ab398cd5e54ad1f2141abe173ba302c99aa
611
require "rails_helper" RSpec.describe Jobs::Scheduler, type: :model do describe "ActiveModel validations" do it { expect(subject).to validate_presence_of(:job) } it { expect(subject).to validate_presence_of(:time) } it { expect(subject).to respond_to(:enabled?) } end describe "ActiveModel associati...
26.565217
57
0.698854
6ab8e338ffe7aa70b917194aeecf0b0cfd805e6f
1,248
# # Be sure to run `pod lib lint WPInjection.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'WPInjec...
35.657143
105
0.641026
1a1065b4c69abfc149165358a2f6afb768384977
144
# frozen_string_literal: true json.ancestors @relations.ancestors json.descendants @relations.descendants json.current_doc @relations.search_id
28.8
39
0.861111
11107f5345a9911a76afd49b750e5d532b89d492
8,110
# frozen_string_literal: true require "project_types/script/test_helper" describe Script::Layers::Infrastructure::Languages::AssemblyScriptTaskRunner do include TestHelpers::FakeFS let(:ctx) { TestHelpers::FakeContext.new } let(:script_id) { "id" } let(:script_name) { "foo" } let(:extension_point_config) d...
30.037037
116
0.599014
01eced9d776c55c9204e87ce611cc0185af36b5b
494
class CreateEmployeeGrades < ActiveRecord::Migration def self.up create_table :employee_grades do |t| t.string :name t.integer :priority t.boolean :status t.integer :max_hours_day t.integer :max_hours_week end create_default end def self.down drop_table :employee_...
23.52381
121
0.690283
bfa60b2142d34be6940d74c5d6f27efa46bc2822
904
module DataAbstraction::SensorData class EarthMagnetometer < Generic STANDARD_UNIT = "nT" def initialize(data, meta_values = {}, unit = STANDARD_UNIT) super(data, meta_values, unit) @values = Array.new @values[0] = MagneticValue.new(data['values'][0].to_f, @unit) @values[1] = MagneticV...
30.133333
102
0.55531
26699105f55f74647f991170bef245246edfe33d
140
class AddClassroomIdToPresentations < ActiveRecord::Migration def change add_column :presentations, :classroom_id, :integer end end
23.333333
61
0.8
62292b0824acc5a1556d8b329334e0dd504573ad
75
require "omniauth-firmafon/version" require 'omniauth/strategies/firmafon'
25
38
0.84
08a41e0af100328124c3bdbcb04cfabd2311cc5c
491
covers 'facets/kernel/try' test_case Kernel do method :try do test do example = Struct.new(:name).new("bob") example.try(:name).assert == "bob" end test "without argument" do example = Struct.new(:name).new("bob") example.try.name.assert == "bob" end end end test_case ...
13.638889
44
0.596741
e95892ec0e47386700bef09c45ac0d898ec6eb2e
861
# -*- encoding: utf-8 -*- $:.push File.expand_path("../lib", __FILE__) require "kasoba/version" Gem::Specification.new do |s| s.name = "kasoba" s.version = Kasoba::VERSION s.platform = Gem::Platform::RUBY s.authors = ["Lacides Charris", "Guillermo Iguaran"] s.email = ["lacidescharris@...
39.136364
99
0.643438
21fa23ec8e701f2726e5e70b14ae5448885ff9bf
868
module Tanker module Pagination autoload :WillPaginate, 'tanker/pagination/will_paginate' autoload :Kaminari, 'tanker/pagination/kaminari' def self.create(results, total_hits, options = {}, categories = {}) begin backend = Tanker.configuration[:pagination_backend].to_s.gsub(/\/(.?)/) { "::...
28.933333
168
0.640553
017cac1de2ce60540c77fca2f9f1e2c0601a5460
15,416
# frozen_string_literal: true describe Facter::FactManager do let(:internal_manager) { instance_spy(Facter::InternalFactManager) } let(:external_manager) { instance_spy(Facter::ExternalFactManager) } let(:cache_manager) { instance_spy(Facter::CacheManager) } let(:fact_loader) { instance_double(Facter::FactLoad...
37.236715
120
0.650493
08b6ec4ebc2a58e628f1f5c8e5a7db7389703d11
558
require 'active_support/core_ext/hash/indifferent_access' module ActiveRecord::Turntable class Config include Singleton def self.[](key) instance[key] end def [](key) self.class.load!(ActiveRecord::Base.turntable_config_file) unless @config @config[key] end def self.load!...
22.32
84
0.681004
18b647d5d1ee9625d45233e3b42ef471e15a892e
865
cask "iina-plus" do version "0.6.6,22042822" sha256 "584d29420fe82cdf3980bc7df4b54a052f6fbef4a31f64d0e837a85a985af1af" url "https://github.com/xjbeta/iina-plus/releases/download/#{version.csv.first}(#{version.csv.second})/iina+.#{version.csv.first}.dmg" name "IINA+" desc "Extra danmaku support for iina (iina...
29.827586
136
0.669364
ed944a3d407431041aa5c952839b3e27b19ad213
146
module Linter class Ruby < Base FILE_REGEXP = /.+(\.rb|\.rake)\z/ private def job_name "RubocopReviewJob" end end end
12.166667
37
0.589041
4a596f08108527e3e85d22b1f9487cfb5217d140
1,572
# 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 u...
28.581818
62
0.658397
edb0c11aa6f8ddf7446302ce01f7aa256f943712
674
module Hammock module ActionControllerPatches MixInto = ActionController::Rescue def self.included base base.send :include, InstanceMethods base.send :extend, ClassMethods # base.class_eval { # alias_method_chain :clean_backtrace, :truncation # } end module Cla...
20.424242
68
0.649852
eda4151550266c3090615d1fe2d6b83ee58d9bbe
703
require 'sinatra/base' require './controllers/application' require './controllers/account' require './controllers/item' require './controllers/category' require './models/category' require './models/account' require './models/item' require './models/location' require './controllers/location' require './controllers/set...
29.291667
45
0.756757
7a6aa4ed34c8146ccfda475f24511337fdff451a
146
require "test_helper" class StimulantTest < Minitest::Test def test_that_it_has_a_version_number refute_nil ::Stimulant::VERSION end end
18.25
39
0.794521
d5d7349d449653fe53114a631f3a8bc7f99cd7c7
657
require "geny/command" require "geny/registry" require "geny/actions/geny" RSpec.describe Geny::Actions::Geny do let(:command) { instance_double(Geny::Command) } let(:registry) { instance_double(Geny::Registry, find!: command) } subject(:geny) { described_class.new(registry: registry) } describe "#run" do ...
27.375
68
0.660578
f8404589d3bdaf82581b7d7730808b9e64b5a6ef
1,328
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') require File.expand_path(File.dirname(__FILE__) + "/../lib/connection_content") require 'fileutils' describe ActiveRecord::ConnectionAdapters::MysqlAdapter do before(:each) do @connection = ActiveRecord::Base.connection end describe :load_c...
30.883721
84
0.696536
3863e582899668b65a16bcccc55090b73c04358a
3,792
puts "\noptimize position:\n\n" class Position attr_accessor :x, :y, :z def initialize( x, y, z ) @x = x @y = y @z = z end end position_values = [] position_base_values = [] position_identical = 0 File.readlines( 'scripts/position_values.txt' ).each do |line| values = line.split( ',' ) posit...
28.727273
161
0.649262
913ed6640a22383bf0315c146ade4820d82e7e11
1,478
class Gssdp < Formula desc "GUPnP library for resource discovery and announcement over SSDP" homepage "https://wiki.gnome.org/GUPnP/" url "https://download.gnome.org/sources/gssdp/1.0/gssdp-1.0.2.tar.xz" sha256 "a1e17c09c7e1a185b0bd84fd6ff3794045a3cd729b707c23e422ff66471535dc" revision 1 bottle do cell...
28.980392
93
0.663058
875792f35f23b44b911a05518bb1f8d180863034
233
development: bucket: <%= @name %>_development access_key_id: secret_access_key: test: bucket: <%= @name %>_test access_key_id: secret_access_key: production: bucket: <%= @name %> access_key_id: secret_access_key:
15.533333
34
0.695279
1c17672a69aed33712f151ab45c74e8f490d4697
209
class CreateTableAnswers < ActiveRecord::Migration[5.2] def change create_table :answers do |t| t.string :text t.boolean :is_correct, :default => false t.integer :question_id end end end
20.9
55
0.698565
1cd2fb07694db191481afa7787d2791b9cc8ee02
1,249
#!/usr/bin/env ruby # Test to see if Struct can be inherited from usefully. BEGIN { base = File.dirname( File.dirname(File.expand_path(__FILE__)) ) $LOAD_PATH.unshift "#{base}/lib" require "#{base}/utils.rb" include UtilityFunctions } try( "to subclass Struct as ConfigStruct" ) { class ConfigStruct < Struct ...
23.12963
74
0.678943
6a0d36a1b8e7a83b7ec3bb49b7ea0c94d4a2b47f
1,981
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) require 'enumerator' describe "Enumerable#each_slice" do before :each do @enum = EnumerableSpecs::Numerous.new(7,6,5,4,3,2,1) @sliced = [[7,6,5],[4,3,2],[1]] end it "passes element groups...
31.444444
80
0.635033
e9ecd955a83ea60e1ecf5fa0d9c7ad69afc39ab1
2,892
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ImportExport::Mgmt::V2016_11_01 module Models # # Contains the job information. # class JobResponse include MsRestAzure # @retur...
27.542857
79
0.4713
6a8774a6763e0b57074cf012c3a0edc67ea1a28a
4,734
# frozen_string_literal: true # Cloud Foundry Java Buildpack # Copyright 2013-2018 the original author or authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache....
37.872
112
0.765104
9140abd83c591eedb1ecc43b43e7573ab1392502
1,224
# # Be sure to run `pod spec lint SNetwork.podspec' to ensure this is a # valid spec and to remove all comments including this before submitting the spec. # # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html # To see working Podspecs in the CocoaPods repo see https://github.co...
34
106
0.64134
f81e127588ca5e4c7016a60db7d82184ded87c27
160
class Hash def symbolize_keys inject({}) do |options, (key, value)| options[(key.to_sym rescue key) || key] = value options end end end
17.777778
53
0.6125
210bfbd5701cdda4dc61149d8e0c2f82e635275f
451
# frozen_string_literal: true require 'yaml' require_relative 'env/version' module RuboCop # Rubocop Cop for checking ENV module Env class Error < StandardError; end PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').free...
26.529412
75
0.745011
28803164fcfb29d079f76598b4b75b5069fb65b7
2,016
class ProfilesController < Profiles::ApplicationController include ActionView::Helpers::SanitizeHelper before_action :user before_action :authorize_change_username!, only: :update_username skip_before_action :require_email, only: [:show, :update] def show end def applications @applications = curren...
23.172414
80
0.687004
f8c37d6b24cabe597f01544696611590bb2345f7
2,432
class Span < ApplicationRecord belongs_to :application belongs_to :host belongs_to :grouping, :primary_key => :uuid, :polymorphic => true belongs_to :layer belongs_to :trace, :primary_key => :trace_key, :foreign_key => :trace_key belongs_to :parent, :primary_key => :uuid, :class_name => "Span" has_many :...
24.079208
94
0.648849
ab61d3ec91fc4c32be59cdd1261a08e0f143c614
557
cask "quarto" do version "0.3.118" sha256 "b8d87cf3ce36157c483b438a44f1012b588b422de3f607f92329b19cdbfc77ee" url "https://github.com/quarto-dev/quarto-cli/releases/download/v#{version}/quarto-#{version}-macos.pkg", verified: "github.com/quarto-dev/quarto-cli/" name "quarto" desc "Scientific and technic...
29.315789
107
0.736086
ff0d2de682ed718bc564eabfc001e0f71cf1e2d1
1,547
#!/usr/bin/env ruby require 'test/unit' # Unit test for io/tcpserver.rb require_relative '../../io/tcpfns' require_relative '../../io/tcpserver' class TestTCPDbgServer < Test::Unit::TestCase include Trepanning::TCPPacking def test_basic server = Trepan::TCPDbgServer.new({ :open => false, ...
28.648148
66
0.401422
f793e300b2ac5561862e0cbda8d70c683799b41b
551
# frozen_string_literal: true module Resolvers module AccessGrants class UserCollectionResolver < GraphQL::Schema::Resolver include SearchObject.module(:graphql) include Resolvers::PageBasedPagination include Resolvers::SimplyOrdered type Types::UserCollectionAccessGrantType.connection_...
23.956522
76
0.711434
abf4ab7325b090dea471b64747d63a49e912ac37
3,256
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::DataMigration::Mgmt::V2018_07_15_preview module Models # # Results for schema comparison between the source and target # class SchemaCompariso...
32.888889
79
0.523034
f745811bfcb7b9f81253dd37ea746f6b47c9d84f
289
require File.expand_path('../../../../spec_helper', __FILE__) describe "Gem::DependencyResolver#development_shallow" do it "needs to be reviewed for spec completeness" end describe "Gem::DependencyResolver#development_shallow=" do it "needs to be reviewed for spec completeness" end
28.9
61
0.771626
7ae28e8711ad987c32f92e39eba0742ae7be9403
1,499
# # The MIT License # Copyright (c) 2019- Nordic Institute for Interoperability Solutions (NIIS) # Copyright (c) 2018 Estonian Information System Authority (RIA), # Nordic Institute for Interoperability Solutions (NIIS), Population Register Centre (VRK) # Copyright (c) 2015-2017 Estonian Information System Authority (R...
46.84375
103
0.779186
e221477b34eb8ec4426dbf688459affc7fb52b70
1,635
module AbAdmin class Engine < ::Rails::Engine engine_name 'ab_admin' initializer 'ab_admin.assets_precompile', :group => :all do |app| app.config.assets.precompile += AbAdmin.assets end initializer 'ab_admin.setup' do ::Mime::Type.register 'application/vnd.ms-excel', :xlsx ActiveS...
41.923077
84
0.715596
e95237dfe0295134e5111bc71b959c1f5c1ba35c
2,201
# coding: utf-8 require 'spec_helper' require 'support/editor' require 'support/playground_actions' RSpec.feature "Using third-party Rust tools", type: :feature, js: true do include PlaygroundActions before { visit '/' } scenario "formatting code" do editor.set 'fn main() { [1,2,3,4]; }' in_tools_menu...
22.459184
138
0.626079
398f43438295fbdbd92e446f0fb2dccc784b42fd
987
module Outpost class SessionsController < Outpost::BaseController skip_before_filter :require_login before_filter :get_authentication_attribute respond_to :html def new redirect_to outpost.root_path if current_user end def create if user = Outpost.user_class.authenticate( ...
23.5
73
0.674772
9127eda68a454ec7674ff02b906ff3c158eaead6
155
class AddSlugToPosts < ActiveRecord::Migration[5.2] def change add_column :posts, :slug, :string add_index :posts, :slug, unique: true end end
22.142857
51
0.709677
ed611befd864d7ad5b70e46e2a96ee35c4931378
977
require "spec_helper" describe Paperclip::Processor do it "instantiates and call #make when sent #make to the class" do processor = double expect(processor).to receive(:make) expect(Paperclip::Processor).to receive(:new).with(:one, :two, :three).and_return(processor) Paperclip::Processor.make(:one, :...
36.185185
111
0.694985
e91e8bd1ebff83dda7544ac16afca6f9813b7597
1,019
# frozen_string_literal: true require 'zenaton/refinements/date' RSpec.describe Date do using Zenaton::Refinements describe '#to_zenaton' do subject { described_class.new(2018, 8, 1).to_zenaton } let(:expected) do { 'y' => 2018, 'm' => 8, 'd' => 1, 'sg' => 2299161.0...
20.38
68
0.580962
79b54faa0bcb300215ca5770154d932dc3efaf5d
62
module Minitest module Tagz VERSION = "1.7.0" end end
10.333333
21
0.645161
1a3c980e7646a78cbb69ed8a1e24a713411e2eb3
128
# frozen_string_literal: true class RatingRequestIssue < RequestIssue # :nocov: def rating? true end # :nocov: end
12.8
39
0.695313
7933449619392b6a658eb4ed3dc8a1615371cb4b
6,322
# # Required `:let` examples: # # let(:tooltippable_component_selectors) { [["[data-describe='tooltip-icon']", etc] } # # let(:nested_toggle) { false } # shared_examples_for 'tooltippable components that activate a tooltip' do # it 'activates tooltips on tooltippable component' do # tooltippable_component_selecto...
50.576
267
0.636033
bff5b1f63acc813154464ca1a480f4d5ac6bd775
643
class Plugins::CamaleonMandrill::AdminController < CamaleonCms::Apps::PluginsAdminController def settings @mandrill = current_site.get_meta('mandrill_config') end def save_settings current_site.set_meta('mandrill_config', { smtp_username: params[:man...
33.842105
92
0.598756
7a21a8950a24a243121d8e2706cf4f57a0129fde
2,199
module Editframe class VideoClip attr_reader :layers def initialize(source, options = {}) @id = Util.uuid @form = {} @filters = [] @layers = [] @options = options || { } @resolution = { width: nil, height: nil } @trim = { start: 0, end: nil } @volume = 1.0 ...
24.433333
86
0.55116
e9843c875e92f7f3b0bbb131efa5fb279a0408bd
2,428
module KMP3D module HTMLHelpers def tag(name, attributes={}) content = "#{yield}</#{name}>" if block_given? return "<#{name}#{attributes_to_html(attributes)}>#{content}" end def sidenav(index, callback_method, options=[]) tag(:div, :class => "sidenav") do sidenav_children(index,...
27.280899
70
0.58402
1c5160bf57e15d19a78a0405819a203b8e282d81
795
class SessionsController < ApplicationController def new end def create user = User.find_by(email: params[:session][:email].downcase) if user && user.authenticate(params[:session][:password]) # success if user.activated? log_in user params[:session][:remember_me] == '1' ? re...
25.645161
77
0.630189
26f7af3a4da0c7e035c85f9af80a269ea46df4ce
372
module Moneta module Api module Responses # Ответ на запрос получения информации по операции. # Transaction information response. class GetOperationDetailsByIdResponse include Moneta::Api::DataMapper # @return [Moneta::Api::Types::OperationInfo] property :operation, typ...
23.25
57
0.682796
9145493cca4d41e22a7329a5a1ef7b0bbf2c81f1
3,848
=begin #Datadog API V2 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator Unless explicitly stated otherwise all files in this repository are licensed ...
28.932331
215
0.663202
ed91cf00649a000a6cfb26e6d2cfe71e280528bb
823
cask "book-ends" do version "14.0.2" sha256 "ca8989518200773ba88facdd450f10f1f01436b4e3301279214d33176630f002" url "http://das-nas.myasustor.com/dapp-dmg/Bkends-#{version}.dmg" name "Bookends" desc "Reference management and bibliography software" homepage "https://www.sonnysoftware.com/" livecheck do ...
30.481481
102
0.73147
f7276bb74aa36a8ba34d0fae6ce1f5ea90bb9965
178
json.extract! user, :id, :first_name, :last_name, :email, :biography, :purpose, :days, :active, :password_digest, :created_at, :updated_at json.url user_url(user, format: :json)
59.333333
138
0.735955
336e9a3e63551f35100604c2bb0fd22de0a392b8
3,743
require 'spec_helper' require 'fakefs/spec_helpers' module LicenseFinder describe GoVendor do include FakeFS::SpecHelpers let(:logger) { double(:logger, active: nil) } subject { GoVendor.new(options.merge(project_path: Pathname(project_path), logger: logger)) } before do allow(logger).to rece...
30.185484
123
0.620091
ace2b7582699fd6d6daeb3898e60a903d27dcfc6
1,288
class Whitedb < Formula desc "Lightweight in-memory NoSQL database library" homepage "http://whitedb.org/" url "http://whitedb.org/whitedb-0.7.3.tar.gz" sha256 "10c4ccd754ed2d53dbdef9ec16c88c732aa73d923fc0ee114e7e3a78a812849d" bottle do cellar :any sha256 "9ec140c350c8233dcbd67def0607eb1cdb764fd3f14a...
37.882353
93
0.752329
03ff8c7ab514f31116df58ea51d0c552a235c970
1,626
# coding: utf-8 lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "metanorma/iec/version" Gem::Specification.new do |spec| spec.name = "metanorma-iec" spec.version = Metanorma::Iec::VERSION spec.authors = ["Ribose Inc."] spec.email ...
36.133333
69
0.678352
e8f98138488a3999945ef97f7f6f2565e898bc50
374
# frozen_string_literal: true module PageMeta class HashMetaTag < MetaTag def render return if content.empty? content.each_with_object([]) do |(attr, value), buffer| next if value.blank? attr = attr.to_s.tr("_", ":") buffer << helpers.tag(:meta, property: "#{base_name}:#{att...
22
86
0.617647
bbf43c6108ef54952c305e2ebdaada621b5a06da
14,532
require 'test_helper' class UploadsControllerTest < ActionDispatch::IntegrationTest context "The uploads controller" do setup do @user = create(:user) end context "image proxy action" do should "work" do url = "https://i.pximg.net/img-original/img/2017/11/21/17/06/44/65985331_p0.png"...
44.036364
275
0.694536
1d24dd319e7633853d433446e46ee696c655e9a8
139
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_contraq_session'
34.75
77
0.805755
4a21858d4135dbd13bcd219c35e4493f2245ab35
148
require 'test_helper' class Api::V1::SourcesControllerTest < ActionDispatch::IntegrationTest # test "the truth" do # assert true # end end
18.5
70
0.72973
21b900746f8492a8941eeeabf53e30f71704d8e6
173
Rails.application.config.content_security_policy do |policy| policy.connect_src :self, :https, 'http://localhost:3035', 'ws://localhost:3035' if Rails.env.development? end
57.666667
108
0.780347
799a82d760a582dd4ef23bfa84f91e8b940aa048
253
module FidorApi class Collection module KaminariSupport def last_page? current_page == total_pages end def next_page current_page + 1 end def limit_value per_page end end end end
14.055556
35
0.592885
7a15e88cea5594029eb07675ec5ef9c46b636563
168
# frozen_string_literal: true module Webhooks class ConfiguredWebhookAction include Dry::Transaction def call(params) Success(true) end end end
14
31
0.720238
01a3943aff52045532ee98fadce863835f264a5c
1,021
require File.expand_path('../boot', __FILE__) require 'rails/all' Bundler.require(*Rails.groups) require "sanitycheck" module Dummy class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in confi...
37.814815
99
0.731636
7ab9806c248f6db36127d0c64642aca47871c0d5
791
class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :omniauthable, :omniauth_providers => [:google_...
39.55
92
0.730721
b9d8c15c2ba41dfe87e47849239da79f2b69e4fa
1,440
require 'git_utils' require 'r10k_utils' require 'master_manipulator' test_name 'CODEMGMT-84 - C59271 - Attempt to Deploy with Invalid r10k Config' #Init env_path = on(master, puppet('config print environmentpath')).stdout.rstrip git_repo_path = '/git_repos' git_control_remote = File.join(git_repo_path, 'environments....
27.692308
88
0.755556
1a422449fd5d22f5a0d7a93bb56d946167971ead
1,043
# frozen_string_literal: true require 'test_helper' class OrgThrityDayActivityDecoratorTest < ActiveSupport::TestCase describe 'project_count_text' do it 'should return "S" for small orgs' do ota = create(:org_thirty_day_activity).decorate stub_orgs_projects_count(10) ota.project_count_text.mu...
27.447368
67
0.725791
21a7920dcc7cb91961904332de5974ca086e2302
147
require File.expand_path('../../../spec_helper', __FILE__) describe "FileTest.grpowned?" do it "needs to be reviewed for spec completeness" end
24.5
58
0.734694
28ddff1ca8816dfbce64c50f77da5a8655fa95fe
12,379
module Cryptopals module CtrSubstitutions include AES include Xor SAMPLES = %w[ SSBoYXZlIG1ldCB0aGVtIGF0IGNsb3NlIG9mIGRheQ== Q29taW5nIHdpdGggdml2aWQgZmFjZXM= RnJvbSBjb3VudGVyIG9yIGRlc2sgYW1vbmcgZ3JleQ== RWlnaHRlZW50aC1jZW50dXJ5IGhvdXNlcy4= SSBoYXZlIHBhc3NlZCB3aXRoIGEgbm9kIG9...
62.837563
166
0.820179
f8a4509b15666e07893188e7deade822f35828b0
1,164
cask 'thunder' do version '3.3.9.4280' sha256 '197e6c77b36ca7647fd07eabc45acdf6d9a9161149ccde65a97d83e622902e0d' # down.sandai.net was verified as official when first introduced to the cask url "http://down.sandai.net/mac/thunder_#{version}.dmg" appcast 'https://static-xl9-ssl.xunlei.com/json/mac_download_ur...
38.8
82
0.652921