Class: Roger::Release::Finalizers::Rsync
- Defined in:
- lib/roger/release/finalizers/rsync.rb
Overview
Finalizes the release by uploading your mockup with rsync to a remote server
Instance Method Summary collapse
- #call(release, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Rsync
constructor
A new instance of Rsync.
Constructor Details
#initialize(options = {}) ⇒ Rsync
Returns a new instance of Rsync.
17 18 19 20 21 22 23 24 25 |
# File 'lib/roger/release/finalizers/rsync.rb', line 17 def initialize( = {}) @options = { rsync: "rsync", remote_path: "", host: nil, username: nil, ask: true }.update() end |
Instance Method Details
#call(release, options = {}) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/roger/release/finalizers/rsync.rb', line 27 def call(release, = {}) = @options.dup.update() # Validate options (release, ) return unless prompt_for_upload() check_rsync_command([:rsync]) local_path = release.build_path.to_s remote_path = [:remote_path] local_path += "/" unless local_path =~ %r{/\Z} remote_path += "/" unless remote_path =~ %r{/\Z} release.log(self, "Starting upload of #{(release.build_path + '*')} to #{[:host]}") rsync([:rsync], local_path, remote_path, ) end |