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 |
|---|---|---|---|---|---|
91a3a222805a1c4aadf5355433999d5f0c4c8f12 | 409 | require 'rubygems'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
driver.get "http://google.com"
element = driver.find_element :name => "q"
element.send_keys "Cheese!"
element.submit
puts "Page title is #{driver.title}"
wait = Selenium::WebDriver::Wait.new(:timeout => 10)
wait.until { driver... | 24.058824 | 58 | 0.738386 |
030c54f75c5b05deb42f1b01f166b80124c8dd77 | 704 | # frozen_string_literal: true
require "date"
class Date
NOT_SET = Object.new # :nodoc:
def to_s(format = NOT_SET) # :nodoc:
if formatter = DATE_FORMATS[format]
ActiveSupport::Deprecation.warn(
"Date#to_s(#{format.inspect}) is deprecated. Please use Date#to_formatted_s(#{format.inspect}) instead.... | 26.074074 | 112 | 0.65483 |
7a9f6a02d0e171a639d148ba3ea5518a6770f245 | 5,926 | # sexp-ruby - A simple Ruby library for parsing and validating s-expressions
# Copyright (c) 2007-2015 Ingo Ruhnke <grumbel@gmail.com>
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
#
... | 24.589212 | 102 | 0.551131 |
f75812be673fda30792eafa2828e4e0e64f93c47 | 1,130 | name "necrosan"
description "Master role applied to necrosan"
default_attributes(
:networking => {
:interfaces => {
:external_ipv4 => {
:interface => "ens18",
:role => :external,
:family => :inet,
:address => "80.67.167.77",
:prefix => "32",
:gateway => "10.0... | 24.042553 | 95 | 0.548673 |
9161efa6ea822be2a77fad68d255346be4fbf213 | 6,024 | #
# Author:: Mike Dodge (<mikedodge04@gmail.com>)
# Copyright:: Copyright (c) 2015 Facebook, 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
#
# ... | 41.260274 | 146 | 0.667497 |
083b165dcecdf5e376db5588e8bfd8846d13d86e | 271 | require 'active_support/deprecation'
require 'active_support/core_ext/module/attribute_accessors'
ActiveSupport::Deprecation.warn(
"The cattr_* method definitions have been moved into active_support/core_ext/module/attribute_accessors. Please require that instead."
)
| 38.714286 | 136 | 0.841328 |
260ba6993256fbfcd32bafc8cc87eba3c873cb35 | 1,507 | require 'spec_helper'
require_relative 'shared_examples'
describe BRDocuments::IE::AL do
before :all do
@format_examples = {
'240000048' => '24.000.004-8'
}
@valid_numbers = %w(
240000048
24.000.004-8
24.000004.8
24000004-8
24.810989-8
24.840219-6
24.838... | 24.306452 | 80 | 0.627074 |
1a5ff22d5d98cb5caa96262f4b6eb4806a5229ae | 10,626 | RSpec.describe Metasploit::Model::Association::Tree do
context 'expand' do
subject(:expand) {
described_class.expand(associations)
}
context 'with Array<Hash>' do
let(:associations) {
[
{
first_parent: :first_child
},
{
... | 27.744125 | 131 | 0.582063 |
f818d93964bf1d8340915a8f678e92b41d99499d | 89 | # frozen_string_literal: true
class AdminAccessDeniedException < SmartvpnException; end
| 22.25 | 57 | 0.853933 |
03ab1cfb3e301715c1de5dd962db9ec6fc13a970 | 4,020 | module Rpush
module Client
module ActiveModel
module Apns
module Notification
APNS_DEFAULT_EXPIRY = 1.day.to_i
APNS_PRIORITY_IMMEDIATE = 10
APNS_PRIORITY_CONSERVE_POWER = 5
APNS_PRIORITIES = [APNS_PRIORITY_IMMEDIATE, APNS_PRIORITY_CONSERVE_POWER]
de... | 38.653846 | 149 | 0.579353 |
bb53a2440d4aa6034bdbe3e618ab35372d45f4dc | 2,164 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | 36.677966 | 85 | 0.752311 |
33192fae39f0c890d368949162a896975b58efde | 937 | require "rails_helper"
RSpec.describe Exchanges::BrokerApplicantsHelper, dbclean: :after_each, :type => :helper do
context "sort_by_latest_transition_time" do
let(:person1) {FactoryGirl.create(:person, :with_broker_role)}
let(:person2) {FactoryGirl.create(:person, :with_broker_role)}
let(:person3) {Fact... | 49.315789 | 107 | 0.77588 |
1d54a9f0f8a7054eae35834a773bcb12f4a2871b | 2,043 | # frozen_string_literal: true
require "ams_lazy_relationships/core/lazy_relationship_meta"
module AmsLazyRelationships::Core
module LazyRelationshipMethod
# This method defines a new lazy relationship on the serializer and a method
# with `lazy_` prefix.
#
# @param name [Symbol] The name of the lazy... | 33.491803 | 105 | 0.673519 |
f8e1325e2f16d27e94f020d15a238143a3e457dc | 18,634 | # Encoding: utf-8
# IBM WebSphere Application Server Liberty Buildpack
# Copyright IBM Corp. 2014, 2016
#
# 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... | 50.63587 | 179 | 0.623108 |
263158c4dfd99e36be83cdc38b4723215a0faf43 | 4,644 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 45.087379 | 114 | 0.762274 |
034c40a0436ea448f11ff7afc04e91d1ee5cfe15 | 127 | class CourseSerializer < ActiveModel::Serializer
attributes :id, :name, :description, :teacher_id
belongs_to :teacher
end
| 25.4 | 50 | 0.779528 |
0124ae7c5a4ea02588cde34320b387a1b6345b3c | 995 | require "rails_helper"
describe "PreviewUserMentions API", :json_api do
context "GET /preview_user_mentions/" do
def make_request_for_preview(preview)
get "#{host}/preview_user_mentions/", preview_id: preview.id
end
let(:preview_a) { create(:preview) }
let(:preview_b) { create(:preview) }
... | 31.09375 | 69 | 0.721608 |
7addb50ba0b86de4a5e2ac1b1c85a547844c0457 | 300 | require 'fileutils'
module Umakadata
# A class that represents Vocabulary Prefix
#
# @since 1.0.0
class VocabularyPrefix
class << self
EXCLUDE_PATTERNS = [
/www.openlinksw.com/
].freeze
def exclude_patterns
EXCLUDE_PATTERNS
end
end
end
end
| 15.789474 | 45 | 0.633333 |
ace9be155bc616c011be64cd9ed1b2306cf0249a | 705 | Pod::Spec.new do |s|
s.name = 'PDKTZipArchive'
s.version = '0.4.1'
s.summary = 'Utility class for zipping and unzipping files on iOS and Mac.'
s.description = 'PDKTZipArchive is a simple utility class for zipping and unzipping files on iOS and Mac.'
s.homepage = 'https://github.com/Prod... | 47 | 109 | 0.629787 |
5d63a45e83871c80bc10c25215a5d1d6dff54f94 | 1,061 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "jason_view_tool/version"
Gem::Specification.new do |spec|
spec.name = "jason_view_tool"
spec.version = JasonViewTool::VERSION
spec.authors = ["Jason Woo"]
spec.email = ["jas... | 37.892857 | 85 | 0.655985 |
f726be1396b3e5e122b7aa5081ccf5d5b2a3a438 | 41 | module Multipart
module Post
end
end
| 8.2 | 16 | 0.756098 |
619ba82c08af74eced9307de027d89e0247ac132 | 566 | # frozen_string_literal: true
# Filters a collection based on the internal members aggregator
class DuplicateFileIterator
include Enumerable
def initialize(collection = [], duplicates: true)
@collection = collection
@duplicates = duplicates
end
def each(&block)
grouped = @collection.group_by(&:ag... | 25.727273 | 120 | 0.687279 |
7a6c42f76da3060994a2f6a59a84f268c89645ac | 4,742 | require File.dirname(__FILE__) + '/../spec_helper'
include PreferenceFactory
describe Preference, "by default" do
before(:each) do
@preference = Preference.new
end
it "should not have an attribute" do
@preference.attribute.should be_blank
end
it "should not have an owner" do
@preference.owner.... | 25.632432 | 78 | 0.717841 |
87bfd4f168d2e06c25d6c52c573e9470cc8262b4 | 1,470 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Consumption::Mgmt::V2019_05_01
module Models
#
# The details of the error.
#
class ErrorDetails
include MsRestAzure
# @return [S... | 24.915254 | 75 | 0.504082 |
26bdc6b8c2c42adc0ff1fc3d2bb1c790cb275e97 | 2,078 | # frozen_string_literal: true
describe Api::V3::DecisionReview::ContestableIssueFinder, :all_dbs do
include IntakeHelpers
def lookup(ids = {})
Api::V3::DecisionReview::ContestableIssueFinder.new(
{
decision_review_class: decision_review_class,
veteran: veteran,
receipt_date: rece... | 28.861111 | 97 | 0.674206 |
d508a32eb0291e9c05f63d5e1bd5912a34cf4bbb | 4,993 | class Chef
module Formatters
# Handles basic indentation and colorization tasks
class IndentableOutputStream
attr_reader :out
attr_reader :err
attr_accessor :indent
attr_reader :line_started
attr_accessor :current_stream
attr_reader :semaphore
def initialize(out, er... | 28.695402 | 106 | 0.569798 |
26f29358871309db3a785a4151eadbf1e9f1c910 | 3,120 | describe RuboCop::Cop::Migration::UnsafeMigration do
subject(:cop) { described_class.new }
before do
inspect_source(cop, source)
end
shared_examples "valid code" do
it "doesn't register an offense" do
expect(cop.offenses).to be_empty
end
end
context "a non-migration class" do
let(:s... | 26 | 95 | 0.621474 |
e24ce551b91fbcb1733acd43ebf4c6f27a91a4f4 | 1,517 | Pod::Spec.new do |s|
s.name = "STPopup"
s.version = "1.7.1"
s.summary = "STPopup provides STPopupController, which works just like UINavigationController in form sheet/bottom sheet style, for both iPhone and iPad."
s.description = <<-DESC
- Extend your view controller fro... | 56.185185 | 221 | 0.625577 |
612df2dfe48b05448237185c2e22f1953fe8210a | 1,406 | require 'spec_helper'
describe FacetParser do
context "with a select facet definition" do
let(:facet_definition) {
{
'type' => "text",
'filterable' => true,
'display_as_result_metadata' => true,
'name' => "Case type",
'key' => "case_type",
'preposition' => "o... | 31.954545 | 88 | 0.571835 |
117ac0601678d7879cecf1c097ce59c2182287f0 | 170 | # frozen_string_literal: true
require "mini_magick"
Riiif::Image.file_resolver = RiiifResolver.new
Riiif::Image.file_resolver.base_path = Figgy.config["derivative_path"]
| 34 | 70 | 0.823529 |
62097b7d7b3f3af175204ef21ad2be0d0a6ed394 | 1,191 | SlackRubyBotServer::Events.configure do |config|
config.on :command, '/evening_standup' do |command|
include Keeper_pre_standup
include Evening_Standup_Commands
include Both_Standup_Commands
team_id = command[:team_id]
user_id = command[:user_id]
standup = Standup_Check.find_by(user_id: user_i... | 29.775 | 66 | 0.606213 |
214bfd046f95d7816827428c5f3dca9ac042ee68 | 4,850 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 45.327103 | 114 | 0.761856 |
03099f456abed6b4abf2eecdfd72272a51c797ba | 738 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'flutter_tts'
s.version = '0.0.1'
s.summary = 'A flutter text to speech plugin.'
s.description = <<-DESC
A flutter text to speech plugin
... | 32.086957 | 83 | 0.567751 |
bb7542dadf9e27c7616d8542e4ae4d025cb705d0 | 387 | class CreateItems < ActiveRecord::Migration[5.0]
def change
create_table :items do |t|
t.string :title
t.string :code
t.string :item_type
t.string :state
t.string :reference
t.string :domain
t.string :description
t.string :mac
t.string :serie
t.integer :... | 20.368421 | 48 | 0.607235 |
bb734ba9334ec16f88575bda058e29345179ad71 | 2,890 | # 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.054054 | 96 | 0.695848 |
39e99c66a9cb9fc6245f5c8f0b4a091587a5eabc | 500 | require './test/app_helper'
require './test/vcr_helper'
class AppRoutesProblemsTest < Minitest::Test
include Rack::Test::Methods
def app
Xapi::App
end
def test_full_problems_list
get '/problems'
options = { format: :json, name: 'get_full_problems_list' }
Approvals.verify(last_response.body, o... | 21.73913 | 63 | 0.71 |
618496bd63ae402bd8f164badd75791e0c7cf769 | 303 | class SearchableField
attr_accessor :name, :field_type, :association_name, :associated_klass
def initialize(name, field_type, association_name, associated_klass)
@name = name
@field_type = field_type
@association_name = association_name
@associated_klass = associated_klass
end
end | 30.3 | 71 | 0.778878 |
38d640ee19ed9f5a4a498381d9e2285f1977e95a | 779 | AssetSync.configure do |config|
config.fog_provider = 'AWS'
config.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID']
config.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
config.fog_directory = ENV['FOG_DIRECTORY']
# Increase upload performance by configuring your region
# config.fog_region = 'eu-west-1... | 35.409091 | 80 | 0.75353 |
033be7d15f8cc09a6cae7cf0931a440dbd5fbd4a | 2,506 | describe Travis::API::V3::Services::Installation::Find, set_app: true do
let(:user) { Travis::API::V3::Models::User.find_by_login('svenfuchs') }
let!(:installation) { Travis::API::V3::Models::Installation.create(owner_type: 'User', owner_id: user.id, github_id: 789) }
let(:token) { Travis::Api::App::AccessToke... | 38.553846 | 125 | 0.53352 |
1d9b1a4463becd96891cec68ea56f3fbfc2744ad | 21,277 | describe ManageIQ::Providers::Redhat::InfraManager do
it ".ems_type" do
expect(described_class.ems_type).to eq('rhevm')
end
it ".description" do
expect(described_class.description).to eq('Red Hat Virtualization')
end
describe ".metrics_collector_queue_name" do
it "returns the correct queue name"... | 39.474954 | 202 | 0.653147 |
7a8228678b50eb2f1a1638dc0027ceef892aa62a | 42 | module FakeDynamo
VERSION = "0.0.1"
end
| 10.5 | 19 | 0.690476 |
bfd767a94519c8663cd84fc46d49103807941965 | 3,238 | # frozen_string_literal: true
# code by MSP-Greg
# file is included all scripts in the repo
require 'json'
require 'net/http'
module JsonPrIssueBase
fn_cred = ARGV[0]
if File.exist? fn_cred
cred = JSON.parse(File.read fn_cred, mode: 'rb:UTF-8')
else
puts "Filename passed as ARGV doesn't exist!"
e... | 23.985185 | 89 | 0.546016 |
4a4fb9477992e8624f8405ad518b567cf1d86f74 | 441 | rspec_module = defined?(RSpec::Core) ? 'RSpec' : 'Spec' # for RSpec 1 compatability
Kernel.const_get(rspec_module)::Matchers.define :be_able_to do |*args|
match do |ability|
ability.can?(*args)
end
failure_message_for_should do |ability|
"expected to be able to #{args.map(&:inspect).join(" ")}"
end
... | 29.4 | 84 | 0.69161 |
38304a87449afde51a52471d2905ebc624d9c450 | 95 | # frozen_string_literal: true
module BlackHole
def self.method_missing(*)
self
end
end
| 13.571429 | 29 | 0.747368 |
384c9a1f7fb86dccdcfb20bcd950b3ab549da8e9 | 2,481 | # frozen_string_literal: true
RSpec.describe RuboCop::Cop::Lint::RequireParentheses do
subject(:cop) { described_class.new }
it 'registers an offense for missing parentheses around expression with ' \
'&& operator' do
expect_offense(<<-RUBY.strip_indent)
if day.is? 'monday' && month == :jan
... | 29.188235 | 115 | 0.645304 |
79a5491ba0172d64ae7378c23635f860b263c467 | 6,383 | =begin
#Hydrogen Integration API
#The Hydrogen Integration API
OpenAPI spec version: 1.3.1
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.21
=end
require 'date'
module IntegrationApi
class UpdateCardClientResponseVO
attr_access... | 29.279817 | 107 | 0.626351 |
38834648e5a60ab50b9304edc6a19c8ff7f53c4c | 806 | require 'spec_helper'
describe Alchemy::EssencesHelper do
let(:element) { FactoryGirl.create(:element, :create_contents_after_create => true) }
before do
element.content_by_name('intro').essence.update_attributes(:body => 'hello!')
end
it "should render an essence" do
content = element.content_by_na... | 26.866667 | 87 | 0.729529 |
7af9e34a2e3b6a6a1e8c0b17049103872e3c978c | 996 | BASE_PATH = 'https://raw.githubusercontent.com/weh/can-has-templates-for/master'
puts <<INFO
------------------===<<{ WARNING }>>===------------------
Make Sure RVM Setup is correct: rvm use 2.2.0@blog_gemset
INFO
unless no?('Ready? [yes]')
apply "#{BASE_PATH}/rails/database.rb" unless no?('Setup MySQL Database?... | 29.294118 | 82 | 0.658635 |
e2c523b96f7f4fb918ffa5d174c493892ac5fb8a | 5,169 | require 'spec_helper'
describe Wyatt::Netsuite::Records::Builder do
let(:builder_class) { Wyatt::Netsuite::Records::Builder }
let(:builder) { builder_class.new(record_name, schema_file_path) }
let(:record_name) { "foo_bar_baz" }
let(:record_class_name) { "FooBarBaz" }
let(:schema_file_pa... | 25.716418 | 96 | 0.670923 |
0131da5fca5b000d6a71bbde19182921d803fc61 | 176 | class UserMailer < Devise::Mailer
def activation_instructions(record, token, opts = {})
@token = token
devise_mail(record, :activation_instructions, opts)
end
end
| 22 | 55 | 0.727273 |
380b48fcb835dde2111d9a2d4370fa56d9ea917e | 2,729 | #!/usr/bin/env ruby
require 'rex/post/meterpreter/extensions/sniffer/tlv'
require 'rex/proto/smb/utils'
module Rex
module Post
module Meterpreter
module Extensions
module Sniffer
###
#
# This meterpreter extension can be used to capture remote traffic
#
###
class Sniffer < Extension
def initialize(client)
super... | 27.019802 | 69 | 0.749725 |
03677dfd3bfffd6a94521c60610e749dcdae258e | 710 | # frozen_string_literal: true
require 'generators/warclight/install_generator'
module Warclight
##
# Warclight Update generator. This subclasses the Install generator, so this is
# intended to override behavior in the install generator that can allow the
# downstream application to choose if they want to take... | 30.869565 | 81 | 0.738028 |
e8df7f5c203bdcfc41bc9c7a8437156759a86572 | 2,592 | class MongoCxxDriver < Formula
desc "C++ driver for MongoDB"
homepage "https://github.com/mongodb/mongo-cxx-driver"
url "https://github.com/mongodb/mongo-cxx-driver/archive/r3.6.7.tar.gz"
sha256 "a9244d3117d4029a2f039dece242eef10e34502e4600e2afa968ab53589e6de7"
license "Apache-2.0"
head "https://github.com/... | 42.491803 | 123 | 0.65625 |
e80d80762d21e0e7041b29ad3fdc7d498ad716d4 | 1,850 | # Medium is a module used to interact with the Medium v1 API
module Medium
# Users class is used to interact with the Users API endpoint of Medium
class Users
# Initialize a new Medium::Users client
#
# @param client [#get] The network client to use while retrieving data from
# the Users resource.... | 31.355932 | 93 | 0.581622 |
e27ee0c3221851daab5cc27f3e70ae4ad31f6d6b | 19,910 | # 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::Monitor::Mgmt::V2017_10_01_preview
#
# Composite Swagger for Application Insights Management Client
#
class ComponentCurrentPricingPla... | 52.671958 | 206 | 0.720844 |
1a5d2573059ec57a06d8413d74ff0b477f251f95 | 747 | # encoding: BINARY
class MQTT::SN::Packet::Connect < MQTT::SN::Packet
attr_accessor :keep_alive
attr_accessor :client_id
DEFAULTS = {
:request_will => false,
:clean_session => true,
:keep_alive => 15
}
# Get serialisation of packet's body
def encode_body
if @client_id.nil? || @client_id.e... | 23.34375 | 80 | 0.685408 |
abd69fede2842731ecbb954e21a9697f587e0d2a | 1,093 | points = []
folds = []
File.readlines("input2.txt").collect(&:chomp).reject(&:empty?).each do |line|
if line.start_with?("fold along")
axis, point = line.split(" ")[-1].split("=")
folds << [axis, point.to_i]
else
points << line.split(",").collect(&:to_i)
end
end
folds.each do |axis, point|
puts "pr... | 19.175439 | 77 | 0.538884 |
7a9b24c62f4b1d5cff210c78c41807c62d6eae21 | 27,395 | # frozen_string_literal: true
require 'rspec_api_documentation/dsl'
require 'helpers/acceptance_spec_helper'
# https://github.com/zipmark/rspec_api_documentation
resource 'AudioEventComments' do
# set header
header 'Accept', 'application/json'
header 'Content-Type', 'application/json'
header 'Authorization',... | 49.990876 | 187 | 0.70345 |
5d821376863ce579b9438611456bc85641a8e939 | 1,365 | =begin
#GraphHopper Directions API
#You use the GraphHopper Directions API to add route planning, navigation and route optimization to your software. E.g. the Routing API has turn instructions and elevation data and the Route Optimization API solves your logistic problems and supports various constraints like time win... | 31.744186 | 403 | 0.769231 |
08c30a96290d4cf597efce088d7b2e199b21c591 | 411 | # just for compatibility; requiring "md5" is obsoleted
#
# $RoughId: md5.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
# $Id: md5.rb 12007 2007-03-06 10:09:51Z knu $
require 'digest/md5'
class MD5 < Digest::MD5
class << self
alias orig_new new
def new(str = nil)
if str
orig_new.update(str)
else... | 17.125 | 54 | 0.593674 |
18b2bfa22aeaf9595555ebc0959060abb9463e88 | 376 | cask :v1 => 'mongochef' do
version '3.1.0'
sha256 '6c67fbad534bba6815c2ce665f91e8e5dc8700f597b6b4cf47789a99db62ed97'
url "https://cdn.3t.io/mongochef/mac/#{version}/MongoChef.dmg"
name 'MongoChef'
homepage 'https://3t.io/mongochef/'
# License is free for personal use (gratis) and paid for business use (com... | 28.923077 | 84 | 0.739362 |
1c8ec26bfc963590cd021978d4f96056dbb7ae4a | 891 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'recording a new maneuver score' do
let(:judge) { create :user, :judge }
let(:maneuver) { create :maneuver }
let(:participant) { create :participant }
let(:mp) do
ManeuverParticipant.find_by maneuver_id: maneuver,
... | 28.741935 | 82 | 0.67789 |
262d8da9fc57ca3ba534891e3faa5930aa9fd45e | 1,650 | module TD::Types
# Represents a local file.
#
# @attr path [TD::Types::String, nil] Local path to the locally available file part; may be empty.
# @attr can_be_downloaded [Boolean] True, if it is possible to download or generate the file.
# @attr can_be_deleted [Boolean] True, if the file can be deleted.
# ... | 56.896552 | 115 | 0.750303 |
1aa9ceafdf529778544bf3d77aa1df535906afb0 | 782 | =begin
Copyright 2012-2013 inBloom, Inc. and its affiliates.
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... | 30.076923 | 72 | 0.772379 |
91d2e3dd625d7be8283ac9be4117877f5ed1a032 | 193 | {
'info' => {
'url' => 'http://eruditeum.com/mantis',
'username' => 'test_admin',
'password' => 'test_password'
},
'parameters' => {
'issue_attachment_id' => '000001',
}
}
| 17.545455 | 43 | 0.533679 |
f7c07c3d834a3832847de4df3344ec8cefeffcf9 | 859 | # frozen_string_literal: true
module Clowne
module Declarations
class Trait # :nodoc: all
def initialize
@blocks = []
end
def extend_with(block)
@blocks << block
end
def compiled
return @compiled if instance_variable_defined?(:@compiled)
@compiled ... | 17.895833 | 66 | 0.605355 |
911bad8822717a2bf79192f3fc1450fae514b36c | 844 | require 'swiftcore/swiftiplied_mongrel'
require 'merb-core/rack/handler/mongrel'
module Merb
module Rack
class SwiftipliedMongrel < Mongrel
# Starts Mongrel as swift.
#
# ==== Parameters
# opts<Hash>:: Options for Mongrel (see below).
#
# ==== Options (opts)
# :host<Stri... | 32.461538 | 76 | 0.626777 |
030253554ffd0701290cd2e657522d134017ecc5 | 93 | class FavoriteSerializer < ActiveModel::Serializer
attributes :id, :issue_id, :user_id
end
| 23.25 | 50 | 0.795699 |
e827520f09f10eac5ab8ef5c786075d722273bd8 | 1,649 | # frozen_string_literal: true
module Effective
class Representative < ActiveRecord::Base
attr_accessor :new_representative_user_action
acts_as_role_restricted
log_changes(to: :organization) if respond_to?(:log_changes)
belongs_to :organization, polymorphic: true, counter_cache: true
belongs_to... | 28.929825 | 116 | 0.70285 |
391f37aab82b7b6147339129e3c99f7c82223448 | 652 | # Usage examples:
# folder.documents.should be_contiguous
# folder.documents.should be_contiguous.starting_at(1)
RSpec::Matchers.define :be_contiguous do
match do |array|
@start ||= 0
array.each_with_index do |current, index|
current.reload.position.should == index + @start
end
end
def sta... | 23.285714 | 56 | 0.661043 |
87c3f5248f4e910f7b4270977dad8eb16f352da0 | 956 | require 'spec_helper'
require 'browser/location'
require 'browser/socket'
describe Browser::Socket do
# FIXME: find out why it doesn't work inline
ws = "ws://#{$window.location.host}/socket"
it 'creates a socket' do
promise = Promise.new
Browser::Socket.new ws do |s|
s.on :open do |e|
expe... | 19.916667 | 49 | 0.588912 |
bb445bb7fc9d93446f685a99d950c2bef3cbb7fa | 6,071 | class Hazelcast < Formula
desc "Hazelcast is a streaming and memory-first application platform for fast, stateful, data-intensive workloads on-premises, at the edge or as a fully managed cloud service."
homepage "https://github.com/hazelcast/hazelcast-command-line"
url "https://repo.maven.apache.org/maven2/... | 83.164384 | 180 | 0.766431 |
ed90d5cc6b595c5736109bf98989b61d324ec3d8 | 3,651 | # frozen_string_literal: true
module Stealth
module Nlp
module Luis
class Result < Stealth::Nlp::Result
ENTITY_MAP = {
'money' => :currency, 'number' => :number, 'email' => :email,
'percentage' => :percentage, 'Calendar.Duration' => :duration,
'geographyV2' => :geo, '... | 27.659091 | 117 | 0.453027 |
6a1a75218ac3023cad0e22cdbf4dbe5771686382 | 11,475 | require 'test_helper'
class WirecardTest < Test::Unit::TestCase
include CommStub
TEST_AUTHORIZATION_GUWID = 'C822580121385121429927'
TEST_PURCHASE_GUWID = 'C865402121385575982910'
TEST_CAPTURE_GUWID = 'C833707121385268439116'
def setup
@gateway = WirecardGateway.new(:login => '', :password => '', :sign... | 37.37785 | 130 | 0.652985 |
bb7c07b2c5242034131e7dace65a5142bdf44b07 | 1,026 | require 'spec_helper'
require_relative '../../../../lib/genome/core/helpers/property'
RSpec.describe Genome::Core::Helpers::Property do
subject(:test_klass) { Class.new { include Genome::Core::Helpers::Property } }
let(:property_name) { :test_property }
let(:property_parameters) {
{
param1: 'value_1',... | 30.176471 | 136 | 0.723197 |
0310cbb309b9942fc61d0da8d7b65aa1f9006aed | 250 | module BaconExpect; module Matcher
class BeTrue
def matches?(value)
value == true
end
def fail!(subject, negated)
raise FailedExpectation.new(FailMessageRenderer.message_for_be_true(negated, subject))
end
end
end; end | 22.727273 | 92 | 0.712 |
acd1e8deb97af742a47f00793937a05c1cdf1f6a | 741 | module RedisRecord
module Helpers
def redis
@redis ||= self.class.redis
end
def id
@fields[:id] ||= SecureRandom.hex(10)
end
def persisted?
find_by(:id, id)
end
def to_param
persisted? ? id : nil
end
def new_record?
to_param ? false : true
end
... | 13.722222 | 43 | 0.576248 |
112e8e698c82cc0e212f0926f7d9b0ffec8716fe | 1,543 | #
# Copyright:: 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 32.829787 | 84 | 0.760855 |
7960db1bfee3826f0114b89e5257595963948aa6 | 613 | # frozen_string_literal: true
module AllinsonFlex
class DynamicSchema < ApplicationRecord
belongs_to :context
belongs_to :profile
before_destroy :check_for_works
serialize :schema, JSON
validates :allinson_flex_class, :schema, presence: true
delegate :profile_version, to: :profile
privat... | 25.541667 | 93 | 0.69168 |
625b85db2dbe46087fc63217abd81898d4afb23d | 182 | class UserNoms < ActiveRecord::Migration
def change
create_table :user_noms do |t|
t.integer :giver_id
t.integer :consumer_id
t.timestamps
end
end
end
| 16.545455 | 40 | 0.67033 |
01d931bf081d527a6e7354c7920e62dad218384f | 139 | class AddArchivedAtToUseAgreement < ActiveRecord::Migration
def change
add_column :use_agreements, :archived_at, :datetime
end
end
| 23.166667 | 59 | 0.798561 |
ff923fbf529ae7e43535130aa676905e43a56d86 | 195 | module CodeRay
module Scanners
load :html
# XML Scanner
#
# $Id$
#
# Currently this is the same scanner as Scanners::HTML.
class XML < HTML
register_for :xml
end
end
end
| 10.263158 | 57 | 0.646154 |
ff5406f50423b39ae0a4e570af8eceb374df254e | 457 | default['duosecurity']['install_type'] = 'source'
default['duosecurity']['package_action'] = 'upgrade'
default['duosecurity']['source_sha256'] = 'e2df2be50539c54c87cdc4964fdfee0fbd79a3f15fdfd807e94941291b5d6197'
default['duosecurity']['source_version'] = '1.10.1'
default['duosecurity']['use_pam'] = 'no'
default['duosec... | 45.7 | 108 | 0.73523 |
082cdbaa30d8a1c124efc180447bbcd4474d0017 | 181 | class CreateAPIKeys < ActiveRecord::Migration
def change
create_table :api_keys do |t|
t.string :name
t.string :access_token
t.timestamps
end
end
end
| 16.454545 | 45 | 0.668508 |
084b59099529e131bf7965c8efa850234e5d07d6 | 1,656 | # Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
require File.expand_path(File.... | 31.846154 | 84 | 0.649155 |
335c15df8fb232b1c23834453be4f06576826abb | 209 | class Label
# Accessible properties
attr_accessor :name, :link_url
# Initialize properties
def initialize(entry)
@name = entry.fields[:name]
@link_url = entry.fields[:link_url]
end
end | 14.928571 | 39 | 0.69378 |
01a7c958be1ec6c9ae849805859b310f7801988b | 74 | # frozen_string_literal: true
module UseCaseFlow
VERSION = '1.0.0'
end
| 12.333333 | 29 | 0.743243 |
031be181ca3dd3a5253fa5836ac8c0648e589056 | 1,731 | Rails.application.routes.draw do
resources :users
root 'pages#home'
get 'subscribe' => 'users#new', as: 'subscribe'
get 'pages/api/:zip' => 'pages#api'
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
# You can hav... | 27.046875 | 84 | 0.644714 |
285dee4ad5adba92658a1ba1fa54b7bbb039e176 | 1,560 | require_relative 'event_relay'
module Metro
class EventStateManager
def initialize
@current_state = []
end
attr_accessor :window
attr_reader :current_state
#
# Clear all the event relays of the current game state
#
def clear
current_state.clear
end
#
# Fir... | 22.285714 | 81 | 0.678205 |
91b142d5da2aa7ab65031f78bbfa4d4581989a79 | 2,712 | require 'spec_helper'
describe Chicago::ETL::LoadDatasetBuilder do
let(:db) { double(:database).as_null_object }
before :each do
db.stub(:[]).with(:original_users).
and_return(TEST_DB[:original_users])
db.stub(:[]).with(:original_preferences).
and_return(TEST_DB[:original_preferences])
db[... | 31.172414 | 149 | 0.673304 |
d5c267585b68120211669e4c95db2137b211b5d6 | 179 | class RemoveUniqueNameIndexFromProjectStatus < ActiveRecord::Migration
def change
remove_index :project_statuses, :name if index_exists?(:project_statuses, :name)
end
end
| 29.833333 | 84 | 0.810056 |
01165072bd50e7124d6efa3c5166f4e8897cea4b | 1,914 | control 'VCST-67-000030' do
title 'The Security Token Service must set the secure flag for cookies.'
desc "The secure flag is an option that can be set by the application server
when sending a new cookie to the user within an HTTP Response. The purpose of
the secure flag is to prevent cookies from being observ... | 34.8 | 80 | 0.685475 |
28130f03655a053aa883c65e6f28dcee7f1d55ef | 2,506 | require "spec_helper"
describe Volunteer do
describe '#name' do
it 'returns the name of the volunteer' do
test_volunteer = Volunteer.new({:name => 'Jane', :project_id => 1, :id => nil})
expect(test_volunteer.name).to eq 'Jane'
end
end
describe '#project_id' do
it 'returns the project_id... | 30.560976 | 85 | 0.613727 |
79aed0847e9a091a9e3ece469083a71e0520a9ff | 978 | cask 'bettertouchtool' do
if MacOS.version <= :mavericks
version '2.05'
sha256 '41013cfeffee286a038363651db3dd315ff3a1e0cf07774d9ce852111be50a5a'
# bettertouchtool.net/releases was verified as official when first introduced to the cask
url "https://bettertouchtool.net/releases/btt#{version}_final_10_... | 31.548387 | 93 | 0.735174 |
bb2ae20c3d34cb99f23b070dae2373301e61ccb3 | 488 | cask "cmdtap" do
version "1.9.4"
sha256 "7e31179f044f3a834ea51daf250ad5085d6c8ea4bbabb8c1b193cff103d3f5ea"
url "https://www.yingdev.com/Content/Projects/CmdTap/Release/#{version}/CmdTap.zip"
name "CmdTap"
desc "Adds other functions to Task Switcher"
homepage "https://www.yingdev.com/projects/cmdtap"
liv... | 27.111111 | 85 | 0.711066 |
abb5b719e4d47d10840d29a832c64557ccce81ac | 825 | class ContentController < Api::BaseController
before_action :validate_params!
def show
filter = api_request.to_filter
content = Finders::Content.call(filter: filter)
@content_items = content[:results]
@page = content[:page]
@total_pages = content[:total_pages]
@total_results = content[:tot... | 24.264706 | 125 | 0.698182 |
26477a19fd914c4f83aa6e58ce9c529ad45d9722 | 11,694 | # Copyright (C) 2014-2019 MongoDB, 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 ... | 28.945545 | 85 | 0.624594 |
f76b29226351a3fdb3e7d229ac98daf91429e39e | 271 | module Playable
# Override if the current instance maps to multiple playable actions
def playable_actions
[playable_action]
end
# Override if the current instance maps to a single playable action
def playable_action
raise NotImplementedError
end
end
| 22.583333 | 70 | 0.778598 |
d5498f5c9c1181cf6ed8490d283dfea330776b3e | 663 | # Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to diction... | 51 | 178 | 0.815988 |
ac9f340520d8c09e5f7f60c5fe362d651d86eac3 | 127 | object @domain
attributes :id, :name, :type
child :records => :records do
attributes :id, :name, :type, :content, :prio
end
| 18.142857 | 47 | 0.685039 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.