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 |
|---|---|---|---|---|---|
1de287ab5d7623975b3a17b69e2503329f93062c | 467 | require 'test_helper'
require 'cask/version'
describe Cask::CLI::Doctor do
it 'displays some nice info about the environment' do
out, err = capture_io do
Cask::CLI::Doctor.run
end
# no point in trying to match more of this environment-specific info
out.must_match /\A==> OS X Release:/
end
... | 24.578947 | 72 | 0.689507 |
bbe15e63814fb0245012a62ed84b08cceebf6156 | 1,440 | class Mapcidr < Formula
desc "Subnet/CIDR operation utility"
homepage "https://projectdiscovery.io"
url "https://github.com/projectdiscovery/mapcidr/archive/v1.0.0.tar.gz"
sha256 "2e3a0fc4301c6c5ebee75a9c6b7dd2e1c646dc5d67b74f97dc3e2eb187a133de"
license "MIT"
head "https://github.com/projectdiscovery/mapcid... | 48 | 123 | 0.784722 |
ace49d3a4a8113ce2f6b3a27214e0e2502ace25d | 5,442 | # frozen_string_literal: true
require "strscan"
require "uri"
require "net/http"
require_relative "httpool"
class Gel::TailFile
# The number of redirects etc we'll follow before giving up
MAXIMUM_CHAIN = 8
# When attempting a partial file download, we'll back up by this many
# bytes to ensure the preceding ... | 26.417476 | 173 | 0.554759 |
1a5991e344df789fdc7c2b801fa44df4e1c7357e | 2,302 | # frozen_string_literal: true
# == Schema Information
#
# Table name: event_flag_histories
#
# id :integer not null, primary key
# accessibility_and_inclusion :boolean default(FALSE)
# allocations :boolean default(FALSE)
# consuite ... | 42.62963 | 70 | 0.501738 |
f7ecccd406168140a89b1b0427ca9fc5f35d3abe | 1,971 | require 'ideone'
require 'bacon'
describe 'an ideone gem user' do
it 'can submit Ruby code and receive stdout' do
paste_id = Ideone.submit( :ruby, %{puts "text on stdout"} )
results = Ideone.run( paste_id, nil )
results.should.equal %{text on stdout\n}
end
it 'can submit Perl code and receive stdout... | 33.40678 | 97 | 0.662608 |
2164b9d314a88f05063fb0de6cb28adf85df1a9f | 223 | require 'revamp'
# This class implements slugification of Puppet module name: 'puppetlabs/stdlib' <-> 'puppetlabs-stdlib'
class Revamp::Mapper::PuppetNameSlugger
def map(slash_name)
slash_name.tr('/', '-')
end
end
| 24.777778 | 104 | 0.730942 |
f8a21115a333332230851f05175051a4a708ee8c | 254 | module TopologySpecHelper
RSpec.configure do |config|
config.around(:example, :type => :topology) do |example|
with_modified_env(:TOPOLOGICAL_INVENTORY_URL => "http://topology.example.com") do
example.call
end
end
end
end
| 25.4 | 87 | 0.688976 |
4af6599c437f9ebd94b13ced2ea117427705390a | 586 | Pod::Spec.new do |s|
s.name = 'PodFrameTest'
s.version = '1.0.0'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'liuzhipeng' => 'l519804430@163.com' }
s.summary = 'PodFrameTest for pods'
s.homepage = 'http://www.baidu.com'
s.platform = :... | 41.857143 | 98 | 0.532423 |
33302233120fdf0ad0f23533cdb5b0d7dc6b5d3b | 787 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'adhara_socket_io'
s.version = '0.0.1'
s.summary = 'socket.io for flutter by adhara'
s.description = <<-DESC
socket.io for flutter by adhara
... | 31.48 | 83 | 0.579416 |
f7816cd6b7f43469853e0f6aceda14c2e0eebd8f | 60 | class Question < ActiveRecord::Base
belongs_to :story
end
| 15 | 35 | 0.783333 |
e9bd44766cd2e16d56a54276809698c9623da4ee | 1,772 | class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
# GET /users
# GET /users.json
def index
@users = User.all
end
# GET /users/1
# GET /users/1.json
def show
end
# GET /users/new
def new
@user = User.new
end
# GET /users/1... | 23.626667 | 88 | 0.637133 |
91789d2bd691f36ec66a878e8d86d6cc7ef5b381 | 749 | def initialize(info = {})
super(
update_info(
info,
'Name' => 'Sample Auxiliary',
# The description can be multiple lines, but does not preserve formatting.
'Description' => 'Sample Auxiliary Module',
'Author' => ['Joe Module <joem@example.com>'],... | 34.045455 | 82 | 0.510013 |
e8195fcd923eabe71bd546536e4d80d15580260f | 1,035 | module Imports
class UserImportService < ImportService
def create_users(folder)
import_from(folder, :create_user)
end
private
PROVIDER_TYPE = {
"Data Provider" => User.roles[:data_provider],
}.freeze
def create_user(xml_document)
organisation = Organisation.find_by(old_org_i... | 31.363636 | 100 | 0.689855 |
1c7b698b43200c2207bd848d167ba2a93c12d0a7 | 156 | require "class_names/helper"
module ClassNames
module ViewHelper
def class_names(*args)
::ClassNames::Helper.new(*args).to_s
end
end
end
| 15.6 | 42 | 0.705128 |
d53cc3b04950a2cdadb6fb2b981c002e99b731c4 | 116 | json.extract! @castle_structure, :id, :result_no, :generate_no, :e_no, :frame_type, :i_no, :created_at, :updated_at
| 58 | 115 | 0.75 |
6af355879b8f9e1cf024c2ddac86022be26d31fe | 771 | # frozen_string_literal: true
require 'logger'
module CONF
LOG_FILE = STDOUT
DNS_SERVER_TYPE = :knot
# DNS_SERVER_TYPE = :bind
# 1 = master. 0 = slave
DNS_SERVER_MASTER = (ENV['DNS_MASTER_SERVER'] || 1).to_s == "1"
module KNOT
ZONE_FILE_DIR = ENV['KNOT_ZONE_FILE_DIR'] || '/etc/knot/zones'
ZONE_... | 28.555556 | 78 | 0.701686 |
87685d3e4ca80481eb83d837b9c787a54be62add | 203 | class Player < ApplicationRecord
has_many :games
validates :name, presence: true , uniqueness: true, length: { in: 3..30 }, format: { with: /\A[a-zA-Z]+\z/, message: "only allows letters" }
end
| 40.6 | 145 | 0.660099 |
d56bd4f9dcce8e54fae088f1ab33177404bb32d8 | 206 | class UserAuthentication < ApplicationRecord
belongs_to :user
belongs_to :authenticatable, polymorphic: true
validates_uniqueness_of :authenticatable_id, scope: [:user_id, :authenticatable_type]
end
| 29.428571 | 87 | 0.825243 |
abffd370a0f57fc73945d03256d4c8ba9606cd7a | 513 | require 'chef/provisioning'
# These are the options you can use: http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Client.html#run_instances-instance_method
add_machine_options bootstrap_options: {
key_name: 'THE-KEY-IN-EC2-Network & Security-Key Pairs-Name'
flavor_id: ... | 32.0625 | 128 | 0.62963 |
087e5fd2821286cbf9317321f95ee1e7da30cffc | 130 | # frozen_string_literal: true
# typed: true
# compiled: true
class A
def foo
end
end
require_relative './defines_behavior__2'
| 14.444444 | 40 | 0.761538 |
08a882a437e75c2665702b8efef023ce37d532fd | 650 | module Startups
class Select2SearchService
def self.search_for_startup(term)
startups = Startup.all
query_words = term.split
query_words.each do |query|
startups = startups.where(
'startups.name ILIKE ?', "%#{query}%"
)
end
# Limit the number of object all... | 24.074074 | 109 | 0.604615 |
7ab882fc12ffc8692981d58a3c59249850cfca14 | 1,460 | require "spec_helper"
describe Lumberjack::Device::Multi do
let(:output_1) { StringIO.new }
let(:output_2) { StringIO.new }
let(:device_1) { Lumberjack::Device::Writer.new(output_1, template: ":message") }
let(:device_2) { Lumberjack::Device::Writer.new(output_2, template: ":severity - :message") }
let(:devi... | 33.953488 | 95 | 0.70274 |
7989cf0e5f91c32cc5e404b302b7f8689ac1ddc4 | 1,904 | #! /usr/bin/env ruby
require 'spec_helper'
describe Puppet::Parser::AST::ResourceOverride do
ast = Puppet::Parser::AST
before :each do
@compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("mynode"))
@scope = Puppet::Parser::Scope.new(@compiler)
@params = ast::ASTArray.new({})
@compiler.stubs... | 37.333333 | 101 | 0.673319 |
33b843f355244b9c6ea14b5a80603dd05b80d860 | 206 | # frozen_string_literal: true
module Db2Query
module Type
class Integer < Value
def type
:integer
end
def deserialize(value)
value.to_i
end
end
end
end
| 12.875 | 29 | 0.597087 |
01dd2ca1f8b8b367489eb09112b9cf20482a7cd5 | 2,985 | # frozen_string_literal: true
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 36.402439 | 88 | 0.644891 |
0192babc49edc52afc2d48b656aab22864c4a7a2 | 1,196 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::DevTestLabs::Mgmt::V2016_05_15
module Models
#
# Properties of the disk to detach.
#
class DetachDiskProperties
include MsRestAzure
... | 25.446809 | 75 | 0.565217 |
1da02b45ab5c38b0b118746a04f06eb11d56fe4a | 9,588 | require 'time'
require 'uri'
require 'cookiejar/cookie_validation'
module CookieJar
# Cookie is an immutable object which defines the data model of a HTTP Cookie.
# The data values within the cookie may be different from the
# values described in the literal cookie declaration.
# Specifically, the 'domain' an... | 36.318182 | 80 | 0.654673 |
38b489d7b4153d4c43ec00da0b649b55bc2a4e5a | 210 | class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :username
t.string :password_digest
t.string :name
t.integer :role_id
end
end
end
| 19.090909 | 43 | 0.657143 |
bbd4d5dd9bcecb1f8a35a8ce28ab1b525ced64f5 | 243 | # Author:: Nacer Laradji (<nacer.laradji@gmail.com>)
# Cookbook Name:: zabbix-test
# Recipe:: server_source
#
# Copyright 2011, Efactures
#
# Apache 2.0
node.normal['zabbix']['server']['install'] = true
include_recipe "zabbix::server_source"
| 22.090909 | 52 | 0.720165 |
87852228489bb9f3dbebbfd0d82b8f1c5c77a8cc | 136 | class AddApplicationToDataset < ActiveRecord::Migration[5.2]
def change
add_column :datasets, :application_id, :integer
end
end
| 22.666667 | 60 | 0.772059 |
bbca91ad115eb9adf004602a55b376f07923ffb0 | 281 | class NotImplentedError < StandardError
def initialize(msg="Must be implemented in subclass")
super
end
end
module HerokuJobGovernator
module Interfaces
class Interface
def self.enqueued_jobs(_queue)
raise NotImplentedError
end
end
end
end
| 17.5625 | 55 | 0.725979 |
268301da1447e96b77739ed8d7cd0370b424d57f | 1,624 | module Shawarma
#
# Represents the context passed to the AWS Lambda function. This object
# provides details about the execution state and environment of the Lambda
# function.
#
class Context
# This is the same ID returned to the client that called invoke(). This ID
# is reused for retries on the s... | 31.843137 | 91 | 0.714901 |
2809f2b2e35fb39dd80c23e87568fecd4db6b511 | 174 | # desc "Explaining what the task does"
# task :whitelist do
# # Task goes here
# end
# desc "Explaining what the task does"
# task :blacklist do
# # Task goes here
# end
| 19.333333 | 38 | 0.678161 |
e97a677cb1077f6bd80ae6608ba4437dcc821ec2 | 22 | module ParksHelper
end | 11 | 18 | 0.909091 |
ac985b7425e19a186a164b0df278726d91217f1e | 9,957 | # Unlight
# Copyright(c)2019 CPA
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
require 'digest/md5'
module Unlight
# 渦クラス
class Profound < Sequel::Model
# プラグインの設定
plugin :schema
plugin :validation_class_methods
plugin :hook_class_methods
... | 28.530086 | 155 | 0.591343 |
61d3e32345e50cb1fd8bac48911712befe1777aa | 39,090 | # 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,... | 37.914646 | 217 | 0.642389 |
117b9ef2022aee701c211a90019c2d441e0a7b5f | 424 | # frozen_string_literal: true
class Dictionary
include Mongoid::Document
field :name, type: String
field :publisher, type: String
field :year, type: Integer
# This field must be a Time
field :published, type: Time
# This field must be a Date
field :submitted_on, type: Date
field :description, type... | 22.315789 | 50 | 0.71934 |
01b63cc6ef6eb4d051e8ede22b169589687ea9f8 | 37 | module Didit
VERSION = "0.1.0"
end
| 9.25 | 19 | 0.648649 |
4ab24653a9adc3ae232f6c0a865945fa6492e734 | 148 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_accounts-airpair_session'
| 37 | 86 | 0.810811 |
e94917d28ca51fb72bbad099a23c95d13374786d | 915 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "mores_marvel/version"
Gem::Specification.new do |spec|
spec.name = "mores_marvel"
spec.version = MoresMarvel::VERSION
spec.authors = ["Manoj more"]
spec.email = ["lettertoma... | 35.192308 | 74 | 0.650273 |
e887eeb3d4eecec69676d0cd4d94190e21641624 | 1,118 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.2.3-SNAPSHOT
=en... | 26.619048 | 157 | 0.752236 |
f79d18f27f1d98534d3f5b160f2b2efc8090a9e2 | 22,829 | # -*- encoding: utf-8 -*-
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes.rb', __FILE__)
describe "String#inspect" do
it "taints the result if self is tainted" do
"foo".taint.inspect.tainted?.should == true
"foo\n".taint.inspect.tainted?.should == true... | 30.520053 | 104 | 0.359236 |
1c5efe9a7139e4e95565f341b866eae3c597d7a7 | 974 | # frozen_string_literal: true
module Economic
# Entity::Mapper provides a generic way of building SOAP data structures for
# entities.
#
# Based on an Entity and a set of rules that define the fields to map to, it
# returns a Hash named and ordered properly, ready for passing to the
# endpoint as SOAP data... | 22.136364 | 78 | 0.609856 |
ff7e9cee61ab44d4876fba315aaed6387c91326f | 62 | # frozen_string_literal: true
require_relative 'carrier/dao'
| 15.5 | 30 | 0.822581 |
e9f099118c53696d38cceccc7a320bcb78dfed28 | 6,905 | # Represents a set of phone numbers.
#
class CckForms::ParameterTypeClass::Phones
include CckForms::ParameterTypeClass::Base
MIN_PHONES_IN_FORM = Rails.application.config.cck_forms.phones.min_phones_in_form
MOBILE_CODES = Rails.application.config.cck_forms.phones.mobile_codes
PREFIX = Rail... | 32.880952 | 174 | 0.598262 |
912f9eb5b6b0be6e5fa920208860073ecb18e2fc | 7,662 | require 'gitlab/satellite/satellite'
class Projects::MergeRequestsController < Projects::ApplicationController
before_filter :module_enabled
before_filter :merge_request, only: [:edit, :update, :show, :diffs, :automerge, :automerge_check, :ci_status]
before_filter :closes_issues, only: [:edit, :update, :show, :d... | 31.020243 | 142 | 0.722918 |
2658f7a92dc59cfcd5b247a1a119e42c6180dbbc | 1,805 | require 'advent_of_code/y2019/calculator'
include Calculator
def first
max_output = 0
[0,1,2,3,4].permutation.each do |nums|
out = 0
nums.each do |phase|
pgr_tmp = input.clone
@input_buffer = [phase, out]
state = execute_intcode(pgr_tmp, version: 2, read_from: :read_buffer)
out ... | 22.012195 | 81 | 0.625485 |
79a8b74fa39695996d812a8426172a9eae34f3dd | 350 | class VlcRemote < Cask
version :latest
sha256 :no_check
url 'http://hobbyistsoftware.com/Downloads/VLCRemote/latest-mac.php?cdn'
appcast 'http://hobbyistsoftware.com/Downloads/VLCRemote/vlcSetupHelperVersions.xml'
homepage 'http://hobbyistsoftware.com/vlc'
caskroom_only true
caveats do
manual_instal... | 25 | 86 | 0.771429 |
1c86006e817f2c797654586cd50feb89f7384aa6 | 181 | #
# Cookbook Name:: cook2
# Recipe:: default
#
# Copyright 2017, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
file '/home/ubuntu/file1' do
content 'file1'
end
| 15.083333 | 43 | 0.718232 |
039677364613560218cdd961a5e6dd38fa0ea2ba | 6,459 | =begin
#Sunshine Conversations API
The version of the OpenAPI document: 9.4.5
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'date'
module SunshineConversationsClient
# The webhook that generated the payload.
class WebhookSubSchema
# The unique ID of the webhook.
... | 29.902778 | 223 | 0.621613 |
e2c66e9d4e300a23f967c94b8c9f184512d896cb | 157 | class Menu < ActiveRecord::Base
validates_presence_of :name
has_many :menu_items
accepts_nested_attributes_for :menu_items, reject_if: :all_blank
end
| 22.428571 | 66 | 0.815287 |
21b8728b47f24094657317e7121f9f70cda11a2d | 505 | User.delete_all
Tweet.delete_all
baxter_black = User.create(:username=>'Baxter Black', :email => 'bb@example.com', :password_digest => 'pass')
john_boy = User.create(:username=>'John Boy', :email => 'jb@example.com', :password_digest => 'word')
tweet1 = Tweet.create(:content => 'First Tweet', :user_id => 1)
tweet2 = ... | 45.909091 | 109 | 0.683168 |
08366e896d8d95c7e3b2d03d00dbb3557188cdf6 | 590 | #!/usr/bin/env ruby
# vim: et ts=2 sw=2
module ICloud
end
require "icloud/core_ext/array"
require "icloud/core_ext/date_time"
require "icloud/core_ext/object"
require "icloud/helpers/date_helpers"
require "icloud/helpers/guid"
require "icloud/helpers/inflections"
require "icloud/helpers/proxy"
require "icloud/recor... | 21.071429 | 37 | 0.79322 |
21891c181becefa8d429587b5c601783d9f3d337 | 7,873 | run "if uname | grep -q 'Darwin'; then pgrep spring | xargs kill -9; fi"
#####################################
# SOME DEFS
require 'open-uri'
require 'net/http'
require 'nokogiri'
def gem_get_version(gem)
url = "https://rubygems.org/gems/#{gem}"
uri = URI.parse(url)
page = Net::HTTP.get_response(uri)
page_par... | 30.87451 | 207 | 0.593167 |
4a418dfcb046acf4a0b416cf39e9a763e7a97b65 | 5,452 | module ShouldaMatchmakers
module Model
module ActiveRecord
module FactorySmModelHelper
def factory_attributes
attributes_for_factory = get_validation_attributes(@app_class_name)
attributes_for_factory = attributes_for_factory | get_required_attributes(@app_class_name)
... | 43.616 | 122 | 0.706713 |
9107ad38c9e29ea9464fb46d57959c121fb82d78 | 3,749 | # encoding: UTF-8
# frozen_string_literal: true
module ApplicationHelper
def check_active(klass)
if klass.is_a? String
return 'active' unless (controller.controller_path.exclude?(klass.singularize))
else
return 'active' if (klass.model_name.singular == controller.controller_name.singularize)
... | 30.729508 | 141 | 0.647906 |
79efca1ca0c94826a561f236a19215fc81784e90 | 83 | json.plans @plans do |plan|
json.partial! 'api/v1/plans/plan', plan: plan
end
| 20.75 | 48 | 0.674699 |
acc9b111138f1f95c43057e6df7e50ed1a5de5e6 | 2,214 | # -*- coding: binary -*-
module Msf
module Java
module Rmi
module Client
module Registry
module Builder
# Builds an RMI call to java/rmi/registry/RegistryImpl_Stub#lookup() used to
# retrieve the remote reference bound to a name.
#
# @param... | 33.044776 | 88 | 0.501355 |
1802967d7d9c953d1e00bc6df987d957dc6a5ead | 491 | module SessionsHelper
def log_in(user)
session[:user_id] = user.id
end
def current_user
# rubocop:disable Style/GuardClause
# rubocop:disable Style/IfUnlessModifier
if session[:user_id]
@current_user ||= User.find_by(id: session[:user_id])
end
# rubocop:enable Style/IfUnlessModifier... | 19.64 | 59 | 0.694501 |
b913d6789bcf3b0b48059a40536a06b419f268e2 | 3,507 | # frozen_string_literal: true
module UseCase
class UpdateAssessmentAddressId
class AddressIdMismatched < StandardError; end
class AddressIdNotFound < StandardError; end
class AssessmentNotFound < StandardError; end
class InvalidAddressIdFormat < StandardError; end
def initialize(
addres... | 34.722772 | 165 | 0.706587 |
f7c9eb48bafaa97c5c7f968c2ac661650185c245 | 130 | class AddEnrollmentToStudent < ActiveRecord::Migration[5.1]
def change
add_column :students, :enrollment, :string
end
end
| 21.666667 | 59 | 0.761538 |
08b088d377f374c0807226181f475338e367e512 | 533 | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | 33.3125 | 96 | 0.780488 |
1c6c767d08e1a57dc6a6b4e7022fc1164218ffc8 | 361 | # frozen_string_literal: true
module SystemAdmin
class ValidationErrorsController < ApplicationController
def index
authorize(ValidationError, :index?)
@grouped_counts = ValidationError.group(:form_object).order("count_all DESC").count
@grouped_column_error_counts = ValidationError.list_of_dist... | 30.083333 | 89 | 0.786704 |
6aa7efff830e682498aa74ab2b3cca635f60db15 | 841 | module Adminterface
module Extensions
module Views
module Components
module SiteTitle
def tag_name
:div
end
private
def title_image
helpers.image_tag(site_title_image, class: "image", alt: title_text)
end
end
e... | 22.72973 | 80 | 0.665874 |
91bf1516f75ade67240f14b2a2f711f8b5c55217 | 202 | require 'spec_helper'
#I hate calling out directly from Ruby like this
## but the function: "command('nproc')" was returning strings I couldn't cast
describe `nproc`.to_i do
it { should >= 12 }
end
| 20.2 | 77 | 0.722772 |
6ada4a0fe8d688bd0326382078ab00545fa1a9ab | 1,221 | class Prototool < Formula
desc "Your Swiss Army Knife for Protocol Buffers"
homepage "https://github.com/uber/prototool"
url "https://github.com/uber/prototool/archive/v1.8.0.tar.gz"
sha256 "e700c38e086a743322d35d83cb3b7a481a72d8136db71625a423ba6494a56e58"
revision 1
bottle do
cellar :any_skip_relocati... | 32.131579 | 93 | 0.732187 |
d524493e414947e44c1aec10ca5e1b84809fbf7e | 1,286 | module Prefab
class CancellableInterceptor < GRPC::ClientInterceptor
WAIT_SEC = 3
def initialize(base_client)
@base_client = base_client
end
def cancel
@call.instance_variable_get("@wrapped").instance_variable_get("@call").cancel
i = 0
while (i < WAIT_SEC) do
if @call... | 26.791667 | 93 | 0.635303 |
1c44620196165893acb6e23f26f548c206e90396 | 2,312 | 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... | 34.507463 | 86 | 0.759948 |
ab572081e0e64fb6cb1ddaac1ebbca94b38a5b59 | 554 | require File.dirname(__FILE__) + '/app'
# Load initializers
Dir[File.dirname(__FILE__) + '/config/initializers/*.rb'].each {|file| require file }
<% if (addApi){ %>
<% if (addBackgroundJobs){ %>
run Rack::Cascade.new [API, Rack::URLMap.new('/' => Web, '/sidekiq' => Sidekiq::Web)]
<% } else { %>
run Rack::Casc... | 29.157895 | 87 | 0.555957 |
d5ec185dd9d2f34406bfa66a94f2e9a1e6bdb073 | 896 | describe file('/var/lib/vt/bin/mysqlctld0.sh') do
its('owner') { should eq 'vitess' }
its('group') { should eq 'vitess' }
its('mode') { should cmp '0750' }
it { should exist }
its('content') { should match '#!/bin/sh' }
its('content') { should match 'exec /usr/local/bin/mysqlctld' }
end
describe file('/va... | 29.866667 | 65 | 0.61942 |
5d54034afd3b0bd2e38e332938dbf30ff9f4a0b9 | 42 | Before do
@test_site = TestSite.new
end
| 10.5 | 27 | 0.738095 |
38e76b103ce2cdc71c4865ea4025e8a75d9f7a2c | 877 | class FlickrController < ApplicationController
# NOTE: If PAGESIZE is so small that it can't span a page with images, the
# continuation code may leave a gap if images in the middle of the horizontal
# scroller. Yes, it does handle getting more, but not well enough to handle
# this one case.
PAGESIZE = 50
... | 33.730769 | 79 | 0.718358 |
612a9d3d1cb51dfe020a40300071efe135f3d7e9 | 759 | Pod::Spec.new do |s|
s.name = "MRFoundation"
s.version = "0.1"
s.summary = "A network communication framework."
s.description = "MRFoundation is a network communication framework for iOS and OS X."
s.homepage = "https://github.com/MacRemote/RemoteFoundation"
s.license = { :type... | 30.36 | 101 | 0.627141 |
d56e744148546488c12fe0469362ef9aa06cc0c1 | 542 | require 'spec_helper'
feature 'Has correct abilities' do
let(:organization) { create(:organization) }
let(:conference) { create(:full_conference, organization: organization) } # user is cfp
let(:user) { create(:user) }
context 'when user has no role' do
before do
sign_in user
end
scenario ... | 24.636364 | 89 | 0.701107 |
916d927a725d98c1fb07bad0687aa8a41129e9e8 | 7,696 | require 'findit/asset/image'
require 'findit/asset/map-marker'
require 'findit/location'
module FindIt
# Abstract class for a map feature.
#
# To implement a feature, the derived class must:
#
# * Either define <i>@type</i> class instance variable or override <i>self.type</i> method.
# * Either define ... | 29.714286 | 118 | 0.599142 |
9146496c3e67cc40371dc05367f609edf3bb43c0 | 183 | class CreateIdentityTypes < ActiveRecord::Migration
def change
create_table :identity_types do |t|
t.string :description
t.timestamps null: false
end
end
end
| 18.3 | 51 | 0.710383 |
014127e22689b9287e9e823a61d90ae83f35df87 | 2,269 | ##
# 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::Scanner
def initialize... | 31.082192 | 97 | 0.587043 |
5d3990d014368145dd3ed43d8cb0e5dced647f17 | 165 | class AddFieldsToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :username, :string
add_index :users, :username, unique: true
end
end
| 23.571429 | 53 | 0.727273 |
2868cbe5fcae43b13db53c6a79bb42ab97c43556 | 141 | class Favorite < ActiveRecord::Base
attr_accessible :stamp_id
belongs_to :user
belongs_to :stamp
validates_presence_of :stamp_id
end
| 20.142857 | 35 | 0.801418 |
268e9c0f965928a6580defa02eb775fd80172841 | 862 | override :erlang, version: "18.3.4.9"
override :lua, version: "5.1.5"
override :rubygems, version: "3.0.2"
override :bundler, version: '~> 1.17'
override :'omnibus-ctl', version: "master"
override :chef, version: "v14.11.21"
override :ohai, version: "v14.8.11"
override :ruby, version: "2.5.5"
# This SHA is the last com... | 45.368421 | 89 | 0.735499 |
8791d82ea05c0b77019e6416b78b69cb0fd9137c | 273 | # frozen_string_literal: true
class SassTemplate
SASS_ENGINE_OPTIONS = {
cache: false,
style: :compressed
}.freeze
def initialize(template)
@template = template
end
def render
::Sass::Engine.new(@template, SASS_ENGINE_OPTIONS).render
end
end
| 16.058824 | 61 | 0.70696 |
79ffc873c621f09ed865f121df5bb3e0591399b7 | 5,342 | # typed: true
# frozen_string_literal: true
require "rubocops/extend/formula"
require "extend/string"
module RuboCop
module Cop
module FormulaAudit
# This cop audits `patch`es in formulae.
# TODO: Many of these could be auto-corrected.
class Patches < FormulaCop
extend T::Sig
e... | 40.469697 | 112 | 0.601835 |
bf8ad22d6b3da880d603059832a8fea5b1be559f | 1,114 | class Game < ActiveRecord::Base
belongs_to :game_type
has_many :game_players, dependent: :destroy
has_many :players, through: :game_players
has_many :spoils, dependent: :destroy
has_many :plates, through: :spoils
belongs_to :owner, class_name: "Player", foreign_key: "player_id"
has_many :bonuses, depen... | 20.254545 | 76 | 0.708259 |
6aae98534e68f18b1b1776bc6a572a0e905622b8 | 14,350 | # frozen_string_literal: true
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 37.664042 | 191 | 0.715819 |
b93f8270101ca7d54a7d8e70b0a66cda2bb914fd | 196 | class CreatePizzas < ActiveRecord::Migration
def change
create_table :dishes do |t|
t.string :name
t.timestamps
end
add_index :dishes, :name, :unique => true
end
end
| 16.333333 | 45 | 0.653061 |
7ad4a51e4c979c84197ac7a7a75e846f7607f487 | 1,221 | module Stupidedi
module Versions
module FunctionalGroups
module ThirtyForty
module SegmentDefs
s = Schema
e = ElementDefs
r = ElementReqs
W20 = s::SegmentDef.build(:W20, "Packing",
"To specify packing details of the items shipped",
e:... | 37 | 74 | 0.583129 |
5d0251aeb28e30e42c5b3cbc4d3a1c2eac73b35d | 504 | cask :v1 => 'selfcontrol' do
version '2.0.2'
sha256 'cd1fb7bd5524d81e784ad67f8639cfb836261f07d7e6db75458a398b17f9a1f9'
url "http://downloads.selfcontrolapp.com/SelfControl-#{version}.zip"
appcast 'http://selfcontrolapp.com/SelfControlAppcast.xml',
:sha256 => '05d48c097c072ffd92d4d938b6984c8a09f446a55... | 36 | 87 | 0.769841 |
87a5498bc3e9f65bfe5962958873d67da5df72eb | 1,685 | require 'chef/mixin/shell_out'
include Chef::Mixin::ShellOut
action :append do
if new_resource.rule.kind_of?(String)
rules = [new_resource.rule]
else
rules = new_resource.rule
end
if not node["simple_iptables"]["chains"][new_resource.table].include?(new_resource.chain)
node.set["simple_iptables"][... | 43.205128 | 239 | 0.694955 |
abe13266a33ba90fa7974ef550abdd5aa5681f98 | 1,153 | # Creates the primary channel through which Partners submit requests, which occurs via the API
class API::V1::PartnerRequestsController < ApplicationController
skip_before_action :verify_authenticity_token
skip_before_action :authenticate_user!
skip_before_action :authorize_user
respond_to :json
def create
... | 27.452381 | 94 | 0.718994 |
87ccf4c8b49dbcca8935b500313064c4cfa7c18e | 3,763 | require "bundler"
require "omnibus"
require_relative "../build-chef-dk-gem"
require_relative "../../../../tasks/gemfile_util"
module BuildChefDKGem
class GemInstallSoftwareDef
def self.define(software, software_filename)
new(software, software_filename).send(:define)
end
include BuildChefDKGem
... | 31.621849 | 211 | 0.615732 |
33d21e4855feba39e729dce74d21ef8f23e89e3a | 138 | require("spec_helper")
describe(Ingredient) do
it { should have_and_belong_to_many(:recipes) }
it { should have_many(:amounts) }
end
| 19.714286 | 49 | 0.746377 |
21cb0bf2e958f0bf5b8e0843d34c1ab543409e64 | 225 | class Venue < ActiveRecord::Base
validates_presence_of(:name)
before_save(:capitalize_name)
has_and_belongs_to_many(:bands)
private
define_method(:capitalize_name) do
self.name=(name().capitalize())
end
end
| 18.75 | 36 | 0.755556 |
013a85fbef3803b1321fc5f41498333e2832ce51 | 954 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.896552 | 74 | 0.735849 |
d5b64ee1ce9da1c7f79fa635e1d77e5a5d259392 | 1,511 | module Riddler
class Content
include ::Enumerable
include ::Riddler::Concerns::Includeable
include ::Riddler::Concerns::Logging
def self.content_type
self::CONTENT_TYPE
end
def self.type
self::TYPE
end
def self.from_definition definition, context={}
context = ::Rid... | 19.126582 | 85 | 0.629385 |
3905f86a7cfaf10ed8f7c6ab2176f6eec2401758 | 4,654 | # encoding: UTF-8
require 'faraday'
require 'faraday_middleware'
require 'yajl'
module Citibike
# Class representing a Faraday instance used to connect to the
# actual Citibike API, takes a variety of options
class Connection
def initialize(opts = {})
@options = {
adapter: Faraday.default_ada... | 28.206061 | 87 | 0.576708 |
ff185fc690ea5179566fead4c3f00f2298b9acdc | 197 | class CleanupGoogleAccountColumns < ActiveRecord::Migration
def up
remove_column(:google_accounts, :last_ga_login_request_at)
remove_column(:google_accounts, :last_google_data)
end
end
| 28.142857 | 62 | 0.812183 |
7ad14ccefd0549701409e3ee3aec234c050cc525 | 2,960 | require('capybara/rspec')
require('./app')
require('./spec/spec_helper')
Capybara.app = Sinatra::Application
set(:show_exceptions, false)
RSpec.configure do |config|
config.after(:each) do
Task.all().each() do |task|
task.destroy()
end
List.all().each() do |list|
list.destroy()
end
end... | 30.515464 | 77 | 0.659459 |
f70c086fa0c2cf931c140e70e2f2b31d78e36223 | 1,103 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{good_sort}
s.version = "0.2.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jason King"]
s.date = %q{2010-02-12}
s.email = %q{jk@silentcow.com}
s.extra_rdoc_files ... | 36.766667 | 263 | 0.68631 |
e92bfb5e8c30222fff75cb84799db65ba756c3eb | 108 | # frozen_string_literal: true
class InlineCustomFormBuilder < CustomFormBuilder
namespace InlineForm
end
| 18 | 49 | 0.851852 |
793a3aa1ec01650794acf945e70037082e89b026 | 3,293 | # rubocop:disable Naming/VariableNumber
module Swagger
module V1
class Errors
def self.definitions # rubocop:disable Metrics/MethodLength
{
error_400: {
type: 'object',
properties: {
error: { type: 'string', example: 'Bad Request' }
}
... | 33.602041 | 213 | 0.422411 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.