If the namespace is not used then the commands will perform on top of the default database.
bundle exec rake db:create
bundle exec rake db:migrate
By using the namespace we are going to use all the configuration for our alternate DB.
# Capistrano 2 | |
before "deploy", "friday:good_luck" | |
namespace :friday do | |
friday_jumper = %{ | |
┓┏┓┏┓┃ | |
┛┗┛┗┛┃⟍ ○⟋ | |
┓┏┓┏┓┃ ∕ Friday | |
┛┗┛┗┛┃ノ) |
# HACK to enable using protected methods from Rails 4.2 and initial states as default attributes for ActiveRecord | |
module StateMachine | |
module Integrations | |
module ActiveModel | |
public :around_validation | |
end | |
module ActiveRecord | |
public :around_save |
# config/initializers/hacks.rb | |
Dir[Rails.root.join("lib/hacks/**/*.rb")].each { |file| require file } |
def deep_merge(hash1, hash2) | |
result = hash1.dup | |
hash2.keys.each do |key| | |
if hash2[key].is_a?(Hash) && hash1[key].is_a?(Hash) | |
result[key] = deep_merge(hash1[key], hash2[key]) | |
else | |
result[key] = hash2[key] | |
end | |
end |
require "timeout" | |
module WaitSteps | |
extend RSpec::Matchers::DSL | |
matcher :become_true do | |
match do |block| | |
begin | |
Timeout.timeout(Capybara.default_wait_time) do | |
sleep(0.1) until value = block.call |
def nested_symbolize_keys(thing) | |
case thing | |
when Array | |
thing.map { |value| nested_symbolize_keys(value) } | |
when Hash | |
Hash[thing.map { |key, value| [key.to_sym, nested_symbolize_keys(value)] }] | |
else | |
thing | |
end | |
end |
ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
RSpec.configure do |config| | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before(:each) do | |
DatabaseCleaner.strategy = :transaction | |
end | |
config.before(:each, js: true) do |
Why Should I Care (For Developers)
"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."