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 |
|---|---|---|---|---|---|
2671e51819a04acf551a96ce4b5a4db4a301422b | 1,262 | ##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
###
#
# Exec
# ----
#
# Ex... | 21.758621 | 72 | 0.625198 |
21f5c9d959c6b57ce2bc7fe064beb6c243729b06 | 2,351 | require "inventory_refresh"
require "manageiq-messaging"
require "topological_inventory/persister/logging"
require "topological_inventory/persister/workflow"
require "topological_inventory/schema"
module TopologicalInventory
module Persister
class Worker
include Logging
def initialize(messaging_clie... | 28.670732 | 112 | 0.653764 |
08daa088341121c1bac1620d7e822e159612ae1e | 4,757 | class Tournament < ActiveRecord::Base
has_many :registrations, :include => :user, :dependent => :destroy
has_many :brackets, :dependent => :destroy
has_many :matches, :through => :brackets
validates :name, :should_start_at, :should_end_at, :match_length_seconds, :presence => true
validates :should_start_at... | 30.88961 | 105 | 0.649359 |
082ab130b29a2d6d3387c0bbf8f7066a15304f12 | 1,160 | # frozen_string_literal: true
module RedmineGitHosting
module GitoliteWrappers
module Projects
module Common
def handle_repositories_move(projects)
repo_list = []
delete_parent_path = []
projects.reverse_each do |project|
project.gitolite_repos.reverse_each... | 30.526316 | 90 | 0.616379 |
38821a5a34cb1cb7b09dc3d5f8fb64a8f37d7bca | 3,026 | require 'spec_helper'
def publish_and_consume_once(queue_name="test_sink", data="data")
amqp do
q = MQ.queue(queue_name)
q.subscribe do |hdr, msg|
hdr.should be_an MQ::Header
msg.should == data
done { q.unsubscribe; q.delete }
end
EM.add_timer(0.2) do
MQ.queue(queue_name).publ... | 26.54386 | 101 | 0.688367 |
ac582fc6699f651b1c7a9c97c15a22430c25d867 | 195 | # frozen_string_literal: true
class AddIsSupportToCategories < ActiveRecord::Migration[4.2]
def change
add_column :categories, :is_support, :boolean, default: false, null: false
end
end
| 24.375 | 78 | 0.769231 |
f87a8659e71ea5be41e8950660c15a894e4ca50b | 54,516 | # Copyright 2015 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, ... | 40.835955 | 120 | 0.605822 |
18fa50fb0d7f0fac3cf709fd8b6d38cece239942 | 1,679 | # Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: MIT
# DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
# vcenter - VMware vCenter Server provides a centralized platform for managing your VMware vSphere environments
require 'spec_helper'
require 'json'
requi... | 33.58 | 119 | 0.771888 |
6aba605970f9652e42b26d0ad2887236ca5f4b74 | 1,025 | require 'swagger_helper'
describe 'Users API' do
path '/users' do
post 'Registers a new user' do
tags 'Users'
consumes 'application/json'
parameter name: :user, in: :body, schema: {
type: :object,
properties: {
name: { type: :string },
email: { ... | 21.808511 | 122 | 0.539512 |
623e6047c05b0658c46840ba2d0753ca92b401c7 | 1,467 | # frozen_string_literal: true
class Systems::ParseTemplate
include Dry::Monads[:result, :do]
SYSTEM_SCHEMA = Dry::Schema.Params do
required(:name).filled(:string)
required(:file).filled(:any)
required(:data_file).filled(:any)
required(:private_data_file).maybe(:any)
end
def call(input)
pa... | 23.66129 | 86 | 0.681663 |
39048f2b57e983a11e98e40e39d71d80deb80245 | 1,156 | #!/usr/bin/env ruby
#
# $Id$
#
# This script lists each module by the default ports it uses
#
# $Revision$
#
msfbase = __FILE__
while File.symlink?(msfbase)
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
end
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
requi... | 21.018182 | 75 | 0.679066 |
627fa131021b9bde1859703207f688a65a8c3db9 | 65 | module Cells
module Handlebars
VERSION = "0.2.2"
end
end
| 10.833333 | 21 | 0.661538 |
1d0dec02498daf6077713b135be1b6084563f6c3 | 474 | require 'chef/mixin/shell_out'
# helpers for testing bluepill
module BluepillTestHelpers
include Chef::Mixin::ShellOut
include MiniTest::Chef::Assertions
include MiniTest::Chef::Context
include MiniTest::Chef::Resources
MiniTest::Chef::Resources.register_resource(:bluepill_service)
MiniTest::Chef::Infect... | 31.6 | 86 | 0.799578 |
01d5ff0793146ab183d31bb5356e6869f0aad17f | 459 | cask 'patchwork' do
version '3.9.0'
sha256 'b2af77bdc568a6b005df1de1526d6901b6b87d80685abd4109c90daa7ff9e4a3'
url "https://github.com/ssbc/patchwork/releases/download/v#{version}/Patchwork-#{version}-mac.dmg"
appcast 'https://github.com/ssbc/patchwork/releases.atom',
checkpoint: 'c758b28773840d0f3b2e... | 35.307692 | 100 | 0.777778 |
03e3171c4c1031c8495c75279f660761a47e379b | 781 | require 'twitter/enumerable'
module Twitter
class GeoResults
include Twitter::Enumerable
attr_reader :attrs
alias to_h attrs
alias to_hash attrs
alias to_hsh attrs
class << self
# Construct a new SearchResults object from a response hash
#
# @param response [Hash]
# ... | 19.04878 | 66 | 0.608195 |
7928beb79fa0c4973d3d90ef395a0e1fee3dbe1d | 372 | require File.expand_path(File.dirname(__FILE__)) + '/test_helper'
class HasAndBelongsToManyAssociationTest < Test::Unit::TestCase
def test_create_associated_has_and_belongs_to_many_models
Hickey.dump :user => {:login => 'xli', :countries => [{:name => 'China'}]}
assert_equal 1, user.countries.size
asser... | 37.2 | 78 | 0.747312 |
1a05a78216c0d9ead9c9b19fd4c2443c3806d12c | 288 | require_relative 'card'
class Deck
attr_reader :cards
def initialize
@cards = Array.new
Card.values.each { |value| Card.suits.each { |suit| @cards << Card.new(value, suit) } }
end
def deal_cards(n)
deck.pop(n)
end
def shuffle
@cards.shuffle!
end
end | 15.157895 | 91 | 0.638889 |
186de54a8b8832520c705258a8eb809336083077 | 1,854 | # frozen_string_literal: true
module Dast
module Profiles
class UpdateService < BaseContainerService
include Gitlab::Utils::StrongMemoize
def execute
return unauthorized unless allowed?
return error('Profile parameter missing') unless dast_profile
return error(dast_profile.er... | 28.523077 | 104 | 0.679612 |
abc96cd1275e2012dc15b62b6695d5653780d927 | 1,608 | set :application, "spree-demo"
# If you aren't deploying to /u/apps/#{application} on the target
# servers (which is the default), you can specify the actual location
# via the :deploy_to variable:
set :deploy_to, "/home/spreedemo/live"
# If you aren't using Subversion to manage your source code, specify
# your SCM b... | 34.956522 | 88 | 0.730721 |
398db00706abdbd0e8f95a761334d5932c8efdb9 | 894 | require_relative 'value_format'
# Arguments for ‘variables’ request.
class DAP::VariablesArguments < DAP::Base
# The Variable reference.
property :variablesReference, as: 'number'
# Optional filter to limit the child variables to either named or indexed. If omitted, both types are fetched.
# Values: 'indexed'... | 40.636364 | 112 | 0.746085 |
e20d36720b07995f27905c9d63759743444447ed | 2,865 | #!/usr/bin/env ruby
# Export, to stdout, a dump of all data needed to rebuild search indexes.
# By default, exports the data for the "government" search index. If the
# --detailed flag is supplied on the command line, exports the data for the
# "detailed" search index.
#
# Providing an EXPORT_DIRECTORY environment var... | 29.234694 | 98 | 0.69459 |
f71f61ce40fa3c89d8bd0defbf0a2f6ad29a9d3e | 200,044 | # opengl-bindings
# * http://rubygems.org/gems/opengl-bindings
# * http://github.com/vaiorabbit/ruby-opengl
#
# [NOTICE] This is an automatically generated file.
module OpenGLExt
def self.get_ext_enum_GL_3DFX_multisample
[
'GL_MULTISAMPLE_3DFX',
'GL_SAMPLE_BUFFERS_3DFX',
'GL_SAMPLES_3DFX',
... | 29.710976 | 70 | 0.731299 |
edb5428cf8da71d5df4d5b404a6d88f1f981aa2b | 175 | require 'will_paginate'
require_relative '../bootstrap_pagination/action_view' if defined?(ActionView)
require_relative '../bootstrap_pagination/sinatra' if defined?(Sinatra)
| 43.75 | 78 | 0.828571 |
796605f547d58053449ab8b06d55f35fbb62e063 | 2,510 | module TrackMappingsProgress
def tracks_mappings_progress(options = {})
class_eval do
include TrackMappingsProgress
unless _process_action_callbacks.any? { |c| c.kind == :before && c.filter == :find_site }
# Make sure find_site is there in the call chain, we depend on it,
# but don't ... | 30.609756 | 95 | 0.675299 |
7ae81dabe2424200b213438c832431884691237c | 2,494 | require File.dirname(__FILE__) + '/spec_helper'
# $COPY = :method001
# $COPYT = :html
describe YARD::Templates::Engine.template(:default, :method) do
before { Registry.clear }
shared_examples_for "all formats" do
it "should render html format correctly" do
html_equals(Registry.at('#m').format(:format... | 24.45098 | 95 | 0.572173 |
acf53fd55d113c582ce6f20a270d543671c674e1 | 162 | require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
end
| 27 | 65 | 0.777778 |
1c8eefb07bf85b7cb9bbb05fcccd1483fd95e994 | 2,473 | require 'json'
module BuildTools
class CustomService
# @option options [required, String] :service_name
# @option options [String] :gem_version
# @option options [String] :gem_name
# @option options [required, String] :model_path
# @option options [required, String] :default_endpoint
def ini... | 29.094118 | 84 | 0.612616 |
5d9889e06c6742362291e3c87bf6b45b8721fb36 | 5,321 | #
# Be sure to run `pod lib lint WJBaseComponent.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'WJBa... | 40.930769 | 113 | 0.691036 |
2874949bdfe458d2b2b7a360f2f4271c091d99cf | 3,939 | # frozen_string_literal: true
require "features_helper"
RSpec.feature "Facility page functionality", type: :feature do
let(:admin) { create(:admin, :power_user) }
let!(:ihmi) { create(:organization, name: "IHMI") }
let!(:another_organization) { create(:organization) }
let!(:ihmi_group_bathinda) { create(:faci... | 36.813084 | 116 | 0.674791 |
285ca01b26ffc8e3308b2b3028736ec0e99c97d1 | 529 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require File.expand_path('../shared/iteration', __FILE__)
require File.expand_path('../shared/each', __FILE__)
require File.expand_path('../../enumerable/shared/enumeratorized', __FILE__)
describe "Hash... | 44.083333 | 91 | 0.752363 |
6ac8d9b97d35fec805d3b69152c89765b7d32fbb | 524 | require "rails_helper"
describe "the Site Settings", js: true do
login_success
it "Settings Form" do
admin_sign_in
visit "#{cama_root_relative_path}/admin/settings/site"
expect(page).to have_content("Basic Information")
expect(page).to have_content("Configuration")
within '#site_settings_form' ... | 30.823529 | 58 | 0.711832 |
6a557c2be020c6c7708f1ce219d6fdf71e5ead1b | 1,376 | # -*- encoding: utf-8 -*-
require File.expand_path("../lib/fuzzy_match/version", __FILE__)
Gem::Specification.new do |s|
s.name = "fuzzy_match"
s.version = FuzzyMatch::VERSION
s.authors = ["Seamus Abshere"]
s.email = ["seamus@abshere.net"]
s.homepage = "https://github.com/seamusabsher... | 41.69697 | 137 | 0.722384 |
61e77094014cac8e82ce9d52fae772e7145bac52 | 419 | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
Mime::Type.register "application/n-triples", :nt
Mime::Type.register "application/ld+json", :jsonld
Mime::Type.register "text/turtle", :ttl
Mime::Type.register 'app... | 46.555556 | 63 | 0.75895 |
ab486e8b0d2db7a3f3ef64a3e57c03e7a2dd235d | 520 | #!/usr/bin/env ruby
module Rex
module Post
module Meterpreter
###
#
# Base class for all extensions that holds a reference to the
# client context that they are part of. Each extension also has a defined
# name through which it is referenced.
#
###
class Extension
#
# Initializes the client and name attributes.
... | 16.25 | 74 | 0.719231 |
e922f5379db37cb4f62cb94422c142220b8e4f44 | 9,671 | class Gcc < Formula
def arch
if Hardware::CPU.type == :intel
if MacOS.prefer_64_bit?
"x86_64"
else
"i686"
end
elsif Hardware::CPU.type == :ppc
if MacOS.prefer_64_bit?
"powerpc64"
else
"powerpc"
end
end
end
def osmajor
`uname -r`.... | 34.173145 | 113 | 0.643677 |
ff586980ec958e7f78aa87c1055895352ed13fd1 | 72 | Rails.application.routes.draw do
get 'index', controller: 'dummy'
end
| 18 | 34 | 0.75 |
33c6b5a1d302de96718ac4d6a6c6dc748d5e5055 | 3,333 | require_relative '../../spec_helper'
require_relative 'fixtures/classes'
describe "BasicObject#instance_exec" do
it "is a public instance method" do
BasicObject.should have_public_instance_method(:instance_exec)
end
it "sets self to the receiver in the context of the passed block" do
a = BasicObject.new... | 30.861111 | 80 | 0.692769 |
ab40fb2872f70c67aa804cfdf5f1bea91bdb3c0e | 302 | # This is a helper class to better deal with model translation tools
# when used in combination with Globalize2 translated internal
class ModelTranslation < ::Translation
attr_accessor :table_name
attr_accessor :facet
attr_accessor :locale
attr_accessor :record_id
attr_accessor :value
end
| 27.454545 | 69 | 0.804636 |
d5899c15af6aa7407e41bc8c2ff4978a9e0b221d | 511 | class MeasurementUnitQualifier < Sequel::Model
plugin :time_machine
plugin :oplog, primary_key: :measurement_unit_qualifier_code
set_primary_key [:measurement_unit_qualifier_code]
one_to_one :measurement_unit_qualifier_description, key: :measurement_unit_qualifier_code,
... | 42.583333 | 124 | 0.767123 |
39b78829202d44fd987f4bb12260a27342c23f75 | 136 | module Selenium
module Client
class CommandError < RuntimeError
end
class ProtocolError < RuntimeError
end
end
end
| 13.6 | 38 | 0.713235 |
d5245a30fe0825ac3be7b080e62b2cf4e91f93fc | 677 | # Names a match to influence tree construction.
#
# Example:
#
# str('foo') # will return 'foo',
# str('foo').as(:foo) # will return :foo => 'foo'
#
class Parslet::Atoms::Named < Parslet::Atoms::Base
attr_reader :parslet, :name
def initialize(parslet, name)
super()
@parslet, @name = par... | 20.515152 | 60 | 0.623338 |
bbf696173e0e9ea079799f807b8894b7759b8fe2 | 1,176 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v7/enums/custom_interest_member_type.proto
require 'google/api/annotations_pb'
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("google/ads/googleads/v7/enums/custom_interest_member_t... | 36.75 | 221 | 0.763605 |
bb051f2f07ecfaea2050a71bbefe00154baf3c9b | 2,786 | class DonationMigrator
def initialize(donations: nil, user: nil, params: nil)
@donations = donations
@user = user
@params = params
end
def self.all
donations = scope.all.group_by { |x| "#{x.edit_source} #{x.created_at.to_date}" }
donations = donations.map { |_, versions| DonationToMigrate.new... | 26.037383 | 103 | 0.641421 |
ac1e32fd86bdf05961356dcb8f1e632081a2064a | 103 | require 'spec_helper'
describe(Ingredient) do
it { should validate_uniqueness_of(:ingredient) }
end
| 17.166667 | 51 | 0.786408 |
e8c00c19fc471b6305f7b3fc59ea924788b2a577 | 2,487 | Rails.application.routes.draw do
root "zernikes#main"
# post "/compute", to: "zernikes#compute", as: "compute"
# get "/compute", to: "zernikes#compute"
post "/update", to: "zernikes#update", as: "update"
get "/manual", to: "zernikes#manual", as: "enter_manually"
post "/set_all_zero", to: "zernikes#set_al... | 31.884615 | 92 | 0.637314 |
e23ccb0abe1f0e2f90989f81762b4677e3bbcf97 | 9,695 | # Title: Jekyll Image Tag
# Authors: Rob Wierzbowski : @robwierzbowski
#
# Description: Better images for Jekyll.
#
# Download: https://github.com/robwierzbowski/jekyll-image-tag
# Documentation: https://github.com/robwierzbowski/jekyll-image-tag/readme.md
# Issues: https://github.com/robwierzbowski/jekyll-image-tag/is... | 39.410569 | 341 | 0.625168 |
2682092dc9002890b7dc7631389e5de9cd71a2bf | 212 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
module Azure
VERSION = '0.68.0'
end
| 26.5 | 94 | 0.754717 |
1de9e9c3cc2e4bfbc4fcbf0e155aad90b49a4299 | 1,030 | class UspsConfirmationMaker
def initialize(pii:, issuer:, profile:)
@pii = pii
@issuer = issuer
@profile = profile
end
def otp
@otp ||= generate_otp
end
def perform
UspsConfirmation.create!(entry: attributes)
UspsConfirmationCode.create!(
profile: profile,
otp_fingerprint... | 22.391304 | 81 | 0.662136 |
e979276ee5bd25dfdb3dad97e93d0d20634be590 | 939 | # <<fonte>> lib/lftmi/c4/at_p/Pilha.rb
module Lftmi
class Pilha
# Pilha::
def initialize
@conteudo = ["Z0"]
end
attr_reader :conteudo
# Pilha_comportamento_elementar
# Pilha::
def top
@conteudo[-1]
end
# Pilha::
def pop
@conteudo.pop
end
# Pilha::
... | 15.145161 | 39 | 0.538871 |
5df8d1c4cd3a7fba73c5dfd2a753c38ef9e472b1 | 1,942 | #
# Cookbook Name:: ca_openldap
# Recipe File:: client
#
# Copyright 2013, Christophe Arguel <christophe.arguel@free.fr>
#
# 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.apa... | 28.558824 | 86 | 0.728115 |
1d703198ebf49f12bb53f7b3ef26984844cf8c97 | 46 | require 'spec_helper'
require 'string_output'
| 15.333333 | 23 | 0.826087 |
01aec135331938414a932e037e36c1e715a24601 | 1,881 | # A base class providing CRUD for GlobalRegistry Entities.
# API doc at https://github.com/CruGlobal/global_registry_docs/wiki/Entities
module GlobalRegistryModels
module Entity
class Base < CommonBase
attribute :client_integration_id, String
validates_presence_of :client_integration_id
def in... | 29.390625 | 146 | 0.645933 |
2175b35cb9ea6ee6b49b8c9d861d0a062adb8226 | 2,717 | require 'excon'
require_relative 'jsonapi'
module JSONAPI
module Model
# Supports mechanics of connecting with remote endpoint
module Connectable
extend ActiveSupport::Concern
# Connection for accessing remote endpoints
#
# @return [Excon::Connection]
def connection
sel... | 25.392523 | 93 | 0.626426 |
ff1967beb5117cdc939b8e614cd3d6ff7bac14ee | 6,745 | # frozen_string_literal: true
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 43.798701 | 140 | 0.64255 |
21d37af4b3b801c1897c59e2dbdc88f751bfeca2 | 2,595 | class Redis28 < Formula
homepage "http://redis.io/"
url "http://download.redis.io/releases/redis-2.8.19.tar.gz"
sha256 "29bb08abfc3d392b2f0c3e7f48ec46dd09ab1023f9a5575fc2a93546f4ca5145"
bottle do
root_url "https://homebrew.bintray.com/bottles-versions"
sha256 "9251b1a449b5335aa3a48b23621f1ac87fdaa0c4ad... | 35.547945 | 118 | 0.647784 |
bb1f9647be3aee703b6cad1b76214a877af06b0c | 8,606 | class Vtk < Formula
desc "Toolkit for 3D computer graphics, image processing, and visualization."
homepage "http://www.vtk.org"
url "http://www.vtk.org/files/release/7.1/VTK-7.1.0.tar.gz"
mirror "https://fossies.org/linux/misc/VTK-7.1.0.tar.gz"
sha256 "5f3ea001204d4f714be972a810a62c0f2277fbb9d8d2f8df39562988c... | 36.935622 | 128 | 0.661864 |
7a1908874d129d94d91ac5d68e46ddbb740cac37 | 992 | {
matrix_id: '67',
name: 'bcsstm12',
group: 'HB',
description: 'SYMMETRIC MASS MATRIX, ORE CAR (CONSISTENT MASSES)',
author: 'J. Lewis',
editor: 'I. Duff, R. Grimes, J. Lewis',
date: '1982',
kind: 'structural problem',
problem_2D_or_3D: '1',
num_rows: '1473',
num_cols: '1473'... | 29.176471 | 89 | 0.645161 |
d5b5ba982781985eb06171ca3ad4567282e89bc7 | 1,820 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... | 41.363636 | 85 | 0.772527 |
1a5d074519a1cbe0174eca2fc459060f3e584682 | 1,677 | # A general Vagrant system implementation for "solaris 11".
#
# Contributed by Jan Thomas Moldung <janth@moldung.no>
require "vagrant"
module VagrantPlugins
module GuestSolaris11
class Plugin < Vagrant.plugin("2")
name "Solaris 11 guest."
description "Solaris 11 guest support."
config("solari... | 25.8 | 72 | 0.658915 |
bbdcab6dae534cb0341e5a1e8081f13a41ac5bb7 | 7,675 | require 'date'
require 'bigdecimal'
require 'stringio'
require 'active_support/concern'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/array/wrap'
require 'action_controller'
require 'action_dispatch/http/upload'
module ActionController
class ParameterMissing < IndexError... | 28.531599 | 115 | 0.618502 |
ab8152ecff5d825b7c8fd96dbfc64055359159fa | 335 | # Monkeypatch for slashes to work
module Elasticsearch
module API
# Generic utility methods
#
module Utils
alias_method :__pathify_without_slashes, :__pathify
def __pathify(*segments)
__pathify_without_slashes(*segments.map { |s| s.gsub('/', '%2F')}).gsub('%252F', '%2F')
end
... | 22.333333 | 95 | 0.653731 |
6242258ea0e4d68a2a064b487c359f2424646a1b | 119 | require_relative '../../spec_helper'
describe "IO#fdatasync" do
it "needs to be reviewed for spec completeness"
end
| 19.833333 | 49 | 0.747899 |
f8f2e78178b9a1b6f8fa9d5eb7869d0c72ffd28c | 1,100 | cask "webcatalog" do
version "33.1.1"
if Hardware::CPU.intel?
sha256 "5843f503b5e2ee4b9e2200bb6494f2ef00d3a0913ed37c4e2bea00eef0049763"
url "https://github.com/webcatalog/webcatalog-app/releases/download/v#{version}/WebCatalog-#{version}.dmg",
verified: "github.com/webcatalog/webcatalog-app/"
el... | 29.72973 | 117 | 0.734545 |
1dd28296c755f6366f7e88c07afee8703f6dd8ee | 2,926 | # encoding: UTF-8
module Wice
module Columns #:nodoc:
class ViewColumnString < ViewColumn #:nodoc:
attr_accessor :negation, :auto_reloading_input_with_negation_checkbox
def render_filter_internal(params) #:nodoc:
@contains_a_text_input = true
css_class = 'form-control input-sm ' + ... | 32.876404 | 167 | 0.596719 |
bf548944d09af54068a5f04cdd78a0359356a2b9 | 918 | # The Book of Ruby - http://www.sapphiresteel.com
# illustrates how to read and write instance variables
# using accessor methods
class Thing
def initialize( aName, aDescription )
@name = aName
@description = aDescription
end
# get accessor for @name
def name
return @na... | 20.863636 | 55 | 0.66122 |
6a2ad3388606c748faed228d18ea3eb3c4d5265b | 341 | module LibyuiTestFramework
module Pages
module ExpertPartitioner
class AbortDialogPage
attr_reader :app
YES_BUTTON = { label: 'Yes' }
def initialize(app)
@app = app
end
def press_yes
app.button(YES_BUTTON).click
end
end
... | 17.05 | 38 | 0.548387 |
03777edf9e3f4f22c2464e4942d9fa504f685133 | 6,544 | # Copyright © 2011-2019 MUSC Foundation for Research Development
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list... | 55.457627 | 163 | 0.757488 |
5d882c2b27e0694e8b11f1a8843ddff4373467a0 | 61 | module UOM
class MeasurementError < StandardError; end
end
| 15.25 | 45 | 0.803279 |
91150b8629cf7d7df7a28302d1c196e6ce5bb732 | 1,190 | # frozen_string_literal: true
class Mutations::AddToInventory < GraphQL::Function
# arguments passed as "args"
argument :title, !types.String, description: "Title of the product being added"
argument :description, !types.String, description: "Description of product being added"
argument :price, !types.Float, d... | 37.1875 | 166 | 0.716807 |
336d006c6bddfb5faaa2b798db78367ae2fb987f | 2,222 | require 'bosh/dev/vcloud'
require 'bosh/dev/writable_manifest'
module Bosh::Dev::VCloud
class MicroBoshDeploymentManifest
include Bosh::Dev::WritableManifest
attr_reader :filename
def initialize(env, net_type)
@env = env
@net_type = net_type
@filename = 'micro_bosh.yml'
unless ... | 35.269841 | 94 | 0.491899 |
26ce4d6cc1588ea37a93fff55c79c7de7b24e504 | 21,642 | describe SignUpSheetController do
let(:assignment) { build(:assignment, id: 1, instructor_id: 6, due_dates: [due_date], microtask: true, staggered_deadline: true) }
let(:instructor) { build(:instructor, id: 6) }
let(:student) { build(:student, id: 8) }
let(:participant) { build(:participant, id: 1, user_id: 6, ... | 46.742981 | 154 | 0.661492 |
1c0308a66bf3267b3ce45bc056994d75ae057966 | 163 | require 'test_helper'
class ProblemsControllerTest < ActionController::TestCase
test "should get edit" do
get :edit
assert_response :success
end
end
| 16.3 | 57 | 0.754601 |
039cf05ea74bf8919c0fb5c427bad1801fd266f0 | 701 | require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
def setup
@base_title = "Ruby on Rails Tutorial Sample App"
end
test "should get home" do
get root_path
assert_response :success
assert_select "title", "#{@base_title}"
end
test "should get help" do
... | 21.90625 | 65 | 0.693295 |
f70a754fff1b556874bae8a21200cbefc35efba8 | 832 | require 'rails_helper'
describe UsersController do
before do
@user = User.create!(user_attributes)
end
context "when not signed in" do
before do
session[:user_id] = nil
end
it "cannot access index" do
get :index
expect(response).to redirect_to(new_session_url)
end
... | 18.086957 | 54 | 0.652644 |
9159183dd4315cd958a84c6cb926db7282f150e7 | 947 | module PROIEL::Valency::Obliqueness
# Sorts frames by obliqueness
def self.sort_frames(frames)
# Sort frames by obliqueness, then by inspecting them so that we get
# a stable, reproducible order.
frames.sort_by { |frame| [obliqueness_of_arguments(frame[:arguments]).sort, frame.inspect] }
end
# Sort... | 29.59375 | 96 | 0.749736 |
e8850c3cc66327ac0f444e05248b956fc0ba8e2f | 456 | # 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::NetApp::Mgmt::V2019_11_01
module Models
#
# Defines values for ReplicationSchedule
#
module ReplicationSchedule
_10min... | 22.8 | 70 | 0.675439 |
1d5e5a10d12e81e918e8d3eed235a9a7705b2a9c | 277 | module CampusSolutions
module WorkExperienceUpdatingModel
def passthrough(model_name, params)
proxy = model_name.new({user_id: @uid, params: params})
result = proxy.get
HubEdos::StudentApi::V2::WorkExperiences.expire @uid
result
end
end
end
| 25.181818 | 61 | 0.707581 |
263b921d560e69459bdab28fb7d7497929d0b09d | 4,900 | # ----------------------------------------------------------------------------
# <copyright company="Aspose" file="create_visual_object_bounds_request.rb">
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person ob... | 47.572816 | 191 | 0.673673 |
bf59acd19fe9741e0151c5b5124f097545cae17c | 8,051 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/aiplatform/v1/model_service.proto
require 'google/api/annotations_pb'
require 'google/api/client_pb'
require 'google/api/field_behavior_pb'
require 'google/api/resource_pb'
require 'google/cloud/aiplatform/v1/io_pb'
require 'google/cloud... | 60.533835 | 186 | 0.770339 |
6a72c2999b0b1206d32b2243effd614529b912ba | 1,202 | class TaskwarriorTui < Formula
desc "Terminal user interface for taskwarrior"
homepage "https://github.com/kdheepak/taskwarrior-tui"
url "https://github.com/kdheepak/taskwarrior-tui/archive/v0.9.2.tar.gz"
sha256 "dd37dc4536afecd2875517ddb5588f3c8313bac2f3e76ef12f621f38c146fd6a"
license "MIT"
head "https://g... | 35.352941 | 93 | 0.74376 |
abca138de9722f2dc545f1673fee926597451700 | 1,432 | require File.expand_path("../../Abstract/abstract-php-extension", __FILE__)
class Php71Intl < AbstractPhp71Extension
init
desc "Wrapper for the ICU library"
homepage "http://php.net/manual/en/book.intl.php"
revision 7
bottle do
sha256 "8baf31d4e9a6739bc509624ef3c63f7a696eb8d1912cb1c586931a67c6d8d853" =>... | 29.833333 | 92 | 0.677374 |
4aa0b3e07b1a78b35c40e4329568650017d2cd8b | 3,055 | # Reference: https://github.com/macvim-dev/macvim/wiki/building
class Macvim < Formula
desc "GUI for vim, made for macOS"
homepage "https://github.com/macvim-dev/macvim"
url "https://github.com/macvim-dev/macvim/archive/snapshot-151.tar.gz"
version "8.1-151"
sha256 "4752e150ac509f19540c0f292eda9bf435b89861385... | 39.166667 | 93 | 0.611129 |
ed1e32be8187fe0f8f6df3a7b15b6e564d4e02a1 | 840 | module ClickTracksHelper
def stat_by(start_date, end_date)
start_date ||= 1.month.ago
end_date ||= Time.current
line_chart by_day_api_item_click_tracks_path(@item, start_date: start_date, end_date: end_date),
basic_opts('Click count', start_date, end_date)
end
private
def basic_opts... | 27.096774 | 114 | 0.505952 |
5d8025473634f89990347dd236b5e0b2e908efc5 | 2,932 | # This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
requ... | 40.164384 | 86 | 0.748977 |
28800eb3aa99f47904dc7f04f47e916762c81e85 | 134 | Spree::Role.class_eval do
class << self
define_method :affiliate do
find_or_create_by(name: :affiliate)
end
end
end
| 16.75 | 41 | 0.69403 |
6aa664254c75805c4d1c695adc2b68e81501294f | 97 | # frozen_string_literal: true
require 'mkmf'
create_makefile('fast_underscore/fast_underscore')
| 19.4 | 50 | 0.835052 |
7ac4b9519ca45a3840c2e72a16a614202a1a61c3 | 279 | class AddDischargeReasonCodeToUKRDCTreatments < ActiveRecord::Migration[5.2]
def change
within_renalware_schema do
add_column :ukrdc_treatments, :discharge_reason_code, :integer
add_column :ukrdc_treatments, :discharge_reason_comment, :string
end
end
end
| 31 | 76 | 0.78853 |
1ccbf2e0d16803d989b849fc5e565975ac9a6179 | 37,063 | module ActiveScaffold
module Helpers
# Helpers that assist with the rendering of a Form Column
module FormColumnHelpers
# This method decides which input to use for the given column.
# It does not do any rendering. It only decides which method is responsible for rendering.
def active_scaffol... | 47.455826 | 184 | 0.667944 |
33d4cce8b3fb86d27a3c623b6d6348719b6186fe | 40 | module Netutils
VERSION = "0.1.2"
end
| 10 | 19 | 0.675 |
e87699639da0503c3dc0b7de6ffa54537a9e2a76 | 718 | # frozen_string_literal: true
class S3BucketsFetchService < ApplicationService
module Error
class Unauthorized < CloudError
attr_reader :account_name
def initialize(account_name)
@account_name = account_name
end
def message
"You do not have a permission to view buckets f... | 21.757576 | 93 | 0.706128 |
7afe91fbe62dbc6904d4c317d4bb3e1159e21196 | 277 | module Fog
module XenServer
class Compute
class Real
def destroy_record(ref, provider_class)
@connection.request({ :parser => Fog::XenServer::Parsers::Base.new, :method => "#{provider_class}.destroy" }, ref)
end
end
end
end
end | 25.181818 | 124 | 0.624549 |
fff312daac63ea686004896af5187c58228e45cd | 39,883 | module Raylib # rubocop:disable Metrics/ModuleLength Metrics/LineLength
#####################################################################################
# raylib.h
#####################################################################################
#-------------------------------------------------------... | 83.612159 | 167 | 0.599579 |
e852f0ffa8b0711a155e604d5e1cfbc025de046f | 342 | require_relative 'out'
class ExceptionHandler
def handle(info=nil)
begin
return yield
rescue Exception => details
if !info.to_s.empty?
$out.error info
end
$out.error details.message
details.backtrace.reverse.each do |detail|
$out.error detail
end
exit... | 18 | 48 | 0.619883 |
4a7374acb73c382c3cac9c89571c6b00e6899529 | 2,086 | 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... | 35.965517 | 86 | 0.752637 |
1a517b945c6a56ef63f4736c35b5e59217953bce | 451 | # frozen_string_literal: true
class Spree::PurchasePolicyTypesController < Spree::StoreController
before_action :load_purchase_policy
def index
@purchase_policy_types = Spree::PurchasePolicyType.all
end
def show
@purchase_policy_type = Spree::PurchasePolicyType.find(params[:id])
end
protected
... | 22.55 | 88 | 0.778271 |
61353dea088cf9dd94fc353621e6a0811cb6b3b6 | 2,697 |
$is_Jekyll = false
begin
require "jekyll"
puts "testing cases using jekyll"
$is_Jekyll = true
rescue LoadError
require "liquid"
puts "testing cases using liquid"
end
Liquid::Template.error_mode = :strict
def isJekyll
$is_Jekyll
end
def assertEqual(expected, real)
if expected != real
raise "#{real}... | 19.686131 | 79 | 0.678161 |
117d2b4c08dc934e8b853b31f7df704e437ddcdd | 523 | # frozen_string_literal: true
# Creates a new API scenario with the given attributes. Scenarios are marked as
# protected.
CreateAPIScenario = lambda do |attributes = {}|
attributes = attributes
.slice(:area_code, :end_year, :scenario_id, :protected)
.reverse_merge(protected: true, source: 'ETM')
scenario... | 29.055556 | 79 | 0.751434 |
b9ac86935b400187c2217d4a51c0c22be322f202 | 24,018 | # frozen_string_literal: true
require 'fileutils'
RSpec.describe QiniuNg::Storage do
describe QiniuNg::Storage::BucketManager do
it 'should get all bucket names' do
client = QiniuNg.new_client(access_key: access_key, secret_key: secret_key)
expect(client.bucket_names).to include('z0-bucket', 'z1-buc... | 36.668702 | 123 | 0.646015 |
b961f720c37522e89e15f843d42c63c1065c3a12 | 779 | module Pageflow
class Theme
attr_reader :name, :directory_name, :options
def initialize(name, options = {})
@name = name.to_s
@directory_name = name.to_s
@options = options
end
def stylesheet_path
"pageflow/themes/#{name}.css"
end
def has_home_button?
!@options... | 19.475 | 48 | 0.667522 |
ff23570b782aae1ac187869cb16d3248ffe23dd0 | 3,583 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
... | 32.87156 | 100 | 0.560145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.