Class: Grifork::Config
- Inherits:
-
Object
- Object
- Grifork::Config
- Defined in:
- lib/grifork/config.rb
Defined Under Namespace
Classes: Grifork, Log, Rsync, SSH
Instance Method Summary collapse
- #dry_run? ⇒ Boolean
-
#initialize(args) ⇒ Config
constructor
A new instance of Config.
- #mode ⇒ Object
- #parallel ⇒ Object
-
#rsync_opts ⇒ Array<String>
Build
rsync
command-line options from @rsync and @ssh objects. - #ssh ⇒ Object
Constructor Details
#initialize(args) ⇒ Config
Returns a new instance of Config.
9 10 11 12 13 |
# File 'lib/grifork/config.rb', line 9 def initialize(args) args.each do |key, val| instance_variable_set("@#{key}", val) end end |
Instance Method Details
#dry_run? ⇒ Boolean
23 24 25 |
# File 'lib/grifork/config.rb', line 23 def dry_run? @dry_run ? true : false end |
#mode ⇒ Object
15 16 17 |
# File 'lib/grifork/config.rb', line 15 def mode @mode || :standalone end |
#parallel ⇒ Object
19 20 21 |
# File 'lib/grifork/config.rb', line 19 def parallel @parallel || :in_threads end |
#rsync_opts ⇒ Array<String>
Build rsync
command-line options from @rsync and @ssh objects
35 36 37 38 39 40 41 42 |
# File 'lib/grifork/config.rb', line 35 def rsync_opts @rsync ||= Rsync.new opts = @rsync. if opts.grep(/^(-e|--rsh)$/).size.zero? opts.concat(['--rsh', ssh.command_for_rsync]) end opts end |