Class: Groonga::Client::CommandLine::GroongaClient::ReadlineREPL
- Inherits:
-
Object
- Object
- Groonga::Client::CommandLine::GroongaClient::ReadlineREPL
- Defined in:
- lib/groonga/client/command-line/groonga-client.rb
Instance Method Summary collapse
-
#initialize(runner) ⇒ ReadlineREPL
constructor
A new instance of ReadlineREPL.
- #run ⇒ Object
Constructor Details
#initialize(runner) ⇒ ReadlineREPL
Returns a new instance of ReadlineREPL.
379 380 381 382 383 |
# File 'lib/groonga/client/command-line/groonga-client.rb', line 379 def initialize(runner) @runner = runner @history_path = guess_history_path read_history end |
Instance Method Details
#run ⇒ Object
385 386 387 388 389 390 391 392 393 |
# File 'lib/groonga/client/command-line/groonga-client.rb', line 385 def run loop do line = Readline.readline("> ", true) break if line.nil? add_history(line) @runner << line @runner << "\n" end end |