Module: Bombshell::Shell::Commands

Included in:
Bombshell::Shell
Defined in:
lib/bombshell/shell/commands.rb

Overview

Standard commands that show up in all Bombshell shells.

Constant Summary collapse

HIDE =

An explicit list of commands to hide from tab completion.

[:method_missing, :get_binding, :_prompt, :to_s]

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object

Provide an error message for unknown commands rather than raise an exception.



14
15
16
17
# File 'lib/bombshell/shell/commands.rb', line 14

def method_missing(*args)
  return if [:extend, :respond_to?].include? args.first
  puts "Unknown command #{args.first}"
end

Instance Method Details

#quitObject

Exit safely, accounting for the fact that we might be inside a subshell.



9
10
11
# File 'lib/bombshell/shell/commands.rb', line 9

def quit
  throw :IRB_EXIT
end