Created
July 22, 2008 12:38
-
-
Save dramsay/899 to your computer and use it in GitHub Desktop.
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
require 'rubygems' | |
require 'irb/completion' | |
require 'map_by_method' | |
require 'what_methods' | |
require 'pp' | |
IRB.conf[:AUTO_INDENT]=true | |
#require 'wirble' | |
# start wirble (with color) | |
#Wirble.init | |
#Wirble.colorize | |
def Object.method_added(method) | |
return super(method) unless method == :helper | |
(class<<self;self;end).send(:remove_method, :method_added) | |
def helper(*helper_names) | |
returning $helper_proxy ||= Object.new do |helper| | |
helper_names.each { |h| helper.extend "#{h}_helper".classify.constantize } | |
end | |
end | |
helper.instance_variable_set("@controller", ActionController::Integration::Session.new) | |
def helper.method_missing(method, *args, &block) | |
@controller.send(method, *args, &block) if @controller && method.to_s =~ /_path$|_url$/ | |
end | |
helper :application rescue nil | |
end if ENV['RAILS_ENV'] | |
class Object | |
def tap | |
yield self | |
self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment