class Ronin::CLI::Commands::Irb

Starts ronin’s interactive Ruby shell.

## Usage

ronin irb [options]

## Options

-I, --include DIR                Directory to add to $LOAD_PATH
-r, --require PATH               Ruby files to require
-h, --help                       Print help information

Attributes

include_dirs[R]

The additional directories to add to ‘$LOAD_PATH`.

@return [Array<String>]

require_paths[R]

The additional paths to require before starting the Ruby shell.

@return [Array<String>]

Public Class Methods

new(include_dirs: [], require_paths: [], **kwargs) click to toggle source

Initializes the {Irb} command.

@param [Array<String>] include_dirs

Optional Array of directories to add to `$LOAD_PATH`.

@param [Array<String>] require_paths

Optional Array of paths to require before starting the Ruby shell.
Calls superclass method
# 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

Public Instance Methods

run(*argv) click to toggle source

Runs the ‘ronin irb` command.

# 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