Module: Bombshell

Defined in:
lib/bombshell.rb,
lib/bombshell/shell.rb,
lib/bombshell/version.rb,
lib/bombshell/completor.rb,
lib/bombshell/environment.rb,
lib/bombshell/shell/commands.rb

Overview

Bombshell enables the lickety-split creation of interactive consoles (really just boring old custom IRB sessions). As a Ruby library developer, you may want to build a little shell into your library so that other developers can play around with it before adding it to their applications. In the past this has been a real PITA. With Bombshell it's a little easier.

Defined Under Namespace

Modules: Shell Classes: Completor, Environment

Constant Summary

VERSION =

Used by Bueller

"0.1.6"

Class Method Summary collapse

Class Method Details

.launch(shell) ⇒ Object

Launch a shell. This is typically called from a “gem binary” executable Ruby script as described in the README.

Parameters:

  • shell (Class)

    The shell class to launch. Must include Bombshell::Shell.



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/bombshell.rb', line 17

def launch(shell)
  begin
    failure = shell.launch(ARGV.dup)
    Kernel.exit(failure ? 1 : 0)
  rescue SystemExit => e
    Kernel.exit(e.status)
  rescue Exception => e
    STDERR.puts("#{e.message} (#{e.class})")
    STDERR.puts(e.backtrace.join("\n"))
    Kernel.exit(1)
  end
end