Skip to content

Instantly share code, notes, and snippets.

@hotchpotch
Created July 26, 2008 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotchpotch/2612 to your computer and use it in GitHub Desktop.
Save hotchpotch/2612 to your computer and use it in GitHub Desktop.
begin
require 'rubygems'
require 'readline/history/restore/auto_save'
Readline::History::Restore::AutoSave.scriptname
#require 'active_support'
rescue Exception
end
module Kernel
def r(arg)
puts `refe #{arg}`
end
private :r
end
class Module
def r(meth = nil)
if meth
if instance_methods(false).include? meth.to_s
puts `refe #{self}##{meth}`
else
super
end
else
puts `refe #{self}`
end
end
end
#module Kernel
# def lg(*args)
# Gem::IrbCompletion.get_instance.gem *args
# end
#end
#
#module Gem
# class IrbCompletion
# def initialize
# puts 'new!'
# IrbCompletion.instance_methods.each do |m|
# next if %w|__send__ __id__ object_id gem|.include? m.to_s
# IrbCompletion.module_eval { undef_method m }
# end
#
# Gem.source_index.to_a.map{|a| a.last.name}.each do |name|
# IrbCompletion.module_eval {
# define_method(name, IrbCompletion.instance_method(:gem))
# }
# end
# end
#
# def gem(gem_name, *version_requirements)
# puts '!!'
# end
# def self.get_instance
# @@instance ||= self.new
# end
# end
#end
IRB.conf[:PROMPT_MODE] = :SIMPLE
require 'irb/completion'
#require 'irb-history'
IRB.conf[:AUTO_INDENT] = true
##IRB.conf[:SAVE_HISTORY] = 100000
IRB.conf[:EVAL_HISTORY] = 16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment