Module: Mmailer::Client
- Included in:
- ErrorHandling, MyCLI
- Defined in:
- lib/mmailer/client.rb
Instance Method Summary collapse
Instance Method Details
#client(cmd, args = nil) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/mmailer/client.rb', line 3 def client(cmd, args=nil) require 'drb/drb' uri = 'druby://localhost:12345' begin obj = DRbObject.new_with_uri(uri) if args obj.send(cmd, args) else obj.send(cmd) end rescue DRb::DRbConnError => e puts e. + "\nIs the server running? (You can start the server with `mmailer server`)" end end |