Skip to content

Instantly share code, notes, and snippets.

@dramsay
Created July 22, 2008 12:38
Show Gist options
  • Save dramsay/899 to your computer and use it in GitHub Desktop.
Save dramsay/899 to your computer and use it in GitHub Desktop.
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