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 |
|---|---|---|---|---|---|
081a86600dfd4d9e7b953f4396f122d786708d4b | 133 | require 'rspec'
require 'sir'
RSpec.configure do |config|
config.color_enabled = true
config.formatter = 'documentation'
end | 19 | 40 | 0.736842 |
ac0897a17a05db5149f71457ec9bc103888214f8 | 4,529 | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (http://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module America
module Argentina
module Ushuaia
include TimezoneDefinition
timezone 'A... | 50.322222 | 72 | 0.550453 |
f77a53b28d6589477d8220d33c8cd3143f42bfaa | 15,816 | require_relative '../../../spec_helper'
describe AIXM::Feature::Airspace do
context "only required attributes set" do
subject do
AIXM.airspace(type: "TMA", name: "Test TMA")
end
describe :initialize do
it "sets defaults" do
_(subject.id).must_equal 'C55466EC'
_(subject.geome... | 32.476386 | 79 | 0.516186 |
bb4eba103b81c64c41cedc9b64a8a25f59fde33f | 2,276 | require File.dirname(__FILE__) + '/../spec_helper'
describe IceCube::DailyRule, 'occurs_on?' do
it 'should not produce results for @interval = 0' do
start_date = DAY
schedule = IceCube::Schedule.new(start_date)
schedule.add_recurrence_rule IceCube::Rule.daily(0)
#check assumption
dates = schedul... | 38.576271 | 102 | 0.680141 |
61d23698c54f1bd9c9657adc661db4a9ed550297 | 3,050 | require 'socket'
require 'logger'
require 'rubygems'
require 'eventmachine'
here = File.dirname(__FILE__)
require File.join(here, 'queue_collection')
require File.join(here, 'handler')
module StarlingServer
VERSION = "0.10.0"
class Base
attr_reader :logger
DEFAULT_HOST = '127.0.0.1'
DEFAULT_P... | 24.206349 | 77 | 0.587869 |
263cb838631e3dbbbc88730875f159adf165fa41 | 1,416 | def it_requires_authentication(options = {})
default_options = {
:for => {
:index => :get,
:show => :get,
:new => :get,
:create => :post,
:edit => :get,
:update => :patch,
:destroy => :delete
},
:params => {:id => '4c6c760494df2a18cc000015'}
... | 24 | 75 | 0.560734 |
3877c1a12a1da582ece2e6967babc957963444dd | 1,174 | # frozen_string_literal: true
module Competitions
# Year-long best rider competition for senior men. http://obra.org/oregon_cup
class OregonCup < Competition
def friendly_name
"Oregon Cup"
end
def point_schedule
[100, 75, 60, 50, 45, 40, 35, 30, 25, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, ... | 29.35 | 115 | 0.620102 |
6a7c8e0d5ebf523df4d44a1ada8e6c6e4dbba6b3 | 1,508 | #
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Tyler Cloke (<tyler@opscode.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 ma... | 23.5625 | 74 | 0.600796 |
79e5127e1ee849be57ed083ff2f49ab3a01bc0d9 | 5,331 | require 'symath/definition'
module SyMath
class Definition::Operator < Definition
attr_reader :args
attr_reader :exp
def self.init_builtin()
SyMath::Definition::D.new
SyMath::Definition::Xd.new
SyMath::Definition::Int.new
SyMath::Definition::Bounds.new
SyMath::Definition::S... | 23.279476 | 85 | 0.556744 |
38d04d147752e35714bbc1ef35918fae7e13ec67 | 510 | require_relative "lib/simple/hash"
Gem::Specification.new do |spec|
spec.name = "simple-hash"
spec.version = Simple::Hash::VERSION
spec.authors = ["localhostdotdev"]
spec.email = ["localhostdotdev@protonmail.com"]
spec.summary = "typically make JSON into object with accessors"
spec.homepage = "https://gith... | 34 | 65 | 0.713725 |
182bdd23716d465b2c6b245d06fb9d9f6cc9257f | 921 | RailsAdmin.config do |config|
### Popular gems integration
## == Devise ==
config.authenticate_with do
warden.authenticate! scope: :user
end
config.current_user_method(&:current_user)
config.authorize_with do |controller|
unless current_user.has_role? :admin
redirect_to main_app.root... | 21.418605 | 87 | 0.634093 |
87a6eea06039f65e2794b92d2ab3e140bdf3ceba | 2,517 | Shindo.tests('Fog::Compute[:vsphere] | vm_clone request', ['vsphere']) do
# require 'guid'
compute = Fog::Compute[:vsphere]
response = nil
response_linked = nil
template = 'rhel64'
datacenter = 'Solutions'
default_params = {
'datacenter' => datacenter,
'template_path' => template,
'resource_p... | 44.946429 | 133 | 0.663091 |
6a84f0c6f2087b0ae06a41cf8273aa7dce790ffb | 4,133 | require File.dirname(__FILE__) + "/../spec_helper"
java_import 'java_integration.fixtures.PrivateInstanceMethod'
java_import 'java_integration.fixtures.PrivateStaticMethod'
java_import 'java_integration.fixtures.ProtectedInstanceMethod'
java_import 'java_integration.fixtures.ProtectedStaticMethod'
java_import 'java_in... | 37.572727 | 99 | 0.747399 |
bfe03bd671d8fc2f731fe955b312f4300d60329e | 58,695 | require 'ostruct'
require 'xml/xml_utils'
require 'cgi' # Used for URL encoding/decoding
require 'metadata/linux/LinuxUsers'
require 'metadata/linux/LinuxUtils'
require 'metadata/ScanProfile/HostScanProfiles'
class Host < ApplicationRecord
include SupportsFeatureMixin
include NewWithTypeStiMixin
in... | 33.888568 | 165 | 0.659715 |
ff1aa255c937129c5b81237c2d1cc37a40eb4729 | 6,581 | # Encoding: utf-8
require 'socket'
require 'redis'
require 'json'
require 'securerandom'
# The top level container for all things qless
module Qless
# Define our error base class before requiring the other files so they can
# define subclasses.
Error = Class.new(StandardError)
# to maintain backwards compati... | 25.707031 | 79 | 0.637897 |
f8bf894cf0d090ca4ba69e6cbeeff4e8b18b2853 | 1,195 | node ||= {
"rbenv" => {
"versions" => [ "2.2.2" ],
"local" => "2.2.2",
"gems" => [ "bundler", "rake" ],
"user" => "vagrant",
"rbenv_config_file" => "~/.bash_profile",
"rbenv_dir" => "/var/tmp/rbenv",
"rubybuild_dir" => "/var/tmp/rbenv/plugins/ruby-build",
},
}
node["rbenv"]["versions"].... | 34.142857 | 111 | 0.622594 |
d5d04dc3c4d85d640c547eef2f3bace29300088e | 2,697 | # 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... | 41.492308 | 116 | 0.705599 |
79a9ed6ada6238ad7bbcbeddeec1eed231d8f6fb | 4,027 | shared_examples_for 'globus::repo::el' do |facts|
if facts[:operatingsystem] == 'Fedora'
let(:url_os) { 'fedora' }
else
let(:url_os) { 'el' }
end
let(:baseurl) { "https://downloads.globus.org/toolkit/gt6/stable/rpm/#{url_os}/#{facts[:operatingsystemmajrelease]}/$basearch/" }
let(:baseurl_v5) { "https:... | 56.71831 | 294 | 0.4815 |
1d3fabc6feeee2d1f9a33cd4fdbea1590e156ff2 | 1,597 | require 'json'
require 'bunny'
module Integrity
class Notifier
class AMQP < Notifier::Base
def self.to_haml
<<-HAML
%p.normal
%label{ :for => "amqp_queue_host" } Host
%input.text#amqp_queue_host{ |
:name => "notifiers[AMQP][queue_host]", |
:type => "text", ... | 27.067797 | 60 | 0.500939 |
1d78d463ac40cecca2d185511c0f8e3661a1da0f | 2,971 | require 'core/operation'
require 'concurrent-edge'
require 'digest'
module Operations
class Analyze < Operation
params_validation do
required(:user).filled
required(:url).filled(:str?)
required(:files).each do
schema do
required(:filename).filled(:str?)
required(:typ... | 27.256881 | 153 | 0.654998 |
21d9a75173bf3a0e2065dce7fd571527352461e6 | 1,468 | # -*- encoding: utf-8 -*-
# stub: request_store 1.4.1 ruby lib
Gem::Specification.new do |s|
s.name = "request_store".freeze
s.version = "1.4.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Steve... | 37.641026 | 112 | 0.662125 |
f8a213c32822395eb4f96ecef5f4483b5eacf165 | 2,116 | # Copyright 2017 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, so... | 32.060606 | 78 | 0.587902 |
01431132e02433d19ec7161aa3174c4e47c8311d | 107 | module OrderEngine
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
end
| 17.833333 | 46 | 0.775701 |
7a89256ad1f75a58bff96866c663d61b6622df41 | 23,106 | #! /usr/bin/env ruby -S rspec
require 'spec_helper'
require 'puppet/indirector/rest'
shared_examples_for "a REST http call" do
it "should accept a path" do
lambda { @search.send(@method, *@arguments) }.should_not raise_error(ArgumentError)
end
it "should require a path" do
lambda { @searcher.send(@metho... | 38.964587 | 149 | 0.675193 |
bf929e529dd2b4d259cf512668c1870bc71beb30 | 11,919 | require 'jwt'
require 'spec_helper'
# Depends on the following `let`s:
# key_generation_parameter: one of [1024, 2048, 'prime256v1']
# signature_method: one of [:dsa_sign_asn1, :sign]
# approximate_token_size: Integer byte size of tokens
shared_examples_for 'all subclasses of Session::Abstract' do
inclu... | 29.7975 | 107 | 0.619851 |
085e87ba017537f1a453483155519a14121cc3f6 | 1,024 | # frozen_string_literal: true
module ElasticAPM
RSpec.describe SpanHelpers do
class Thing
include ElasticAPM::SpanHelpers
def do_the_thing
'ok'
end
span_method :do_the_thing
def self.do_all_things
'all ok'
end
span_class_method :do_all_things
end
... | 21.333333 | 66 | 0.610352 |
e9ff4d3719175330208c4f3c4c3803dc2c162702 | 100 | class DropManifests < ActiveRecord::Migration[5.1]
def change
drop_table :manifests
end
end
| 16.666667 | 50 | 0.75 |
e9d4ed1e8032d9e456a95c37d107a8eb8d413e5e | 3,124 | module Spree::Chimpy
module Interface
class ProductUpserter
delegate :log, :store_api_call, to: Spree::Chimpy
def initialize(product)
@product = product
end
def upsert
return unless @product.id
data = product_hash
begin
if mail_chimp_product_ex... | 29.196262 | 108 | 0.582586 |
e98d2460d11d9fd0473ac9d5bc52d858b1c1032d | 118 | module Homeland
class Username
def self.sanitize(username)
username.gsub(/[^\w.-]/, '_')
end
end
end | 16.857143 | 35 | 0.618644 |
01b697bd27febfc24319a9efa7a73289452d7494 | 1,613 | require File.expand_path('../../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
describe "Socket::IPSocket#peeraddr" do
before :each do
@do_not_reverse_lookup = BasicSocket.do_not_reverse_lookup
@server = TCPServer.new("127.0.0.1", SocketSpecs.port)
@client = TC... | 32.918367 | 76 | 0.698078 |
03c5bf662b0489ccf22209f8af945da0efa7eb6c | 536 | class User < ApplicationRecord
has_many :room_users
has_many :rooms, through: :room_users
def join(room_id)
room = Room.find_by(uid: room_id)
room_user = self.room_users.find_or_create_by(room_id: room.id)
end
def leave(room_id)
room = Room.find_by(uid: room_id)
room_user = self.room_users.f... | 25.52381 | 77 | 0.718284 |
8716355e50f492bbcb9c8a3872e6c057a87508c5 | 5,163 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
include Msf::Auxiliary::AuthBrute
include Msf:... | 34.192053 | 134 | 0.56963 |
1864824fa600ce14bb48d4f7f39f0ff41c33a8bd | 121 | class Sharder
class Railtie < Rails::Railtie
rake_tasks do
load "tasks/sharder_tasks.rake"
end
end
end
| 15.125 | 37 | 0.68595 |
18614b860d5ea2f1fc99e4e21d80f9aebece6cd6 | 2,685 | desc "Generate ElasticBeanstalk configuration template"
namespace :awseb do
task :generate_config_template do
require 'securerandom'
require 'highline/import'
require 'yaml'
require 'aws-sdk'
require 'aws-sdk-resources'
require 'json'
templates_path = File.dirname(__FILE_... | 38.913043 | 137 | 0.704283 |
080247d20b3ad73046929341c6b5a5a491e47c28 | 3,452 | # frozen_string_literal: true
# == Schema Information
#
# Table name: alchemy_attachments
#
# id :integer not null, primary key
# name :string
# file_name :string
# file_mime_type :string
# file_size :integer
# creator_id :integer
# updater_id :integer
# ... | 26.553846 | 93 | 0.642236 |
f8677bf81f6760e6df8e86d8efbd3106b422121c | 7,833 | require 'spec_helper'
describe Terrapin::CommandLine do
before do
Terrapin::CommandLine.path = nil
on_unix! # Assume we're on unix unless otherwise specified.
end
it "takes a command and parameters and produces a Bash command line" do
cmd = Terrapin::CommandLine.new("convert", "a.jpg b.png", :swallo... | 39.964286 | 136 | 0.609473 |
26dd302cd00d6f50634a2417acdc1f281b6baa3a | 600 | class ApplicationController < ActionController::Base
protect_from_forgery prepend: true
before_action :authenticate_user!, unless: :api_path
before_action :update_allowed_parameters, if: :devise_controller?
protected
def update_allowed_parameters
devise_parameter_sanitizer.permit(:sign_up) do |u|
... | 28.571429 | 69 | 0.755 |
edd91d0bee93d2c218b19b2d38961a1a95320a84 | 1,626 | class Id3ed < Formula
desc "ID3 tag editor for MP3 files"
homepage "http://code.fluffytapeworm.com/projects/id3ed"
url "http://code.fluffytapeworm.com/projects/id3ed/id3ed-1.10.4.tar.gz"
sha256 "56f26dfde7b6357c5ad22644c2a379f25fce82a200264b5d4ce62f2468d8431b"
license "GPL-2.0"
bottle do
cellar :any_sk... | 43.945946 | 94 | 0.718327 |
7a928861b70477fb05887c1fda2fb984677138d8 | 1,067 | module Registries
class ManualsRegistry < Registry
include CacheableRegistry
delegate :[], to: :manuals
def values
manuals
end
def cache_key
"registries/manuals"
end
private
def cacheable_data
manuals_as_hash
end
def manuals
@manuals ||= fetch_from_c... | 21.77551 | 92 | 0.626992 |
212334bb3102e063246ac0404014c6a6ccc520a9 | 2,007 | module Remarkable
# This class is responsable for converting matchers to macros. You shouldn't
# worry with what happens here, because it happens automatically.
#
module Macros
protected
def method_missing(method_id, *args, &block) #:nodoc:
if method_id.to_s =~ /^(should_not|should)_(.+)/
... | 34.016949 | 110 | 0.629297 |
879e931d4c5ea4ea0fff1a3b888bcac73def5940 | 718 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = 'EXLocation'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.au... | 31.217391 | 73 | 0.610028 |
61d4e2b8aea3dafe15e7b0e981dc1140f6a6d08d | 4,997 | # encoding: utf-8
require "cases/helper"
require 'active_record/base'
require 'active_record/connection_adapters/postgresql_adapter'
class PostgresqlJSONTest < ActiveRecord::TestCase
class JsonDataType < ActiveRecord::Base
self.table_name = 'json_data_type'
store_accessor :settings, :resolution
end
de... | 29.744048 | 123 | 0.661997 |
393f31809f973aee570397c80e0e6f73d222cfa4 | 527 | class SessionsController < ApplicationController
# user shouldn't have to be logged in before logging in!
skip_before_filter :set_current_user
def create
# debugger
auth=request.env["omniauth.auth"]
user=Owner.find_by_provider_and_uid(auth["provider"],auth["uid"]) ||
Owner.create_with_omniaut... | 29.277778 | 72 | 0.728653 |
b9d78b7dd6dedf6f41a677dcdeacebfa75db3873 | 351 | # frozen_string_literal: true
require 'spec_helper'
describe Organization do
let(:organization) { create(:organization) }
describe 'validation' do
it 'is not valid without a name' do
should validate_presence_of(:name)
end
end
describe 'associations' do
it { should have_many(:conferences).d... | 19.5 | 61 | 0.717949 |
79a3582af5445c7c2232a34fdc77fc12e4544511 | 1,205 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'schema_plus/pg_types/version'
Gem::Specification.new do |gem|
gem.name = "schema_plus_pg_types"
gem.version = SchemaPlus::PgTypes::VERSION
gem.authors = ["Boaz Yaniv"]
... | 40.166667 | 88 | 0.675519 |
bb518fa5516bc9a2d31f95b85acab11e0a28a139 | 1,095 | require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'puppet_x', 'bobtfish', 'ec2_api.rb'))
Puppet::Type.newtype(:aws_cgw) do
@doc = "Manage AWS customer gateways: http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-CreateCustomerGateway.html"
newparam(:name)
ensurabl... | 27.375 | 146 | 0.628311 |
1d8b55b48913e40413af47978f095c515c4d150c | 932 | # FIXME implement
# require File.dirname(__FILE__) + "/../../spec_helper"
#
# describe Admin::CellsController do
# include SpecControllerHelper
#
# before(:each) do
# @controller.stub!(:require_authentication)
# @controller.stub!(:has_permission?).and_return(true)
# @controller.stub!(:current_user).a... | 28.242424 | 92 | 0.645923 |
bf1072eca239e333ded09fd830e89bb558059ff9 | 236 | class CreateClubs < ActiveRecord::Migration[6.0]
def change
create_table :clubs do |t|
t.string :name
t.text :description
t.string :avatar
t.string :active_book_isbn13
t.timestamps
end
end
end
| 18.153846 | 48 | 0.648305 |
33e1c08e7b998fdf12438bfd0072da14e9f63907 | 868 | module Rake
class Scope < LinkedList
# Path for the scope.
def path
map { |item| item.to_s }.reverse.join(":")
end
# Path for the scope + the named path.
def path_with_task_name(task_name)
"#{path}:#{task_name}"
end
# Trim +n+ innermost scope levels from the scope. In no cas... | 20.186047 | 69 | 0.59447 |
d5c4d8ae0c6ed4fbdc634aed6aa25b16be2b6ad2 | 57 | module JiveWebhooks
module ApplicationHelper
end
end
| 11.4 | 26 | 0.824561 |
61e6177667e953160ef6c22005740deeb0698c9f | 375 | require "bundler/setup"
require "contextualized_logs"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expe... | 25 | 66 | 0.76 |
edb994f4100c166dfa0920f1ed6565d6405e3942 | 1,128 | # 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... | 38.896552 | 86 | 0.74734 |
5d40a1cb6f19708b46a9c0d823152ab7d45aa7ed | 41 | module PushType
VERSION = '0.13.1'
end
| 10.25 | 20 | 0.682927 |
0151494847f4c24376ad313f6151df6ff67b59df | 625 | # frozen_string_literal: true
# Security::SecurityJobsFinder
#
# Used to find jobs (builds) that are related to the Secure products:
# SAST, DAST, Dependency Scanning and Container Scanning
#
# Arguments:
# params:
# pipeline: required, only jobs for the specified pipeline will be found
# job_ty... | 31.25 | 108 | 0.7248 |
acf50f8e9e9b5afe8331fd7c798f57a81b891248 | 755 | Pod::Spec.new do |s|
s.name = "Flash2Cocos2D"
s.version = "0.7"
s.summary = "Library to import animations made in Flash to Cocos2D."
s.description = "A modified grapefrukt-export creates xml descriptions of timeline animations. Flash2Cocos2D imports that xml and recreates what were timeline ... | 47.1875 | 175 | 0.664901 |
e2324dea7c685cb461070996c7fccf6d5f812003 | 432 | class Organisation < ApplicationRecord
has_and_belongs_to_many :content_items
has_many :problem_reports, through: :content_items
has_many :anonymous_contacts, through: :content_items
validates :slug, presence: true
validates :web_url, presence: true
validates :title, presence: true
validates :content_id,... | 28.8 | 60 | 0.782407 |
284f4dc3540fdf223d0167f6f2fc4e3596653da8 | 1,758 | #! /usr/bin/env ruby
## 验证项目配置的 Ruby 脚本
## 无参数支持,Xcode 设置的环境变量都在就行
# require 'rubygems'
require 'xcodeproj'
require 'plist'
# 主目标的名称,留空尝试自动寻找
main_target_name = nil
xcode_build_configuration = ENV["CONFIGURATION"]
xcodeproj_path = ENV["PROJECT_FILE_PATH"]
proj = Xcodeproj::Project.open(xcodeproj_path)
# 找到 App targ... | 23.44 | 76 | 0.721274 |
01395b8926d4f2590b5821ab8f6d712399875668 | 1,084 | class GolangMigrate < Formula
desc "Database migrations CLI tool"
homepage "https://github.com/golang-migrate/migrate"
url "https://github.com/golang-migrate/migrate/archive/v4.14.1.tar.gz"
sha256 "c4bb59dd2a1c99980b453f37d0838d292aef9feab86ff5ec230f13e097761017"
license "MIT"
bottle do
sha256 cellar: ... | 38.714286 | 122 | 0.771218 |
f81030d7537a8827fa1bc0cf2799507ca7d0fb5d | 622 | # Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron
# Example:
#
# set :output, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyModel.some_m... | 23.923077 | 80 | 0.71865 |
5dec7ff570b5bc238262858b17f294e231c862f7 | 8,275 | ##
# 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 = ExcellentRa... | 32.324219 | 141 | 0.585861 |
1c48c5ae77b5381b21771b008e3a1ff672ae8757 | 1,356 | # 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/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
unless Module.const_defined?(:Aws)
require 'aws-sdk-core'
require 'aws-si... | 24.214286 | 86 | 0.728614 |
2833a9820db0fb4536bc753a36642e20aaf71ac0 | 845 | Pod::Spec.new do |s|
# 1
s.platform = :ios
s.ios.deployment_target = '10.0'
s.name = "TestTrisa"
s.summary = "Test Trisa summary."
s.requires_arc = true
# 2
s.version = "0.1.0"
# 3
s.license = { :type => "MIT", :file => "LICENSE" }
# 4 - Replace with your name and e-mail address
s.author = { "Surya" => "surya@agili... | 21.125 | 77 | 0.649704 |
03f8f8a5e22b710b09fd95588fc53bdcf9276f01 | 507 | class User < ApplicationRecord
extend Devise::Models
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
has_many :friendships
has_man... | 39 | 80 | 0.741617 |
e8410668cf2bfd66a331220c896af67c445905b3 | 151 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_params-test-sandbox_session'
| 37.75 | 89 | 0.807947 |
086f2689128d4ecc5678128ad70ea352e4df4d15 | 2,891 | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 35.256098 | 97 | 0.631269 |
e82a978bbba1ed05d1899bd51142506d41aa8d32 | 3,099 | #! /usr/bin/env ruby
# ******************************
# CODE SAMPLER Script
# ******************************
# == Synopsis
#
# == Examples
#
#
# == Usage
#
# == Author
# Evin Grano
#
# == Copyright
#
require 'rubygems'
require 'find'
require 'ftools'
require 'fileutils'
class CodeSampler
#instance vars
def in... | 26.042017 | 94 | 0.539852 |
01dfdc851843603c994a137c5234db45c3125676 | 329 | def do_ops(line)
return line.start_with?('ADD_CHILD') ? "CHILD_ADDITION_FAILED" : "PERSON_NOT_FOUND"
end
def parse_file(file)
f = File.open(file, "r")
f.each_line do |line|
puts do_ops(line.to_s)
end
f.close
end
def main
input_file = ARGV[1]
out = parse_file(input_file)
print... | 19.352941 | 87 | 0.653495 |
3954e9b5624161ef36e08c48f579e9625ec1dd91 | 1,564 | require "rails_helper"
describe ApplicationHelper, type: :helper do
describe "#page_header" do
it "links to the user dashboard if user logged in" do
current_organization = build_stubbed(:casa_org)
user = build_stubbed(:user, casa_org: current_organization)
allow(helper).to receive(:user_signe... | 34.755556 | 86 | 0.728261 |
18785e0f3481a778a75d02a5a4cb5ccfc73b761b | 1,233 | RSpec.describe ExhaustPipe do
describe "#tailwind" do
it "takes a list of classes and returns a string" do
classes = ExhaustPipe.tailwind("m-10", "p-10")
expect(classes).to eq "m-10 p-10"
end
it "can be interapolated with erb" do
require "erb"
template = ERB.new <<~TEMPLATE
... | 26.804348 | 69 | 0.616383 |
215f19d580aca082fb99f92c59b567d290d75d8b | 2,062 | class CargoAudit < Formula
desc "Audit Cargo.lock files for crates with security vulnerabilities"
homepage "https://rustsec.org/"
url "https://github.com/RustSec/rustsec/archive/cargo-audit/v0.15.2.tar.gz"
sha256 "ed330d33f86036acd27ab8f717903aa515c306d02217aa217c95e2a5fdab1f8e"
license any_of: ["Apache-2.0",... | 41.24 | 123 | 0.70902 |
61278199dac01ecc5473edc221e4465ec695d2ea | 707 | # config.ru
%w{
sinatra
sinatra/json
airrecord
redis
./app
}.each { |r| require r }
enable :sessions
secret = Digest::MD5.hexdigest(SecureRandom.hex)
set :session_secret, secret
configure :production do
disable :show_exceptions
uri = URI.parse("redis://redis-19094.c10.us-east-1-4.ec2.cloud.redislabs.com... | 26.185185 | 105 | 0.743989 |
bf9490824e41ff895023a789e403f15584f41e85 | 2,966 | provides :tomcat_service_systemd
provides :tomcat_service, platform: 'fedora'
provides :tomcat_service, platform: %w(redhat centos scientific oracle) do |node| # ~FC005
node['platform_version'].to_f >= 7.0
end
provides :tomcat_service, platform: 'debian' do |node|
node['platform_version'].to_i >= 8
end
provides... | 27.981132 | 97 | 0.714767 |
6a1a4fdde3b8b6b04fed43303cc74e725e1eefc2 | 792 | # Base class to handle errors when invoking an underlying connection from a makara proxy.
# Each concrete implementation of a MakaraProxy can provide it's own ErrorHandler which should inherit
# from this class.
module Makara
class ErrorHandler
def handle(connection)
yield
rescue Exception => e
i... | 25.548387 | 102 | 0.664141 |
218cb219297021cf4d8c198529d3caa143c74e9c | 4,354 | require 'thread'
require 'concurrent/constants'
require 'concurrent/errors'
require 'concurrent/ivar'
require 'concurrent/executor/safe_task_executor'
require 'concurrent/options'
module Concurrent
# {include:file:doc/future.md}
#
# @!macro copy_options
#
# @see http://ruby-doc.org/stdlib-2.1... | 31.323741 | 111 | 0.632062 |
1d5a116cbef16ea5dcbd03415d619faacf388c6c | 437 | module SupplyDrop
module AsyncEnumerable
def each(&block)
pool = SupplyDrop::ThreadPool.new(SupplyDrop::Util.thread_pool_size)
super do |item|
pool.schedule(item, &block)
end
pool.shutdown
end
def map(&block)
pool = SupplyDrop::ThreadPool.new(SupplyDrop::Util.thread_... | 21.85 | 74 | 0.640732 |
871729ec7dde34e811e6b98cdb1307885b90cca2 | 1,260 | require 'spec_helper'
module Spree
module Wombat
describe Handler::AddShipmentHandler do
let(:message) {::Hub::Samples::Shipment.request}
let(:handler) { Handler::AddShipmentHandler.new(message.to_json) }
describe "process" do
context "with all reference data present" do
le... | 31.5 | 98 | 0.615873 |
abe8180e359771532fd0acd109d3ca37ec6bb583 | 1,348 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.thnic.co.th/th/status_available.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
requir... | 22.098361 | 76 | 0.675816 |
626e7dc0087c6607918ec767f92648f8bd34bd70 | 126 | module Attractor
module Rails
class Engine < ::Rails::Engine
isolate_namespace Attractor::Rails
end
end
end
| 15.75 | 40 | 0.698413 |
1a18943f9a60efce35e15d484ff194247dfec4a9 | 255 | require "lita-away"
require "lita/rspec"
# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
# was generated with Lita 4, the compatibility mode should be left disabled.
Lita.version_3_compatibility_mode = false
| 36.428571 | 93 | 0.803922 |
91c154f2bcf6ae9a5ee8bfbffdceb43b21f50d96 | 2,064 | Puppet::Type.newtype(:pg_role) do
@doc = "Manages a PostgreSQL role as a puppet resource"
newparam(:name) do
desc "The name of the role"
isnamevar
end
ensurable
newproperty(:password) do
desc "The hashed password of the database user"
newvalues :absent, /^md5[0-9a-f]+$/
validate do |v... | 33.836066 | 251 | 0.688953 |
ede8c2fcc26e1647e7bf50262bdabff8ed77340a | 521 | $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
require 'funtools'
Gem::Specification.new do |s|
s.name = 'funtools'
s.version = Funtools::VERSION
s.description = 'Tools to assist in programming in a more functional style'
s.summary = 'Functional programming tools'
s.authors = ['Tina Wuest']... | 27.421053 | 77 | 0.658349 |
f7c9da04de7dbef2ea42d6fc30c6f905dd9b4fbd | 205 | FactoryBot.define do
factory :donation do
name { Faker::Name.name }
email { Faker::Internet.email }
amount { Faker::Number.between(from: 1, to: 5000) }
frequency { 'One Time' }
end
end
| 22.777778 | 55 | 0.643902 |
ffd20b64fe302fc4a8f7fef0de0c759b3110ede7 | 709 | require "language/node"
class Marked < Formula
desc "Markdown parser and compiler built for speed"
homepage "https://marked.js.org/"
url "https://registry.npmjs.org/marked/-/marked-3.0.0.tgz"
sha256 "30b2c3f787c70697f14e6f5bfbd2d066e02d5b121bbea637ecb4a59dd7dcfa60"
license "MIT"
bottle do
sha256 cella... | 28.36 | 112 | 0.736248 |
abc75f98a75d377217f67d270f22434f405c58ac | 14,594 | module PaypalService::API
class Payments
# Include with_success for wrapping requests and responses
include RequestWrapper
attr_reader :logger
MerchantData = PaypalService::DataTypes::Merchant
TokenStore = PaypalService::Store::Token
PaymentStore = PaypalService::Store::PaypalPayment
L... | 34.501182 | 123 | 0.634028 |
f8789e9f07b49abb07c2c929b4f355b53bc25ce2 | 3,147 | require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
include Moo::Model
describe Moo::Model::ImageData do
describe 'initialize' do
d = ImageData.new
[:link_id, :image_box, :resource_uri, :image_store_file_id].each do |att|
it "sets #{att.to_s} to nil" do
d.send(att).should == n... | 23.485075 | 77 | 0.601207 |
333b7f4fdbc055af5fb595b95dea0307fbf4f16e | 2,549 | # 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,... | 42.483333 | 108 | 0.748529 |
33ce8d84172f538035030ef187e2f6a09d51c509 | 89 | FactoryBot.define do
factory :post do
topic
user
body { "body" }
end
end
| 11.125 | 20 | 0.606742 |
bb4e546d01a18c93fcf28c9a6174261b8fe8c93a | 1,821 | class ContainerConverter
attr_reader :destination, :index, :container
def initialize(container:, dest:, index: )
data = container[container.keys.first].symbolize_keys
@container = OpenStruct.new(data)
@destination = dest
@index = index + 1
end
def path
children? ? folder_path : file_path
... | 20.460674 | 77 | 0.67765 |
2818dca5698aa6645e18c94c66e7029656b81e5d | 1,578 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{capistrano-ext}
s.version = "1.2.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jamis Buck"]
s.date = %q{2008-06-14}
s.description = %q{Useful task libraries and me... | 46.411765 | 255 | 0.686312 |
f7c14d2dc654f6a842ff5282ddb31c532ac5cae2 | 3,779 | ##########################################################################
# Copyright 2015 ThoughtWorks, 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/li... | 34.354545 | 168 | 0.65123 |
219c56f5b4c86c9f840fa763f91aa24a2d30bb11 | 13,919 | # Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmat... | 49.710714 | 179 | 0.752281 |
394d7e4fe2d949d906145d3d6a20e00f14487ca6 | 369 | # frozen_string_literal: true
class SeasonValidator < ActiveModel::Validator
def validate(record)
overlaps = Season.find_by('start_date < ? AND end_date > ? AND id != ?',
record.end_date, record.start_date, record.id.to_i)
return if overlaps.blank?
record.errors.add(:base, ... | 30.75 | 81 | 0.672087 |
4a0fcc55d8310ba89c48ab42cbf75acae90dbcdd | 678 | Pod::Spec.new do |s|
s.name = "srt"
s.version = "1.1.0"
s.summary = ""
s.description = <<-DESC
Your description here.
DESC
s.homepage = "https://github.com/ApolloZhu/srt"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Zhiyu Zhu" => "public-ap... | 33.9 | 93 | 0.581121 |
38ec9e4f4a24981f66eb64c2f162d930060d1735 | 1,152 | # frozen_string_literal: true
require 'attr/gather/aggregators/base'
module Attr
module Gather
module Aggregators
# Deep merges result hashes
#
# @api public
class DeepMerge < Base
# Initialize a new DeepMerge aggregator
#
# @param reverse [Boolean] deep merge res... | 22.588235 | 72 | 0.555556 |
e25e76fc22420ea5b3840e150be35ff242a754fc | 431 |
def permutations?(string1, string2)
return false if string1.length != string2.length
string1 = string1.chars
string2 = string2.chars
hash = {}
hash.default = 0
string1.each do |char|
hash[char] += 1
end
string2.each do |element|
if hash[element] == nil
return false
else hash[elemen... | 15.962963 | 50 | 0.642691 |
ff720da3f9f9820579a12fbdbf855c1c6cc4deca | 1,489 | module HealthSeven::V2_7
class Dg1 < ::HealthSeven::Segment
# Set ID - DG1
attribute :set_id_dg1, Si, position: "DG1.1", require: true
# Diagnosis Code - DG1
attribute :diagnosis_code_dg1, Cwe, position: "DG1.3", require: true
# Diagnosis Date/Time
attribute :diagnosis_date_time, Dtm, position: "DG1.5"
# ... | 41.361111 | 82 | 0.750839 |
384e1361e5ce7fbb83c549d5062c3f1e6512b88f | 1,177 | require 'rails/generators/named_base'
module Shatter
module Generators
class Shatter < Rails::Generators::NamedBase
desc "Generates separate files for a model's association, validation, operation and query logic."
source_root File.expand_path('../templates', __FILE__... | 47.08 | 248 | 0.626168 |
d5c7af9e94096542e34338dd8a5463d7700760cf | 427 | cask :v1 => 'wiznote' do
version '2015-01-14'
sha256 '5edd3fd654c6168779f89553de970c35038111624ff9a0a4b26dbaa2530b035e'
# wiz.cn is the official download host per the vendor homepage
url "http://release.wiz.cn/wiznote-macos-#{version}.dmg"
homepage 'http://www.wiznote.com/'
license :unknown # todo: chan... | 35.583333 | 115 | 0.749415 |
ff2545cfed974f79da989a792d469138b46aa886 | 8,076 | #
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Christopher Brown (<cb@opscode.com>)
# Author:: Daniel DeLeo (<dan@opscode.com>)
# Copyright:: Copyright (c) 2009, 2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this... | 30.134328 | 118 | 0.609708 |
33b7565c950576083c287a0a0f83ad170235c3f4 | 191 | module Postal
module MessageInspectors
extend ActiveSupport::Autoload
eager_autoload do
autoload :Clamav
autoload :Rspamd
autoload :SpamAssassin
end
end
end
| 17.363636 | 34 | 0.706806 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.