Class: Ronin::DB::CLI::Commands::Irb Private
- Inherits:
-
Ronin::DB::CLI::Command
- Object
- Core::CLI::Command
- Ronin::DB::CLI::Command
- Ronin::DB::CLI::Commands::Irb
- Includes:
- DatabaseOptions
- 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
--db-file PATH The sqlite3 database file to use
--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 included from DatabaseOptions
#db_config, #db_connect, included
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.
76 77 78 79 |
# File 'lib/ronin/db/cli/commands/irb.rb', line 76 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.
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/ronin/db/cli/commands/irb.rb', line 57 def run unless [:no_connect] db_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.
68 69 70 71 |
# File 'lib/ronin/db/cli/commands/irb.rb', line 68 def set_logger require 'logger' DB.logger = Logger.new(stderr,:debug) end |