Class: Relaxo::QueryServer::DebugShell

Inherits:
Object
  • Object
show all
Defined in:
lib/relaxo/query_server/shell.rb

Instance Method Summary collapse

Constructor Details

#initialize(log, wrapper) ⇒ DebugShell

Returns a new instance of DebugShell.



64
65
66
67
# File 'lib/relaxo/query_server/shell.rb', line 64

def initialize(log, wrapper)
	@log = log
	@wrapper = wrapper
end

Instance Method Details

#runObject

Read commands from input, execute them and then write out the results.



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/relaxo/query_server/shell.rb', line 70

def run
	@wrapper.run do |command|
		@log.puts "-> #{command.inspect}"
		
		result = yield command
		
		@log.puts "<- #{result.inspect}"
		
		next result
	end
end