Class: Grifork::Config::SSH
- Inherits:
-
Object
- Object
- Grifork::Config::SSH
- Defined in:
- lib/grifork/config.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#command_for_rsync ⇒ String
Build
ssh
command with options. -
#initialize(opts = {}) ⇒ SSH
constructor
A new instance of SSH.
Constructor Details
#initialize(opts = {}) ⇒ SSH
Returns a new instance of SSH.
55 56 57 |
# File 'lib/grifork/config.rb', line 55 def initialize(opts = {}) @options = opts end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
54 55 56 |
# File 'lib/grifork/config.rb', line 54 def @options end |
Instance Method Details
#command_for_rsync ⇒ String
Build ssh
command with options
61 62 63 64 65 66 67 68 69 |
# File 'lib/grifork/config.rb', line 61 def command_for_rsync args = [] args << "-l #{@options[:user]}" if @options[:user] args << "-p #{@options[:port]}" if @options[:port] if @options[:keys] @options[:keys].each { |key| args << "-i #{key}" } end "ssh #{args.join(' ')}" end |