As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/usr/bin/env ruby | |
# A simple utility to extract patterns out of input streams | |
# | |
# Heavily inspired by: | |
# http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html | |
# https://gist.github.com/jstorimer/1465437 | |
# | |
# Examples: | |
# |
#!/usr/bin/env sh | |
if ! which md5sum > /dev/null; then | |
echo Install md5sum | |
exit 1 | |
fi | |
if ! which curl > /dev/null; then | |
echo Install curl | |
exit 1 |
# 1) Use VCR.use_cassette in your let block. This will use | |
# the cassette just for requests made by creating bar, not | |
# for anything else in your test. | |
let(:foo) { VCR.use_cassette("foo") { create(:bar) } } | |
it "uses foo" do | |
foo | |
end | |
# 2) Wrap the it block that uses #foo in VCR.use_cassette. |
As configured in my dotfiles.
start new:
tmux
start new with session name:
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
module Pluralize | |
module_function | |
def pluralize(string) | |
string = string.dup | |
@plural.each do |pattern, options| | |
string.gsub!(pattern, options[:replace]) | |
end |