lib/fulmar/infrastructure/service/transfer/rsync.rb in fulmar-1.8.8 vs lib/fulmar/infrastructure/service/transfer/rsync.rb in fulmar-1.8.9

- old
+ new

@@ -62,13 +62,19 @@ path = Pathname.new(path) return Pathname.new(@config.base_path) + path unless path.absolute? path end + def rsync_excludes + return nil unless @config[:rsync][:exclude] + excludes = [*@config[:rsync][:exclude]] + excludes.map { |exclude| "--exclude='#{exclude}'" }.join(' ') + end + # Assembles all rsync command line parameters from the configuration options def rsync_command_options options = ['-rl'] - options << "--exclude='#{@config[:rsync][:exclude]}'" if @config[:rsync][:exclude] + options << rsync_excludes if rsync_excludes options << "--exclude-from='#{@config[:rsync][:exclude_file]}'" if @config[:rsync][:exclude_file] options << "--owner --group --chown='#{@config[:rsync][:chown]}'" if @config[:rsync][:chown] options << "--chmod='#{@config[:rsync][:chmod]}'" if @config[:rsync][:chmod] options << '--delete' if @config[:rsync][:delete] options