This file contains 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
route_options = {:controller => 'toys', :action => 'index', :owner_id => 'toy_owner'} | |
# initialize Mapper with the current RouteSet | |
mapper = ActionController::Routing::RouteSet::Mapper.new(ActionController::Routing::Routes) | |
# create a new named_route | |
new_named_route = mapper.named_route('rubber_duck', 'rubber_duck', route_options) | |
# add to current RouteSet | |
ActionController::Routing::Routes.routes.insert(0, new_named_route) |
This file contains 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
{ | |
"bootstrap": { | |
"chef": { | |
"url_type": "http", | |
"init_style": "init", | |
"server_fqdn": "ec2-174-129-61-113.compute-1.amazonaws.com", | |
}, | |
"recipes": "bootstrap::client" | |
} | |
} |
This file contains 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
# Get the latest production tag | |
git tag -l 'production/*' | tail -1 | |
> production/20090610235902 | |
# Create a local production_bugfix branch | |
git branch production_bugfix production/20090610235902 | |
# Checkout or "switch" to the production_bugfix branch | |
git co production_bugfix |
This file contains 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
RecursiveEnumerator.new(self) do |klass| | |
klass.superclass.respond_to?(:foobar) ? klass.superclass : break | |
end |
This file contains 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
dir = File.dirname(__FILE__) | |
require File.expand_path("#{dir}/../../spec/spec_suite") | |
require File.expand_path("#{dir}/../../spec/spec_helpers/firefox_helper") | |
$LOAD_PATH.unshift("#{dir}/../vendor/plugins/screw-unit-server/lib") | |
require "screw_unit" | |
class ScrewUnitSpecSuite < SpecSuite | |
def run | |
header | |
params = {} |