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 |
|---|---|---|---|---|---|
6106e01267efba00f6964e341ae593f852be529a | 39 | module NYCCorp
VERSION = "0.1.0"
end
| 9.75 | 19 | 0.666667 |
e202d4be9ab335e02953101c0e1d8f983f4fa2ed | 809 | class Rpt::AttendeeReportsController < Rpt::AbstractReportController
def show
@attendees = Attendee.yr(@year).with_planlessness(planlessness)
respond_to do |format|
format.html do
@attendee_count = @attendees.count
@user_count = User.yr(@year).count
@planless_attendee_count = Attendee.yr(@yea... | 25.28125 | 83 | 0.71199 |
e2744d36bc55f6a977138effba5425ef465f5ba4 | 1,501 | class QuestionsController < ApplicationController
before_action :find_question, except: [:new, :create]
before_action :validate_admin
def show
respond_to do |format|
format.html { render :show }
format.json { render json: @question}
end
end
def new
@concept = Concept.find(params[:conc... | 24.606557 | 112 | 0.652232 |
b90f4d8344272d357429f8dc0bacd5884facf965 | 4,887 | require 'test_helper'
require "authlogic/test_case" # include at the top of test_helper.rb
class RecipesControllerTest < ActionController::TestCase
setup do
@recipe = recipes(:one)
end
setup :activate_authlogic
test "should get index" do
get :index
assert_response :success
get :index, format:... | 24.933673 | 134 | 0.679558 |
62791e224cf999be8803d8a566722ecf21cf40f2 | 27 | require "inline_attachment" | 27 | 27 | 0.888889 |
8715c94eb7b76c9d9176f3a8c9c45f5d35c8f8a2 | 242 | FactoryGirl.define do
factory :kudoer do
first_name "Lukasz"
last_name "Lenart"
email "lukasz@sml.com"
password "testtest"
password_confirmation "testtest"
end
end
| 20.166667 | 42 | 0.549587 |
b94e402464dabbdda2b0b4934e76d19404c0bd44 | 1,323 | #!/usr/bin/env ruby
require File.join(".", File.dirname(__FILE__), "..", "lib", "cp_env")
# This script will delete any pods which are:
#
# * not part of a ReplicaSet
# * and not in kube-system
# * and have been running for more than 2 days
#
# Such pods prevent the node-recycler from draining a node to
# repla... | 28.148936 | 72 | 0.717309 |
1aeeb8da29e9f3b7fe7fa583651257a31a2324c6 | 6,510 | require 'haml_lint/cli'
describe HamlLint::CLI do
let(:io) { StringIO.new }
let(:output) { io.string }
let(:logger) { HamlLint::Logger.new(io) }
let(:cli) { described_class.new(logger) }
describe '#run' do
subject { cli.run(args) }
let(:args) { [] }
let(:options) { HamlLint::Options.new }
i... | 25.135135 | 87 | 0.606912 |
628e925d79dd6dc03fd4d505460da140464f691a | 2,253 | require 'rack/builder'
require 'warden'
require 'rails_warden' if defined?('Rails')
require 'omniauth-music_glue'
require 'music_glue/tyson/middleware'
require 'music_glue/tyson/missing_authentication'
require 'music_glue/tyson/strategies/omniauth'
class MusicGlue::Tyson::Builder
def self.new(app, options = {})
... | 26.505882 | 105 | 0.681758 |
1d1dd60a973af6c929d23a989bed2266e39228e6 | 6,296 | # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
require 'date'
require 'logger'
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
module OCI
# An object returned in the event of a work request error.
class LoadBalancer::Models::WorkRequestError
ERROR_CODE_EN... | 34.217391 | 137 | 0.66979 |
edb44075e377b6e0453f0f001290b2cfa56fc903 | 66 | class AuthToken < ApplicationRecord
has_secure_token :value
end
| 16.5 | 35 | 0.833333 |
edecfcfefc8a1769074a510ee5a1cdf3e24e200c | 260 | class EnPayment < ApplicationRecord
belongs_to :consumer
validates :day, numericality: { less_than_or_equal_to: 31, greater_than: 0 }
validates :percent, numericality: { less_than_or_equal_to: 100, greater_than: 0 }
validates_with PercentValidator
end
| 37.142857 | 83 | 0.796154 |
e26d06004eaf827eef84068d5eae3846888d9306 | 6,023 | require 'test/unit'
require 'test/test_helper'
require 'rbconfig'
require 'jruby/path_helper'
def load_behavior_block(&block)
eval("__FILE__", block.binding)
end
class TestLoad < Test::Unit::TestCase
include TestHelper
def setup
@prev_loaded_features = $LOADED_FEATURES.dup
@prev_load_path = $LOAD_PATH... | 26.073593 | 110 | 0.716088 |
1aa2cbb548539e41c03c6ed4878ba40512cce3a9 | 61,515 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::UsageData, :aggregate_failures do
include UsageDataHelpers
before do
stub_usage_data_connections
stub_object_store_settings
clear_memoized_values(described_class::CE_MEMOIZED_VALUES)
end
describe '.uncached_data' do
s... | 42.220316 | 219 | 0.686272 |
03fc41beb82fdf09e7659160fdc3b0d8a966eedc | 1,001 | Rails.application.routes.draw do
if Settings.homepage.external_url
root to: redirect(Settings.homepage.external_url)
else
root 'home#index'
end
get 'checklist' => 'home#checklist'
get 'terms_and_conditions' => 'home#terms_and_conditions'
get 'accessibility-statement' => 'home#accessibility_stateme... | 25.666667 | 72 | 0.694306 |
03bf81f63a6e7049d2945da9d775283462212a1f | 320 | # frozen_string_literal: true
class RemoveColumnsFromGliders < ActiveRecord::Migration[6.1]
def change
remove_column :gliders, :favorite_courses_base
remove_column :gliders, :favorite_courses_level_3
remove_column :gliders, :favorite_courses_level_6
remove_column :gliders, :favored_courses
end
end
| 29.090909 | 61 | 0.8 |
e272f40e5f78bf9ddec598fc59e5fb9ef8ae6bd3 | 142 |
newparam(:cwd) do
desc <<-EOD
The default directory from where the scripts will be run. If not specfied, this will be /tmp.
EOD
end
| 15.777778 | 96 | 0.697183 |
e8fdb733a6278d0dde262f020fcb6280f34b1d38 | 7,272 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.0.0-beta2
=end
... | 31.2103 | 197 | 0.631876 |
1da75f11b7d6b09d1930ca636daa9fef15973f03 | 1,599 | module SessionsHelper
# Logs in the given user.
def log_in(user)
session[:user_id] = user.id
end
def remember(user)
user.remember
cookies.permanent.signed[:user_id] = user.id
cookies.permanent[:remember_token] = user.remember_token
end
# Returns true if the given user is the current user.... | 23.514706 | 74 | 0.686054 |
1c842c48d6bf1d283ae08608dc242967b0cc2b56 | 32,509 | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: AGPL-3.0
require 'arvados_model_updates'
require 'has_uuid'
require 'record_filters'
require 'serializers'
require 'request_error'
class ArvadosModel < ApplicationRecord
self.abstract_class = true
include ArvadosModelUpdates
... | 32.705231 | 179 | 0.67083 |
ed527fd31e2314724dd5fff853fe73dddf25573a | 831 | class Dtomo < ApplicationRecord
belongs_to :user
validate :name_validator
validates :name, presence: :true
validates :stage, inclusion: { in: [1, 2, 3, 4] }
validates :evo_type, inclusion: { in: %w(good bad neutral) }
validates :happiness_meter, inclusion: { in: (0..100).to_a }
validates :hu... | 39.571429 | 146 | 0.663057 |
910658284856f446f4feb7076e96d9bd13870624 | 1,658 | require "vagrant/action/builder"
require "vagrant-extended-storage/action"
require "vagrant-extended-storage/action/manage_storage"
module VagrantPlugins
module ExtendedStorage
module Action
include Vagrant::Action::Builtin
autoload :CreateAdapter, File.expand_path("../action/create_adap... | 30.703704 | 100 | 0.645959 |
61c17e0ac5e39888d4a922d7f5da430d8ad3a34d | 704 | require 'ebay/types/store_theme'
require 'ebay/types/store_color_scheme'
module Ebay # :nodoc:
module Types # :nodoc:
# == Attributes
# array_node :themes, 'Theme', :class => StoreTheme, :default_value => []
# array_node :generic_color_schemes, 'GenericColorSchemeArray', 'ColorScheme', :class => StoreC... | 35.2 | 132 | 0.701705 |
bfc65ee05c6161a41f085552747b88e4ff6e00cc | 3,365 | # This file was automatically generated for ClickSend by APIMATIC v2.0 ( https://apimatic.io ).
module ClickSend
class HttpClient
# Execute an HttpRequest when the response is expected to be a string.
# @param [HttpRequest] The HttpRequest to be executed.
def execute_as_string(http_request)
... | 39.588235 | 96 | 0.574146 |
d50595a423faa2d7a9274bad3a48eb0add81fac0 | 2,148 | # This file is copied to spec/ when you run 'rails generate rspec:install'
require "spec_helper"
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../config/environment", __dir__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.... | 44.75 | 86 | 0.743017 |
282764235c798ffc190c695eb0c25eb77e933c13 | 467 | cask "kode54-cog" do
version "1411,85e27e749"
sha256 "89b3ef9d3252275338ae59ad5f74cbc39da21f132ae86d8920d3f7ec717c9bd4"
url "https://f.losno.co/cog/Cog-#{version.after_comma}.zip",
verified: "losno.co/cog/"
name "Cog"
homepage "https://kode54.net/cog/"
livecheck do
url "https://balde.losno.co/co... | 22.238095 | 75 | 0.683084 |
112b90ed566c1635215a480de690f415e58465e3 | 1,415 | control "ESXI-67-000033" do
title "The password hashes stored on the ESXi host must have been generated
using a FIPS 140-2 approved cryptographic hashing algorithm."
desc "Systems must employ cryptographic hashes for passwords using the SHA-2
family of algorithms or FIPS 140-2 approved successors. The use of unapp... | 41.617647 | 252 | 0.730742 |
088cafa3f6fdad1885f7b3915a780d4d24ce6792 | 2,097 | require 'thor'
require 'xcodeproj'
module Objc_Obfuscator
module Integrator
def integrate_xcode(encryption_key, project_path, podfile_path, target_name)
project = Xcodeproj::Project.open project_path
main_target = project.targets.first
unless target_name.empty?
main_target = project.t... | 34.377049 | 125 | 0.680496 |
d5dc1da31a551006166897b37efe740a070b27a7 | 816 | cask "keeweb" do
version "1.18.7"
if Hardware::CPU.intel?
sha256 "f99146aebc34b59ec5ea56ffde2048c860feb69d69b958643efd7485fa7a0135"
url "https://github.com/keeweb/keeweb/releases/download/v#{version}/KeeWeb-#{version}.mac.x64.dmg",
verified: "github.com/keeweb/keeweb/"
else
sha256 "6e4870b166... | 26.322581 | 105 | 0.729167 |
010c89bd593f29cde718ca700039c185cfe041fe | 5,142 | ##
# 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::Exploit::Remote
Rank = NormalRankin... | 26.505155 | 118 | 0.636523 |
2107ee24b8c5d5c9292917173c70be443bd40c59 | 6,154 | require 'openssl'
require 'origami'
include Origami
Origami.module_eval do
self::PDF.class_eval do
def to_blob
output
end
def signature_page(page, options={})
outer_leading = 10
optimus_width = 180
optimus_height = 22 * 3
# Define the attributes of a box where we will put ... | 35.367816 | 136 | 0.642671 |
d5060fb4ff659b502076b0ef6f54071e158db9f7 | 1,931 | class StakeCurrency < DbConnection::KitSaasSubenv
enum status: {
GlobalConstant::StakeCurrency.setup_in_progress_status => 1,
GlobalConstant::StakeCurrency.active_status => 2,
GlobalConstant::StakeCurrency.inactive_status => 3
}
serialize :constants, JSON
# Format data to a format which goes into... | 19.907216 | 124 | 0.627136 |
08dd3821485ea71e4cd269aac7e3ffcfdf7ab124 | 1,007 | # frozen_string_literal: true
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'well_secure_password/version'
Gem::Specification.new do |spec|
spec.name = 'well_secure_password'
spec.version = WellSecurePassword::VERSION
spec.platform ... | 37.296296 | 90 | 0.689176 |
f705a2dbfeb60f5b0928b37d583a5c82e12378fd | 901 | Pod::Spec.new do |s|
s.name = 'RealmLoginKit'
s.version = '0.1.3'
s.license = { :type => 'Apache-2.0', :file => 'LICENSE' }
s.summary = 'A generic login view controller for apps that use the Realm Mobile Platform'
s.homepage = 'https://realm.io'
s.author = { 'Realm' => 'help@realm.io' }
s.source... | 34.653846 | 102 | 0.651498 |
d5467429de26b883c6093887855514c044354f31 | 1,521 | module Poly::Controller
require 'poly/controller/content_for_extender'
require 'poly/controller/pagination_extender'
require 'poly/controller/actions_extender'
require 'poly/view/presentations'
class Base < ::InheritedResources::Base
include ContentForExtender
include PaginationExtender
include A... | 26.684211 | 120 | 0.685733 |
3997ad84d978ff4e0ea949870d41e8118f9e4df3 | 5,488 | #! /usr/bin/env ruby
require 'spec_helper'
require 'yaml'
require 'puppet/util/network_device'
require 'puppet/util/network_device/netapp/device'
describe Puppet::Util::NetworkDevice::Netapp::Facts do
let :transport do
mock 'netapp server'
end
let :version do
YAML.load_file(my_fixture('system-get-vers... | 38.377622 | 124 | 0.644862 |
ffeedd7f7819f481d177aed8d71f305cdc962728 | 881 | $LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
MODELS = File.join(File.dirname(__FILE__), 'models')
require 'rubygems'
require 'mongoid'
require 'mongoid_auto_increment'
require 'database_cleaner'
require 'simplecov'
SimpleCov.start
Dir["#{MODELS}/*.rb"... | 22.025 | 81 | 0.735528 |
b96c3cea79b1eac57688ea61c493d48acf690ae2 | 9,432 | # 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_06_01
module Models
#
# A network interface in a resource group.
#
class NetworkInterface < Resource
include MsRes... | 33.211268 | 85 | 0.472434 |
266261c4ee2e9aaface240bb74d45079381c0e80 | 3,350 | # Be sure to restart your server when you modify this file
# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3... | 47.183099 | 150 | 0.752239 |
bfc3d1428573f6a08dc7c85739e660a5b5726587 | 732 | # Monkey patching patterns lifted from
# https://github.com/thoughtbot/airbrake/blob/master/lib/airbrake/rake_handler.rb
module ExceptionNotifier
module RakePatch
def display_error_message(ex)
super(ex)
ExceptionNotifier::Rake.maybe_deliver_notification(ex,
:rake_command_line => reconstruct_co... | 28.153846 | 81 | 0.729508 |
113317b4733709c01b21a9351498d236a3d2fb5d | 2,642 | ##
# $Id$
##
##
# 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
include ... | 29.032967 | 118 | 0.652536 |
6ac76818786b31d5275b71dae845edb40bbe6050 | 4,560 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: hook.proto
require 'google/protobuf'
require 'lint_pb'
require 'shared_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("hook.proto", :syntax => :proto3) do
add_message "gitaly.PreReceiveHookRequest" do
optional :rep... | 49.032258 | 158 | 0.754386 |
1d66149676994a67c335ba40a68f7ddaa7589bba | 686 | module YmCore::Generators
module Migration
def self.included(base)
base.send(:include, Rails::Generators::Migration)
base.extend(ClassMethods)
end
module ClassMethods
def next_migration_number(path)
unless @prev_migration_nr
@prev_migration_nr = Time.now.u... | 20.176471 | 73 | 0.610787 |
21b0bcfeef79d3680bc61a7d1c4c79b3a559e3c8 | 11,605 | require 'concurrent'
module RocketJob
# Server
#
# On startup a server instance will automatically register itself
# if not already present
#
# Starting a server in the foreground:
# - Using a Rails runner:
# bin/rocketjob
#
# Starting a server in the background:
# - Using a Rails runner:
... | 30.300261 | 117 | 0.618613 |
f8d86fb4e53b4214a55fae66b2eeb079db57e630 | 2,476 | # frozen_string_literal: true
module Justdi
# Store of entities definitions
class DefinitionStore
class << self
# Class for stores generation
# @return [Class<Hash>]
def general_store
@general_store ||= Hash
end
# Class for register handlers generation
# @return [Cl... | 22.306306 | 70 | 0.622375 |
18c137e48ffedb451e27e6647a241463a82b8369 | 1,762 | require 'active_record'
require 'logger'
ActiveRecord::Base.establish_connection
ActiveRecord::Base.logger = Logger.new(SPEC_ROOT.join('debug.log'))
ActiveRecord::Migration.verbose = false
ActiveRecord::Schema.define do
create_table :users, :force => true do |t|
t.column :name, :string
t.column :username, :... | 30.37931 | 84 | 0.689557 |
180c12cffb1b0100d1f89de4ae4faec8d00c2a96 | 254 | # frozen_string_literal: true
require 'pathname'
# Encapsulates app configuration
module App
class << self
def env
ENV['RACK_ENV'] || 'development'
end
def root
Pathname.new(File.expand_path('..', __dir__))
end
end
end
| 14.941176 | 51 | 0.653543 |
915d44ff447cdb80d8dfc5506846f87d7f3b6f3b | 276 | require 'spec_helper'
RSpec.describe EmailAddressee do
it { should validate_presence_of(:email) }
it { should validate_presence_of(:addressee) }
it { should validate_presence_of(:email_type) }
it { should belong_to(:email) }
it { should belong_to(:addressee) }
end
| 27.6 | 49 | 0.746377 |
62bff5be61588e97aed726bf1ad457f6f61b94df | 288 | require 'grape_skeleton/settings'
module GrapeSkeleton
module Config
def self.app_name
@app_name ||= GrapeSkeleton::Settings.application_name
end
def self.to_h
{
app_name: app_name,
version: GrapeSkeleton::VERSION,
}
end
end
end
| 15.157895 | 60 | 0.645833 |
1dccae5cdfa57198912b5f47bb856d5db9a7fcca | 357 | class Doublecommand < Cask
version '1.7'
sha256 '312aaf1a60517c694b24131bf502945dc23a22c917971c3e7a3adca163560503'
url 'http://doublecommand.sourceforge.net/files/DoubleCommand-1.7.dmg'
homepage 'http://doublecommand.sourceforge.net'
pkg 'DoubleCommand-1.7.pkg'
uninstall :script => '/Library/StartupItems/... | 32.454545 | 78 | 0.795518 |
7968138a5683739e31f36df6f7fdcedd2fc99a89 | 339 | # encoding: utf-8
require 'libis/workflow/mongoid'
module Libis
module Ingester
class AccessRight
include ::Libis::Workflow::Mongoid::Base
store_in collection: 'access_rights'
field :name, type: String
field :ar_id, type: String
index({name: 1}, {unique: true, name: 'by_name'})
... | 16.95 | 55 | 0.651917 |
5dedfb5d484c0886553629d2fd93186c9c0c4761 | 601 | require 'codeclimate-test-reporter'
CodeClimate::TestReporter.start
require 'twofishes'
require 'minitest/autorun'
require 'minitest/unit'
require 'minitest/pride'
require 'mocha/mini_test'
module MiniTest
class Test
def mock_thrift_client
thrift_client = mock
Twofishes::Client.expects(:thrift_clien... | 22.259259 | 70 | 0.757072 |
4a23aea771be391afd69d6feb2311ed77087e31f | 1,772 | # encoding: UTF-8
control 'VCRP-70-000002' do
title 'Envoy must set a limit on established connections.'
desc "Envoy client connections must be limited in order to preserve system
resources and to continue servicing connections without interruption. Without a
limit, set the system would be vulnerable to a trivial... | 26.447761 | 106 | 0.709932 |
38561eec17017cf6004bc1bd70514c8abb3ffef1 | 7,450 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2017 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.44664 | 96 | 0.663356 |
876fda83c4d0de66886d202f3245b2974ae43eaa | 74 | # Use the staging config.
require File.expand_path('staging.rb', __dir__)
| 24.666667 | 47 | 0.77027 |
6ae780475a96572d48e8a756ee1f629577f63fa7 | 1,785 | # Backpack - Skyscanner's Design System
# Copyright 2018-2021 Skyscanner Ltd
# 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... | 37.1875 | 100 | 0.660504 |
6a767aae5f6a58f9668bbb03dfff6baf0a39c1ba | 2,841 | class ContainerDashboardController < ApplicationController
extend ActiveSupport::Concern
include Mixins::GenericSessionMixin
include Mixins::BreadcrumbsMixin
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
after_action :set_session_data
def show
@lasta... | 23.479339 | 73 | 0.725097 |
7a4fa5dc028e1820caaa1ca27998c28efd3dc39d | 64 | class Planet < ApplicationRecord
has_many :moons
end
| 10.666667 | 32 | 0.6875 |
3952ef27ac652db6dd0dd14c7f8474899d218304 | 922 | module Fog
module AWS
class IAM
class Real
require 'fog/aws/parsers/iam/basic'
# Remove a policy from a group
#
# ==== Parameters
# * group_name<~String>: name of the group
# * policy_name<~String>: name of policy document
#
# ==== Returns
... | 26.342857 | 94 | 0.506508 |
3982c459cca47894114a8748c40e0c0e419ec7b9 | 88 | module Activerecord
module Cti
class Railtie < ::Rails::Railtie
end
end
end
| 12.571429 | 36 | 0.681818 |
f734aaedb93271e4c74ff112c2f1bd1322a6c848 | 2,973 | require_relative '../test_helper'
require_relative 'test_commands/plain_subcommand'
class CompletionTest < Minitest::Test
def setup
Fylla.load('test')
end
def test_cli_start_completion_generator
expected = <<~'HERE'
#compdef _test test
function _test_help {
_arguments \
"-... | 25.194915 | 70 | 0.499159 |
3317c2dd7d6d730c26bce26500751e6288d0c63f | 517 | module LambdaCallback
class ResolutionProofResultController < AuthTokenController
def create
dcs = DocumentCaptureSession.new
dcs.result_id = result_id_parameter
dcs.store_proofing_result(resolution_result_parameter)
end
private
def result_id_parameter
params.require(:result_... | 21.541667 | 61 | 0.750484 |
acae0a7b5bc01baf647b87448a70cb59dc522dc5 | 2,766 | # -*- encoding: utf-8 -*-
# stub: sinatra 2.0.5 ruby lib
Gem::Specification.new do |s|
s.name = "sinatra".freeze
s.version = "2.0.5"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "bug_tracker_uri" => "https://github.com/sinatra/si... | 65.857143 | 425 | 0.693059 |
08e5b8343f4261b573ccc7ce25032f5b3f32095b | 1,491 | require 'test_helper'
class RegistrationsControllerTest < ActionController::TestCase
setup do
@request.env["devise.mapping"] = Devise.mappings[:user]
I18n.available_locales = [:en, :fr, :et]
I18n.locale = :en
end
test "a logged in user should be able to edit their user profile" do
sign_in users... | 28.673077 | 107 | 0.678739 |
3875176b8b047ba87a1e7fdb6e640b6b91daa4df | 3,455 | module Magento
# http://www.magentocommerce.com/wiki/doc/webservices-api/api/sales_order_shipment
# 100 Requested shipment not exists.
# 101 Invalid filters given. Details in error message.
# 102 Invalid data given. Details in error message.
# 103 Requested order not exists.
# 104 Requested tracking no... | 25.592593 | 86 | 0.633864 |
ab70bbff6a40a4074fc17f34f73c84517aa04b68 | 673 | # Marks the given envelopes as deleted in a single transaction
class BatchDeleteEnvelopes
attr_reader :envelopes, :delete_token
def initialize(envelopes, delete_token)
@envelopes = envelopes
@delete_token = delete_token
end
def run!
Envelope.transaction do
check_token!
envelopes.map do... | 23.206897 | 73 | 0.695394 |
7a52fadccf5d5af1402839cf5b85c09dd25616af | 2,874 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Discourse Zendesk Plugin' do
let(:staff) { Fabricate(:moderator) }
let(:zendesk_url_default) { 'https://your-url.zendesk.com/api/v2' }
let(:zendesk_api_ticket_url) { zendesk_url_default + '/tickets' }
let(:ticket_response) do
{
tic... | 35.925 | 104 | 0.657272 |
e8902f7f9405e6b3b52c09b82d14d5bcfe128f6d | 1,055 | # frozen_string_literal: true
require_relative '../report.rb'
module Weather
module Provider
class Abstract
def initialize(*_args)
@city_name = 'Unknown'
@city_id = nil
end
def current_weather_for(_city_name_or_id)
raise NotImplementedError, "#{self.class.name}#current... | 23.444444 | 100 | 0.596209 |
bb1b3ca50eaaa8486766ce3d8397b00a8af9c6f4 | 2,635 | #
# Cookbook Name:: rabbitmq
# Provider:: user
#
# Copyright 2011, Opscode, 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 ... | 39.328358 | 118 | 0.746869 |
ab3bf1c3f0032967282ccdfa87a37f9760aa7e20 | 32 | module CourseOverviewHelper
end
| 10.666667 | 27 | 0.90625 |
e84c5851cbc100a8a7d7ee08f0d24b501a2f2c34 | 638 | # Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
include Acl9::Helpers
# If user is an admin the admin options should be shown.
access_control :show_admin_options? do
allow :admin
end
# Return a progressbar
def insert_progressbar(percent)
... | 35.444444 | 131 | 0.713166 |
5dfd6ddc730ea18c6271ff038081f4302cc4c13d | 243 | # frozen_string_literal: true
FactoryGirl.define do
factory :course_discussion_topic_subscription,
class: Course::Discussion::Topic::Subscription.name do
association :topic, factory: :course_discussion_topic
user
end
end
| 27 | 64 | 0.769547 |
ff70b7c4992800a9185a673b086da1490e911d73 | 2,120 | #
# Be sure to run `pod lib lint ${POD_NAME}.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|
def self.smart_version
ta... | 31.176471 | 100 | 0.620755 |
6ad01fe1d00a594a2928a182136b6c1ebfcb0a40 | 6,844 | require "rails_helper"
def robust_password
"1G09_!9s08vUsa"
end
def fill_valid_user
fill_in :user_address, with: generate(:french_address)
fill_in :user_phone_number, with: generate(:french_phone_number)
fill_in :user_email, with: "hello+#{(rand * 10000).to_i}@covidliste.com" # needs valid email here
check ... | 29.5 | 161 | 0.651081 |
62ae50ece8211804c6a173a6fa550aa02400665b | 916 | #!/usr/bin/env ruby
$: << File.expand_path('../lib', __dir__)
require 'etc'
require 'logger'
require 'griffin'
require 'grpc'
require 'griffin/interceptors/server/logging_interceptor'
require_relative '../grpc/benchmark_queue_service'
require_relative '../grpc/benchmark_report_service'
Griffin::Server.configure do |c... | 26.171429 | 120 | 0.740175 |
7a9aae9a99f16d271bbc171101c45497724e9a68 | 2,820 | require 'HDLRuby'
configure_high
# Describes a simple D-FF
system :dff0 do
bit.input :clk, :rst, :d
bit.output :q, :qb
qb <= ~q
par(clk.posedge) do
q <= d & ~rst
end
end
# Instantiate it for checking.
dff0 :dff0I
# Decribes another D-FF
system :dff1 do
input :clk, :rst, :d
out... | 18.675497 | 75 | 0.640426 |
6278e4901251308cc17da35813f60db18ebe0834 | 152 | module Indie
module Otp
class ApplicationController < ApplicationController::Base
protect_from_forgery with: :exception
end
end
end
| 15.2 | 61 | 0.743421 |
038370cf5c4dad51cc91d777347174a95fc9010d | 1,131 | class Phyml < Formula
# cite Guindon_2010: "https://doi.org/10.1093/sysbio/syq010"
desc "Fast maximum likelihood-based phylogenetic inference"
homepage "http://www.atgc-montpellier.fr/phyml/"
url "https://github.com/stephaneguindon/phyml/archive/v3.3.20200621.tar.gz"
sha256 "a8243923ee08c74cab609a4b086ade66c6... | 34.272727 | 121 | 0.738285 |
ffc6f5b426c57fa6053034e275d7807f3c5f97d7 | 107 | require "railspress/version"
require "railspress/engine"
module Railspress
# Your code goes here...
end
| 15.285714 | 28 | 0.766355 |
33cce5d50401d896718e8a7782f26a2cf0262824 | 274 | include YARD::MRuby::Templates::Helpers::HTMLHelper
def init
sections :header, [:function_signature, T('docstring'), :source]
end
def source
return if owner != object.namespace
return if Tags::OverloadTag === object
return if object.source.nil?
erb(:source)
end
| 21.076923 | 66 | 0.733577 |
ed2f8314a9251ec2b3852a13af25ea3ffc845ae1 | 1,495 | class Dcled < Formula
desc "Linux driver for dream cheeky USB message board"
homepage "https://www.jeffrika.com/~malakai/dcled/index.html"
url "https://www.jeffrika.com/~malakai/dcled/dcled-2.2.tgz"
sha256 "0da78c04e1aa42d16fa3df985cf54b0fbadf2d8ff338b9bf59bfe103c2a959c6"
bottle do
cellar :any
sha256... | 42.714286 | 94 | 0.758528 |
2647682731b6a44c80ffac18ab459e0c38440396 | 144 | # Be sure to restart your server when you modify this file.
Shoeshop::Application.config.session_store :cookie_store, key: '_Shoeshop_session'
| 36 | 82 | 0.805556 |
7944b802b739dee5cda0ec2ce4df917c096c78ac | 203 | component "rubygem-aws-sdk-ec2" do |pkg, settings, platform|
pkg.version "1.266.0"
pkg.md5sum "34b730c219852e2e20a0388fcf7615ba"
instance_eval File.read('configs/components/_base-rubygem.rb')
end
| 29 | 64 | 0.773399 |
1af935f2fd9076be47d362217f3507344def7c11 | 1,274 | # 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,... | 34.432432 | 83 | 0.733124 |
3885f7a3848758c07ba72718bec10fcec4ab601f | 1,633 | require 'test_helper'
class UsersSignupTest < ActionDispatch::IntegrationTest
def setup
ActionMailer::Base.deliveries.clear
end
test "invalid signup information" do
get signup_path
assert_no_difference 'User.count' do
post users_path, params: { user: { name: "",
... | 34.020833 | 78 | 0.605021 |
f7665137edae7d67156f56811c535f9748f3c38b | 8,625 | require 'rails_helper'
describe ServiceProviderUpdater do
include SamlAuthHelper
let(:fake_dashboard_url) { 'http://dashboard.example.org' }
let(:dashboard_sp_issuer) { 'some-dashboard-service-provider' }
let(:inactive_dashboard_sp_issuer) { 'old-dashboard-service-provider' }
let(:openid_connect_issuer) { '... | 33.173077 | 96 | 0.643014 |
4a73bb5a134f8731c2853f4d031a805b1c1054b8 | 7,590 | Shoes.app( :title => 'Shoe_vie v.0.0.1', :width => 450, :height => 600, :resizable => true, :margin => 20 ) do
background "#343".."#eee"
stroke rgb(0.5, 0.5, 0.7)
fill rgb(1.0, 1.0, 0.9)
@vid = nil
@downloading = false
stack(:margin => 10) do
@download_stack = stack(:stroke => black, :strokewidth => 5... | 41.47541 | 240 | 0.620817 |
91f38a48795759d8697972e96d43b5cab1c94528 | 5,966 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Projects::MergeRequests::CreationsController do
let(:project) { create(:project, :repository) }
let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) }
let(:user) { project.first... | 30.284264 | 119 | 0.643647 |
1a36a4393a669ef55ae0ac8d6d7b97aea2961280 | 1,461 | module Layouts
class SchoolPresenter < ::ApplicationPresenter
def props
{
school_name: current_school.name,
school_logo_path: school_logo_path,
school_icon_path: school_icon_path,
courses: courses,
is_course_author: current_user_is_a_course_author?,
has_notifi... | 26.089286 | 76 | 0.673511 |
384970cb40583f877ae4906ecfc5b4a7da7b9e09 | 12,796 | # frozen_string_literal: true
require 'spec_helper'
describe PassengerDatadog do
let(:Statsd) { double(Datadog::Statsd) }
let(:statsd) { instance_double(Datadog::Statsd) }
subject { described_class.new }
context 'passenger not running' do
before do
allow(subject).to receive(:`).and_return('')
e... | 53.764706 | 118 | 0.62879 |
2169ef012b403f8fe2d682231c35db21873b1cec | 87 | # Sample code from Programing Ruby, page 448
File.join("usr", "mail", "gumby")
| 29 | 44 | 0.632184 |
ac0b6a7e565a352ee1c2dfb81d9fbad5452d6644 | 3,619 | #
#
# Author:: Adam Jacob (<adam@opscode.com>)
# Copyright:: Copyright (c) 2009 Opscode, Inc.
# 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 at
#
# h... | 33.509259 | 104 | 0.636087 |
1151a9c0aa5628074c4d5c3682e92db4124cb582 | 5,508 | # This service to be used as part of the importer script
# to amend any node ids stored in sankey_card_links.query_params
# that might have got out of sync.
module Api
module V3
module SankeyCardLinks
class QueryParams
include Singleton
def cleanup(query_params)
cleaned_query_para... | 24.48 | 69 | 0.544662 |
d5bab6abb511981b4b051626780390e7bb42a109 | 1,567 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v5/errors/authorization_error.proto
require 'google/protobuf'
require 'google/api/annotations_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("google/ads/googleads/v5/errors/authorization_error.proto", :s... | 37.309524 | 198 | 0.752393 |
39237845aeb5f57fffeed513f749be8d9246166b | 7,550 | require 'spec_helper'
RSpec.describe DropletKit::DropletActionResource do
subject(:resource) { described_class.new(connection: connection) }
let(:droplet_id) { 1066 }
let(:fixture) { api_fixture("droplet_actions/#{action}") }
include_context 'resources'
describe '#action_for_id' do
let(:action) { 'eve... | 33.705357 | 119 | 0.663046 |
0320da5589516b14de4c4b27ea993e6ac8d00378 | 9,690 | # frozen_string_literal: true
require 'hanami/helpers'
module Web
class Application < Hanami::Application
configure do
##
# BASIC
#
# Define the root path of this application.
# All paths specified in this configuration are relative to path below.
#
root __dir__
... | 30.376176 | 115 | 0.608669 |
e9d81f4ba06c43b5ad05a3b3e8600dbf77cb4850 | 167,134 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::LexModelBuildingService
module Types
# The request is not well... | 35.260338 | 128 | 0.614974 |
4a21c2aa4fdb9fd74cd1744ee614141b68af3aff | 57 | module MoreCoreExtensions
VERSION = "3.7.0".freeze
end
| 14.25 | 26 | 0.754386 |
2836457604ebbf57f92298370ac51f421a308dcb | 8,298 | # 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::SQL::Mgmt::V2017_10_01_preview
#
# A service client - single point of access to the REST API.
#
class SqlManagementClient < MsRestAzur... | 41.49 | 154 | 0.739214 |
5d7085fa635e51898b8facbb18663599f51186d8 | 387 | require 'spec_helper'
require 'mspec/expectations/expectations'
require 'mspec/matchers'
RSpec.describe BlockingMatcher do
it 'matches when a Proc blocks the caller' do
expect(BlockingMatcher.new.matches?(proc { sleep })).to eq(true)
end
it 'does not match when a Proc does not block the caller' do
expec... | 27.642857 | 68 | 0.741602 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.