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 |
|---|---|---|---|---|---|
614c484ae2d10c41a28902cf9551a01313d20360 | 10,686 | class Poetry < Formula
include Language::Python::Virtualenv
desc "Python package management tool"
homepage "https://python-poetry.org/"
url "https://files.pythonhosted.org/packages/94/89/92040eafbb76dcbb2b3ee185499b89281f712b34faa7673850778b0ddda4/poetry-1.1.4.tar.gz"
sha256 "946a5a1173be607c7c5c593358a0fb0c... | 46.25974 | 147 | 0.801516 |
01a8adcdb872cb3779fb8d9e6aa7e66e8a70f018 | 1,538 | require 'helper'
describe Pry::DEFAULT_CONTROL_D_HANDLER do
describe "control-d press" do
before do
# Simulates a ^D press.
@control_d = "Pry::DEFAULT_CONTROL_D_HANDLER.call('', _pry_)"
end
describe "in an expression" do
it "should clear out passed string" do
str = 'hello wor... | 26.067797 | 73 | 0.56827 |
8701774a02a6612ddc219a76997bdb622c14159d | 6,647 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'systems', type: :request do
include SchemaMatchers
before do
Flipper.enable('va_online_scheduling')
sign_in_as(user)
allow_any_instance_of(VAOS::UserService).to receive(:session).and_return('stubbed_token')
end
context 'with a ... | 37.982857 | 111 | 0.637581 |
e8eb9ced4d752fbce192b82a4b7ae09dc426f045 | 2,935 | # frozen_string_literal: true
require 'active_support/core_ext/integer/time'
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 any time
# it changes. This slows down response ti... | 35.792683 | 87 | 0.770698 |
1a051b2637b3ead963d8c8a744d0abab02afa612 | 87 | json.partial! 'locations/hours_locations/show_single', hours_location: @hours_location
| 43.5 | 86 | 0.850575 |
b98b36d4677a2f135e877a8c9cfe43382568d992 | 1,210 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... | 35.588235 | 111 | 0.713223 |
ff0737f16b0a0017be3c4940009161abf70e1ab1 | 257 | module ApplicationHelper
# Returns the full title on a per-page basis.
def full_title(page_title = '')
base_title = "Interactive Story"
if page_title.empty?
base_title
else
page_title + " - " + base_title
end
end
end
| 18.357143 | 47 | 0.645914 |
bf2217e08d2ddcc31e8e2cb25c66eae6235a2eb7 | 253 | module Drift
class Handbrake
def initialize(options = {})
@options = options
end
def binary
@bin ||= (@options.fetch(:path, nil) || which)
end
private
def which
`which HandBrakeCLI`.strip
end
end
end
| 14.055556 | 52 | 0.581028 |
ab2dda8e77d85be082272c79afd03a805c7c859a | 143 | class RenameLikesTotalToLikesCount < ActiveRecord::Migration[5.2]
def change
rename_column :builds, :likes_total, :likes_count
end
end
| 23.833333 | 65 | 0.783217 |
08cfc68c42a9171a822befa9fa4275c996810289 | 2,347 | # frozen_string_literal: true
# Cloud Foundry Java Buildpack
# Copyright 2013-2019 the original author or authors.
#
# 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.... | 36.107692 | 114 | 0.728164 |
b92905b9e137962a8275dd87f57443c717e554ab | 2,059 | require 'rails_helper'
RSpec.describe Bootstrap4RailsComponents::Bootstrap::Components::Dropdown do
let(:dropdown) { described_class.new(options, ActionController::Base.new.view_context) }
let(:options) { {} }
it { expect(described_class).to be < Bootstrap4RailsComponents::Bootstrap::Components::Base }
it_beh... | 30.731343 | 95 | 0.690141 |
032cb796d94026572e1be0b97845309c5361a56e | 5,077 | require "active_support/core_ext/integer/time"
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 applica... | 43.393162 | 114 | 0.76561 |
1c39674247a8a98d222388a986c34713cde35aaf | 2,478 | # Build a simple guessing game
# I worked on this challenge [by myself, with: ].
# I spent [1] hours on this challenge.
# Pseudocode
# Input: Guess
# Output: Whether it's higher, lower, or correct
# Steps: Find out if the guess is higher, lower, or correct. Tell user what the result is until correct.
# Initial So... | 29.5 | 298 | 0.735674 |
38decf255c1b5f70a07747f41c849884e86c0073 | 2,063 | module Elasticity
class InstanceGroup
ROLES = Elasticity::InstanceConstraints::VALID_INSTANCE_COLLECTION_ROLES
attr_accessor :count
attr_accessor :type
attr_accessor :role
attr_accessor :ebs
attr_accessor :bid_price
attr_accessor :name
attr_reader :bid_price
attr_reader :market... | 25.469136 | 113 | 0.625303 |
11075e01ae0f53eeb21c80944a20af2dd8813fe7 | 136 | require 'simplecov'
SimpleCov.start do
add_filter "spec/"
end
require 'rspec'
require 'rspec/mocks'
require 'ffmpeg'
include FFMPEG
| 12.363636 | 21 | 0.764706 |
87cffaf07635e32fe9d730e575bc4fa7909dfbd5 | 3,407 | require "assert"
require "a-lint-runner"
class ALintRunner::Config
class UnitTests < Assert::Context
desc "ALintRunner::Config"
setup do
@unit_class = ALintRunner::Config
end
subject{ @unit_class }
should have_imeths :settings
end
class InitTests < UnitTests
desc "when init"
... | 28.872881 | 76 | 0.660405 |
ac7ba425963aa6bc121a3a234fcce44f69539e8b | 2,213 | class GameBoard < ActiveRecord::Base
has_and_belongs_to_many :categories
belongs_to :game
has_many :finished_clues
has_many :clues, :through => :categories
@@num_categories = 6
#Loads categories into gameboard
def getCategories
if self.game_type == "double"
... | 35.126984 | 100 | 0.596927 |
1d7793af835de1badc52bcba9c6ad1a3666ab9d4 | 54 | # frozen_string_literal: true
class Page < Entry
end
| 10.8 | 29 | 0.777778 |
3937f720788867bc00ec5cad462fb22fe9dc41c2 | 401 | # frozen_string_literal: true
module Ci
class TestFailureHistoryWorker
include ApplicationWorker
sidekiq_options retry: 3
include PipelineBackgroundQueue
tags :exclude_from_kubernetes
idempotent!
def perform(pipeline_id)
Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline|
... | 19.095238 | 60 | 0.738155 |
1cd7211992cf11495dbe57c32ee6350c5d0ce8bc | 150 | class Slogan < ActiveRecord::Migration[5.0]
def change
add_column :slogans ,:title,:string
add_column :slogans ,:category,:string
end
end
| 21.428571 | 43 | 0.72 |
39f4f93a81967ffc3ab7f10eaf6edabdbd37ddad | 20,948 | # RubyMotion (at least as of 3.6) does not include an implementation of
# StringScanner (strscan.rb). So an implementation was borrowed from MacRuby:
# https://github.com/MacRuby/MacRuby/blob/d1e47668d4345c78871f49b06849f3c7e4355943/lib/strscan.rb
#
# However, that implementation treats the pointer as a character poin... | 29.587571 | 105 | 0.568551 |
bf65a857952f8e010b7434158283b10ba15ee2f9 | 1,389 | require "rails_helper"
RSpec.describe Api::Provider::ClientsController,
type: :request do
describe "as provider" do
let(:provider) { create :user, :provider }
before { login_as provider }
let(:client) {
create :provider_client,
provider_profile: provider.provider_profil... | 23.542373 | 58 | 0.576674 |
6299dfadba6251c6647b5db44eb48de94a78b47e | 3,815 | # Copyright (c) 2016, Arista Networks, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions... | 34.0625 | 79 | 0.73709 |
bfc2a432e16f1364f9c25f9cc3f1f65efd2a128a | 1,982 | # calls the handle method even if it doesn't exist
handler.send(message)
# only calls the handle method if it exists
handler.handle(message)
# Proposal: Just the reader and writer in the client library
# No messaging reader, subscription, or writer in the
# messaging library
Read.(stream: stream_name) do |event_data... | 23.879518 | 77 | 0.765388 |
615b8b610b0b089acfcb2fa15835c3087a8b176c | 1,179 | module ErrorMessagesHelper
# Render error messages for the given objects. The :message and :header_message options are allowed.
def error_messages_for(*objects)
options = objects.extract_options!
messages = objects.compact.map { |o| o.errors.full_messages }.flatten
unless messages.empty?
object =... | 39.3 | 133 | 0.698049 |
bb9a942ba4989702fde3227ebf2a17a72eeabea1 | 1,921 | require 'spec_helper'
require "vagrant-openstack/config"
describe VagrantPlugins::OpenStack::Config do
describe "defaults" do
let(:vagrant_public_key) { Vagrant.source_root.join("keys/vagrant.pub") }
subject do
super().tap do |o|
o.finalize!
end
end
its(:api_key) { should be_ni... | 24.628205 | 77 | 0.608537 |
4a5a857e7862a1ccda2eca7f21d727b4b9dde76c | 1,415 | # frozen_string_literal: true
require 'spec_helper'
describe 'cis_hardening::setup::sudo' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
# Section 1.3 - Configure sudo
# Ensure sudo is installed - Section 1.3.1
it {
is_expected.... | 26.698113 | 87 | 0.534276 |
183ccec2438f133433301227e2fd3b42b59315da | 3,242 | require "social_feed_agregator/base_reader"
require "social_feed_agregator/feed"
require "twitter"
module SocialFeedAgregator
class TwitterReader < BaseReader
attr_accessor :consumer_key,
:consumer_secret,
:twitter_oauth_token,
:twitter_oauth_toke... | 30.299065 | 102 | 0.554596 |
08a0c38e9ebe2bd62b93a3bd9f28ba7dc086d61c | 414 | require 'spec_helper'
spec_template = 'it { is_expected.to run.with_params([10, 20]).and_raise_error([ArgumentError, "Error message"]) }'
subject = Magicbox::SpecTests::Function.new(
'raise_error',
{
function_args: [10, 20],
value: [ArgumentError, 'Error message'],
}
)
describe 'raise_error spec_test' ... | 23 | 115 | 0.707729 |
38b1da93002f9d1acf63a752089c4791df6f9a91 | 224 | Rails.application.routes.draw do
get '/signup', to:'users#new'
root 'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
end | 28 | 45 | 0.683036 |
11528b1ee476ec185b411bfbcb1b213ec6ea1f29 | 846 | class AddProducts < ActiveRecord::Migration[6.0]
def change
Product.create ({
:title => 'Havaiian',
:description => 'This is Havaiian pizza',
:price => 300,
:size => 30,
:is_spicy => false,
:is_veg => false,
:is_best_offer => false,
:path_to_image => '/images/havaiian.jpg'
... | 22.864865 | 48 | 0.567376 |
08c81bf33ee6fb77963bd3d7d93d731d2a7ddbcb | 645 | # encoding: utf-8
require 'rails_best_practices/core/check'
module RailsBestPractices
module Prepares
# Remember the mailer names.
class MailerPrepare < Core::Check
include Core::Check::Classable
interesting_nodes :class
interesting_files MAILER_FILES, MODEL_FILES
def initialize
... | 22.241379 | 60 | 0.649612 |
d51c5dc377488ea0877950f581f732c7b899df09 | 10,415 | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Europe
module Andorra
include TimezoneDefinition
timezone 'Europe/Andorra' do |tz|
... | 52.336683 | 72 | 0.582429 |
bbe78bd1d940264d934a379c1bcb59d39f496906 | 656 | require 'optparse'
require_relative "base"
module VagrantPlugins
module CommandPlugin
module Command
class Uninstall < Base
def execute
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant plugin uninstall <name> [-h]"
end
# Parse the options
... | 22.62069 | 93 | 0.583841 |
62a7fa5bdf1d62f27b3e9938d13fc4507e1ef3c7 | 2,299 | # frozen_string_literal: true
# == Schema Information
#
# Table name: admissions
#
# id :bigint not null, primary key
# title :string
# shown_application_deadline :datetime
# user_priority_deadline :datetime
# created_at ... | 33.808824 | 104 | 0.661157 |
e8d70be0ca27fe0f6ed8d8b67ab61029717ff529 | 244 | require 'test_helper'
class BoardRowComponentTest < ViewComponent::TestCase
setup do
render_inline(BoardRowComponent.new(Array.new(10, nil)))
end
test 'should render atoms' do
assert_selector('.board-atom', count: 10)
end
end
| 20.333333 | 60 | 0.741803 |
f7ff05fe6f4fb522698c3e504751d58718460283 | 1,698 | 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... | 42.45 | 85 | 0.773263 |
28a2e91f1d7d43ec3c51231558ee3b1847516c4e | 1,958 | class AircrackNg < Formula
desc "Next-generation aircrack with lots of new features"
homepage "https://aircrack-ng.org/"
url "https://download.aircrack-ng.org/aircrack-ng-1.3.tar.gz"
sha256 "8ae08a7c28741f6ace2769267112053366550e7f746477081188ad38410383ca"
bottle do
sha256 "64d5f8a6fd5613bafe78e3164810e9... | 26.821918 | 94 | 0.666496 |
79f77a6e4f719209164a30f343f63514f02f9c36 | 774 | class Group < ActiveRecord::Base
extend FriendlyId
friendly_id :title, use: :slugged
Paperclip.options[:command_path] = "C:\Program Files\ImageMagick-6.9.0-Q16"
Paperclip.options[:command_path] = 'C:\Program Files (x86)\GnuWin32\bin'
acts_as_taggable
belongs_to :user
has_many :members, :foreign_key => :group... | 28.666667 | 175 | 0.732558 |
edc5e94aa9c43047b5d303b2a886be5c45983b87 | 6,483 | require 'optparse'
require 'rake'
module Webby::Apps
class Main
# Create a new instance of Main, and run the +webby+ application given the
# command line _args_.
#
def self.run( args )
self.new.run args
end
attr_reader :cmd_line_options
# Create a new Main webby object for building websites.
#
... | 25.324219 | 84 | 0.639673 |
91ab00ed691bb5182d6fdc0e732cc6b506424e2b | 7,641 | require 'spec_helper'
describe Resolv::Hosts::Dynamic do
describe '#initialize' do
context 'with an empty params list' do
res = Resolv::Hosts::Dynamic.new
it 'should have empty lookup maps' do
expect(
res.instance_variable_get(:@name2addr).empty?
).to eq true
expe... | 26.53125 | 85 | 0.546918 |
217d9671fc1e9ea8227e7ac2ce9ee478e0a89fa8 | 2,896 | require "spec_helper"
describe RedboothRuby::Organization, vcr: 'organization' do
include_context 'authentication'
let(:create_organization_params) do
{ name: 'new Organization' }
end
let(:new_organization) { client.organization(:create, create_organization_params.merge(session: session)) }
let(:organiz... | 35.753086 | 156 | 0.698895 |
f8097283c7a73b3e4caee6a06fa0fe5aa86125ee | 1,347 | require 'open4'
require 'timeout'
module RHCHelper
module Runnable
include Loggable
class StringTee < StringIO
attr_reader :tee
def initialize(other)
@tee = other
super()
end
def <<(buf)
tee << buf
super
end
end
def iconv_handler
@... | 24.053571 | 109 | 0.569414 |
3827b2c6a699006e1fe604f60f69ca0a977ee98f | 1,472 | #
# Cookbook Name:: aws-parallelcluster
# Recipe:: _setup_python
#
# Copyright 2013-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the
# License. A copy of the License is located at
#
#... | 28.862745 | 121 | 0.72962 |
ffb138a5bd13c84384e73f03c47965007075c3c6 | 606 | # frozen_string_literal: true
module Reek
module AST
#
# Locates references to the current object within a portion
# of an abstract syntax tree.
#
class ReferenceCollector
def initialize(ast)
@ast = ast
end
def num_refs_to_self
(explicit_self_calls.to_a + implic... | 18.9375 | 66 | 0.630363 |
01b778108fbd1274e9d8e12b840187c239b737f7 | 329 | module Job::Cms::CopyNodes::CmsLayouts
extend ActiveSupport::Concern
include SS::Copy::CmsLayouts
include Job::Cms::CopyNodes::CmsContents
def copy_cms_layouts
Cms::Layout.site(@cur_site).excludes(depth: 1).where(filename: /^#{@cur_node.filename}\//).each do |layout|
copy_cms_layout(layout)
end
... | 27.416667 | 111 | 0.723404 |
1c620a0da07102db2e4b1c47288cddd04177b6f9 | 549 | # frozen_string_literal: true
module Archimate
module DataModel
class SchemaInfo
include Comparison
# @!attribute [r] schema
# @return [String, NilClass]
model_attr :schema, default: nil
# @!attribute [r] schemaversion
# @return [String, NilClass]
model_attr :schemavers... | 22.875 | 57 | 0.622951 |
b943f52a35e8d3432d5e1ad2751ec05d5aeddab4 | 2,249 | # ~*~ encoding: utf-8 ~*~
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path '../../lib/gollum/file_view', __FILE__
class FakePage
def initialize filepath
@filepath = filepath
end
# From page.rb
def filename_stripped
::File.basename(@filepath, ::File.ext... | 21.018692 | 110 | 0.674967 |
5db4a1aca73f3a281bd40e2749b8492c2973ff4d | 474 | cask :v1 => 'pinegrow-web-designer' do
version :latest
sha256 :no_check
# amazonaws.com is the official download host per the vendor homepage
url 'https://pinegrow.s3.amazonaws.com/PinegrowMac.zip'
name 'Pinegrow'
name 'Pinegrow Web Editor'
name 'Pinegrow Web Designer'
homepage 'http://pinegrow.com/'
... | 31.6 | 115 | 0.738397 |
ed6c36547ee4cb58ea80a865a4ecf9db3201c5b9 | 185 | require 'arel_toolkit/version'
require 'arel'
require 'arel/extensions'
require 'arel/sql_to_arel'
module ArelToolkit
class Error < StandardError; end
# Your code goes here...
end
| 18.5 | 34 | 0.767568 |
4ad447f062ba7acf8a63245a34dd40041f364bd4 | 1,810 | class Jed < Formula
desc "Powerful editor for programmers"
homepage "https://www.jedsoft.org/jed/"
url "https://www.jedsoft.org/releases/jed/jed-0.99-19.tar.gz"
mirror "https://deb.debian.org/debian/pool/main/j/jed/jed_0.99.19.orig.tar.gz"
sha256 "5eed5fede7a95f18b33b7b32cb71be9d509c6babc1483dd5c58b1a169f2bdf... | 34.807692 | 109 | 0.703315 |
f89690b576446b41503fda47079bb3e7c431a9a4 | 5,916 | class Gdal < Formula
desc "Geospatial Data Abstraction Library"
homepage "https://www.gdal.org/"
url "https://download.osgeo.org/gdal/3.1.0/gdal-3.1.0.tar.xz"
sha256 "e754a22242ccbec731aacdb2333b567d4c95b9b02d3ba1ea12f70508d244fcda"
bottle do
sha256 "0fa8ba696f7997dece5800fa019e886a408c9928b7ca01d2b54314... | 32.327869 | 98 | 0.634888 |
eddbc04ce8a235962120d64150e5103240f6dd94 | 6,837 | require 'active_support/core_ext/object/to_query'
require 'rack/utils'
module Redmine
module SudoMode
class SudoRequired < StandardError
end
class Form
include ActiveModel::Validations
attr_accessor :password, :original_fields
validate :check_password
def initialize(password ... | 30.386667 | 111 | 0.639754 |
91b5de9ec622cb1bdb47bad04eef7754aa4cebee | 775 | control 'localhost' do
describe foreign_source('localhost') do
it { should exist }
end
describe import('localhost', 'localhost') do
it { should exist }
end
describe import_node('1', 'localhost') do
it { should exist }
its('node_label') { should eq 'localhost' }
end
%w(127.0.0.1 10.0.2.15).... | 29.807692 | 77 | 0.614194 |
03f894d670b7804007b5402a7ef4b9dca07befcd | 388 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe PaginatorComponent, type: :component do
pending "add some examples to (or delete) #{__FILE__}"
# it "renders something useful" do
# expect(
# render_inline(described_class.new(attr: "value")) { "Hello, components!" }.css("p").to_html
... | 24.25 | 99 | 0.664948 |
ab751ea63f283015c17197f0a618f1e5fc64d262 | 3,036 | control 'VMCH-70-000027' do
title 'Log retention must be properly configured on the virtual machine.'
desc "
The ESXi hypervisor maintains logs for each individual VM by default. These logs contain information including, but not limited to, power events, system failure information, tools status and activity, t... | 39.947368 | 290 | 0.708498 |
1ccd48a66ded14d9625f8e9fa42a0a65eb62fd77 | 44 | require 'skyblue/rails'
Skyblue::Rails.load
| 14.666667 | 23 | 0.795455 |
6102548927a2edbfc123a5818e4dd4d9cde999e0 | 456 | # This migration comes from mpp_blog (originally 20150321112150)
# This migration comes from acts_as_taggable_on_engine (originally 5)
# This migration is added to circumvent issue #623 and have special characters
# work properly
class ChangeCollationForTagNames < ActiveRecord::Migration
def up
if ActsAsTaggableO... | 38 | 95 | 0.791667 |
08df85bff34ddda762ac288b331abc9672acc617 | 708 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "reactable_rails/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "reactable_rails"
s.version = ReactableRails::VERSION
s.authors = ["dphaener"]
s.email = [... | 29.5 | 85 | 0.652542 |
876dcf137551fc19054c8d7a355440b35df5ccea | 257 | describe Cupid do
subject { Cupid.new 'bob', 'x123', 42 }
its(:client) { should be }
its('client.wsse.username') { should == 'bob' }
its('client.wsse.password') { should == 'x123' }
its('server.account') { should == 42 }
end
| 28.555556 | 50 | 0.560311 |
e94e62dc3c2cc4a3052d74d2b80d52e50f15fb7a | 346 | module Capistrano
module DSL
module DeployLocker
def deploy_locker_redis_config_file
fetch(:deploy_locker_redis_config_file)
end
def deploy_locker_key_prefix
fetch(:deploy_locker_key_prefix)
end
def deploy_locker_expiration
fetch(:deploy_locker_expiration)
... | 20.352941 | 47 | 0.702312 |
61416378fa4b86184bded4f0760dc4b29503dadb | 367 | require 'test_helper'
module Conductor
class AnnotationsTest < ActionDispatch::IntegrationTest
include Engine.routes.url_helpers
test "Can see annotations view" do
get annotations_url
assert_select "h1", "Conductor: Annotations"
end
test "Can see annotations" do
get annotations_ur... | 21.588235 | 57 | 0.711172 |
032339d2271581f2c02917087c1691b7f8ac6a2f | 293 | module Ceres
class Inspector
def initialize(&block)
@block = block
end
def inspect_object(object)
if @block
@block.call(object)
else
object
end.inspect
rescue => e
"<EXCEPTION RAISED IN INSPECT: #{e.inspect}>"
end
end
end
| 16.277778 | 51 | 0.576792 |
1d57fafb68bf06fb5cb447feb26c5976d7bb8393 | 1,595 | namespace :doggohub do
namespace :ldap do
desc 'DoggoHub | LDAP | Rename provider'
task :rename_provider, [:old_provider, :new_provider] => :environment do |_, args|
old_provider = args[:old_provider] ||
prompt('What is the old provider? Ex. \'ldapmain\': '.color(:blue))
new_provider = ar... | 38.902439 | 102 | 0.667712 |
6177300a755fd8c0332526347f9284e2ebdd1f80 | 1,924 | class Aide < Formula
desc "File and directory integrity checker"
homepage "https://aide.github.io/"
url "https://github.com/aide/aide/releases/download/v0.16.2/aide-0.16.2.tar.gz"
sha256 "17f998ae6ae5afb9c83578e4953115ab8a2705efc50dee5c6461cef3f521b797"
license "GPL-2.0-or-later"
bottle do
cellar :any_... | 28.294118 | 94 | 0.685031 |
bb0665b1314ed9f81aac71ef0793b6abdea98d45 | 896 | class Just < Formula
desc "Handy way to save and run project-specific commands"
homepage "https://github.com/casey/just"
url "https://github.com/casey/just/archive/v0.5.5.tar.gz"
sha256 "01dee8065b7441ec501d0fed9a5e32d1414faf8a10e0ce2846cd2e87ea6af834"
bottle do
cellar :any_skip_relocation
sha256 "a3... | 30.896552 | 93 | 0.732143 |
6a5e7e7aea2071851152c93337528c7f61b7fc2c | 11,513 | require 'test_helper'
require 'v_object/i_tip/broker_tester'
module Tilia
module VObject
class BrokerNewEventTest < ITip::BrokerTester
# Similar to the one in broker_helper, but not the same
def local_parse(message, expected = [])
parse(nil, message, expected, 'mailto:strunk@example.org')
... | 24.919913 | 112 | 0.68427 |
614c78135b660fbd0be9209c79fde80ddba2a237 | 2,990 | require 'net/ssh/loggable'
module Net; module SFTP; module Operations
# A convenience class for working with remote directories. It provides methods
# for searching and enumerating directory entries, similarly to the standard
# ::Dir class.
#
# sftp.dir.foreach("/remote/path") do |entry|
# puts entr... | 32.150538 | 80 | 0.625418 |
8799e01c70f63b11506d5dc9400b086b0bbdf653 | 1,412 | class SwiftProtobuf < Formula
desc "Plugin and runtime library for using protobuf with Swift"
homepage "https://github.com/apple/swift-protobuf"
url "https://github.com/apple/swift-protobuf/archive/1.9.0.tar.gz"
sha256 "2937ddb4404ea596b4e09a1d25d00a59dc78842abe1bd5389c75a464f7172b2f"
head "https://github.com... | 32.837209 | 93 | 0.704674 |
acd39dd86db1d9ea0c89c2104b500ae6ec1f1c9f | 6,581 | #!/usr/bin/env ruby
# frozen_string_literal: false
# check-ssl-host.rb
#
# DESCRIPTION:
# SSL certificate checker
# Connects to a HTTPS (or other SSL) server and performs several checks on
# the certificate:
# - Is the hostname valid for the host we're requesting
# - If any certificate chain is presente... | 32.905 | 120 | 0.664185 |
182963b6dd9cad2adb8abbc68e3e73df654dcc80 | 114 | class ExtractionDatum < ActiveRecord::Base
belongs_to :instance
belongs_to :extraction
acts_as_paranoid
end
| 19 | 42 | 0.815789 |
b97ef9a68cdd072f4eba743df60a928383076938 | 932 | module LeagueAssist
class Summoner < Request
VERSION = 'v4'
attr_reader :name, :id, :puuid, :region, :server, :match_history
def initialize(name: nil, server: nil)
account = request(server, "/lol/summoner/#{VERSION}/summoners/by-name/#{name}")
@id = account['id']
@puuid = account['puuid... | 25.189189 | 88 | 0.594421 |
acff4bdff90bb5213c893d22cf0551208f82518e | 242 | module Molder
class MolderError < StandardError; end
class InvalidCommandError < MolderError; end
class InvalidTemplateName < MolderError; end
class ConfigNotFound < MolderError; end
class LiquidTemplateError < MolderError; end
end
| 30.25 | 46 | 0.801653 |
210106c582c20e58c0ba43b3124c2c8d8125b52c | 39 | require 'rack_session_access/capybara'
| 19.5 | 38 | 0.871795 |
e2f1eb270031e6f6f7764ced2f672abcc51d1b5c | 628 | require 'odm/node'
require 'odm/decode'
require 'odm/alias'
class Odm::CodeListItem < Odm::Node
def initialize(document, coded_value, rank, order_number)
super("CodeListItem", document)
self.add_attribute("CodedValue", "#{coded_value}")
self.add_attribute("Rank", "#{rank}") if !rank.empty?
self.add_attribute... | 23.259259 | 78 | 0.72293 |
397506e0049854317b6a76fb9149244f3f0bd426 | 1,692 | AcpcPokerGuiClient::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" fo... | 42.3 | 85 | 0.780142 |
e888ec5dd151f896cc31aa71065a80f609f71700 | 29 | module AcceptancesHelper
end
| 9.666667 | 24 | 0.896552 |
79237148e68f002794461946b20740b0275f1177 | 977 | # frozen_string_literal: true
require "rails_helper"
RSpec.describe User, type: :model do
it "has a valid factory" do
expect(create(:user)).to be_valid
end
# Validations
it { should validate_presence_of(:first_name) }
it { should validate_presence_of(:last_name) }
it { should validate_presence_of(:em... | 27.914286 | 69 | 0.69089 |
ff92caa164c635bbf6ae01b9d9580d1ca1d6b22c | 1,706 | class FormBuilder < ResourceFormBuilder
# def building_site
# association :building_site, :collection => BuildingSite.all.order(:name), :include_blank => false
# end
#
# def building_list
# association :building_list, :collection => BuildingList.all.order(:name), :include_blank => false
# end
#
... | 27.079365 | 127 | 0.709261 |
39525ff57066c3f0745c87951c1132c7d1f33d9d | 3,270 | describe WifiUser::UseCase::SnsNotificationHandler do
let(:request) { double(body: double(read: {})) }
let(:email_parser) { double }
let(:message_id) { "some-message-id" }
let(:to_address) { "bob@something.gov.uk" }
let(:email_signup_handler) { double(execute: nil) }
let(:sponsor_signup_handler) { double(ex... | 31.747573 | 114 | 0.684404 |
acddc1a4a49cc963a90d610c6300ecda5de1d571 | 956 | # frozen_string_literal: true
require 'flexirest'
module GuideStarApi
# Searches the GuideStar Premier API, returning richer data than the Essentials API
# @see https://apiportal.guidestar.org/api-static-documentation-v3
# @see https://apiportal.guidestar.org/docs/services/microservices.api.profile/operations/5... | 31.866667 | 124 | 0.748954 |
9105db0a209e92f027c9e33454f43dde687ae328 | 1,981 | # frozen_string_literal: true
module Subscribers
# Subscriber will receive response payload from mitc and perform validation along with persisting the payload
class MitcResponseSubscriber
include ::EventSource::Subscriber[http: '/determinations/eval']
extend EventSource::Logging
# From medicaid_gatewa... | 41.270833 | 119 | 0.718324 |
38f5507b1366ddba50b5675fee93a6e6cbab9494 | 6,556 | # encoding: utf-8
module Sherlock #:nodoc
# Collect metrics from the database for any given node and time period.
class MetricCollector
# Initialize a new metric collector.
#
# @param [ String ] node_id The ID of the node to collect metrics for.
# @param [ Array<String> ] paths An array of metric... | 34.324607 | 78 | 0.6446 |
e92b11c2204c4ceec4ceaca3b20d326ad29fc989 | 784 | class RegistrantChangeConfirmEmailJob < ApplicationJob
def perform(domain_id, new_registrant_id)
domain = Domain.find(domain_id)
new_registrant = Registrant.find(new_registrant_id)
log(domain)
RegistrantChangeMailer.confirmation_request(domain: domain,
... | 31.36 | 91 | 0.610969 |
f7203d02c6d7b2b7f7e6e742fdf8e7343029e918 | 2,797 | class Netpbm < Formula
desc "Image manipulation"
homepage "https://netpbm.sourceforge.io/"
# Maintainers: Look at https://sourceforge.net/p/netpbm/code/HEAD/tree/
# for stable versions and matching revisions.
url "https://svn.code.sf.net/p/netpbm/code/stable", :revision => 3750
version "10.86.10"
version_... | 36.324675 | 95 | 0.679299 |
61844ecccf0d5d7b42b7ac05f98564f2955ca3bd | 409 | require "bundler/setup"
Bundler.require(:default)
require 'sinatra'
require 'resque/server'
require 'resque/scheduler'
require 'resque/scheduler/server'
require 'yaml'
Resque.redis = Redis.new
# Or, with custom options
# Resque.redis = Redis.new({
# :host => "127.0.0.1",
# :port => 6379,
# :db => 1,
# })
# Re... | 19.47619 | 40 | 0.669927 |
ac59a865b02744b10692ba0c46610151c6143616 | 893 | # Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to diction... | 37.208333 | 88 | 0.761478 |
acdf904b7eb4cf79bacff3627cba7ab992378f0d | 18,235 | require 'active_record_helper'
describe Api::Pagination::TimestampFilterable do
subject { TimestampFilterableMock }
let(:time) { Time.zone.parse('Oct 20 00:00:00 GMT 2012') }
describe 'api' do
it 'has a default order and limit' do
expect(subject.filtered_page_by.to_sql).to include('items.created_at D... | 38.148536 | 121 | 0.651385 |
ff6c80055449fde457a259c754d777fd44722813 | 1,618 | # 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 l... | 67.416667 | 146 | 0.796663 |
5d8a07957dcffe044a13d2bb4b168daf32ae1916 | 7,559 | # frozen_string_literal: true
require_relative 'teammate'
module Gitlab
module Danger
module Helper
RELEASE_TOOLS_BOT = 'gitlab-release-tools-bot'
# Returns a list of all files that have been added, modified or renamed.
# `git.modified_files` might contain paths that already have been renamed... | 32.029661 | 127 | 0.561582 |
1de5bb4f0ba06ab981965754d05084ca37afe534 | 668 | require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module TravelAgencyRails
class Application < Rails::Application
# Initialize configuration defaults for originally generat... | 33.4 | 82 | 0.767964 |
d58d269bcec4a7bec8fc835fa7a71904d1c753d9 | 1,611 | require 'phraseapp-ruby'
require 'nokogiri'
require 'colorize'
module PhraseApp
module Android
class PhraseAppClient
attr_accessor :client, :project_id, :locale_files, :locales, :sub_path
def initialize(options = {})
credentials = PhraseApp::Auth::Credentials.new token: (options[:token] |... | 25.571429 | 109 | 0.585351 |
bb7f75f8d582413726d1783af8e6a2ee51abc00e | 4,545 |
class CodetoolsController < ApplicationController
before_action :authenticate_user!, :search, except: [:show]
before_action :set_drawer, except: [:search]
before_action :set_drawers, except: [:show]
before_action :set_codetool, only: [:show, :edit, :update, :destroy]
def index
# if @drawer.friends.excl... | 30.503356 | 140 | 0.689329 |
b913477a6b2b1f353d5cea640693e22177161c13 | 1,100 | require File.expand_path('../boot', __FILE__)
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
Bundler.require(*Rails.groups)
require "params... | 36.666667 | 99 | 0.741818 |
03dc772ee2ce530a4777433eb07f5b6efa1589e5 | 519 | # == Schema Information
#
# Table name: outlets
#
# id :integer not null, primary key
# service_url :string(255)
# organization :string(255)
# account :string(255)
# language :string(255)
# created_at :datetime
# updated_at :datetime
# service ... | 24.714286 | 60 | 0.566474 |
f833f32b51ab99996eb3e22e9bedf3f349de0b92 | 364 | class String
# Escapes string for use with Objective-C
#
def to_obj_c
"\\\@\\\"#{self}\\\""
end
# Escapes string for use with C
#
def to_c
"\\\"#{self}\\\""
end
# Strips heredoc indents
#
def strip_heredoc
indent = scan(/^[ \t]*(?=\S)/).min
indent_len = (indent || '').length
... | 16.545455 | 43 | 0.532967 |
0394b10bfe8807cac36fca0ca46bf24f20cf1c6e | 3,113 | # -*- encoding: utf-8 -*-
require 'nokogiri'
require 'metainspector'
module SiteValidator
##
# A sitemap has an URL, and holds a collection of pages to be validated
#
class Sitemap
attr_accessor :url, :max_pages
def initialize(url, max_pages = 100)
@url = url
@max_pages = max_pages
... | 31.13 | 141 | 0.595888 |
d59d33c0eb4ed613c9e3dcfebd0c4faa4a1d0846 | 2,390 | require 'spec_helper'
describe AssetHostCore::Loaders::YouTube do
describe '::build_from_url' do
it 'matches a youtube URL' do
loader = AssetHostCore::Loaders::YouTube.build_from_url('http://www.youtube.com/watch?v=y8Kyi0WNg40')
loader.should be_a AssetHostCore::Loaders::YouTube
end
it 'does... | 31.866667 | 127 | 0.676569 |
038c35e9d5cdd5b0c2c4f4dec6129aaa2fb7b0b5 | 2,699 | # frozen_string_literal: true
require 'spec_helper_acceptance'
describe 'prometheus openldap exporter' do
it 'openldap_exporter works idempotently with no errors' do
pp = 'include prometheus::openldap_exporter'
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
des... | 30.325843 | 124 | 0.694702 |
b912ab471858874f1838fe980809141470cb98a1 | 851 | cask "nomachine-enterprise-client" do
version "7.0.208_4"
sha256 "d2ef2b881188bc1faf3bce971d69fa2f1a8b9a596625f9a66e9d7904acb12af0"
url "https://download.nomachine.com/download/#{version.major_minor}/MacOSX/nomachine-enterprise-client_#{version}.dmg"
appcast "https://www.nomachine.com/download/download&id=15"
... | 40.52381 | 120 | 0.719154 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.