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