Darky
yet another shell wrapper....
Syntax
Darky.new do |shell|
shell['/usr/local'] do
shell.exec "pwd"
end
shell.exec "pwd"
shell = shell['/usr/local']
shell.exec "pwd"
shell.chdir "/tmp" do
shell.exec "pwd"
end
shell.exec "pwd"
shell.chdir! "/tmp"
shell.exec "pwd"
end
shell = Darky.new(:dir => '/tmp')
shell.exec "pwd"
obj = shell.async.ln_lrth
obj.on_success { |resp| STDOUT.puts resp.out }
obj.on_failure { |resp| STDOUT.puts response.err }
TODO
- use send method to send commands + think about arguments
- can be included to any class
- support environment variables (sticky or non-sticky)
- support eventmachine
- support threads
- support celluloid.io
- support threads
- support callbacks success, failure, or just .callback
- exec without fork
- support sudo prompt
- exceptions - failure, permission denied
- internal / external logger
- logger should support filters, like ignore /shuki.*/
- open4/3
- timeout + handler
- kill when using proxy object
- save the state when using custom client
- can be included into class - to describe a service