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 |
|---|---|---|---|---|---|
91f3744c94812707d4664f81a1190061471713ce | 231 | class CreatePolychromeShows < ActiveRecord::Migration
def change
create_table :polychrome_shows do |t|
t.string :slug
t.text :show_data
t.timestamps
end
add_index :polychrome_shows, :slug
end
end
| 19.25 | 53 | 0.69697 |
33c3220ac1f58714bf667eb8c57e1ab297103f08 | 968 | #!/usr/bin/env ruby
$: << File.dirname(__FILE__)+'/../../lib'
require 'wukong'
require 'wuclan/models'; include Wuclan::Models
require 'wuclan/models/multi_edge'
TwitterUser.class_eval do
def age
end
end
# Common to all user-user relationships.
module RelationshipBase
def both_edge_rels
[ ["a_#{self.class.r... | 18.615385 | 74 | 0.697314 |
ab4bf437fb5bd978b493c2d070d56f9321f1e307 | 238 | require "spec_helper"
RSpec.describe Webpacker::ManifestRemote do
it "has a version number" do
expect(Webpacker::ManifestRemote::VERSION).not_to be nil
end
it "does something useful" do
expect(false).to eq(true)
end
end
| 19.833333 | 60 | 0.735294 |
accaf0fbd7dcac03de1c9e5720deb110aeff505b | 288 | class CreateApplicants < ActiveRecord::Migration[5.2]
def change
create_table :applicants do |t|
t.string :name
t.string :email
t.string :phone
t.string :career_level
t.integer :experience
t.text :cover_note
t.timestamps
end
end
end
| 19.2 | 53 | 0.642361 |
26060969d6e6901aac4ff89faaf641026847f01c | 998 | require 'rollbar/rails'
Rollbar.configure do |config|
config.access_token = 'aaaabbbbccccddddeeeeffff00001111'
# By default, Rollbar will try to call the `current_user` controller method
# to fetch the logged-in user object, and then call that object's `id`,
# `username`, and `email` methods to fetch those pro... | 47.52381 | 78 | 0.748497 |
91d18ada35e87ac2e409f4b6f6a24ecb67994c9a | 231 | require File.dirname(__FILE__) + '/../scripts'
module RubiGen::Scripts
class Update < Base
mandatory_options :command => :update
protected
def banner
"Usage: #{$0} [options] generator"
end
end
end
| 17.769231 | 46 | 0.636364 |
e83a728396b50b5afd2116df1dfbfe86e95154b2 | 1,421 | require 'recursive-open-struct'
describe OpenscapResult do
let(:openscap_result) { described_class.new(:id => 17) }
context "#html" do
it "raises exception if there is no blob" do
expect { openscap_result.html }.to raise_error(NoMethodError)
end
it "extracts the arf html" do
openscap_resul... | 34.658537 | 91 | 0.59817 |
266b88e0aef37dc0477ff1d554741104de7c99a3 | 1,116 | require 'test_helper'
class ExternalHandlersTest < MiniTest::Test
include RabbitHelper
TEST_QUEUE = "test.ElmerFudd.cast"
module Handler
extend self
def call(_env, message)
run(text: message.payload["text"])
end
def run(text:, **_ignore_rest_of_the_payload)
$responses.push text
... | 21.461538 | 66 | 0.704301 |
ed15b87a6f9b4c28572de7b823d55a73a0dc4087 | 136 | class ChangePermissionNameInApps < ActiveRecord::Migration
def change
rename_column :apps, :permissions, :permissionStr
end
end
| 22.666667 | 58 | 0.794118 |
ac6ca2f6a45789e0177781dd398f65f48ba0bfb4 | 666 | # This file is included by every sub-project's spec_helper
if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start do
root File.expand_path('../..', __FILE__)
merge_timeout 3600
# command name is injected by the spec.rake runner
if ENV['BOSH_BUILD_NAME']
command_name ENV['BOSH_BUILD_N... | 24.666667 | 70 | 0.716216 |
7a456a7355d6b51500a598e18ca4274a7493c122 | 119 | class AddStateToBackers < ActiveRecord::Migration[4.2]
def change
add_column :backers, :state, :string
end
end
| 19.833333 | 54 | 0.739496 |
5da54c33a8bd8557da39d2b45a6594bdcc3d5c26 | 426 | require_relative "website"
require_relative "publisher_identifier"
require_relative "code"
module OnixParser
module Elements
class Publisher < Base
attribute :publishing_role, Code, list: "45"
attribute :publisher_identifier,
Types::Collection,
of: PublisherIdentifier
attribute ... | 25.058824 | 56 | 0.725352 |
39035fcf732ee92800b81e93781af9908e079d9d | 2,419 | class Node
attr_accessor :data, :next_node, :visited
def initialize(data,next_node)
@data =data
@next_node = next_node
end
end
class LinkedList
attr_accessor :head
def addfirst(node)
node.next_node = @head if (@head)
@head = node
end
def add(node)
unless head
... | 19.666667 | 76 | 0.588673 |
872cc9c2b33eaf44cf660505742d420f06116e67 | 1,785 | # 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::Synapse::Mgmt::V2019_06_01_preview
module Models
#
# Custom setup script properties for a managed dedicated integration
# runtim... | 28.790323 | 78 | 0.57535 |
91906bd2eb689cbbb8c92c1768bd6b1f677b8fbf | 2,171 | require 'time'
# A module to gather uptime facts
#
module Facter::Util::Uptime
def self.get_uptime_seconds_unix
uptime_proc_uptime or uptime_sysctl or uptime_executable
end
def self.get_uptime_seconds_win
require 'facter/util/wmi'
last_boot = ""
Facter::Util::WMI.execquery("select * from Win32_... | 26.156627 | 101 | 0.583602 |
abb35365006f13519d921e5dee2fb5d355db2602 | 1,832 | module Fixtures
class << self
def instant_verify_request_json
raw = read_fixture_file_at_path('fixtures/instant_verify/request.json')
JSON.parse(raw).to_json
end
def instant_verify_success_response_json
raw = read_fixture_file_at_path('fixtures/instant_verify/successful_response.json')
... | 30.533333 | 102 | 0.758734 |
21aa8f69740490eb7659d2c80fa048b85e023fdb | 1,577 | class Chruby < Formula
desc "Ruby environment tool"
homepage "https://github.com/postmodern/chruby#readme"
url "https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz"
sha256 "7220a96e355b8a613929881c091ca85ec809153988d7d691299e0a16806b42fd"
head "https://github.com/postmodern/chruby.git"
bottle do
... | 32.854167 | 92 | 0.720989 |
e82e3d44d2ec63fbfb9ed0e337d7be2cf7725e27 | 2,409 | # frozen_string_literal: true
module MaintenanceTasks
# Generator used for creating maintenance tasks in the host application.
#
# @api private
class TaskGenerator < Rails::Generators::NamedBase
source_root File.expand_path("templates", __dir__)
desc "This generator creates a task file at app/tasks and... | 25.62766 | 80 | 0.655874 |
4a016c0f009a1f65aad5154bfb0226fc2eb7e5a1 | 1,862 | # first fix redirects to whitehall-admin URLs
Unpublishing.where('alternative_url like "https://whitehall-admin%"').each do |unp|
original_url = unp.alternative_url
new_url = nil
# for items that point to an admin show page, find the public url of that edition
original_url.match('government/admin/[\w-]+/(\d+)$'... | 38 | 113 | 0.739527 |
615be1ac41673ec0b5897eb413a885f7ab524440 | 344 | class Vote < ActiveRecord::Base
belongs_to :user
belongs_to :response
has_one :poll, through: :response
validates :user_id, uniqueness: { scope: :response_id }
#add validation to ensure that for questions w/o select multiple, multiple responses can't be given
def self.public_votes
where(public_respo... | 22.933333 | 101 | 0.741279 |
1aad6a4d99d70272d42a88d089d6f2039f249299 | 2,001 | ##
# $Id$
##
##
# 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 ... | 24.402439 | 92 | 0.592704 |
38866ca9ddab2c51877372ff889fd636ea28ee71 | 2,333 | class BisonAT27 < Formula
desc "Parser generator"
homepage "https://www.gnu.org/software/bison/"
url "https://ftp.gnu.org/gnu/bison/bison-2.7.1.tar.gz"
mirror "https://ftpmirror.gnu.org/bison/bison-2.7.1.tar.gz"
sha256 "08e2296b024bab8ea36f3bb3b91d071165b22afda39a17ffc8ff53ade2883431"
revision 1
bottle d... | 35.892308 | 122 | 0.668238 |
91404231f996e1569c4714303d5a0845263641dd | 1,196 | # frozen_string_literal: true
##
# Base annotation resource
#
class AnnotationResource < ApplicationResource
##
# Attributes
#
attribute :content_item_id
attribute :rating
attribute :rated
# State
attribute :secret
attribute :edited
attribute :flagged
attribute :deleted
##
# Relationships
... | 14.95 | 108 | 0.672241 |
bff005551e689cfaa8a33517decdf52d711940d7 | 1,328 | class Nano < Formula
desc "Free (GNU) replacement for the Pico text editor"
homepage "https://www.nano-editor.org/"
url "https://www.nano-editor.org/dist/v4/nano-4.8.tar.gz"
sha256 "335c5c90f17e5863999de012eb4cd7e96e16de24e3255ee20d7aa702e5ef1106"
bottle do
sha256 "05196b3073fe9e0b5e1600d3db27e847c8bf04e... | 34.947368 | 94 | 0.626506 |
f703742bf7c09edab03028fb2b0e06238331f91f | 3,077 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_06_01
module Models
#
# Result of the request to list all P2SVpnServerConfigurations associated
# to a VirtualWan. It contain... | 30.166667 | 80 | 0.557361 |
3348b35b710036a0d1158906db6cd78ffb202684 | 13,199 | require 'rails_helper'
feature "Course students report", js: true do
include UserSpecHelper
include MarkdownEditorHelper
include NotificationHelper
# The basics
let!(:school) { create :school, :current }
let(:course) { create :course, school: school }
let(:level_1) { create :level, :one, course: course ... | 42.440514 | 205 | 0.725055 |
28163d02de48d5936ec5fda3a113504c1df8fcd5 | 1,626 | # snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourceauthor:[Doug-AWS]
# snippet-sourcedescription:[Lists the verified email addresses for SES.]
# snippet-keyword:[Amazon Simple Email Service]
# snippet-keyword:[get_identity_verification_attributes method]
# snip... | 34.595745 | 89 | 0.734932 |
21bb0e8b2199d537048c4aae677a08bfba5284e0 | 1,780 | # Backpack - Skyscanner's Design System
# Copyright 2018 Skyscanner Ltd
# 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 a... | 37.083333 | 100 | 0.660112 |
e82315d94c409d0e488a658d44783559dc45bb44 | 510 | shared_examples_for "find_by_id" do
describe '#find_by_id' do
before do
@session.visit('/with_html')
end
it "should find any element by id" do
@session.find_by_id('red').tag_name.should == 'a'
@session.find_by_id('hidden_via_ancestor').tag_name.should == 'div'
end
it "should ... | 26.842105 | 73 | 0.67451 |
6ab2528f3c4c9cd64dd8e16734a879dc1e30cbf7 | 2,387 | module Hippo::Concerns
# @see ClassMethods
module ExportAssociations
extend ActiveSupport::Concern
included do
class_attribute :exported_associations
end
module ClassMethods
# Mark associations as exported, meaning they can be quered against and optiona... | 45.037736 | 119 | 0.605781 |
6a8a09d1fd71876cc79b42c978a5d11f4522922c | 80 | #Sintaxis de clase
#-Debe tener la primera letra en mayúscula
class Persona
end
| 16 | 42 | 0.8 |
bbb6426465dcbd8d6c3eb56f3511e077d0036633 | 146 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_tic-tac-toe-ui_session'
| 36.5 | 84 | 0.794521 |
08023f2101275a0daee405b3aaee8991db38465f | 4,133 | #require 'coveralls'
#Coveralls.wear!
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause this
# file to always be loaded... | 45.417582 | 129 | 0.745463 |
d515ddfc127715572b56e2cd513e123a12d2f559 | 338 | class BusinessExportJob < ApplicationJob
def perform(business_export)
business_export.export!
NotifyMailer.business_export(
email: business_export.user.email,
name: business_export.user.name,
business_export:
).deliver_later
rescue StandardError => e
Sentry.capture_exception(e)
... | 22.533333 | 40 | 0.733728 |
1c2806b0c9b825133d5b0557908e735f0da5f856 | 515 | class Build::Json
def initialize
@now = Time.now
end
def build
output = Build::JsonRenderer.new(@now).render(**context)
Build.write_with_gz(path: Build.output_path + "data.json", data: output)
end
def context
source = Models::Persistence.load(Build.source_path)
matches = source.matches... | 20.6 | 76 | 0.669903 |
bf0a4da37d064e02d34ef49af5ac0fef53984586 | 8,821 | require 'spec_helper'
module QueueBus
describe Application do
describe ".all" do
it "should return empty array when none" do
Application.all.should == []
end
it "should return registered applications when there are some" do
Application.new("One").subscribe(test_list(test_sub("fd... | 57.653595 | 368 | 0.618184 |
aca6e0c1dcb1085cb89e6559c2b4780554756d17 | 126,453 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2018_08_01
#
# VirtualNetworkGateways
#
class VirtualNetworkGateways
include MsRestAzure
#
# Creates and ... | 46.184441 | 196 | 0.717389 |
7ac83c9090e0cbd9b7146de2cf0548da8d478ab7 | 4,453 | module Postal
class HTTPSender < Sender
def initialize(endpoint, options = {})
@endpoint = endpoint
@options = options
@log_id = Nifty::Utils::RandomString.generate(:length => 8).upcase
end
def send_message(message)
start_time = Time.now
result = SendResult.new
result... | 33.734848 | 113 | 0.565686 |
e88c602d8d917d30e96d7359adda749ed92dc359 | 21,257 | require 'active_support/core_ext/string/inflections'
module Pod
class Installer
class UserProjectIntegrator
# This class is responsible for integrating the library generated by a
# {TargetDefinition} with its destination project.
#
class TargetIntegrator
autoload :XCConfigIntegrat... | 45.8125 | 171 | 0.625488 |
f77b655b7d17bc7dcc5ba782b5fe287bccf82beb | 202 | module AnalyzeMySQL
module Report
class Pool
attr_reader :report
def initialize
@report = []
end
def <<(val)
@report.concat val
end
end
end
end
| 14.428571 | 26 | 0.549505 |
e82433fc61f9b6c392f863b5bfe3a6c6be323a1b | 3,658 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Repo::Filesystem::Write do
##
# Configuration
#
include_context 'repository'
##
# Subject
#
##
# Test variables
#
let(:repo) { Repository.new :topic => create(:topic, :root_content_item_id => 'qyrgv0bcd6') }
let(:content) do... | 25.402778 | 141 | 0.645435 |
e20292a8154a27db4c04c3b79094c0412b7e3114 | 958 | class Spree::Wishlist < ActiveRecord::Base
belongs_to :user, :class_name => Spree.user_class
has_many :wished_products
before_create :set_access_hash
validates :name, :presence => true
def include?(variant_id)
self.wished_products.map(&:variant_id).include? variant_id.to_i
end
def to_param
self... | 22.809524 | 133 | 0.691023 |
1a4341eb00ab16a672f21f5ab0a5d29518e7e344 | 31,615 | require File.expand_path("../../../test_helper", __FILE__)
module FullTextSearch
class SearchControllerTest < Redmine::ControllerTest
include PrettyInspectable
tests SearchController
fixtures :attachments
fixtures :boards
fixtures :changesets
fixtures :custom_fields
fixtures :custom_fie... | 31.837865 | 110 | 0.497359 |
333ea63204e14ce2f58875e7981f94af782cc2b0 | 3,352 | module Intrigue
module Ident
module Check
class Magento < Intrigue::Ident::Check::Base
def generate_checks(url)
[
{
type: 'fingerprint',
category: 'application',
tags: %w[COTS Payments],
vendor: 'Magento',
pr... | 33.52 | 87 | 0.419451 |
26f526c3325ae65df9784fc5c6d3e161c218c641 | 9,419 | require "#{File.dirname(__FILE__)}/../utils"
require 'capistrano/configuration/namespaces'
class ConfigurationNamespacesDSLTest < Test::Unit::TestCase
class MockConfig
attr_reader :original_initialize_called, :options
def initialize
@original_initialize_called = true
@options = {}
end
i... | 30.881967 | 122 | 0.735747 |
616fa019578b60862b0cfeb32c6401ec7a224e4d | 6,116 | # This file has been automatically generated from a template file.
# Please make modifications to
# `templates/src/objective-c/!ProtoCompiler-gRPCPlugin.podspec.template`
# instead. This file can be regenerated from the template by running
# `tools/buildgen/generate_projects.sh`.
# CocoaPods podspec for the gRPC Proto... | 47.78125 | 100 | 0.730216 |
03efefbf2a5f98fd2eadd907706f2e25c37df102 | 1,673 | class AwsEc2Instances < Inspec.resource(1)
name 'aws_ec2_instances'
desc 'Verifies settings for AWS EC2 Instances in bulk'
example '
describe aws_ec2_instances do
it { should exist }
end
'
supports platform: 'aws'
include AwsPluralResourceMixin
def validate_params(resource_params)
unles... | 25.738462 | 83 | 0.704722 |
4abff1d0d86e6ec40d00436c0e22541b38ef1b5e | 2,361 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ManagedApplications::Mgmt::V2016_09_01_preview
module Models
#
# Plan for the appliance.
#
class PlanPatchable
include MsRestAzure
... | 26.233333 | 70 | 0.474375 |
bfdc191013ad3add82a8f734532544f9a194a51b | 90 | class Team < ApplicationRecord
has_many :games
accepts_nested_attributes_for :games
end
| 12.857143 | 36 | 0.844444 |
6ac69d4cd6ed653038cc31431e00fd01c24f969c | 916 | class Ultralist < Formula
desc "Simple GTD-style task management for the command-line"
homepage "https://ultralist.io"
url "https://github.com/ultralist/ultralist/archive/1.5.1.tar.gz"
sha256 "85c15c096fbc8e6f2728783f7243aea0810a0e93e00558efa48473d220459069"
license "MIT"
bottle do
cellar :any_skip_rel... | 32.714286 | 93 | 0.762009 |
e86e5560648621e6f323455a7d250385ed4c34f6 | 2,854 | module ExtJS4
module SassExtensions
module Functions
module Utils
def parsebox(list, n)
assert_type n, :Number
if !n.int?
raise ArgumentError.new("List index #{n} must be an integer")
elsif n.to_i < 1
raise ArgumentError.new("List index ... | 30.688172 | 92 | 0.496496 |
e94aac55553abae5ff422f01687e5d4c4df864f6 | 37 | class Audio < ActiveRecord::Base
end
| 12.333333 | 32 | 0.783784 |
1cde9da6401b4203989264fd72abf8ab05e14405 | 1,788 | class Curl < Formula
desc "Get a file from an HTTP, HTTPS or FTP server"
homepage "https://curl.haxx.se/"
url "https://curl.haxx.se/download/curl-7.64.0.tar.bz2"
sha256 "d573ba1c2d1cf9d8533fadcce480d778417964e8d04ccddcc76e591d544cf2eb"
bottle do
cellar :any
sha256 "e5fa214a00a00fa80d76bd05db14e5c176a... | 28.83871 | 93 | 0.686242 |
61fc4f119c20e35ad39a263d2236515f17a6a6a1 | 2,313 | # encoding: UTF-8
# -------------------------------------------- ⚠️ --------------------------------------------
# `💎`
module ::Ruuuby::MetaData
# TODO: automate searching for a file ex: 'find /path -name "file_name"'
#
# TODO: document https://gist.github.com/barnes7td/3804534
#
# `💎.engine.api_locale`
... | 28.555556 | 125 | 0.579334 |
b9e4f2bb0c2707d853425f54f777e4ab1b692df6 | 7,251 | class Thumby
class SinatraApp < ::Sinatra::Base
include Dragonfly::ImageMagick::Commands
def initialize(thumby_hostnames, preview_server, options = {})
@preview_server = preview_server
@convert_command = options[:convert_command] || 'convert'
@identify_command = options[:identify_command] ||... | 35.89604 | 134 | 0.612743 |
08301d8c7f8765466e0b11012eb3b593ace10e23 | 582 | class Exception
def self.children
@children ||= []
end
end
def exceptions
ObjectSpace.each_object(Class) do |klass|
next if klass.to_s =~ /^(IRB|RubyLex|Errno)/
next unless klass.ancestors.include?(Exception)
begin
klass.superclass.children << klass unless klass == Exception
rescue NoMe... | 20.785714 | 66 | 0.670103 |
189c35cc27b166681675133894c7a1acf4b5d210 | 5,095 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 40.11811 | 102 | 0.734249 |
f7218eca255385cb5d832804c522e3820b9197af | 118 | Rails.application.configure do
config.after_initialize do
require 'abilities_thecore_servers_concern'
end
end
| 19.666667 | 47 | 0.822034 |
286b9d4ca9f0519ddbc80abb3ea3f756e33c072a | 294 | class SessionsController < ApplicationController
def create
user = User.from_omniauth(env["omniauth.auth"])
session[:user_id] = user.id
redirect_to controller: "home", action:"index"
end
def destroy
session[:user_id] = nil
redirect_to controller: "login", action:"index"
end
end
| 22.615385 | 49 | 0.741497 |
3825a332f1d8a420dff04238b6c793862ab04906 | 131 | class Out::Handlers::Tar < Out::Handler
match /^.*zip$/
def execute(*arguments)
exec('unzip', '-l', *arguments)
end
end
| 16.375 | 39 | 0.618321 |
ab81ebe063f62a10098947fa10b9a623a513a8a3 | 6,504 | require 'rails_helper'
describe V1::CarsController do
describe 'GET #index' do
before { create_list(:car, 2) }
before { set_auth_header(token) }
before { get :index }
context 'as anonymous user' do
let(:token) { nil }
it { is_expected.to respond_with(:unauthorized) }
end
cont... | 22.427586 | 76 | 0.551199 |
619b3f827cd94cffac97c0eb180de2e6aea14f7d | 1,009 | # frozen_string_literal: true
# A subject object that contains a subset of values pulled from the database for
# that subject. The "o" is intentional to make these objects not seem to be
# actual ActiveRecord Subject instances.
module Engine
class Sobject
attr_accessor :subject_id, :cells
def initialize(sub... | 28.027778 | 114 | 0.618434 |
e8193cef14abd4839eb6a115f5e2e072b3225236 | 38,567 | # frozen_string_literal: true
require_relative "vendored_thor"
module Bundler
class CLI < Thor
require_relative "cli/common"
package_name "Bundler"
AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
PARSEABLE_COMMANDS = %w[check config help exec platform show ve... | 45.372941 | 241 | 0.654964 |
4aaeb796ba0e640145e1e97f55be8adb0f234f56 | 3,976 | #!/usr/bin/env ruby -w
# The MIT License (MIT)
# Copyright (c) 2016 Alexander J Probst
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the righ... | 45.701149 | 462 | 0.740694 |
6af3a8e29b777717137916f320793b3c6dc0ee34 | 151 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "GC::Profiler.result" do
it "needs to be reviewed for spec completeness"
end
| 25.166667 | 61 | 0.715232 |
f8db8cca24c9682a7b0d7a525957f600f7c9cbfa | 9,039 | ##############################################################################################################
module ServiceDiscoveryMessages
#####-------------------------------------------------------------------------------------------------------
class << self
#### received messages
#........... | 44.747525 | 110 | 0.45536 |
113c8785d6788746b4eb1df6d5c54fcab6d479e7 | 4,257 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = GreatRanking
include Msf::Exploit::Remote::SMB::Client
def initialize(info = {})
super(update_info(info,
'Name... | 28.006579 | 111 | 0.608879 |
9165d09de47d32bee4b487fc23f54c9fbb2e6301 | 460 | describe Rack::NullLogger do
it "act as a noop logger" do
app = lambda { |env|
env['rack.logger'].warn "b00m"
[200, {'Content-Type' => 'text/plain'}, ["Hello, World!"]]
}
logger = Rack::Lint.new(Rack::NullLogger.new(app))
res = logger.call(Rack::MockRequest.env_for)
res[0..1].must_eq... | 24.210526 | 64 | 0.6 |
21721f546eac831929c24310db9cedab77f6d1e1 | 214 | module Admin
class CleanupJob < ApplicationJob
queue_as :default
def perform(*args)
# Remove events older than 30 days
Event.where("created_at < ?", 30.days.ago).delete_all
end
end
end
| 19.454545 | 59 | 0.672897 |
1c6963810c8d16604406d6037134e384d4db9592 | 853 | class Libsndfile1028 < Formula
desc "C library for files containing sampled sound"
homepage "http://www.mega-nerd.com/libsndfile/"
url "http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz"
sha256 "1ff33929f042fa333aed1e8923aa628c3ee9e1eb85512686c55092d1e5a9dfa9"
depends_on "pkg-config_0.29... | 30.464286 | 79 | 0.7034 |
b9559fefdfe1ac4ca5b54b40d3ec334f3cff816b | 1,906 | require 'simplecov'
SimpleCov.start do
add_filter "/spec/"
end
require './extractor.rb'
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description`
# and `failure_message` of custom matchers include text for helper me... | 36.653846 | 79 | 0.718783 |
87d60aa1ddefc44fe3162016ded8e3f3fd62fad6 | 1,377 | # frozen_string_literal: true
require_relative 'executor'
require_relative 'log_wrapper'
require_relative 'options'
require_relative 'plantuml_error'
require_relative 'svg_diagram'
require_relative 'theme'
require_relative 'version'
module Kramdown
module PlantUml
# Represents a PlantUML diagram that can be con... | 27 | 92 | 0.669572 |
1ddda891c2778ec548b41e3e89291bef99cab380 | 2,023 | class Libsigcxx < Formula
desc "Callback framework for C++"
homepage "https://libsigcplusplus.github.io/libsigcplusplus/"
url "https://download.gnome.org/sources/libsigc++/3.0/libsigc++-3.0.6.tar.xz"
sha256 "b70edcf4611651c54a426e109b17196e1fa17da090592a5000e2d134c03ac5ce"
license "LGPL-3.0-or-later"
livec... | 30.19403 | 115 | 0.662877 |
7a6539014f3969ffac0ff436448c765dafde76d9 | 2,867 |
module Widgets
module TableHelper
include CssTemplate
# Returns an HTML table with +:collection+ disposed in rows. Add
# HTML attributes by passing an attributes hash to +html+.
# The content of each item is rendered using the given block.
#
# +:collection+ array of items
# +:cols... | 35.8375 | 106 | 0.570283 |
1c4f4678d9cade5008ff80400962b2913ea4ffac | 1,420 | class Atool < Formula
desc "Archival front-end"
homepage "https://savannah.nongnu.org/projects/atool/"
url "https://savannah.nongnu.org/download/atool/atool-0.39.0.tar.gz"
sha256 "aaf60095884abb872e25f8e919a8a63d0dabaeca46faeba87d12812d6efc703b"
bottle do
cellar :any_skip_relocation
rebuild 2
sha... | 39.444444 | 93 | 0.766901 |
7ac516a7183b72f7ebc4d774262f82c3f47327d2 | 962 | #
# Be sure to run `pod lib lint ${POD_NAME}.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 = 'podTestL... | 32.066667 | 102 | 0.588358 |
edeaf5a6b3f5464b93f5964b747ea6fdc1541857 | 359 | Then /^I (?:read) "([^\"]*)"$/ do |name|
wait_for(WAIT_TIMEOUT) { query("label {text BEGINSWITH '#{name}'}").count + query("label {text CONTAINS '#{name}'}").count >= 1}
end
Then /^I don't (?:read) "([^\"]*)"$/ do |name|
wait_for(WAIT_TIMEOUT) { query("label {text BEGINSWITH '#{name}'}").count + query("label {text... | 44.875 | 130 | 0.584958 |
1c01d60ae4e6217b41c4990ab39fc9cd38a1bdda | 110 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "onnx_instant"
require "minitest/autorun"
| 22 | 58 | 0.754545 |
214aae1a3aa67076259eb2a7bc9de0c3111f76b4 | 2,024 | require_relative '../../spec_helper'
require 'matrix'
describe "Matrix#each" do
before :all do
@m = Matrix[ [1, 2, 3], [4, 5, 6] ]
@result = (1..6).to_a
end
it "returns an Enumerator when called without a block" do
enum = @m.each
enum.should be_an_instance_of(Enumerator)
enum.to_a.should == ... | 26.986667 | 70 | 0.605731 |
282473e9adf46ddbaf3f9236d4df8c0383a00767 | 515 | class Attachment < ApplicationRecord
belongs_to :user
mount_uploader :file, AttachmentUploader
before_create :set_token
# Do not use has_secure_token because it's late for file store
def set_token
self.token = SecureRandom.base58(24)
end
before_save :set_meta_data
def set_meta_data
if file.... | 19.807692 | 64 | 0.724272 |
f8e40b879a9f1a2259ce48c099a625355add4a2a | 872 | require 'chefspec'
describe 'smartos_package::install' do
let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
it 'installs a smartos_package with the default action' do
expect(chef_run).to install_smartos_package('default_action')
expect(chef_run).to_not install_smartos_package('not_default... | 36.333333 | 93 | 0.77867 |
214a258697f631db22cfe566b1ff856e0b1b71e6 | 6,295 | # frozen_string_literal: true
require 'game_manager'
require 'view/form'
module View
class CreateGame < Form
include GameManager
needs :mode, default: :multi, store: true
needs :num_players, default: 3, store: true
needs :flash_opts, default: {}, store: true
needs :user, default: nil, store: tr... | 28.744292 | 117 | 0.555203 |
79b02d4c9e35556e686282762d53e78279e45621 | 1,112 | require File.dirname(__FILE__) + '/spec_helper.rb'
describe "Client" do
it "should instantiate a client with a username and password" do
c = PostalMethods::Client.new(PM_OPTS)
c.class.should == PostalMethods::Client
end
it "should fail without a user/pass on instantiation" do
lambda {PostalMeth... | 32.705882 | 98 | 0.715827 |
388b5b263060fb4f77a870fe4810cb9c50cddb21 | 6,352 | require_relative 'helper'
describe 'View helpers' do
include Recaptcha::Adapters::ViewMethods
it "uses ssl" do
recaptcha_tags.must_include "\"#{Recaptcha.configuration.api_server_url}\""
end
describe "noscript" do
it "does not add noscript tags when noscript is given" do
recaptcha_tags(noscript... | 30.834951 | 112 | 0.697103 |
0863fadd918a137431cf7fb9b937e3fdd4a233e4 | 1,454 | module GitIam
class Iam
def self.who
{
'user.name' => user_name,
'user.email' => user_email,
'remote.origin.url' => remote_origin
}
end
def self.user_name
local_or_remote 'user.name'
end
def self.user_email
local_or_remote 'user.email'
end
... | 22.030303 | 104 | 0.631362 |
e200543567ccbfa22268140820a13d09d1487d19 | 2,809 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.requi... | 44.587302 | 100 | 0.734069 |
917e59c92922bb63dac4257e57e0a6937efed7f5 | 3,407 | {
matrix_id: '2733',
name: 'spaceShuttleEntry_4',
group: 'VDOL',
description: 'spaceShuttleEntry optimal control problem (matrix 4 of 4)',
author: 'B. Senses, A. Rao',
editor: 'T. Davis',
date: '2015',
kind: 'optimal control problem',
problem_2D_or_3D: '0',
num_rows: '2450',
... | 50.850746 | 83 | 0.572938 |
b9d180d2c1719007c840204df6b8209ea1e196bf | 151 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_adriansarli-website_session'
| 37.75 | 89 | 0.81457 |
ac38ae43e00d1372bde1985027c9b189f7099269 | 460 | # frozen_string_literal: true
# Tests for fields using the PhoneNumberValidator
RSpec.shared_examples "validate phone_number" do |form_factory|
it "validates the phone number using the PhoneNumberValidator class" do
validators = build(form_factory, :has_required_data)._validators
expect(validators.keys).to i... | 38.333333 | 73 | 0.791304 |
79a17264b6f2d7623b493334d0143b16b44c8420 | 4,020 | class WorkUnitsController < ApplicationController
include ControllerMixins::WorkUnits
include ControllerMixins::Authorization
before_filter :create_ticket, :only => [:create_in_dashboard]
before_filter :load_new_work_unit, :only => [:new, :create_in_dashboard]
before_filter :check_for_params, :only => [:crea... | 34.655172 | 159 | 0.666169 |
bbeb6db35be70cc134b1417ef5b9818376a81211 | 878 | # frozen_string_literal: true
require_relative 'task/task_settings'
require_relative 'task/topic_name_factory'
module Super
module Flux
module Task
DSL = %w[topic
retries
wait
group_id
offset_commit_interval
offset_commit_threshold... | 21.414634 | 64 | 0.559226 |
03fba1a6b14929943866f9329c5671b3057afad6 | 2,067 | # frozen_string_literal: true
# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0
lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'opentelemetry/semantic_conventions/version'
Gem::Specification.new do |spec|
spec.name = 'opente... | 45.933333 | 193 | 0.730527 |
21223c2d2a313b97320f42a27ab8cc5d7acf7643 | 2,136 | require 'rails_helper'
describe "display_name" do
include ActiveAdmin::ViewHelpers
ActiveAdmin::Application.new.display_name_methods.map(&:to_s).each do |m|
it "should return #{m} when defined" do
klass = Class.new do
define_method(m) { m }
end
expect(display_name klass.new).to eq m... | 29.666667 | 93 | 0.672753 |
018415fa2a6b6e8bab7a08eeaf12798a05f52977 | 82 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'random_cases'
| 27.333333 | 58 | 0.743902 |
6a0dec19b3d2627767b936fa393106cc15e88a5f | 424 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Polygon::Shape do
it 'can be initialized with a list of Polygon::Point' do
points = [
Polygon::Point.new(x: 100, y: 100),
Polygon::Point.new(x: 200, y: 100),
Polygon::Point.new(x: 200, y: 200),
Polygon::Point.new(x: 100, ... | 22.315789 | 58 | 0.636792 |
79cdfae3a4c9d2b1c5676c4b0f854a8ebd84b6f6 | 384 | # frozen_string_literal: true
module Admin
class MasqueradesController < Admin::ApplicationController
def show
requested_user = User.find_by(username: params[:username])
session[:masqueraded_user_id] = requested_user.id
redirect_to repos_path
end
def destroy
session.delete(:masqu... | 21.333333 | 64 | 0.729167 |
bf009dba793213a61c04c505d934454deeef1c78 | 3,598 | require 'rbconfig'
require 'jruby' if defined?(JRUBY_VERSION)
require 'tempfile'
module TestHelper
# TODO: Consider how this should work if we have --windows or similiar
WINDOWS = RbConfig::CONFIG['host_os'] =~ /Windows|mswin/
SEPARATOR = WINDOWS ? '\\' : '/'
IS_JAR_EXECUTION = RbConfig::CONFIG['bindir'].match... | 28.330709 | 105 | 0.603113 |
1c8eec680086e613d0ba35e8937ccd1bee1ff822 | 846 | module Neography
class Rest
module Cypher
include Neography::Rest::Helpers
def execute_query(query, parameters = {}, cypher_options = nil)
options = {
:body => {
:query => query,
:params => parameters
}.to_json,
:headers => json_content_ty... | 28.2 | 105 | 0.591017 |
26432cfa2b8b3fe3a101d44d83fa9a9bb737c194 | 308 | class EmailMessageMailer < ActionMailer::Base
default from: "US Digital Registry <digitalregistry@usa.gov>",
reply_to: "US Digital Registry Team <usdigitalregistry@gsa.gov>"
def email(record)
@email = record
mail(:to => @email.to, :subject => @email.subject, :body => @email.body)
end
end
| 30.8 | 75 | 0.701299 |
4a48762e225d69f33b862aa154a57591b838dcaa | 756 | cask "ocenaudio" do
version "3.10.7"
sha256 :no_check
if MacOS.version <= :high_sierra
url "https://www.ocenaudio.com/downloads/index.php/ocenaudio_sierra.dmg"
elsif MacOS.version <= :catalina
url "https://www.ocenaudio.com/downloads/index.php/ocenaudio_mojave.dmg"
elsif Hardware::CPU.intel?
url ... | 27 | 82 | 0.727513 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.