Class: Ronin::CLI::Commands::Irb Private
- Inherits:
-
Ronin::CLI::Command
- Object
- Core::CLI::Command
- Ronin::CLI::Command
- Ronin::CLI::Commands::Irb
- Defined in:
- lib/ronin/cli/commands/irb.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Starts ronin's interactive Ruby shell.
Usage
ronin irb []
Options
-I, --include DIR Directory to add to $LOAD_PATH
-r, --require PATH Ruby files to require
-h, --help Print help information
Instance Attribute Summary collapse
-
#include_dirs ⇒ Array<String>
readonly
private
The additional directories to add to
$LOAD_PATH
. -
#require_paths ⇒ Array<String>
readonly
private
The additional paths to require before starting the Ruby shell.
Instance Method Summary collapse
-
#initialize(include_dirs: [], require_paths: [], **kwargs) ⇒ Irb
constructor
private
Initializes the Irb command.
-
#run(*argv) ⇒ Object
private
Runs the
ronin irb
command.
Constructor Details
#initialize(include_dirs: [], require_paths: [], **kwargs) ⇒ Irb
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the Ronin::CLI::Commands::Irb command.
81 82 83 84 85 86 |
# File 'lib/ronin/cli/commands/irb.rb', line 81 def initialize(include_dirs: [], require_paths: [], **kwargs) super(**kwargs) @include_dirs = include_dirs @require_paths = require_paths end |
Instance Attribute Details
#include_dirs ⇒ Array<String> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The additional directories to add to $LOAD_PATH
.
65 66 67 |
# File 'lib/ronin/cli/commands/irb.rb', line 65 def include_dirs @include_dirs end |
#require_paths ⇒ Array<String> (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The additional paths to require before starting the Ruby shell.
70 71 72 |
# File 'lib/ronin/cli/commands/irb.rb', line 70 def require_paths @require_paths end |
Instance Method Details
#run(*argv) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Runs the ronin irb
command.
91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/ronin/cli/commands/irb.rb', line 91 def run(*argv) @include_dirs.each do |dir| $LOAD_PATH.unshift(dir) end @require_paths.each do |path| require(path) end require 'ronin' RubyShell.start end |