Class: RsyncCron::Options
- Inherits:
-
Object
- Object
- RsyncCron::Options
- Defined in:
- lib/rsync_cron/options.rb
Constant Summary collapse
- BW_LIMIT =
5*1024
- DEFAULT_FLAGS =
%W[verbose archive compress rsh=ssh bwlimit=#{BW_LIMIT} exclude='DfsrPrivate']
Instance Method Summary collapse
- #<<(flags) ⇒ Object
-
#initialize(flags = DEFAULT_FLAGS) ⇒ Options
constructor
A new instance of Options.
- #to_s ⇒ Object
Constructor Details
#initialize(flags = DEFAULT_FLAGS) ⇒ Options
Returns a new instance of Options.
6 7 8 |
# File 'lib/rsync_cron/options.rb', line 6 def initialize(flags = DEFAULT_FLAGS) @flags = Array(flags.dup) end |
Instance Method Details
#<<(flags) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/rsync_cron/options.rb', line 15 def <<(flags) flags.split(",").each do |flag| @flags << flag if supported?(flag) end self end |
#to_s ⇒ Object
10 11 12 13 |
# File 'lib/rsync_cron/options.rb', line 10 def to_s return if @flags.empty? @flags.map { |flag| "--#{flag}" }.join(" ") end |