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
ace1df127fbe333581c730224210ecafc107a262
701
Pod::Spec.new do |s| s.name = 'AWSSES' s.version = '2.6.6' s.summary = 'Amazon Web Services SDK for iOS.' s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.' s.homepage = 'http://aws...
38.944444
157
0.606277
871fd8099879b0c691ef257fd4e6dd7689d74bfe
1,249
require 'bigdecimal' begin require 'psych' rescue LoadError end require 'yaml' # Define our own class rather than modify the global class class SitemapGenerator::BigDecimal YAML_TAG = 'tag:yaml.org,2002:float' YAML_MAPPING = { 'Infinity' => '.Inf', '-Infinity' => '-.Inf', 'NaN' => '.NaN' } yaml_tag YAML_TAG...
22.303571
107
0.682946
abc443d2fac83d501c5ae500370700c3033f945d
1,442
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module LeaveManagement class Application < Rails::Application # Settings in config/environments/* ta...
36.05
99
0.677531
ff53988d72cfc8c075b0d7a3d3f1b2692100fc26
2,405
class Cask::Source::PathBase # derived classes must define method self.me? def self.path_for_query(query) path_string = "#{query}" path_string.concat('.rb') unless path_string.match(%r{\.rb\Z}i) Pathname.new(path_string) end attr_reader :path def initialize(path) @path = Pathname(path).exp...
28.630952
107
0.60499
01a30a83fd4c71bb2c242ae6c0293ae23fa774f6
1,001
module ArticleJSON module Export module PlainText module Elements class Quote < Base # Quotes are just rendered with a preceding blank line. If a caption # is present, it is rendered below the quote indented with two dashes. # @return [String] def export ...
27.805556
80
0.544456
38fe277701bb37bbd05d574c6eb427de9afe84ae
4,716
class OrigenCoreApplication < Origen::Application self.name = "Origen Core" self.namespace = "Origen" config.name = "Origen Core" config.initials = "Origen" config.rc_url = "git@github.com:Origen-SDK/origen.git" config.semantically_version = true config.release_externally = true config.gem_name = ...
29.111111
115
0.657549
e84a938a81efc47f03d27fc01aef37bcdd0992f1
1,123
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module AtomThemeBrowser class Application < Rails::Application # Settings in config/environments/* t...
41.592593
99
0.73553
08198cf3d1b6ef0c4c0eabd6843b37b2226eaf4d
21,754
require "active_support/concern" module Invoicing # == Time-dependent value objects # # This module implements the notion of a value (or a set of values) which may change at # certain points in time, and for which it is important to have a full history of values # for every point in time. It is used in the i...
55.922879
117
0.647789
33dd9532702f1efcab2539999f964a0aa4dcbced
169
class Product include Mongoid::Document include Mongoid::Search field :brand field :name references_many :tags search_in :brand, :name, :tags => :name end
15.363636
41
0.715976
39b2000bcb1c3c0d7bafd9a31b3c5251e377de91
1,297
module Spree module Api class StoresController < Spree::Api::BaseController before_action :get_store, except: [:index, :create] def index authorize! :read, Spree::Store @stores = Spree::Store.accessible_by(current_ability, :read).all respond_with(@stores) end def...
23.160714
72
0.590594
265d10c6cbfd3014714eff5939718cacba7eda91
24,519
# 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...
51.618947
145
0.562135
e948676ef4ccbc4f3eab25c67a684cb94fbea424
5,274
# Encoding: UTF-8 # # Cookbook Name:: shipyard # Spec:: libraries/resource_shipyard_agent_service # # Copyright (C) 2014, Jonathan Hartman # # 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 # # ...
27.326425
82
0.639742
87523658dd815ad42484121937a77ee919cf5e01
1,205
# Provides the ability to have session cookies for your Rails app calculated # relative to the current time. # # In your environment.rb file (or in the environments/*.rb file of your choice), # do something like the following: # # CGI::Session.expire_after 1.month # # Session cookies will then expire one month after ...
31.710526
80
0.73278
e24f771be3ebd87d2686afe14173d21aad1c8188
1,311
require 'spec_helper' RSpec.describe 'RadarRelay integration specs' do let(:client) { Cryptoexchange::Client.new } let(:dai_weth_pair) { Cryptoexchange::Models::MarketPair.new(base: 'dai', target: 'weth', market: 'radar_relay') } it 'fetch pairs' do pairs = client.pairs('radar_relay') expect(pairs).not_...
33.615385
116
0.716247
bf97f891d21240b4e9556d78333eef8ce96a6007
2,011
# frozen_string_literal: true require 'rails' module FenrirView class Engine < ::Rails::Engine isolate_namespace FenrirView initializer 'fenrir_view.system_path' do |app| FenrirView.configure do |c| c.system_path ||= app.root.join('lib', 'design_system') end end initializer 'fe...
32.967213
89
0.695177
e989d1e37d16f365d94c4775223d73c1f2fa9f6a
285
class CreateArtists < ActiveRecord::Migration[5.2] def up end def down end def change create_table :artists do |t| t.string :name t.string :genre t.integer :age t.string :hometown end end end
16.764706
50
0.519298
79335a8933ad91bc14a91b3acabbcc24191d501d
485
require 'mspec/guards/guard' # Despite that these are inverses, the two classes are # used to simplify MSpec guard reporting modes class EndianGuard < SpecGuard def pattern @pattern ||= [1].pack('L') end private :pattern end class BigEndianGuard < EndianGuard def match? pattern[-1] == ?\001 end end...
18.653846
55
0.731959
2809577fc7c7867faafd2d462a5a8a1388b061a9
3,507
require 'spec_helper' describe Cmxl::Fields::StatementDetails do context 'sepa' do subject { Cmxl::Fields::StatementDetails.parse(fixture_line(:statement_details)) } it { expect(subject.transaction_code).to eql('171') } it { expect(subject.seperator).to eql('?') } it { expect(subject.description).to...
38.966667
290
0.590818
26c65454e2d13bcea207ea81871b178c4247271e
156
power_function = -> (x, z) { (x) ** z } base = gets.to_i raise_to_power = power_function.curry.(base) power = gets.to_i puts raise_to_power.(power)
13
44
0.660256
79f82a05e7f415a180a9f259302178d4ea3a9ade
581
# encoding: UTF-8 require 'ebb' module Merb module Rack class Ebb < Merb::Rack::AbstractAdapter # start an Ebb server on given host and port. # @api plugin def self.new_server(port) Merb::Dispatcher.use_mutex = false opts = @opts.merge(:port => port) @th = Thread.new...
20.034483
91
0.576592
21ccf57f303b2adb091aeefd8d30b07b855d7915
1,482
class G2 < Formula desc "Friendly git client" homepage "https://orefalo.github.io/g2/" url "https://github.com/orefalo/g2/archive/v1.1.tar.gz" sha256 "bc534a4cb97be200ba4e3cc27510d8739382bb4c574e3cf121f157c6415bdfba" license "MIT" head "https://github.com/orefalo/g2.git" bottle do sha256 cellar: :any...
43.588235
120
0.778003
334a64816de50cbc3d42a27e787233fdee21664a
265
# frozen_string_literal: true # This is just a placeholder file, as +Sequel.extensions+ forcefully loads it # instead of assuming we already did. If you're looking for the integration # implementation, you can find it in +lib/appsignal/instrumentations/sequel.rb+
44.166667
79
0.792453
8704511bd638c490c8d2b32deb46aa37a3c6aea5
886
# Inflection using the inflect module copied from # the unmaintained 'english' ruby gem. # # License: MIT # Website: http://english.rubyforge.org class Treat::Workers::Inflectors::Declensors::English require_relative 'english/inflect' # Part of speech that can be declensed. POS = ['noun', 'adjective', 'deter...
28.580645
53
0.680587
bfc849cad0bf98846a4d52a2a1eb3466819fc097
1,630
# 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::Network::Mgmt::V2019_11_01 module Models # # Collection of SecurityProviders. # class VirtualWanSecurityProviders inc...
28.596491
79
0.540491
bf8acb384eec03fc7d955dfcaa2bad2db95a94ec
1,430
# Copyright (C) 2006-2007 Kurt Stephens <ruby-currency(at)umleta.com> # See LICENSE.txt for details. require 'test/ar_test_core' require 'currency' require 'rubygems' require 'active_record' require 'active_record/migration' require 'currency/active_record' module Currency class ArFieldTest < ArTestCore ########...
20.428571
78
0.626573
f8543766b1d36fdc33c469bb7235d6f1c389ed97
1,692
# frozen_string_literal: true # See LICENSE.txt at root of repository # GENERATED FILE - DO NOT EDIT!! require 'ansible/ruby/modules/base' module Ansible module Ruby module Modules # Manage the state of a policy in RabbitMQ. class Rabbitmq_policy < Base # @return [String] The name of the poli...
36.782609
162
0.644799
d5a7ea56e6a1737a3002f8655cf70c97c3699063
1,007
@survey_forms_0 = Survey::Form.new(id: 0) @survey_forms_1 ||= Survey::Form.create!( content_id: @cms_contents_6.id, state: "public", name: "toiawase", title: "市へのお問い合わせ", sort_no: 10, summary: "", description: "", receipt: <<EOS.chomp, <p>お問い合わせを受け付けました。<br />\r 自動返信メールが届いているかご確認ください。(送信までにお時間がかかる場合がありま...
23.418605
63
0.713009
d579a3ca2164116270b7cbec08b7b02a0ae64d4c
907
class MicropostsController < ApplicationController before_action :logged_in_user, only: [:create, :destroy] before_action :correct_user, only: :destroy def create @micropost = current_user.microposts.build(micropost_params) if @micropost.save flash[:success] = "Micropost created!" ...
28.34375
69
0.658214
acaa8bb6fcdf2aed33fe89ebec2e03d5bea476e7
5,133
# # Be sure to run `pod spec lint TSChatClient.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://githu...
37.195652
119
0.595169
876cb06de6fc05c8e11dbe9257f8dcf394153571
928
class CreateTaMappings < ActiveRecord::Migration def self.up create_table :ta_mappings do |t| t.column :ta_id, :integer t.column :course_id, :integer end add_index "ta_mappings", ["ta_id"], :name => "fk_ta_mappings_ta_id" execute "alter table ta_mappings add constraint fk_t...
26.514286
77
0.639009
39ef7901bce1b4f0e92bef23f764a6f170434573
429
require "pathname" require "thin" require "sinatra" require "coffee-script" require "slim" require "gush" require "sinatra-websocket" require "sinatra/assetpack" require "gush/control/version" require "gush/control/app" require "gush/control/cli_extension" require "gush/control/log_sender" module Gush module Control...
20.428571
64
0.7669
fff0d2ffd0fb9b151b25a24ccdd7eeca6e9099a0
295
class StaticController < ApplicationController before_action :require_logged_in skip_before_action :require_logged_in, only: [:home] def home render "/static/home" end def about render "about" end def questions render "questions" end end
17.352941
56
0.664407
38ec9c2a483677811b9442c774054a3cbad8defa
270
module Aliyun module Log module Record class ArgumentError < StandardError; end class UnknownAttributeError < StandardError; end class ProjectNameError < StandardError; end class ParseStatementInvalid < StandardError; end end end end
24.545455
54
0.72963
87c1ca44d70874d412044f65858a0169f69f323d
1,838
# encoding: utf-8 require 'rubygems' require 'sinatra' require 'sinatra/reloader' get '/' do erb "Hello! <a href=\"https://github.com/bootstrap-ruby/sinatra-bootstrap\">Original</a> pattern has been modified for <a href=\"http://rubyschool.us/\">Ruby School</a>" end get '/about' do erb :about end get '/visit' d...
25.527778
173
0.616431
62f1967f13be771b194f26422a8c2d7802dff45a
5,225
require 'spec_helper' describe 'Reference resources' do before(:all) do RSpec.configure { |c| c.include RSpecMixin } @temp=configure_empty_sqlite sr_for_report @ref_1="Al-Zubidy A, Carver JC. Identification and prioritization of SLR search tool requirements: an SLR and a survey. Empir Softw Eng. 2018...
36.538462
185
0.713301
b9ef4525f974913fd52a1cd9fbdf3aa0af4abc9c
3,342
# # Author:: Jason Field # # Copyright:: 2018, Calastone Ltd. # 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/lice...
45.162162
387
0.685518
0350906a999ead8e2175685e5c2fe5932c687b04
119
class AddAddressToShelter < ActiveRecord::Migration def change add_column :shelters, :address, :string end end
19.833333
51
0.764706
ff182b706a118b6b1f908f6c8ef90588a2c5a236
5,046
# 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::Hdinsight::Mgmt::V2018_06_01_preview module Models # # The security profile which contains Ssh public key for the HDInsight # cl...
31.5375
79
0.493658
bffeb10f2c66763b1ae350961f71b9552f03129b
3,309
describe CredentialsManager do describe CredentialsManager::AccountManager do let(:user) { "felix@krausefx.com" } let(:password) { "suchSecret" } it "allows passing user and password" do c = CredentialsManager::AccountManager.new(user: user, password: password) expect(c.user).to eq(user) ...
35.202128
119
0.679662
d55800fbcc2be3da16caae721fb316ac32749d28
2,158
module Sidekiq module JobMonitor class Job attr_reader :attributes, :original_job def initialize(attributes) @attributes = attributes.as_json(only: %w(class jid args state)) @original_job = attributes[:original_job] end def save Sidekiq.redis do |conn| c...
22.715789
72
0.569972
5d0cd26cf098869513ef65e84f00d4581fc97581
2,765
# frozen_string_literal: true module Neo4j::Driver::Internal class SecuritySetting include Scheme attr_reader :encrypted, :trust_strategy, :customized def initialize(encrypted, trust_strategy, customized) @encrypted = encrypted @trust_strategy = trust_strategy @customized = customized...
37.876712
142
0.752984
9145e9af3189b502286dc056fa1bd0a110ff8ed4
1,230
module GitStats module Inspector def to_s vars = defined_ivars.map do |sym| value = if ivars_to_be_filtered.include?(sym) '...' else var = instance_variable_get(sym) var.is_a?(String) ? %("#{var}") : var.inspect en...
23.207547
101
0.527642
1de03232f91d5bf5fb10d13c843c15bcd6f00e07
1,451
require 'rubygems' require 'bundler/setup' ENV['RACK_ENV'] = 'test' require 'standby' ActiveRecord::Base.configurations = { 'test' => { 'adapter' => 'sqlite3', 'database' => 'test_db', 'pool' => 30 }, 'test_standby' => { 'adapter' => 'sqlite3', 'database' => 'test_standby_one', 'pool' => 30 }, ...
24.183333
131
0.665748
d5ed54b9c5530e475daf7917e26c790c41a45f62
1,586
# frozen_string_literal: true module Faker class Music class Prince < Base class << self ## # Produces a random Prince song. # # @return [String] # # @example # Faker::Music::Prince.song #=> "Raspberry Beret" # Faker::Music::Prince.song #=...
24.4
126
0.495586
2836f087b2ec9fb80e89a1756f88a7a09dcce240
5,964
## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # web site for more information on licensing and terms of use. # http://metasploit.com/ ## require 'msf/core' class Metasploit3 < Msf::Auxiliary # Exploit mixins should ...
29.524752
157
0.58216
18437ac4dee9595e31906637f7fb00a1a8dd36b7
1,133
class Gemmy < ApplicationRecord include HasCompats FORBIDDEN_NAMES = %w( new edit rails ) validates :name, presence: true, uniqueness: { allow_blank: true }, exclusion: FORBIDDEN_NAMES scope :with_dependencies, ->(dependencies) { where('dependencies_and_versions ? :dependencies', dependencies: ...
27.634146
135
0.606355
ac9b9978e13daa5365eeec9c57a6da8f0939f895
1,001
class MicropostsController < ApplicationController before_action :logged_in_user, only: [:create, :destroy] before_action :correct_user, only: [:destroy] def create @micropost = current_user.microposts.build(content: micropost_params[:content]) @micropost.image.attach(params[:micropost][:image]) if @...
26.342105
83
0.711289
79057cbb4e1ef80f19a9d92cd7fecf27d87211c7
597
''' Slash Command Incoming Variables token=aUSqBXbocBj5Umd9hpHnrxcO team_id=T0001 team_domain=example channel_id=C2147483705 channel_name=test user_id=U2147483697 user_name=Steve command=/weather text=94070 response_url=https://hooks.slack.com/commands/1234/5678 ''' def build_slack_message(response_type, username, ...
25.956522
132
0.778894
e2497609fc868f0a34920e782044f3a3a0f466ab
2,102
module Jekyll class PortfolioIndex < Page def initialize(site, base, dir) @site = site @base = base @dir = dir @name = "index.html" self.process(@name) self.read_yaml(File.join(base, '_layouts'), 'portfolio.html') self.data['projects'] = self.get_projects(site) end ...
25.950617
79
0.606089
ab6534f367bdcd9294ce51d47da4ae69d12ba0a4
135
# frozen_string_literal: true module ParityHelper # mix-in module_function def parity(n) n.odd? ? 'odd' : 'even' end end
11.25
29
0.666667
3862951f76bde9825bf324d2bb4f46fb32153f45
7,084
require 'chef/formatters/base' class Chef module Formatters # == Formatters::Minimal # Shows the progress of the chef run by printing single characters, and # displays a summary of updates at the conclusion of the run. For events # that don't have meaningful status information (loading a file, syn...
30.016949
89
0.659938
623c8d761aaf1d5757c700e102814395832cf9f7
1,873
require "puppet/parameter/boolean" # Autogenic core type Puppet::Type.newtype(:azure_batchai_cluster) do @doc = "Information about a Cluster." ensurable validate do required_properties = [] required_properties.each do |property| # We check for both places so as to cover the puppet resource path ...
24.973333
203
0.67165
6af6380658185797400d6228bdd037cfb6ac84f4
2,321
$:.unshift File.dirname(__FILE__) require 'singleton' module Ick class Base include Singleton def returns(value, result) raise 'implemented by subclass or by calling meta-method' end def evaluate(value, proc) raise 'implemented by subclass or by calling meta-method' end ...
21.490741
74
0.601034
5d471918407743cd55dc0c97273bfa9117a9e74a
1,109
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # dat...
39.607143
86
0.752029
1c61dbd194d8a250288aaade1e1eb7e3f6acd1ab
1,394
require 'mpd32api/version' require 'mpd32api/mapping' require 'unimidi' module Mpd32Api def Mpd32Api.get_midi_input_device UniMIDI::Input.gets end def Mpd32Api.get_midi_output_device UniMIDI::Output.gets end class Library def initialize(input_device, output_device) input_device.instance_o...
21.78125
68
0.647776
337ad7fb28b0cd0523982bc60059e8cfdbdc93ca
488
class AddCreatedByIdAndUpdatedByIdToModels < ActiveRecord::Migration def change add_column :users, :created_by_id, :integer add_column :users, :updated_by_id, :integer add_column :roles, :created_by_id, :integer add_column :roles, :updated_by_id, :integer add_column :groups, :created_by_id, :integ...
37.538462
68
0.756148
0391faf5d2eb29825d719d28f9f992341f72c6e5
260
class TalksMailerPreview < ActionMailer::Preview def project_talk TalksMailer.project_talk(User.first, Project.first) end def lead_talk TalksMailer.lead_talk(User.first, MoneyRequire.first) end def work_talk end def talk end end
14.444444
57
0.742308
39af671c8f20fdb9eda94de01e10c3eac6b7e176
1,235
RSpec.describe DisjointSetForest do it "has a version number" do expect(DisjointSetForest::VERSION).not_to be nil end describe "#make_set" do it "should create a new set, with one element, and have that element be the set representative" do disjoint_set = DisjointSetForest::DisjointSetForest.new ...
27.444444
103
0.682591
5d82b19a450964863286a360da51d750ae5134b8
107
class SponsorsController < ApplicationController def index @sponsors = Sponsor.active.uniq end end
17.833333
48
0.775701
e9ae711842329e97a30b30eac7d7a97757af1cb5
241
# encoding: utf-8 describe "Negation" do it "works" do blacklist = Selector.new except: /bar/ selector = !blacklist expect(selector[:foo]).to eql(false) expect(selector[:bar]).to eql(true) end end # describe Negation
17.214286
42
0.6639
e8d8eaf12e4e2ddba975822288112cb3bc850701
532
$LOAD_PATH << File.dirname(__FILE__) require 'element.rb' module WikiValidator # class only used to parse Attributes of TemplateItems class Attribute < Element attr_reader :name, :value # |name: value @regex = /\|(?<attribute>\w+):[ ]*(?<value>[^\n;$]*)/ @starts_with =/\|/ private def...
18.344828
57
0.573308
1ad9853b3fd14b0e2bb6da723b54c16e288d5ee6
1,955
# frozen_string_literal: true FactoryBot.define do factory :api_gateway_context, class: Hash do initialize_with { attributes.deep_stringify_keys } end factory :api_gateway_event, class: Hash do path { '/api/v1/mailing/1234' } resource { '/__proxy+}' } httpMethod { 'POST' } headers do {...
25.38961
63
0.570844
283199b376f0b47f07bedfd412d117e24fb30846
2,324
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Expl...
29.417722
129
0.606713
ed4720b2f9b97630b5e5063fe6db90cbca9b1504
4,750
# frozen_string_literal: true module ActiveRecord class FixtureSet class TableRow # :nodoc: class ReflectionProxy # :nodoc: def initialize(association) @association = association end def join_table @association.join_table end def name ...
31.045752
104
0.590526
e2dbcf61049969768655c7e27ed05bd7abd10a7a
3,190
# ******************************************************************************* # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC. # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditio...
44.929577
85
0.74326
ff453f98192d9570a597b53cb5befe67b17a9a60
63
class CommentVote < BaseVote belongs_to_votable :comment end
15.75
29
0.825397
1c9b4bedbb2c4cf0f8e829c3b1d6cf79b8f83286
882
# Copyright (c) 2009-2012 VMware, Inc. module Bosh::Director module Api class TaskManager # Looks up director task in DB # @param [Integer] task_id # @return [Models::Task] Task # @raise [TaskNotFound] def find_task(task_id) task = Models::Task[task_id] if task.nil? ...
26.727273
60
0.561224
4a0abccfa0277d912b17dec76b82071ac566ca02
3,115
describe Spotlight::SolrController, type: :controller do routes { Spotlight::Engine.routes } let(:exhibit) { FactoryBot.create(:exhibit) } describe 'when user does not have access' do before { sign_in FactoryBot.create(:exhibit_visitor) } describe 'POST update' do it 'does not allow update' do ...
31.785714
157
0.638523
03224b2d65e23265d57bb75b56e00d9d2811d668
3,407
module Cnab240 ESTRUTURA_V80 = { :segmentos_implementados => [:a], :pagamento => { :header => Cnab240::V80::Pagamentos::Header, :trailer => Cnab240::V80::Pagamentos::Trailer, :segmentos => [:a], :a => { :remessa => true, :retorno => true } } } ESTRUTURA_...
21.030864
71
0.457
33bda0d26ab58bcd18e0495c363b8b4d53d42c76
15,106
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class Metasploit4 < Msf::Exploit::Remote Rank = ExcellentRanking include Msf::Exploit::Remote::HttpServer include Msf::Exploit::Powershell ...
39.85752
152
0.618761
bb6382ac1d34a2c0bac3b64cfa4e65a6afdfdf23
1,459
require 'rails_helper' describe 'Groups Associated Permissions', reset_provider: true do context 'when creating a new group with an associated collection permission' do before do login group_id = create_group['concept_id'] # collection permissions should show as associated permission on the g...
45.59375
134
0.73475
0397ae551a8d767e50a10cacf738f9fc1b8fe8c3
241
module TicketEvolution module Modules module RetrieveQueuedOrder def retrieve_queued_orders(&handler) handler ||= method(:collection_handler) request(:GET, "/queued_orders", &handler) end end end end
20.083333
49
0.680498
ac2375217f3f3f04a98be349deafb8ad93fa5fcc
2,617
# encoding: utf-8 require 'spec_helper' require_relative '../../../app/helpers/modal_helper' include ActionView::Helpers include ActionView::Context include ModalHelper describe ModalHelper, :type => :helper do header_with_close = { :show_close => true, :dismiss => 'modal', :title => 'Modal header' } header_wi...
41.539683
407
0.655713
b92707b984eaa02f74abc5aff7c8ee5a6f799e7d
522
module CukeSalad module Codify module ConstName def ConstName.from sentence joined_together capitalised( words_from sentence ) end private def ConstName.joined_together words words.join end def ConstName.words_from this_sentence on_word_bou...
21.75
58
0.626437
1afe0fbaf8ab91f52988eb8dcc768e72b602d52e
477
require 'spec_helper' describe SecureAttachment::Cipher do let(:cipher) { SecureAttachment::Cipher } let(:test_text_path) { File.expand_path('./spec/files/test.txt') } let(:text_data) { File.open(test_text_path).read } context 'self' do describe 'decrypt_file' do it 'takes a simple text file and turn...
28.058824
78
0.67086
2120685fda5e48507225cf7ee355d415c691e470
1,755
class SalesReportPdf < Prawn::Document def initialize(pos_invoice_line_items) super({top_margin: 25, left_margin: 20, right_margin: 15, bottom_margin: 20}) text GlobalSettings.organisation_name, size: 15, style: :bold, align: :center move_down 10 text "Total Sales", size: 15, align: :center move_d...
33.113208
188
0.62963
39184389ef698d03d4a18f6b836a7cffdbc01178
422
Deface::Override.new( virtual_path: 'spree/layouts/admin', name: 'uploads_main_menu_tabs', insert_bottom: '#main-sidebar', text: <<-HTML <% if can?(:display, Spree::Upload) %> <ul class="nav nav-sidebar"> <%= tab 'Uploads', url: admin_uploads...
32.461538
87
0.478673
d5f85dc9a64de29039136e72cc133c7b4e1dfa70
223
class CreateUsers < ActiveRecord::Migration[5.0] def change create_table :users do |t| t.string :email t.string :password_digest t.boolean :is_admin t.timestamps null: false end end end
18.583333
48
0.659193
1c6240c94ea57feaa87d17835d6fb75141f19f78
2,113
# frozen_string_literal: true require 'spec_helper' describe Savon do it 'knows the message tag for :authentication' do message_tag = message_tag_for(:authentication, :authenticate) expect(message_tag).to eq(['http://v1_0.ws.auth.order.example.com/', 'authenticate']) end it 'knows the message tag for :...
33.539683
99
0.703265
ff5983714d390ac7c29671139fc94016fe2fbf4f
324
require "notification_file_lookup" module NotificationHelper include ActionView::Helpers::TagHelper def banner_notification if node = Static.banner content_tag(:section, "<div>#{node[:file]}</div>", { id: "banner-notification", class: node[:colour].to_s }, false) else '' end end ...
21.6
72
0.669753
871aeb281c7f59fa36445fbf7a6e4e616bd1f406
486
module Rplidar # Implementation of response to the GET_HEALTH request. class CurrentStateDataResponse < Response def response case raw_response[0] when STATE_GOOD then { state: :good, error_code: error_code } when STATE_WARNING then { state: :warning, error_code: error_code } when ...
28.588235
73
0.674897
1da7bc87e52a261e8c55089239f580750972e0af
701
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'pushwoosh' s.version = '2.2.1' s.summary = 'Pushwoosh Flutter plugin' s.homepage = 'https://pushwoosh.com' s.license = { :file => '../LICENSE' }...
33.380952
83
0.589158
b98eea765becf8203c202990c49972bacc57bbd0
2,294
#-- encoding: UTF-8 #-- copyright # OpenProject is an open source project management software. # Copyright (C) 2012-2021 the OpenProject GmbH # # 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 ChiliProj...
40.964286
123
0.675676
ed20f5618de59f67bd53f823727953f0f08afe66
1,151
# # 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 ...
34.878788
97
0.716768
1d312d8d217324d5d9453ad719a0bca138741b59
33,558
Localization.define('fr_FR') do |l| # General l.store "your blog", "votre blog" l.store "Typo admin", "administration typo" l.store "Publish", "Écrire" l.store "Manage", "Gérer" l.store "Feedback", "Commentaires" l.store "Themes", "Thèmes" l.store "Plugins", "Greffons" l.store "Users", "Utilisateurs" ...
47.532578
556
0.721438
bb2093cd4bb54f9f780c70e267ed65b070078249
2,197
## # $Id$ ## ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Expl...
26.46988
86
0.608102
e98e9456a2873646a67fe440bc4b9c2a565f10a0
1,108
class Ddgr < Formula include Language::Python::Shebang desc "DuckDuckGo from the terminal" homepage "https://github.com/jarun/ddgr" url "https://github.com/jarun/ddgr/archive/v1.8.1.tar.gz" sha256 "d223a3543866e44e4fb05df487bd3eb23d80debc95f116493ed5aad0d091149e" license "GPL-3.0" bottle do cellar :...
34.625
93
0.765343
6a0e131fd01bb738ab191e7d09401e6d5a575a72
199
class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.string :name t.string :email t.string :password_hash t.timestamps end end end
16.583333
43
0.648241
e82625a413b0f7067ae1b8ba48c3e7f54c8dccf3
137
require 'rails_helper' RSpec.describe Spree::BonusVoucher, type: :model do pending "add some examples to (or delete) #{__FILE__}" end
22.833333
56
0.751825
bbdb0b701d84496132a03aa3e4561689e8cdf25b
537
require 'rails_helper' RSpec.describe "ledger_accounts/new", type: :view do before(:each) do assign(:ledger_account, LedgerAccount.new( :ledger_id => 1, :account_id => 1 )) end it "renders new ledger_account form" do render assert_select "form[action=?][method=?]", ledger_accounts_p...
24.409091
91
0.696462
1c10e89166bd020048909b698d2a2e798e0bf1bc
713
require_relative "boot" require "rails/all" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module HistoricalOracle class Application < Rails::Application # Initialize configuration defaults for originally generate...
31
79
0.740533
ac4a0d298bb3316bf63f61cab26d9ef05a5ca628
557
# frozen_string_literal: true class Slow < SitePrism::Page set_url '/slow.htm' set_url_matcher(/slow\.htm$/) element :last_link, 'a', text: 'slow link4' element :invisible, 'input.always_invisible' elements :even_links, '.even' element :undefined, '.not_here' section :first_section, Blank, '.slow-sectio...
27.85
71
0.701975
08718bc92a1ed331cef27af9b93b336b8da7c641
5,391
# frozen_string_literal: true require 'spec_helper' describe Gitlab::ErrorTracking do let(:exception) { RuntimeError.new('boom') } let(:issue_url) { 'http://gitlab.com/gitlab-org/gitlab-foss/issues/1' } let(:expected_payload_includes) do [ { 'exception.class' => 'RuntimeError' }, { 'exception.m...
31.16185
100
0.653126
d5767e5426be41c673dc6fad54dda05dda621d19
1,103
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') module WhosGotDirt::Requests::Entity RSpec.describe LittleSis do describe '#to_s' do it 'should return the URL to request' do expect(LittleSis.new(name: 'ACME Inc.').to_s).to eq('https://api.littlesis.org/entities.xml?q=ACME+In...
29.026316
113
0.615594
ed0cf7b6e3bd5f23ae5188f2076cb0f526e9ed63
7,289
=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://openapi-generator.tech Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product...
30.885593
216
0.633557
5de966135e30ca2190fdfd68630509c76f072853
1,440
require 'spec_helper' enforce_options = [true, false] describe 'security_baseline::rules::debian::sec_service_time' do enforce_options.each do |enforce| context "on Debian with enforce = #{enforce}" do let(:facts) do { osfamily: 'Debian', operatingsystem: 'Ubuntu', ar...
25.714286
64
0.472222
2649530a0845af93a424031d388c4982c055256c
141
json.extract! @atractivo, :id, :name, :description, :parr_id, :cant_id, :prov_id, :subtipo_id, :tipo_id, :categ_id, :created_at, :updated_at
70.5
140
0.730496
1c0d60f3b42fa05d251902bdb8fa91be91b6ac11
2,099
module AllGather state do table :loc_sender table :loc_ips_reduce table :loc_ip_main table :loc_data_reduce table :loc_each_len table :loc_total_senders table :loc_idx scratch :sink table :ips_len interface input, :data_reduce interface input, :sender interface input, ...
32.292308
208
0.640305
f8b9f64399bddc4faab3ccbbb4f02caaca789b43
9,570
module ActionDispatch module Routing # In <tt>config/routes.rb</tt> you define URL-to-controller mappings, but the reverse # is also possible: a URL can be generated from one of your routing definitions. # URL generation functionality is centralized in this module. # # See ActionDispatch::Routing ...
44.101382
125
0.638662
3910dce71cfbdc837b6a55ee7257279c673095c2
448
require 'rails_helper' # Specs in this file have access to a helper object that includes # the LedgerTypesHelper. For example: # # describe LedgerTypesHelper 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