Dir[File.join(File.dirname(__FILE__), "irb_hacks/**/*.rb")].each {|fn| require fn}
# Yet another set of IRB hacks.
#
# Summary of features brought to IRB:
#
# * a and ae methods to invoke or edit code snippets.
# * less method to interactively dump data with OS pager program (e.g. less).
# * IrbHacks::break to instantly return value from code into IRB.
module IrbHacks #:doc:
# Break execution, instantly return a value if caller is invoked from a snippet.
#
# def myfunc
# puts "Reading name..."
# name = File.read(...)
# IrbHacks.break name # Pass what's been read back to console.
#
# ...
# end
#
# irb> ae
# snippet>> myfunc
# irb> a
# Reading name...
# => "John Smith"
def self.break(value = nil)
raise BreakException.new(:value => value)
end
# Access configuration object. See IrbHacks::Config.
#
# IrbHacks.conf
# IrbHacks.conf.snippet_history_size = 200
def self.conf
@conf ||= Config.new
end
end