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
class Log1Buffer < ::Array | |
for meth in PUBLIC_METHODS = %w(debug info warn error fatal).map(&:to_sym) | |
eval "define_method(:#{meth}){|*a| push [:#{meth}, *a] }" | |
end | |
end | |
1.9.3p194 :062 > buffer.debug "something" | |
=> [[:fatal, "something"]] | |
class Log2Buffer < ::Array |
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
map.resources :users, :except=>[:new, :create] | |
map.resources :users, :only=>[:new,:create], :as => :register | |
# Creates these routes | |
users GET /users(.:format) {:controller=>"users", :action=>"index"} | |
edit_user GET /users/:id/edit(.:format) {:controller=>"users", :action=>"edit"} | |
user GET /users/:id(.:format) {:controller=>"users", :action=>"show"} | |
PUT /users/:id(.:format) {:controller=>"users", :action=>"update"} | |
DELETE /users/:id(.:format) {:controller=>"users", :action=>"destroy"} | |
POST /register(.:format) {:controller=>"users", :action=>"create"} |