This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin | |
bundle | |
.bundle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
185) Operations page | |
Failure/Error: let(:admin) { create(:admin) } | |
ActiveRecord::StatementInvalid: | |
PG::Error: ERROR: relation "admins" does not exist | |
LINE 5: WHERE a.attrelid = '"admins"'::regclass | |
^ | |
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), | |
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod | |
FROM pg_attribute a LEFT JOIN pg_attrdef d | |
ON a.attrelid = d.adrelid AND a.attnum = d.adnum |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rspec/exit_matchers/version" | |
# expect { exit(1) }.to exit_with_status(1) | |
module RSpec | |
module ExitMatchers | |
class ExitWithStatus | |
def initialize(expected_status) | |
@expected_status = expected_status | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A sample Gemfile | |
source "https://rubygems.org" | |
gem 'celluloid' | |
gem 'rspec' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cancel_all_failed_jobs(redis) | |
qless = Qless::Client.new(redis: redis) | |
qless.jobs.failed.each do |key, count| | |
puts "#{key}: #{count}" | |
while (jobs = qless.jobs.failed(key, 0, 1000).fetch("jobs")).any? | |
qless.bulk_cancel(jobs.map(&:jid)) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts RUBY_DESCRIPTION | |
class SuperClass | |
def foo | |
"foo" | |
end | |
end | |
class SubClass < SuperClass | |
def foo(arg) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "sequel" | |
# Connect to the DB to make sequel happy. It expects a DB connection when you subclass Sequel::Model | |
DB = Sequel.sqlite | |
# Use the module to avoid naming collisions with other specs. | |
module LearnSequelModelSpec | |
# Where can I safely declare this class without specifying | |
# the database for it?! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sequel/model' | |
Sequel.extension :arbitrary_servers, :server_block | |
non_sharded = Sequel.connect \ | |
adapter: 'mysql2', | |
host: "localhost", | |
database: "vanguard_non_sharded", | |
user: 'root', | |
password: nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run options: include {:focus=>true} | |
All examples were filtered out; ignoring {:focus=>true} | |
Using built in matchers from custom ones | |
fails when the word does not end with the given letter (FAILED - 1) | |
fails when the word does not start with the given letter (FAILED - 2) | |
can match properly | |
Failures: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./script.sh | |
+ rm -rf ./tmp/repro-bundle-standalone-load-path-failure | |
+ mkdir -p ./tmp/repro-bundle-standalone-load-path-failure | |
+ cd ./tmp/repro-bundle-standalone-load-path-failure | |
+ bundle env | |
Bundler 1.6.2 | |
Ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin12.4.0] | |
Rubygems 2.0.3 | |
GEM_HOME /Users/myron/.gem/ruby/1.8.7 | |
GEM_PATH /Users/myron/.gem/ruby/1.8.7:/Users/myron/.rubies/ruby-1.8.7-p374/lib/ruby/gems/1.8 |