six-rsync 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rake/testtask'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'six-rsync'
15
- s.version = '0.5.1'
15
+ s.version = '0.5.3'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
@@ -10,8 +10,8 @@ rescue => e
10
10
  path = File.join(Six::Repositories::Rsync::DATA_PATH, 'logs')
11
11
  FileUtils.mkdir_p path unless File.exists?(path)
12
12
  File.open(File.join(path, "six-rsync-error.log"), 'w') {|f| f.puts e.class, e.message, e.backtrace.join("\n")}
13
- rescue
14
- puts "ERROR: #{$!}"
13
+ rescue => e
14
+ puts "ERROR: #{e.class} #{e.message} #{e.backtrace.join("\n")}"
15
15
  end
16
16
  sleep 10
17
17
  end
@@ -10,8 +10,8 @@ rescue => e
10
10
  path = File.join(Six::Repositories::Rsync::DATA_PATH, 'logs')
11
11
  FileUtils.mkdir_p path unless File.exists?(path)
12
12
  File.open(File.join(path, "six-rsync-error.log"), 'w') {|f| f.puts e.class, e.message, e.backtrace.join("\n")}
13
- rescue
14
- puts "ERROR: #{$!}"
13
+ rescue => e
14
+ puts "ERROR: #{e.class} #{e.message} #{e.backtrace.join("\n")}"
15
15
  end
16
16
  sleep 10
17
17
  end
@@ -31,7 +31,7 @@ module Six
31
31
 
32
32
  module Rsync
33
33
  COMPONENT = 'six-rsync'
34
- VERSION = '0.5.1'
34
+ VERSION = '0.5.3'
35
35
  FOLDER = /(.*)\/(.*)/
36
36
 
37
37
  case RUBY_PLATFORM
@@ -351,10 +351,10 @@ module Six
351
351
  @verbose = false
352
352
  begin
353
353
  fetch_file(verfile_srv, host)
354
- rescue
354
+ rescue => e
355
355
  # FIXME: Should never assume that :)
356
356
  @logger.warn "Unable to retrieve version file from server, repository probably doesnt exist!"
357
- @logger.debug "#{$!}"
357
+ @logger.debug "ERROR: #{e.class} #{e.message} #{e.backtrace.join("\n")}"
358
358
  # raise RsyncExecuteError
359
359
  end
360
360
  @verbose = verbose
@@ -474,9 +474,9 @@ module Six
474
474
  command('', arr_opts)
475
475
  end
476
476
  done = true
477
- rescue
477
+ rescue => e
478
478
  @logger.warn "Failure"
479
- @logger.debug "#{$!}"
479
+ @logger.debug "ERROR: #{e.class} #{e.message} #{e.backtrace.join("\n")}"
480
480
  ensure
481
481
  FileUtils.rm_f slist if slist
482
482
  end
@@ -811,6 +811,8 @@ module Six
811
811
  # Does nicely display error output in logwindow though
812
812
  io = IO.popen(rsync_cmd)
813
813
  io.sync = true
814
+ oldsync = STDOUT.sync
815
+ STDOUT.sync = true
814
816
 
815
817
  #io.each do |buffer|
816
818
  # process_msg buffer
@@ -847,6 +849,8 @@ module Six
847
849
  raise Rsync::RsyncExecuteError.new(rsync_cmd + ':' + out)
848
850
  end
849
851
 
852
+ STDOUT.sync = false unless STDOUT.sync == oldsync
853
+
850
854
  status
851
855
  end
852
856
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 1
9
- version: 0.5.1
8
+ - 3
9
+ version: 0.5.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sickboy
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-28 00:00:00 +02:00
17
+ date: 2010-05-01 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency