Class: SimpleWorker::SshWorker
- Inherits:
-
Object
- Object
- SimpleWorker::SshWorker
- Includes:
- AbstractWorker
- Defined in:
- lib/simpleworker/ssh_worker.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#host ⇒ Object
Returns the value of attribute host.
-
#user ⇒ Object
Returns the value of attribute user.
Attributes included from AbstractWorker
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ SshWorker
constructor
A new instance of SshWorker.
Methods included from AbstractWorker
Constructor Details
#initialize ⇒ SshWorker
Returns a new instance of SshWorker.
8 9 10 11 |
# File 'lib/simpleworker/ssh_worker.rb', line 8 def initialize @script = %W[bash #{File.(File.dirname(__FILE__))}/bash/ssh-remoteworker] @env = {} end |
Instance Attribute Details
#directory ⇒ Object
Returns the value of attribute directory.
6 7 8 |
# File 'lib/simpleworker/ssh_worker.rb', line 6 def directory @directory end |
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'lib/simpleworker/ssh_worker.rb', line 6 def host @host end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'lib/simpleworker/ssh_worker.rb', line 6 def user @user end |
Class Method Details
.create(config = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/simpleworker/ssh_worker.rb', line 13 def self.create(config = {}) worker = new worker.script = config['script'] if config.has_key? 'script' worker.cmd = config['cmd'] if config.has_key? 'cmd' worker.user = config['user'] if config.has_key? 'user' worker.host = config['host'] if config.has_key? 'host' worker.directory = config['directory'] if config.has_key? 'directory' worker end |