source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | buildkite/homebrew-buildkite | https://github.com/buildkite/homebrew-buildkite | bktec.rb | Ruby | mit | 19 | master | 1,756 | # typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class Bktec < Formula
desc "Buildkite Test Engine Client"
homepage "https://github.com/buildkite/test-engine-client"
version "1.6.1"
on_macos do
if Hardware::CPU.intel?
url "https://github.com/buildkit... |
github | buildkite/homebrew-buildkite | https://github.com/buildkite/homebrew-buildkite | Formula/buildkite-agent.rb | Ruby | mit | 19 | master | 3,749 | class BuildkiteAgent < Formula
desc "Build runner for use with Buildkite"
homepage "https://buildkite.com/docs/agent"
stable do
version "3.124.0"
if Hardware::CPU.arm?
url "https://github.com/buildkite/agent/releases/download/v3.124.0/buildkite-agent-darwin-arm64-3.124.0.tar.gz"
sha256 "... |
github | buildkite/homebrew-buildkite | https://github.com/buildkite/homebrew-buildkite | Formula/bktec.rb | Ruby | mit | 19 | master | 1,762 | # typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class Bktec < Formula
desc "Buildkite Test Engine Client"
homepage "https://github.com/buildkite/test-engine-client"
version "2.4.0"
on_macos do
if Hardware::CPU.intel?
url "https://github.com/buildkit... |
github | buildkite/homebrew-buildkite | https://github.com/buildkite/homebrew-buildkite | Formula/terminal-to-html.rb | Ruby | mit | 19 | master | 934 | class TerminalToHtml < Formula
desc "Converts arbitrary shell output (with ANSI) into beautifully rendered HTML"
homepage "https://github.com/buildkite/terminal-to-html"
version "3.6.1"
if Hardware::CPU.arm?
url "https://github.com/buildkite/terminal-to-html/releases/download/v3.6.1/terminal-to-html-3.... |
github | buildkite/homebrew-buildkite | https://github.com/buildkite/homebrew-buildkite | Formula/test-splitter.rb | Ruby | mit | 19 | master | 1,817 | # typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class TestSplitter < Formula
desc "Buildkite test splitting client"
homepage "https://github.com/buildkite/test-splitter"
version "0.9.1"
on_macos do
on_intel do
url "https://github.com/buildkite/test-... |
github | buildkite/homebrew-buildkite | https://github.com/buildkite/homebrew-buildkite | Formula/bk@2.rb | Ruby | mit | 19 | master | 988 | class BkAT2 < Formula
desc "A command-line tool for working with Buildkite"
homepage "https://github.com/buildkite/cli"
disable! date: "2025-12-16", because: "is no longer maintained, use bk@3 instead"
version "2.0.0"
if Hardware::CPU.arm?
url "https://github.com/buildkite/cli/releases/download/v2.0.0/c... |
github | buildkite/homebrew-buildkite | https://github.com/buildkite/homebrew-buildkite | Formula/bk@3.rb | Ruby | mit | 19 | master | 1,532 | # typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class BkAT3 < Formula
desc "Work with Buildkite from the command-line"
homepage "https://github.com/buildkite/cli"
version "3.38.1"
license "MIT"
on_macos do
if Hardware::CPU.intel?
url "https://gith... |
github | buildkite/homebrew-buildkite | https://github.com/buildkite/homebrew-buildkite | Casks/buildkite-mcp-server.rb | Ruby | mit | 19 | master | 1,528 | # This file was generated by GoReleaser. DO NOT EDIT.
cask "buildkite-mcp-server" do
desc "Model Context Protocol server for Buildkite"
homepage "https://github.com/buildkite/buildkite-mcp-server"
version "0.9.0"
livecheck do
skip "Auto-generated on release."
end
binary "buildkite-mcp-server"
on_ma... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | Appraisals | Ruby | mit | 19 | master | 940 | # Every Minor Version for the Current and Last Major Releases
# Latest Minor Version for the Older Releases.
# https://guides.rubyonrails.org/maintenance_policy.html
#
# When you update this, do not forget to update CI settings for matrix testing.
# # Since bundler v1 and Appraisals are not well interacted,
# # we do ... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | shinq.gemspec | Ruby | mit | 19 | master | 1,393 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |spec|
spec.name = "shinq"
spec.version = '1.4.0'
spec.authors = ["Ryoichi SEKIGUCHI"]
spec.email = ["ryopeko@gmail.com"]
spec.summary ... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | spec/spec_helper.rb | Ruby | mit | 19 | master | 1,378 | ENV['RAILS_ENV'] ||= 'test'
$LOAD_PATH << File.expand_path('../helpers', __FILE__)
require 'rspec/mocks/standalone'
require 'simplecov'
require 'erb'
require 'yaml'
require 'active_support'
require 'active_support/core_ext/hash'
require 'active_support/core_ext/numeric/time'
require 'mysql2'
require 'timecop'
def loa... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | spec/integration_spec.rb | Ruby | mit | 19 | master | 4,660 | require 'spec_helper'
require 'shinq'
require 'shinq/client'
require 'securerandom'
describe "Integration" do
before do
Shinq.configuration = {
default_db: :test,
db_config: load_database_config
}
end
after do
Shinq.clear_all_connections! # Return from owner mode
tables = Shinq.conn... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | spec/shinq_spec.rb | Ruby | mit | 19 | master | 3,590 | require 'spec_helper'
require 'shinq'
require 'shinq/configuration'
require 'logger'
describe Shinq do
# remove instance variable deliberately or indeliberately defined by other specs
subject(:shinq) do
Shinq.dup.tap do |shinq|
shinq.instance_variables.each do |variable|
shinq.remove_instance_var... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | spec/shinq/client_spec.rb | Ruby | mit | 19 | master | 1,240 | require 'spec_helper'
require 'shinq'
require 'shinq/client'
describe Shinq::Client do
subject(:shinq_client) do
Shinq::Client.dup.tap do |client|
client.instance_variables.each do |variable|
client.remove_instance_variable(variable)
end
end
end
before do
Shinq.configuration = {
... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | spec/shinq/configuration_spec.rb | Ruby | mit | 19 | master | 3,467 | require 'spec_helper'
require 'shinq/configuration'
describe Shinq::Configuration do
describe "accessors" do
subject { Shinq::Configuration.new({}) }
it { is_expected.to respond_to(:require) }
it { is_expected.to respond_to(:worker_name) }
it { is_expected.to respond_to(:db_config) }
it { is_exp... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | spec/shinq/cli_spec.rb | Ruby | mit | 19 | master | 990 | require 'spec_helper'
require 'shinq/cli'
describe Shinq::CLI do
after do
Shinq.clear_all_connections!
end
describe '.new' do
context 'when there are require statement' do
it 'requires and run the code' do
# NOTE: As CLI alters global process irreversibly, we only check the result
... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq.rb | Ruby | mit | 19 | master | 1,657 | require 'shinq/client'
require 'shinq/configuration'
module Shinq
VERSION = Gem.loaded_specs['shinq'].version.to_s
def self.configuration=(config)
@configuration = case config
when Shinq::Configuration
config
else
Shinq::Configuration.new(config)
end
end
def self.configuration
... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq/client.rb | Ruby | mit | 19 | master | 2,930 | require 'sql-maker'
require 'sql/maker/quoting'
require 'active_support/core_ext/hash/keys'
module Shinq
class Client
def self.builder
@builder ||= SQL::Maker.new(driver: 'mysql', auto_bind: true)
end
def self.enqueue(table_name: , job_id: , args:, scheduled_at: nil)
if scheduled_at && !sche... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq/rails.rb | Ruby | mit | 19 | master | 411 | require 'shinq/active_job/queue_adapters/shinq_adapter'
module Shinq
class Rails < ::Rails::Engine
initializer :shinq do
Shinq::Rails.rails_bootstrap
end
def self.rails_bootstrap
Shinq.configuration.db_config = ActiveRecord::Base.configurations
Shinq.configuration.default_db = ::Rails.... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq/cli.rb | Ruby | mit | 19 | master | 3,682 | require 'optparse'
require 'yaml'
require 'shinq'
require 'shinq/launcher'
require 'shinq/statistics'
require 'shinq/configuration'
require 'shinq/logger'
require 'serverengine'
require 'active_support/inflector'
module Shinq
class OptionParseError < StandardError; end
class CLI
def initialize(args=ARGV)
... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq/logger.rb | Ruby | mit | 19 | master | 260 | require 'logger'
module Shinq
class Logger
def self.initialize_logger
@logger = ::Logger.new(STDOUT)
end
def self.logger=(log)
@logger = log
end
def self.logger
@logger ? @logger : initialize_logger
end
end
end |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq/configuration.rb | Ruby | mit | 19 | master | 1,719 | module Shinq
class ConfigurationError < StandardError; end
# @!attribute abort_on_error
# @return [Boolean] Whether do +queue_abort()+ on performing failure.
# @see Shinq::Launcher#run
#
# Defaults to +true+, which means that worker do +queue_end()+ AFTER it proceeds a job.
# If it is +false+, wo... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq/statistics.rb | Ruby | mit | 19 | master | 343 | require 'shinq/client'
require 'active_support/inflector'
module Shinq
module Statistics
def run
until @stop
Shinq.logger.info Shinq::Client.queue_stats(table_name: Shinq.configuration.worker_name.pluralize)
sleep Shinq.configuration.statistics
end
end
def stop
@stop = ... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq/launcher.rb | Ruby | mit | 19 | master | 1,834 | require 'shinq/client'
require 'active_support/inflector'
module Shinq
module Launcher
def initialize
Shinq.clear_all_connections!
end
# Wait configured queue and proceed each of them until stop.
# @see Shinq::Configuration#abort_on_error
def run
worker_name = Shinq.configuration.wor... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/shinq/active_job/queue_adapters/shinq_adapter.rb | Ruby | mit | 19 | master | 706 | module ActiveJob
module QueueAdapters
class ShinqAdapter
def enqueue(job)
self.class.enqueue job
end
def enqueue_at(job, timestamp)
self.class.enqueue_at job, timestamp
end
class << self
def enqueue(job)
Shinq::Client.enqueue(
table_nam... |
github | ryopeko/shinq | https://github.com/ryopeko/shinq | lib/generators/shinq/worker/worker_generator.rb | Ruby | mit | 19 | master | 1,033 | require 'rails/generators/named_base'
require 'rails/generators/model_helpers'
require 'rails/generators/active_record/migration'
module Shinq
module Generators
class WorkerGenerator < ::Rails::Generators::NamedBase
include ::Rails::Generators::ModelHelpers
include ::Rails::Generators::Migration
... |
github | pjb3/has-bit-field | https://github.com/pjb3/has-bit-field | Rakefile | Ruby | mit | 19 | master | 245 | require 'bundler'
Bundler::GemHelper.install_tasks
require 'rake'
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/*_test.rb'
test.verbose = true
end
task :default => :test |
github | pjb3/has-bit-field | https://github.com/pjb3/has-bit-field | has-bit-field.gemspec | Ruby | mit | 19 | master | 919 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "has-bit-field/version"
Gem::Specification.new do |s|
s.name = "has-bit-field"
s.version = Has::Bit::Field::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Paul Barry"]
s.email = ["mail@paulbarry.com... |
github | pjb3/has-bit-field | https://github.com/pjb3/has-bit-field | test/has-bit-field_test.rb | Ruby | mit | 19 | master | 5,936 | require File.join(File.dirname(__FILE__), 'test_helper')
ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:database => ":memory:"
)
#ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.connection.create_table(:people) do |t|
t.integer :bit_field, :null => true
end
class Person < ... |
github | pjb3/has-bit-field | https://github.com/pjb3/has-bit-field | test/test_helper.rb | Ruby | mit | 19 | master | 379 | require 'rubygems'
require 'bundler'
Bundler.setup
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'test/unit'
require 'active_record'
require File.join(File.dirname(__FILE__), "../rails/init")
require 'has-bit-field'
#ActiveRecord::Base.logger = ... |
github | pjb3/has-bit-field | https://github.com/pjb3/has-bit-field | lib/has-bit-field.rb | Ruby | mit | 19 | master | 2,275 | module HasBitField
# The first arguement +bit_field_attribute+ should be a symbol,
# the name of attribute that will hold the actual bit field
# all following arguments should also be symbols,
# which will be the name of each flag in the bit field
def has_bit_field(bit_field_attribute, *args)
unless table... |
github | openrain/active_racksource | https://github.com/openrain/active_racksource | Rakefile | Ruby | apache-2.0 | 19 | master | 1,642 | require 'rake'
require 'rubygems'
require 'rake/rdoctask'
require 'spec/rake/spectask'
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = "active_racksource"
s.summary = "Rack backend for ActiveResource"
s.email = "remi.taylor@openrain.com"
s.homepage = "http://github.co... |
github | openrain/active_racksource | https://github.com/openrain/active_racksource | active_racksource.gemspec | Ruby | apache-2.0 | 19 | master | 1,408 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{active_racksource}
s.version = "0.1.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["remi"]
s.date = %q{2009-02-09}
s.description = %q{Rack backend for ActiveResource... |
github | openrain/active_racksource | https://github.com/openrain/active_racksource | lib/active_racksource.rb | Ruby | apache-2.0 | 19 | master | 770 | $:.unshift File.dirname(__FILE__)
require 'rubygems' # i'd like to remove this - it's becoming less conventional to have this in ruby gems / libraries
begin
require 'active_resource'
rescue LoadError
raise "active_racksource requires active_resource, try: gem install activeresource"
end
begin
require 'rackbox'... |
github | openrain/active_racksource | https://github.com/openrain/active_racksource | lib/active_racksource/http.rb | Ruby | apache-2.0 | 19 | master | 1,191 | class ActiveRacksource #:nodoc:
# Adapter ... acts like Net::HTTP but actually works against a Rack application
class HTTP
# Rack application
attr_accessor :app
# Initialized a new ActiveRacksource::HTTP
#
# ==== Parameters
# app: a Rack application
#
def initialize app = ActiveRe... |
github | openrain/active_racksource | https://github.com/openrain/active_racksource | lib/active_racksource/connection.rb | Ruby | apache-2.0 | 19 | master | 1,605 | class ActiveRacksource #:nodoc:
# Overrides parts of ActiveResource::Connection for ActiveRacksource (to use Rack instead of HTTP)
module Connection
def self.included base
base.instance_eval {
alias_method_chain :http, :rack_instead_of_real_http
}
end
# Overrides ActiveResource::C... |
github | openrain/active_racksource | https://github.com/openrain/active_racksource | lib/active_racksource/response.rb | Ruby | apache-2.0 | 19 | master | 1,156 | class ActiveRacksource #:nodoc:
# A thin wrapper around Rack::Response
#
# ActiveResource expects an HTTP Response object to be
# formatted in a certain way with the right methods, etc.
#
# This object wraps a Rack::Response and implements an
# inferface that supports ActiveResource
#
# Some method... |
github | openrain/active_racksource | https://github.com/openrain/active_racksource | lib/active_racksource/base.rb | Ruby | apache-2.0 | 19 | master | 372 | class ActiveRacksource #:nodoc:
# Overrides parts of ActiveResource::Base for ActiveRacksource (to use Rack instead of HTTP)
module Base
def self.included base
base.extend ClassMethods
end
module ClassMethods
def app= rack_app
@rack_app = rack_app
end
def a... |
github | michaeledgar/validates_not_profane | https://github.com/michaeledgar/validates_not_profane | Rakefile | Ruby | mit | 19 | master | 581 | require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the validates_not_profane plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the validate... |
github | michaeledgar/validates_not_profane | https://github.com/michaeledgar/validates_not_profane | init.rb | Ruby | mit | 19 | master | 547 | ##########################################
# #
# Validations for profane language #
# Michael J. Edgar #
# OurGreen, Inc. #
# 1/17/2009 #
# #
###################... |
github | michaeledgar/validates_not_profane | https://github.com/michaeledgar/validates_not_profane | test/schema.rb | Ruby | mit | 19 | master | 227 | ActiveRecord::Schema.define(:version => 0) do
create_table :users, :force => true do |t|
t.string :name
t.string :bio
end
create_table :posts, :force => true do |t|
t.string :subject
t.text :post
end
end |
github | michaeledgar/validates_not_profane | https://github.com/michaeledgar/validates_not_profane | test/test_helper.rb | Ruby | mit | 19 | master | 1,037 | ENV['RAILS_ENV'] = 'test'
ENV['RAILS_ROOT'] ||= File.dirname(__FILE__) + '/../../../..'
require 'test/unit'
require File.expand_path(File.join(ENV['RAILS_ROOT'], 'config/environment.rb'))
def load_schema
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
ActiveRecord::Base.logger = Logger.new(... |
github | michaeledgar/validates_not_profane | https://github.com/michaeledgar/validates_not_profane | test/validates_not_profane_test.rb | Ruby | mit | 19 | master | 1,456 | require 'test/unit'
require File.dirname(__FILE__) + '/test_helper.rb'
class ValidatesNotProfaneTest < Test::Unit::TestCase
# Replace this with your real tests.
load_schema
class User < ActiveRecord::Base
validates_not_profane :name
validates_not_profane :bio, :tolerance => 5
end
class Post < Acti... |
github | michaeledgar/validates_not_profane | https://github.com/michaeledgar/validates_not_profane | lib/active_record/validations/validates_not_profane.rb | Ruby | mit | 19 | master | 3,999 | ##########################################
# #
# Validations for profane language #
# Michael J. Edgar #
# OurGreen, Inc. #
# 1/17/2009 #
# #
###################... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | vagrant-shell.gemspec | Ruby | mit | 19 | master | 863 | $:.unshift File.expand_path("../lib", __FILE__)
require "vagrant-shell/version"
Gem::Specification.new do |s|
s.name = "vagrant-shell"
s.version = VagrantPlugins::Shell::VERSION
s.platform = Gem::Platform::RUBY
s.authors = [ "Tom Bombadil", "Mitchell Hashimoto" ]
s.email = [... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | demo/ec2/Vagrantfile | Ruby | mit | 19 | master | 398 | require "vagrant-shell"
require "vagrant-shell/ssh-agent"
VagrantPlugins::Shell::Plugin.make_provider(:ec2)
Vagrant.configure("2") do |config|
config.vm.box = "vagrant-shell"
config.ssh.username = "ubuntu"
config.vm.provider :ec2 do |shell, override|
shell.image = ENV['SHELL_IMAGE']
shell.script = shel... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | demo/self/Vagrantfile | Ruby | mit | 19 | master | 387 | require "vagrant-shell"
require "vagrant-shell/ssh-agent"
VagrantPlugins::Shell::Plugin.make_provider(:self)
Vagrant.configure("2") do |config|
config.vm.box = "vagrant-shell"
config.ssh.username = ENV['LOGNAME']
config.vm.provider :self do |shell, override|
shell.image = 'localhost'
shell.script = Fil... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | demo/docker/Vagrantfile | Ruby | mit | 19 | master | 667 | require "vagrant-shell"
VagrantPlugins::Shell::Plugin.make_provider(:docker)
Vagrant.configure("2") do |config|
config.vm.box = "vagrant-shell"
config.ssh.username = "ubuntu"
config.ssh.private_key_path = "#{ENV['HOME']}/.vagrant.d/insecure_private_key"
%w(precise raring).each do |release|
config.vm.defi... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell.rb | Ruby | mit | 19 | master | 464 | require "pathname"
require "vagrant-shell/plugin"
module VagrantPlugins
module Shell
lib_path = Pathname.new(File.expand_path("../vagrant-shell", __FILE__))
autoload :Action, lib_path.join("action")
autoload :Errors, lib_path.join("errors")
# This returns the path to the source of this plugin.
... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/config.rb | Ruby | mit | 19 | master | 2,568 | require "vagrant"
module VagrantPlugins
module Shell
class Config < Vagrant.plugin("2", :config)
# The ID of the Image to use.
#
# @return [String]
attr_accessor :image
# The timeout to wait for an instance to become ready.
#
# @return [Fixnum]
attr_accessor :inst... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action.rb | Ruby | mit | 19 | master | 3,264 | require "pathname"
require "vagrant/action/builder"
module VagrantPlugins
module Shell
module Action
# Include the built-in modules so we can use them as top-level things.
include Vagrant::Action::Builtin
# This action is called to terminate the remote machine.
def self.action_destroy
... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/errors.rb | Ruby | mit | 19 | master | 603 | require "vagrant"
module VagrantPlugins
module Shell
module Errors
class VagrantShellError < Vagrant::Errors::VagrantError
error_namespace("vagrant_shell.errors")
end
class ShellError < VagrantShellError
error_key(:shell_error)
end
class TimeoutError < VagrantShell... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/ssh-agent.rb | Ruby | mit | 19 | master | 407 | # fool vagrant into using ssh-agent keys instead of a fixed key on file
module Vagrant
module Util
class Platform
def self.solaris?
true
end
end
end
end
require "net/ssh"
module Net::SSH
class << self
alias_method :old_start, :start
def start(host, username, opts)
... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/plugin.rb | Ruby | mit | 19 | master | 2,177 | begin
require "vagrant"
rescue LoadError
raise "The Vagrant Shell plugin must be run within Vagrant."
end
# This is a sanity check to make sure no one is attempting to install
# this into an early Vagrant version.
if Vagrant::VERSION < "1.2.0"
raise "The Vagrant Shell plugin is only compatible with Vagrant 1.2+"... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/provider.rb | Ruby | mit | 19 | master | 1,497 | require "log4r"
require "vagrant"
module VagrantPlugins
module Shell
class Provider < Vagrant.plugin("2", :provider)
def initialize(machine)
@machine = machine
end
def action(name)
# Attempt to get the action method from the Action class if it
# exists, otherwise return... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/util/timer.rb | Ruby | mit | 19 | master | 357 | module VagrantPlugins
module Shell
module Util
class Timer
# A basic utility method that times the execution of the given
# block and returns it.
def self.time
start_time = Time.now.to_f
yield
end_time = Time.now.to_f
end_time - start_time
... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action/run_instance.rb | Ruby | mit | 19 | master | 3,597 | require "log4r"
require "pp"
require 'vagrant/util/retryable'
require 'vagrant-shell/util/timer'
module VagrantPlugins
module Shell
module Action
# This runs the configured instance.
class RunInstance
include Vagrant::Util::Retryable
def initialize(app, env)
@app = app... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action/message_not_created.rb | Ruby | mit | 19 | master | 300 | module VagrantPlugins
module Shell
module Action
class MessageNotCreated
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t("vagrant_shell.not_created"))
@app.call(env)
end
end
end
end
end |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action/is_created.rb | Ruby | mit | 19 | master | 414 | module VagrantPlugins
module Shell
module Action
# This can be used with "Call" built-in to check if the machine
# is created and branch in the middleware.
class IsCreated
def initialize(app, env)
@app = app
end
def call(env)
env[:result] = env[:machi... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action/timed_provision.rb | Ruby | mit | 19 | master | 550 | require "vagrant-shell/util/timer"
module VagrantPlugins
module Shell
module Action
# This is the same as the builtin provision except it times the
# provisioner runs.
class TimedProvision < Vagrant::Action::Builtin::Provision
def run_provisioner(env, name, p)
timer = Util::Ti... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action/message_already_created.rb | Ruby | mit | 19 | master | 308 | module VagrantPlugins
module Shell
module Action
class MessageAlreadyCreated
def initialize(app, env)
@app = app
end
def call(env)
env[:ui].info(I18n.t("vagrant_shell.already_created"))
@app.call(env)
end
end
end
end
end |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action/read_ssh_info.rb | Ruby | mit | 19 | master | 1,044 | require "log4r"
module VagrantPlugins
module Shell
module Action
# This action reads the SSH info for the machine and puts it into the
# `:machine_ssh_info` key in the environment.
class ReadSSHInfo
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action/terminate_instance.rb | Ruby | mit | 19 | master | 847 | require "log4r"
module VagrantPlugins
module Shell
module Action
# This terminates the running instance.
class TerminateInstance
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant_shell::action::terminate_instance")
end
def call(en... |
github | dstrctrng/vagrant-shell | https://github.com/dstrctrng/vagrant-shell | lib/vagrant-shell/action/read_state.rb | Ruby | mit | 19 | master | 906 | require "log4r"
module VagrantPlugins
module Shell
module Action
# This action reads the state of the machine and puts it in the
# `:machine_state_id` key in the environment.
class ReadState
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant_... |
github | kyamaguchi/capybara-sessionkeeper | https://github.com/kyamaguchi/capybara-sessionkeeper | capybara-sessionkeeper.gemspec | Ruby | mit | 19 | master | 1,228 | lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "capybara/sessionkeeper/version"
Gem::Specification.new do |spec|
spec.name = "capybara-sessionkeeper"
spec.version = Capybara::Sessionkeeper::VERSION
spec.authors = ["Kazuho Yamaguchi"]
... |
github | kyamaguchi/capybara-sessionkeeper | https://github.com/kyamaguchi/capybara-sessionkeeper | spec/spec_helper.rb | Ruby | mit | 19 | master | 763 | require "byebug"
require "bundler/setup"
require "capybara/sessionkeeper"
Dir[File.join(File.dirname(__FILE__), "..", "spec", "support", "**/*.rb")].sort.each {|f| require f}
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_st... |
github | kyamaguchi/capybara-sessionkeeper | https://github.com/kyamaguchi/capybara-sessionkeeper | spec/capybara/sessionkeeper_spec.rb | Ruby | mit | 19 | master | 4,052 | require "spec_helper"
RSpec.describe Capybara::Sessionkeeper do
it "has a version number" do
expect(Capybara::Sessionkeeper::VERSION).not_to be nil
end
describe '#save_cookies' do
it "saves cookies into file" do
session.visit 'https://github.com/'
path = session.save_cookies
expect(pat... |
github | kyamaguchi/capybara-sessionkeeper | https://github.com/kyamaguchi/capybara-sessionkeeper | lib/capybara/sessionkeeper.rb | Ruby | mit | 19 | master | 1,931 | require 'capybara'
require "capybara/sessionkeeper/version"
require 'yaml'
module Capybara
module Sessionkeeper
class CookieError < StandardError; end
def save_cookies(path = nil)
path = prepare_path(path, cookie_file_extension)
data = Marshal.dump driver.browser.manage.all_cookies
File.op... |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | rom-redis.gemspec | Ruby | mit | 19 | master | 1,031 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rom/redis/version'
Gem::Specification.new do |spec|
spec.name = 'rom-redis'
spec.version = ROM::Redis::VERSION.dup
spec.authors = ['Piotr Solnica']
spec.email ... |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | Gemfile | Ruby | mit | 19 | master | 289 | source 'https://rubygems.org'
gemspec
group :test do
gem 'rom', github: 'rom-rb/rom', branch: 'master'
gem 'rspec', '~> 3.1'
gem 'codeclimate-test-reporter', require: false
end
group :tools do
gem 'guard'
gem 'guard-rspec'
gem 'guard-rubocop'
gem 'rubocop', '~> 0.28'
end |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | Guardfile | Ruby | mit | 19 | master | 736 | group :red_green_refactor, halt_on_fail: true do
guard :rspec, cmd: 'rspec', all_on_start: true do
# run all specs if Gemfile.lock is modified
watch('Gemfile.lock') { 'spec' }
# run all specs if any library code is modified
watch(%r{\Alib/.+\.rb\z}) { 'spec' }
# run all specs if supporting files... |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | lib/rom/redis/relation.rb | Ruby | mit | 19 | master | 215 | require 'redis/namespace'
require 'rom/relation'
module ROM
module Redis
class Relation < ROM::Relation
adapter :redis
forward(*::Redis::Namespace::COMMANDS.keys.map(&:to_sym))
end
end
end |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | lib/rom/redis/dataset.rb | Ruby | mit | 19 | master | 643 | module ROM
module Redis
class Dataset
attr_reader :connection, :commands
def initialize(connection, commands = [])
@connection = connection
@commands = commands
end
def to_a
view
end
def each(&block)
view.each(&block)
end
def ma... |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | lib/rom/redis/gateway.rb | Ruby | mit | 19 | master | 676 | require 'redis'
require 'redis/namespace'
require 'rom/gateway'
require 'rom/redis/dataset'
module ROM
module Redis
class Gateway < ROM::Gateway
adapter :redis
attr_reader :datasets
def initialize(options = {})
@connection = ::Redis.new(options)
@datasets = {}
end
... |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | spec/spec_helper.rb | Ruby | mit | 19 | master | 482 | # encoding: utf-8
if RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.4.0' && ENV['CI'] == 'true'
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
end
require 'rom-redis'
root = Pathname(__FILE__).dirname
Dir[root.join('shared/*.rb').to_s].each { |f| require f }
Dir[root.join('support/*.rb').to_s... |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | spec/unit/relation_spec.rb | Ruby | mit | 19 | master | 452 | describe ROM::Redis::Relation do
include_context 'container'
subject { rom.relations[:users] }
before do
configuration.relation(:users)
end
it '#set' do
expect(subject.set(:a, 1).to_a).to eq(['OK'])
end
it '#hset' do
expect(subject.hset(:who, :is, :john).to_a).to eq([true])
end
it '#h... |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | spec/unit/dataset_spec.rb | Ruby | mit | 19 | master | 269 | require 'rom/lint/spec'
describe ROM::Redis::Dataset do
let(:conn) { ::Redis::Namespace.new(:test) }
let(:dataset) { ROM::Redis::Dataset.new(conn).set(:a, 1).set(:b, 2).get(:a) }
let(:data) { %w(OK OK 1) }
it_behaves_like 'a rom enumerable dataset'
end |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | spec/integration/adapter_spec.rb | Ruby | mit | 19 | master | 557 | describe 'Adapter' do
include_context 'container'
before do
configuration.relation(:users) do
adapter :redis
def by_id(id)
hgetall(id)
end
end
configuration.mappers do
define(:users) do
model User
end
end
end
it 'works' do
rom.relations.users... |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | spec/shared/container.rb | Ruby | mit | 19 | master | 251 | RSpec.shared_context 'container' do
let(:container) { ROM.container(configuration) }
let!(:configuration) { ROM::Configuration.new(:redis) }
let(:gateway) { configuration.gateways[:default] }
let(:rom) { container }
end |
github | rom-rb/rom-redis | https://github.com/rom-rb/rom-redis | rakelib/rubocop.rake | Ruby | mit | 19 | master | 367 | begin
require 'rubocop/rake_task'
Rake::Task[:default].enhance [:rubocop]
RuboCop::RakeTask.new do |task|
task.options << '--display-cop-names'
end
namespace :rubocop do
desc 'Generate a configuration file acting as a TODO list.'
task :auto_gen_config do
exec 'bundle exec rubocop --auto-g... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | Rakefile | Ruby | mit | 19 | master | 799 | require "bundler/gem_tasks"
require "rspec/core"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.pattern = FileList["spec/**/*_spec.rb"]
end
task :default => "spec:all"
namespace :spec do
%w(mongoid_4 mongoid_5 mongoid_6).each do |gemfile|
desc "Run Tests against #{gemfile}"
... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | mongoid-observers.gemspec | Ruby | mit | 19 | master | 887 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mongoid/observers/version'
Gem::Specification.new do |spec|
spec.name = "mongoid-observers"
spec.version = Mongoid::Observers::VERSION
spec.authors = ["Chamnap Chhorn"]... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | Gemfile | Ruby | mit | 19 | master | 546 | source 'https://rubygems.org'
gem 'mongoid', '~> 6.0.2'
gem 'rails-observers', github: 'rails/rails-observers'
gem 'rake', '~> 10.4.2'
gem 'rspec', '~> 3.5.0'
gem 'rspec-rails', '~> 3.5.2'
gem 'guard-rspec', '~> 4.7.3'
gem 'pry', '~> 0.9.12.6'
gem 'simplecov', ... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | Guardfile | Ruby | mit | 19 | master | 2,566 | # A sample Guardfile
# More info at https://github.com/guard/guard#readme
## Uncomment and set this to only include directories you want to watch
# directories %w(app lib config test spec feature)
## Uncomment to clear the screen before every task
# clearing :on
## Guard internally checks for changes in the Guardfil... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | lib/mongoid-observers.rb | Ruby | mit | 19 | master | 397 | require "active_support"
require "rails/observers/active_model"
require "mongoid"
require "mongoid/observers/config"
require "mongoid/observers/interceptable"
require "mongoid/observers/railtie" if defined? Rails
require "mongoid/observer"
module Mongoid
include ActiveModel::Observing
delegate(*ActiveModel::Obse... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | lib/mongoid/observer.rb | Ruby | mit | 19 | master | 6,009 | # encoding: utf-8
module Mongoid
# Observer classes respond to life cycle callbacks to implement trigger-like
# behavior outside the original class. This is a great way to reduce the
# clutter that normally comes when the model class is burdened with
# functionality that doesn't pertain to the core responsibil... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | lib/mongoid/observers/railtie.rb | Ruby | mit | 19 | master | 971 | require "rails/railtie"
module Mongoid
module Observers
class Railtie < ::Rails::Railtie
initializer "mongoid.observer" do |app|
ActiveSupport.on_load(:mongoid) do
if app.config.respond_to?(:mongoid)
::Mongoid.observers = app.config.mongoid.observers
end
end
... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | lib/mongoid/observers/interceptable.rb | Ruby | mit | 19 | master | 1,415 | module Mongoid
module Interceptable
include ActiveModel::Observing
class << self
# Get all callbacks that can be observed.
#
# @example Get the observables.
# Interceptable.observables
#
# @return [ Array<Symbol> ] The names of the observables.
def observables
... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | lib/generators/mongoid/observer/observer_generator.rb | Ruby | mit | 19 | master | 487 | # encoding: utf-8
require "rails/generators"
require "rails/generators/mongoid_generator"
module Mongoid
module Generators
class ObserverGenerator < Base
check_class_collision suffix: "Observer"
def self.source_root
File.expand_path("../templates", __FILE__)
end
def create_obser... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | spec/spec_helper.rb | Ruby | mit | 19 | master | 1,175 | require "simplecov"
require "coveralls"
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
Coveralls::SimpleCov::Formatter,
SimpleCov::Formatter::HTMLFormatter
])
SimpleCov.start do
add_filter "/spec/"
end
MODELS = File.join(File.dirname(__FILE__), "app/models")
$LOAD_PATH.unshift(MODELS)
requir... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | spec/mongoid/observer_spec.rb | Ruby | mit | 19 | master | 5,936 | require "spec_helper"
describe Mongoid::Observer do
let(:recorder) do
CallbackRecorder.instance
end
after do
recorder.reset
end
it "is an instance of an active model observer" do
expect(ActorObserver.instance).to be_a_kind_of(ActiveModel::Observer)
end
context "when the oberserver observe... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | spec/app/models/actor.rb | Ruby | mit | 19 | master | 258 | class Actor
include Mongoid::Document
field :name
field :after_custom_count, type: Integer, default: 0
define_model_callbacks :custom
observable :custom
def do_something
run_callbacks(:custom) do
self.name = "custom"
end
end
end |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | spec/app/models/record.rb | Ruby | mit | 19 | master | 988 | class Record
include Mongoid::Document
field :name, type: String
field :before_create_called, type: Boolean, default: false
field :before_save_called, type: Boolean, default: false
field :before_update_called, type: Boolean, default: false
field :before_validation_called, type: Boolean, default: false
fi... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | spec/app/models/person.rb | Ruby | mit | 19 | master | 1,070 | class Person
include Mongoid::Document
field :username, default: -> { "arthurnn#{rand(0..10)}" }
field :title
field :terms, type: Boolean
field :pets, type: Boolean, default: false
field :age, type: Integer, default: "100"
field :dob, type: Date
field :employer_id
field :lunch_time, type: Time
fiel... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | spec/app/models/callback_recorder.rb | Ruby | mit | 19 | master | 514 | class CallbackRecorder < Mongoid::Observer
observe :actor
attr_reader :last_callback, :call_count, :last_record
def initialize
reset
super
end
def reset
@last_callback = nil
@call_count = Hash.new(0)
@last_record = {}
end
Mongoid::Interceptable.observables.each do |callback|
de... |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | spec/app/models/actor_observer.rb | Ruby | mit | 19 | master | 293 | class ActorObserver < Mongoid::Observer
attr_reader :last_after_create_record
def after_create(record)
@last_after_create_record = record
end
def after_custom(record)
record.after_custom_count += 1
end
def before_custom(record)
@after_custom_called = true
end
end |
github | mongoid/mongoid-observers | https://github.com/mongoid/mongoid-observers | spec/generators/mongoid/observer/observer_generator_spec.rb | Ruby | mit | 19 | master | 882 | require "spec_helper"
# Generators are not automatically loaded by Rails
require "generators/mongoid/observer/observer_generator"
describe Mongoid::Generators::ObserverGenerator do
# Tell the generator where to put its output (what it thinks of as Rails.root)
destination File.expand_path("../../../../../spec/tmp"... |
github | Nedomas/databound-rails | https://github.com/Nedomas/databound-rails | databound.gemspec | Ruby | mit | 19 | master | 1,308 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'databound/version'
Gem::Specification.new do |spec|
spec.name = 'databound'
spec.version = Databound::VERSION
spec.authors = ['Domas Bitvinskas']
spec.email =... |
github | Nedomas/databound-rails | https://github.com/Nedomas/databound-rails | spec/spec_helper.rb | Ruby | mit | 19 | master | 1,418 | require 'rubygems'
require 'bundler/setup'
require 'combustion'
Combustion.initialize! :all
require 'rspec/rails'
require 'pry'
RSpec.configure do |config|
config.use_transactional_fixtures = true
end
def javascriptize(ruby_obj)
ruby_obj.each_with_object({}) do |(key, val), obj|
obj[key] = JSON.dump(val)
... |
github | Nedomas/databound-rails | https://github.com/Nedomas/databound-rails | spec/internal/app/controllers/dsl_controller.rb | Ruby | mit | 19 | master | 228 | class DslController < ApplicationController
databound do
model :user
columns :name, :city
dsl(:city, :hottest) { 'Miami' }
dsl(:city, :coldest) do |params|
"Where #{params.name} lives"
end
end
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.