Class: Ronin::DB::CLI::Commands::Irb Private
- Inherits:
-
DatabaseCommand
- Object
- Core::CLI::Command
- Ronin::DB::CLI::Command
- DatabaseCommand
- Ronin::DB::CLI::Commands::Irb
- Defined in:
- lib/ronin/db/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.
Connects to a database and start an interactive Ruby shell.
Usage
ronin-db irb [options]
Options
--db NAME The database to connect to (Default: default)
--db-uri URI The database URI to connect to
--no-connect Do not connect to a database on startup
-h, --help Print help information
Constant Summary
Constants included from URIMethods
Instance Method Summary collapse
-
#load_models ⇒ Object
private
Loads all models.
-
#run ⇒ Object
private
Starts the
ronin-db irb
command. - #set_logger ⇒ Object private
Methods inherited from DatabaseCommand
Methods included from URIMethods
#normalize_adapter, #normalize_sqlite3_path, #parse_uri
Instance Method Details
#load_models ⇒ 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.
Loads all models.
72 73 74 75 |
# File 'lib/ronin/db/cli/commands/irb.rb', line 72 def load_models require 'ronin/db/models' Ronin::DB::Models.connect end |
#run ⇒ 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.
Starts the ronin-db irb
command.
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ronin/db/cli/commands/irb.rb', line 53 def run unless [:no_connect] connect load_models end set_logger CLI::RubyShell.start end |
#set_logger ⇒ 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.
64 65 66 67 |
# File 'lib/ronin/db/cli/commands/irb.rb', line 64 def set_logger require 'logger' DB.logger = Logger.new(stderr,:debug) end |