Sha256: 3d8edc0a27e7eb192c4c93ae4ba3d151fa77a99ef1cca9345abda8fc1bd06f6a

Contents?: true

Size: 927 Bytes

Versions: 1

Compression:

Stored size: 927 Bytes

Contents

# usage: tap console [options]
#
# Opens up an IRB session with the Tap environment initialized as specified
# in tap.yml. Access a Tap::App instance through 'app' and the execution
# environment through 'env'.  For example:
#
#   % tap console
#   >> app.env[:dump]
#   => Tap::Tasks::Dump
#   >> app.info
#   => "state: 0 (READY) queue: 0"
#   >> 
#

ConfigParser.new do |opts|
  opts.separator ""
  opts.separator "options:"

  opts.on("-h", "--help", "Show this message") do
    puts Lazydoc.usage(__FILE__)
    puts opts
    exit
  end
end.parse!(ARGV)

require "irb"

def app
  @app ||= Tap::App.instance
end

IRB.start

# Handles a bug in IRB that causes exit to throw :IRB_EXIT
# and consequentially make a warning message, even on a 
# clean exit.  This module resets exit to the original 
# aliased method.
module CleanExit # :nodoc:
  def exit(ret = 0)
    __exit__(ret)
  end
end
IRB.CurrentContext.extend CleanExit

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tap-0.19.0 cmd/console.rb