Sha256: 9a32c0dfdc2df9f7ca8d4af795974355341b9dd55691c3c3dadfba048866c932

Contents?: true

Size: 479 Bytes

Versions: 7

Compression:

Stored size: 479 Bytes

Contents

module Rsync
  # An rsync command to be run
  class Command
    # Runs the rsync job and returns the results
    #
    # @param args {Array}
    # @return {Result}
    def self.run(*args)
      output = run_command("rsync --itemize-changes #{args.join(" ")}")
      Result.new(output, $?.exitstatus)
    end

private

    def self.run_command(cmd, &block)
      if block_given?
        IO.popen("#{cmd} 2>&1", &block)
      else
        `#{cmd} 2>&1`
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rsync-1.0.9 lib/rsync/command.rb
rsync-1.0.8 lib/rsync/command.rb
rsync-1.0.7 lib/rsync/command.rb
rsync-0.0.6 lib/rsync/command.rb
rsync-0.0.5 lib/rsync/command.rb
rsync-0.0.4 lib/rsync/command.rb
rsync-0.0.3 lib/rsync/command.rb