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.
201 202 203 204 205 |
# File 'lib/groonga/client/command-line/groonga-client.rb', line 201 def initialize(runner) @runner = runner @history_path = guess_history_path read_history end |
Instance Method Details
#run ⇒ Object
207 208 209 210 211 212 213 214 215 |
# File 'lib/groonga/client/command-line/groonga-client.rb', line 207 def run loop do line = Readline.readline("> ", true) break if line.nil? add_history(line) @runner << line @runner << "\n" end end |