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 |
|---|---|---|---|---|---|
2142210cfe5cf3708d5ffa5574506a4c5747f904 | 961 | module Bambora::API
class ProfileRequest
attr_accessor :card, :token, :billing, :custom, :language, :comment, :validate
def initialize(args = {})
if args.kind_of? Token
self.token = args
else
args = {} if args.nil?
args.symbolize_keys!
self.card = Card.new(args[:c... | 29.121212 | 87 | 0.609781 |
620ae83179ef6c39dc93a90e588c4e8af61ca9b3 | 18,568 | require "spec_helper"
RSpec.describe IsoDoc do
it "processes IsoXML bibliographies" do
input = <<~INPUT
<iso-standard xmlns="http://riboseinc.com/isoxml">
<bibdata>
<language>en</language>
</bibdata>
<preface>
<foreword>
<p id="_f06fd0d1-a203-4f3d-a51... | 46.888889 | 323 | 0.533121 |
e8297dd2ad4ca13dd09d498a74e68919384cc7b6 | 544 | desc "Project issues tools - sub-commands : open [user], closed [user]"
flags :after => "Only show issues updated after a certain date"
flags :label => "Only show issues with a certain label"
command :issues do |command, user|
return if !helper.project
user ||= helper.owner
case command
when 'open', 'closed'
... | 30.222222 | 71 | 0.715074 |
33796004d9f07adb805a9de9643812fda494c299 | 42 | module Giferizer
VERSION = "0.1.0"
end
| 10.5 | 19 | 0.666667 |
f7801db8f4948833c6678f1b4ebefbf63b2a8aef | 1,757 | require 'formula'
class Libdlna < Formula
homepage 'http://libdlna.geexbox.org/'
url 'http://libdlna.geexbox.org/releases/libdlna-0.2.4.tar.bz2'
sha1 '5e86f4443eeb9e7194c808301efeb78611a9e8b3'
depends_on 'ffmpeg'
# Use dylib instead of soname
patch :DATA
def install
system "./configure", "--disabl... | 29.283333 | 76 | 0.635743 |
ac0cf566fb2b04e77c8338de40bce06718076641 | 116 | # frozen_string_literal: true
require 'test_helper'
module OmniAuth
class BCryptTest < Minitest::Test
end
end
| 12.888889 | 35 | 0.775862 |
878f06195e9e2641d60d4d00600274b6ea002ac2 | 880 | require 'messages/metadata_base_message'
require 'messages/validators'
module VCAP::CloudController
class BuildpackCreateMessage < MetadataBaseMessage
MAX_BUILDPACK_NAME_LENGTH = 250
MAX_STACK_LENGTH = 250
register_allowed_keys [:name, :stack, :position, :enabled, :locked]
validates_with NoAdditiona... | 23.783784 | 71 | 0.680682 |
87ca79e4989b96b5b3b70a353180c77288f9b9ad | 66 | require 'coveralls'
Coveralls.wear_merged!
require 'test_config'
| 13.2 | 22 | 0.818182 |
f8528e0223a6775b1f4215b2eb8b564ff2d4b68e | 1,456 | class ApplicationHelper::Toolbar::CloudObjectStoreObjectsCenter < ApplicationHelper::Toolbar::Basic
button_group(
'cloud_object_store_object_vmdb',
[
select(
:cloud_object_store_object_vmdb_choice,
nil,
t = N_('Configuration'),
t,
:enabled => false,
:onwhe... | 29.12 | 108 | 0.524038 |
abb096c42428e855a9811e04a9267b17ce15240f | 824 | require 'spec_helper'
module Bosh::Director::DeploymentPlan
module PlacementPlanner
describe TieStrategy do
let(:az1) { AvailabilityZone.new("1", {}) }
let(:az2) { AvailabilityZone.new("2", {}) }
let(:az3) { AvailabilityZone.new("3", {}) }
describe TieStrategy::MinWins do
subject... | 22.888889 | 60 | 0.56068 |
18284dcc9336cc6bfd1529e3ffa8629e511a4633 | 5,257 | =begin
PureCloud Platform API
With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
OpenAPI spec version: v2
Contact: DeveloperEvangelists@genesys.com
Generated by: https://github.com/swagger-ap... | 23.15859 | 177 | 0.576374 |
1a557c2c98c40a366a3e507eecf88d8eeb3896e1 | 282 | module HealthSeven::V2_7_1
class QcnJ01 < ::HealthSeven::Message
attribute :msh, Msh, position: "MSH", require: true
attribute :sfts, Array[Sft], position: "SFT", multiple: true
attribute :uac, Uac, position: "UAC"
attribute :qid, Qid, position: "QID", require: true
end
end | 35.25 | 62 | 0.716312 |
398d40a73f27f7148dd3fed77c826a93172bd47f | 288 | require 'test_helper'
class EnrollmentsControllerTest < ActionDispatch::IntegrationTest
test 'should get create' do
get enrollments_create_url
assert_response :success
end
test 'should get destroy' do
get enrollments_destroy_url
assert_response :success
end
end
| 20.571429 | 65 | 0.777778 |
035481759b080fc862705c4d06356cb8d664f85f | 684 | # frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'letsencrypt::plugin::dns_route53' do
context 'with defaults values' do
pp = <<-PUPPET
class { 'letsencrypt' :
email => 'letsregister@example.com',
config => {
'server' => 'https://acme-staging-v02.api.letse... | 25.333333 | 79 | 0.653509 |
61d245689325bd352c011736bcb9654e9c8852cc | 1,041 | # frozen_string_literal: true
module GraphQL
module Execution
# Boolean checks for how an AST node's directives should
# influence its execution
module DirectiveChecks
SKIP = "skip"
INCLUDE = "include"
module_function
# @return [Boolean] Should this node be included in the query?... | 28.135135 | 75 | 0.599424 |
1a7a7df3f61faa6aac2cee11de39c5b0ac7ff0c7 | 1,505 | require 'test_helper'
class SalesControllerTest < ActionDispatch::IntegrationTest
setup do
@sale = sales(:one)
end
test "should get index" do
get sales_url
assert_response :success
end
test "should get new" do
get new_sale_url
assert_response :success
end
test "should create sale" ... | 30.714286 | 333 | 0.73289 |
f74d1a8ab41b2808b52a4140272e44ae9440019c | 230 | require 'spec_helper'
describe ChinaCity::DataController do
describe "GET 'show'" do
it "returns http success" do
get 'show', id: '000000', use_route: 'china_city'
response.should be_success
end
end
end
| 17.692308 | 55 | 0.682609 |
62620f93304999e31f9fcab84f614969782155f3 | 1,470 | # typed: true
class Parent
extend T::Helpers
extend T::Sig
abstract!
# This should fail, as `T.attached_class` doesn't make sense in an instance
# method context.
sig {returns(T.nilable(T.experimental_attached_class))}
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `T.experimental_attached... | 35 | 105 | 0.704082 |
f85a5c7704c8960df7e3772ccd4d55ac5aaf379e | 680 | module YoudaoFanyiAPI
module Configuration
VALID_OPTIONS = %i[key keyfrom].freeze
DEFAULT_OPTIONS = %i[type doctype version].freeze
OPTIONS = VALID_OPTIONS + DEFAULT_OPTIONS
DEFAULT_TYPE = 'data'
DEFAULT_DOCTYPE = 'json'
DEFAULT_VERSION = '1.1'
attr_accessor *OPTIONS
def... | 20.606061 | 53 | 0.629412 |
21116c11d42f5057b135e541e9943c8a2b3a5c02 | 127 | require 'test_helper'
class CastingPersonTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.875 | 49 | 0.716535 |
395f53d9b934f2e9ae11f73e823fc911b93da1c9 | 106 | RSpec.describe Coals do
it 'has a version number' do
expect(Coals::VERSION).not_to be nil
end
end
| 17.666667 | 40 | 0.716981 |
26113c315693430b85e5a5edca0e81ce56ae4933 | 247 | require File.expand_path('../lib/vega-previewer', __FILE__)
directory = File.expand_path('../vega', __FILE__)
server = VegaPreviewer::Server.new(directory)
listener = VegaPreviewer::Listener.new(directory, server)
listener.start
run server
| 24.7 | 59 | 0.761134 |
614100d665e4b30f9c736e1a2f731a8788c1798c | 405 | class CreateApplicantDetails < ActiveRecord::Migration
def change
create_table :applicant_details do |t|
t.string :name
t.string :email
t.string :phonenumber
t.string :location
t.integer :experience
t.integer :min_salary
t.integer :max_salary
t.references :requireme... | 23.823529 | 63 | 0.676543 |
0305e0cf1198cdddc53611fc249bc26ec3ea04c3 | 513 | # 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::MediaServices::Mgmt::V2019_05_01_preview
module Models
#
# Defines values for JobState
#
module JobState
Canceled = "C... | 23.318182 | 70 | 0.664717 |
38c38d4d83df36ace991b5cae06d612b9dc05225 | 1,611 | Pod::Spec.new do |s|
s.name = 'porcupine'
s.version = '1.9.0'
s.summary = 'A Flutter package plugin for Picovoice\'s Porcupine wake word engine'
s.description = <<-DESC
A Flutter package plugin for Picovoice\'s Porcupine wake word engine.
DESC
s.home... | 44.75 | 127 | 0.638734 |
bb78682ee30f4423ba9a05c5cc45419edd5de98c | 4,932 | require "logstash/inputs/base"
require "logstash/namespace"
require "pathname"
require "socket" # for Socket.gethostname
# Stream events from files.
#
# By default, each event is assumed to be one line. If you
# want to join lines, you'll want to use the multiline filter.
#
# Files are followed in a manner similar to... | 34.48951 | 98 | 0.652068 |
1c75ac9922730f038cc61c648ac8e244a5e2e2bb | 1,369 | # frozen_string_literal: true
require 'spec_helper'
describe Gitlab::NotifyUponDeath do
let(:worker_class) do
Class.new do
include Sidekiq::Worker
include Gitlab::NotifyUponDeath
end
end
describe '.sidekiq_retries_exhausted' do
it 'notifies the JobWaiter when 3 arguments are given and t... | 26.326923 | 86 | 0.641344 |
28962230388f08fbc418e35bcf4d69d5d2b13842 | 2,073 | # encoding: UTF-8
module Axlsx
# A ScatterSeries defines the x and y position of data in the chart
# @note The recommended way to manage series is to use Chart#add_series
# @see Worksheet#add_chart
# @see Chart#add_series
# @see examples/example.rb
class ScatterSeries < Series
# The x data for this se... | 31.409091 | 109 | 0.56247 |
e29d984df94cadf3b847d3f1bd5df6a8248d0729 | 44 | module EventMachine
VERSION = "1.2.1"
end
| 11 | 19 | 0.704545 |
216a97f8771375dd634cc2c74a49e0e70392bb6c | 4,333 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpServer::HTML
include Msf::Exploit::Remote::Tcp
in... | 33.589147 | 125 | 0.600969 |
4a2e038318c90a7060c108707c49c9eeff9bef52 | 71 | class WelcomeController < ApplicationController
def index
end
end
| 14.2 | 47 | 0.802817 |
79b8ec5a56ca8ab54b5394181e57ad266490c7c3 | 8,527 | # 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::Signalr::Mgmt::V2018_10_01
#
# REST API for Azure SignalR Service
#
class Operations
include MsRestAzure
#
# Creates and ... | 37.730088 | 141 | 0.684649 |
7aa838286909cf1565f8d7d1dcf2004d7ddd2493 | 3,090 | #
# Gems
#
require 'active_support/core_ext/module/introspection'
#
# Project
#
require 'metasploit/framework/command'
require 'metasploit/framework/parsed_options'
require 'metasploit/framework/require'
# Based on pattern used for lib/rails/commands in the railties gem.
class Metasploit::Framework::Command::Base
... | 28.348624 | 102 | 0.734304 |
2651002b9b72e6cd99f2d0b6ebb54ac52e28d481 | 854 | require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "react-native-smartad"
s.version = package["version"]
s.summary = package["description"]
s.description = <<-DESC
react-native-smartad
DESC
... | 32.846154 | 113 | 0.578454 |
1aff22430f2329eff4b82c262c5d5add5dd57711 | 258 | class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :name, null: false
t.boolean :admin, default: false
t.text :description
t.timestamps
end
add_index :users, :name
end
end
| 19.846154 | 48 | 0.647287 |
0865e3bc209ab19cd718827be048f5df1c5896c4 | 941 | module ConsulApplicationSettings
# Utility methods to cast values and work with path
module Utils
SEPARATOR = '/'.freeze
PARSING_CLASSES = [Integer, Float, ->(value) { JSON.parse(value) }].freeze
class << self
def cast_consul_value(value)
return false if value == 'false'
return tr... | 24.128205 | 78 | 0.603613 |
ab76697e8aa2867c94ad5549d4d104d81324897c | 154 | class AddOtherRejectionReasonToVisitors < ActiveRecord::Migration[5.1]
def change
add_column :visitors, :other_rejection_reason, :boolean
end
end
| 25.666667 | 70 | 0.798701 |
619bccc2a2847baf8b5236d207db903db9027c63 | 377 | module NamedVariant
class Railtie < ::Rails::Railtie
ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.extend ::NamedVariant::ActiveRecordExtension
ActiveStorage::Attachment.prepend ::NamedVariant::VariantExtension
end
config.after_initialize do
ActiveStorage::Attached::One.pr... | 29 | 75 | 0.755968 |
2645137fc3f20b57737e75f9c4c7125d1bac7686 | 119 | require 'test_helper'
class StampTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 14.875 | 41 | 0.697479 |
5d5dcdd8c3d40892fb0df4939f63ff8f6a27f297 | 3,317 | class Leafnode < Formula
desc "NNTP server for small sites"
homepage "http://www.leafnode.org/"
url "https://downloads.sourceforge.net/project/leafnode/leafnode/1.11.11/leafnode-1.11.11.tar.bz2"
sha256 "3ec325216fb5ddcbca13746e3f4aab4b49be11616a321b25978ffd971747adc0"
bottle :disable, "leafnode hardcodes the... | 31.292453 | 106 | 0.596322 |
1a2fc42846a53a178a64c267a377384c94d2a6bd | 750 | require 'test_helper'
class ImportTest < ActiveSupport::TestCase
test "be valid" do
import = Import.new(:name => "test")
import.metadata = File.new("#{Rails.root}/test/fixtures/data/Kaarten-few.csv")
user = FactoryGirl.create(:user)
import.user = user
assert import.valid?
end
test "import m... | 25.862069 | 82 | 0.68 |
bb56ce8a1ddc6756784309acd7d1795eafbb0ad0 | 4,194 | # frozen_string_literal: true
needs 'Thermocyclers/AbstractThermocycler'
# Class for handling BioRad CFX96 qPCR thermocycler
#
# @author Devin Strickland <strcklnd@uw.edu>
# @author Eriberto Lopez <elopez3@uw.edu>
# @note BioRad module originally deployed as `QPCR_ThermocyclerLib`
# on UW BIOFAB production 10/05/18... | 28.337838 | 79 | 0.705055 |
b9245cd39a54c6b101d200bb149e7d030aff7132 | 154 | class CreateShoppings < ActiveRecord::Migration
def change
create_table :shoppings do |t|
t.string :name
t.timestamps
end
end
end
| 17.111111 | 47 | 0.681818 |
2886d534cdfa20108926cbd7ffb55bb4fdb598fd | 1,124 | require "language/node"
class Whistle < Formula
desc "HTTP, HTTP2, HTTPS, Websocket debugging proxy"
homepage "https://github.com/avwo/whistle"
url "https://registry.npmjs.org/whistle/-/whistle-2.6.7.tgz"
sha256 "cc93aa4e5ff46c80edf7754878e55494f199481b800d2ba19c0e4996358ef633"
license "MIT"
bottle do
... | 37.466667 | 122 | 0.764235 |
915efce428f3d1e6a57b8e83c255ebdef170461f | 127 | class AddScoreToSubmission < ActiveRecord::Migration[5.0]
def change
add_column :submissions, :score, :integer
end
end
| 21.166667 | 57 | 0.755906 |
91cf6531e4d1f5765486ecf78d65f511aa0b43a1 | 1,171 | require 'spec_view_helper'
# As of 3.0.x :type tags are no longer inferred.
# This means, without the `type: :view` tag, the render method does not exist
# in the example context
describe 'hydramata/works/fieldsets/_show.html.erb', type: :view do
let(:object) { double('Object', properties: [property1, property2], c... | 46.84 | 134 | 0.708796 |
39a46fbb1c72728ea70212962014e2419f341fc9 | 144 | class Tag < ApplicationRecord
has_many :taggings
has_many :records, through: :taggings
belongs_to :user
validates_presence_of :name
end
| 20.571429 | 39 | 0.784722 |
acff75b03b292e8a0511c1436ff6c9a614be1adc | 4,598 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::DataFactory::Mgmt::V2018_06_01
module Models
#
# The Dynamics CRM entity dataset.
#
class DynamicsCrmEntityDataset < Dataset
include Ms... | 30.052288 | 75 | 0.418878 |
ff717296c622e717d351aa626bad757843090419 | 905 | require File.expand_path('../../../spec_helper', __FILE__)
describe "Regexp#options" do
it "returns a Fixnum bitvector of regexp options for the Regexp object" do
/cat/.options.should be_kind_of(Fixnum)
/cat/ix.options.should be_kind_of(Fixnum)
end
it "allows checking for presence of a certain option wi... | 41.136364 | 76 | 0.677348 |
03964ef089b6bfdfbc6b0d1d57549676806b82d3 | 2,117 | # frozen_string_literal: true
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Cadenza::FilterNode do
it 'should take an identifier' do
filter = Cadenza::FilterNode.new('trim')
expect(filter.identifier).to eq('trim')
end
it 'should be equal to another filter with the same ... | 29.816901 | 79 | 0.699103 |
39d6606ee57271b9a5eacdbb1e31186688bdf42f | 34,315 | # Generate a calendar showing completed and due Tasks for a Company
# TODO: Simple Events
class ScheduleController < ApplicationController
helper_method :gantt_offset
helper_method :gantt_width
helper_method :gantt_color
def list
today = Time.now.to_date
@year = params[:year] unless params[:year].... | 33.315534 | 404 | 0.578056 |
4adfef502647bbb16e7b9b867c7999a93ef1484b | 2,233 | # vagrant-deploy-goapp-ngnix.rb
require 'chef/provisioning/vagrant_driver'
# Define which Ubuntu image we're going to use and where to download
# it from
vagrant_box 'precise64' do
url 'http://files.vagrantup.com/precise64.box'
end
# Tell provisioning we want to use Vagrant
with_driver 'vagrant'
# Tell provisionin... | 39.175439 | 188 | 0.729512 |
79be2c23d5b00ad2bc74b9ecdc5a66f1c0087e81 | 1,000 | class SessionsController < ApplicationController
def home
end
def create
@user = User.find_by(email: params[:user][:email])
if @user && @user.authenticate(params[:user][:password])
session[:user_id] = @user.id
flash[:notice] = "Sucessfully logged in!"
redirect... | 22.727273 | 75 | 0.546 |
e973fd5979bdcd1ddae944a64cf906ec8c891e56 | 2,951 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2015 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of ... | 33.91954 | 98 | 0.714334 |
f8b563bff8e8604453e7103410c3e9945cb20972 | 1,146 | cask 'unity-facebook-games-support-for-editor@2018.3.4f1' do
version '2018.3.4f1,1d952368ca3a'
sha256 :no_check
url "https://download.unity3d.com/download_unity/1d952368ca3a/MacEditorTargetInstaller/UnitySetup-Facebook-Games-Support-for-Editor-2018.3.4f1.pkg"
name 'Facebook Gameroom Build Support'
homepage '... | 31.833333 | 149 | 0.719895 |
1d12eb25e5ebe3965e2d042ed4049b3ab6a2a0de | 1,906 | require 'spec_helper'
RSpec.describe Information, :type => :model do
it "url" do
information = create :information
expect(information.url).to eq("#{Settings.host}/information/#{information.id}")
end
it "belongs to coupon and favorited" do
coupon = create :coupon, count: 0
expect(coupon.informati... | 30.741935 | 83 | 0.726653 |
4a85f94cfb8904899fbcf6f2d98f589963b252c9 | 119 | require 'test_helper'
class ShapeTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 14.875 | 41 | 0.697479 |
bfd6d615800f1daf0ce808ba27da61acb8c9ea0f | 999 | require 'json'
filename = 'callnumber_map.properties'
callnumbers = {}
callhierarchy = {}
line_num=0
text=File.open(filename).read
text.each_line do |line|
if line_num >= 4
vals = line.split("=")
#puts vals.to_s
if(vals.length == 2)
key = vals[0].strip
callnumbers[key] = vals[1].strip... | 23.785714 | 90 | 0.606607 |
621a901bc098c0bcaa927e0b37b14a8edc1bd11d | 362 | class RemoveOldPaymentColumnsFromCommunity < ActiveRecord::Migration[5.2]
def change
remove_column :communities, :commission_from_seller, :integer, after: :vat
remove_column :communities, :vat, :integer, after: :facebook_connect_enabled
remove_column :communities, :testimonials_in_use, :boolean, after: :min... | 45.25 | 106 | 0.79558 |
289cfd64a738303bdabb1eeda9a836c049f654b3 | 7,649 | # 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::V2020_08_01
module Models
#
# Private endpoint resource.
#
class PrivateEndpoint < Resource
include Ms... | 33.995556 | 84 | 0.469473 |
626827e26329dd96f2aa85e666d72dc5c6173719 | 2,297 | # An instance of this class represents an AutoItX3 WIN32OLE server.
class AutoItX3
HIDING_TIMEOUT = 10 # in seconds
BROWSER_WINDOW_NAME = 'YouTube - Google Chrome'
SW_HIDE = 0
SW_SHOW = 5
def initialize
@server = WIN32OLE.new('AutoItX3.Control')
# set matching option for window title, 2 is match sub... | 35.890625 | 149 | 0.719634 |
91e23ae2c7f93ca6e355dba30855c44287ac2912 | 2,543 | module Fog
module Compute
class AzureRM
# Real class for Compute Request
class Real
def list_managed_disks_in_subscription
msg = 'Listing all Managed Disks'
Fog::Logger.debug msg
begin
managed_disks = @compute_mgmt_client.disks.list
rescue Ms... | 37.955224 | 140 | 0.506095 |
7914e1e470faa1654dd4bd33ab471826023ba1c5 | 18,183 | =begin
#Datadog API V1 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... | 43.396181 | 169 | 0.683606 |
5db2e676b00739419723d0461c72aa1a88ab9f9a | 1,559 | #
# Be sure to run `pod lib lint LVPopup.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 = 'LVPopup'
... | 35.431818 | 99 | 0.634381 |
1c260d4f5a7553b289bd0b100a3ee1e066515efe | 2,919 | name "Lxd"
description "Personal Compute Cloud Service with LXD"
version "0.1"
maintainer "OneOps"
maintainer_email "support@oneops.com"
license "Apache License, Version 2.0"
grouping 'default',
:access => "global",
:packages => [ 'base', 'mgmt.cloud.service', 'cloud.servic... | 29.785714 | 188 | 0.602261 |
910aac3f390d4fb90759df7ba8e655a46d7b62f6 | 1,960 | module Faye
class Transport::Http < Transport
def self.usable?(dispatcher, endpoint, &callback)
callback.call(URI === endpoint)
end
def encode(messages)
Faye.to_json(messages)
end
def request(messages)
content = encode(messages)
params = build_params(content)
requ... | 23.614458 | 91 | 0.592347 |
03934c7e181439ca7f9cc8dff76297c31e094601 | 1,725 | Puppet::Type.newtype(:rabbitmq_parameter) do
desc 'Type for managing rabbitmq parameters'
ensurable do
defaultto(:present)
newvalue(:present) do
provider.create
end
newvalue(:absent) do
provider.destroy
end
end
autorequire(:service) { 'rabbitmq-server' }
validate do
fai... | 23.310811 | 109 | 0.657391 |
7a60a499952eb201ecd0d6a0f860aa3a5a27b98c | 2,151 | # server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
# server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
# server 'example.com', user: 'deploy', roles: %w{ap... | 34.693548 | 88 | 0.668991 |
d507925ec83e249c19787ffa5dfb56561a9352b0 | 1,123 | #
# Author:: Adam Jacob (<adam@chef.io>)
# Copyright:: Copyright 2009-2016, Chef Software 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
#
# ... | 26.116279 | 74 | 0.680321 |
e96ff642991791e4c8a4b5c8fe83ca0e27209cdb | 1,114 | #Fibonacci Number Location by Length
def num_digits(num)
num.to_i.to_s.length
end
def find_fibonacci_index_by_length(n)
answer = 3
#start with 1, 1.
fib_1_ago, fib_2_ago = 1, 1
number_to_check = fib_1_ago + fib_2_ago
while num_digits(number_to_check) < n
fib_2_ago, fib_1_ago = fib_1_ago, number_to_c... | 35.935484 | 86 | 0.740575 |
084a7151555d5687356bd1bded4e00604fe9c9bd | 305 | begin
require 'openssl'
OpenSSL # ensure OpenSSL is loaded
vendor = File.expand_path('../vendor', __FILE__)
$:.unshift(vendor) unless $:.include?(vendor)
require 'net/http/persistent'
USE_PERSISTENT = true
rescue LoadError, NameError => e
require 'net/http'
USE_PERSISTENT = false
end
| 19.0625 | 50 | 0.711475 |
18b9955f390c8a3cfddf19f9244e437888d69450 | 473 | require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
test "should get home" do
get static_pages_home_url
assert_response :success
end
test "should get about" do
get static_pages_about_url
assert_response :success
end
test "should get band" do
get stati... | 18.92 | 65 | 0.752643 |
012707a8ebffc57bd4c4aaccaa74d491ab740091 | 515 | require "bundler/setup"
require "storage"
require "pathname"
require "minitest/utils"
require "minitest/autorun"
require "mocha"
require "mocha/mini_test"
TMP = Pathname.new(File.expand_path(File.dirname(__FILE__) + "/tmp"))
RESOURCES = Pathname.new(File.expand_path(File.dirname(__FILE__) + "/resources"))
class Min... | 17.758621 | 81 | 0.735922 |
f8628a0f9a9e60181e29dc11359379687e0932b8 | 50 | module MlbBattingAverages
VERSION = "0.1.0"
end
| 12.5 | 25 | 0.74 |
4a6aa11860399c44e44055b34fcd4d6348a022c9 | 896 | require 'spec_helper'
require 'rollbar/delay/resque'
describe Rollbar::Delay::Resque do
describe '.call' do
let(:payload) do
{ :key => 'value' }
end
let(:loaded_hash) do
Rollbar::JSON.load(Rollbar::JSON.dump(payload))
end
before do
allow(Resque).to receive(:inline?).and_return... | 22.4 | 79 | 0.642857 |
ff83ca9ec3216d97d275bf869362ff693c48ac16 | 626 | class AuthController < ApplicationController
before_action :authenticate_user!, :validate_service, except: :callback
def callback
login = Login.from_omniauth(request.env['omniauth.auth'])
raise CanCan::AccessDenied.new('Not authorized!', :read, SupplyTeachers) unless login.permit?(:supply_teachers)
us... | 27.217391 | 115 | 0.742812 |
3841029e98ef494daec9e930c849b662c216de06 | 5,586 | # 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_08_01
module Models
#
# Route Filter Resource.
#
class RouteFilter < Resource
include MsRestAzur... | 31.738636 | 79 | 0.440566 |
4a87355675d385629451c028b17d181d1e2e7eee | 252 | # Be sure to restart your server when you modify this file.
# All Legislative preferences are here.
Legislative::Application.config.application_name = 'Congreso Interactivo'
Legislative::Application.config.created_by_name = 'CongresoInteractivo.org'
| 36 | 75 | 0.81746 |
1aaef7a32e3c46490e2a92ac249e90defca35d29 | 70 | load File.expand_path('../../../capistrano/tasks/ssh.rake', __FILE__)
| 35 | 69 | 0.7 |
e8a3fd1f1a0e193313b03650c072d8c018e469c3 | 548 | # frozen_string_literal: true
# Define order by filter rule
#
module QueryFilter
module Rules
class OrderBy < Scope
DIRECTIONS = %w[asc desc].freeze
def name
'order_by'
end
def valid?(params)
params[key].present? && DIRECTIONS.include?(params[direction_key].try(:downcase... | 19.571429 | 89 | 0.624088 |
ed815dd54bac0f8a8cea89ef98bc0347b2ece62c | 270 | class SuperDemandsController < ApplicationController
def discard
@demand = SuperDemand.find_by(discard_token: params[:token])
@demand.update(discarded_at: Time.now)
NotifyJob.perform_later("Super Demand discarded: #{@demand.email}", "DemandBot")
end
end
| 33.75 | 84 | 0.759259 |
f8da5cda224e986351fb1bd1124a14ad2b6784d3 | 2,808 | class ErlangAT20 < Formula
desc "Programming language for highly scalable real-time systems"
homepage "https://www.erlang.org/"
# Download tarball from GitHub; it is served faster than the official tarball.
url "https://github.com/erlang/otp/archive/OTP-20.3.8.24.tar.gz"
sha256 "588e34a89f9ea8ebc3bda0918e4e1f... | 32.651163 | 93 | 0.702991 |
87b88941f4394384e4659b9ac4ebafcec9507463 | 5,862 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'net/ssh'
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Auxiliary::Report
include Msf::Exploit::Remote::SSH
... | 29.756345 | 148 | 0.660355 |
ab1db5617d434705fe270c7df8dc5e15a85faebb | 1,863 | # frozen_string_literal: true
::RSpec.describe ::Koffer::Promise do
let(:promise) { described_class.new }
describe '#rescue' do
context 'when the promise resolves' do
subject! { promise.rescue { |reason| "recovered from #{reason.message}" } }
before { promise.resolve(1) }
it { is_expected.... | 34.5 | 120 | 0.672034 |
398a85103e7eb1430b71fabc119f149f5900b42e | 1,645 | require 'spec_helper'
module Boilerpipe::SAX
describe HTMLContentHandler do
describe '.new' do
it 'sets up tag actions'
it 'initializes state'
end
describe '#start_element' do
it 'saves the last tag element' do
subject.start_element 'div'
expect(subject.last_start_tag).... | 19.583333 | 69 | 0.63465 |
080501037c76d3aa1890f0b1c326569ac5b494c2 | 7,440 | class FenestrationConstruction
include Mongoid::Document
include Mongoid::Timestamps
field :name, type: String
field :fenestration_type, type: String
field :fenestration_product_type, type: String
field :assembly_context, type: String
field :certification_method, type: String
field :skylight_glazing, t... | 36.292683 | 101 | 0.649328 |
b964d9e2d722025512ce0ba225bfb80fc64e0428 | 1,751 | describe 'Chooser expected behaviors', js: true do
context 'when using the chooser' do
before do
login
visit new_permission_path
find('#collection_option_selected').click()
end
it 'does not click the + button when pressing enter in the left filter box' do
fill_in('from-filter', wi... | 35.734694 | 142 | 0.680183 |
e814bd5ab5b9bda92a7a6f765c3ba18ca218142c | 41 | div.this_is do
span.in_a_file render
end | 13.666667 | 22 | 0.829268 |
2629620604e3d10c129e2c3804280e74688e8f93 | 2,517 | # -*- encoding: utf-8 -*-
# stub: webpacker 5.2.1 ruby lib
Gem::Specification.new do |s|
s.name = "webpacker".freeze
s.version = "5.2.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "changelog_uri" => "https://github.com/rails/we... | 48.403846 | 198 | 0.656337 |
e9b3f73a7cdf46e05c661c3ef2d7eba7295967e7 | 142 | #
# Cookbook:: build_cookbook
# Recipe:: smoke
#
# Copyright:: 2017, Dru Goradia, All Rights Reserved.
include_recipe 'delivery-truck::smoke'
| 20.285714 | 53 | 0.739437 |
5d48649efab5f86799d64139a9209c9b8a8d2c8d | 3,897 | require_dependency 'application_controller'
class CommentsExtension < Radiant::Extension
version "0.0.5"
description "Adds blog-like comments and comment functionality to pages."
url "http://github.com/ntalbott/radiant-comments/tree/master"
define_routes do |map|
map.with_options(:contro... | 38.205882 | 149 | 0.634591 |
abc1ea722a1e8676182f5d28f538c60706d08f52 | 866 | require 'test_helper'
class LiqpayHelperTest < Test::Unit::TestCase
include ActiveMerchant::Billing::Integrations
def setup
@helper = Liqpay::Helper.new(1234, 'merch1', :amount => 500, :currency => 'USD')
end
def test_basic_helper_fields
assert_field 'merchant_id', 'merch1'
assert_field 'amou... | 25.470588 | 84 | 0.699769 |
7a7b2a1c402aad316b1b7f23a1ce17945744bb37 | 2,514 | #
# Author:: AJ Christensen (<aj@hjksolutions.com>)
# Copyright:: Copyright (c) 2008 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
#
# ... | 33.52 | 113 | 0.648369 |
01bcc9f35fea0afb7bfceb3d3989dd37b0af2630 | 1,333 | require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
# Require the g... | 38.085714 | 99 | 0.744936 |
1d67f83c6b1dc20fc805962d3fa0c94f3632b1c0 | 306 | # frozen_string_literal: true
class CreateComments < ActiveRecord::Migration[6.0]
def change
create_table :comments do |t|
t.references :user, null: false, foreign_key: true
t.references :post, null: false, foreign_key: true
t.string :content
t.timestamps
end
end
end
| 21.857143 | 56 | 0.689542 |
21922940277e7efd9da83f2a9da043f4b2728efa | 6,569 | require "nokogiri"
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class WorldpayUsGateway < Gateway
class_attribute :backup_url
self.display_name = "Worldpay US"
self.homepage_url = "http://www.worldpay.com/us"
# No sandbox, just use test cards.
self.live_url = 'https://... | 31.280952 | 116 | 0.606485 |
287d13b14ebc16968a433b4f372fd67a73517a4e | 1,413 | =begin
#Topological Inventory
#Topological Inventory
The version of the OpenAPI document: 2.0.0
Contact: support@redhat.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.2.1
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for TopologicalInventoryApiClient::Collecti... | 26.166667 | 102 | 0.745223 |
ff3be0ec0813fae3a355fc2079eb73e8cae2ee2e | 443 | =begin
#Aspose.ThreeD Cloud API Reference
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.11-SNAPSHOT
=end
require 'date'
module AsposeThre... | 15.821429 | 102 | 0.740406 |
ac82951bcad3814cec26dd0cf87f5580d130de0f | 784 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe EE::BulkImports::Groups::Graphql::GetEpicsQuery do
it 'has a valid query' do
context = BulkImports::Pipeline::Context.new(create(:bulk_import_tracker))
result = GitlabSchema.execute(
described_class.to_s,
variables: described_cl... | 23.757576 | 78 | 0.710459 |
085be46734cecd31d667a3840c79a27cc6ed9e31 | 74 | module Backbone
module NestedAttributes
VERSION = "0.5.0"
end
end
| 12.333333 | 25 | 0.702703 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.