six-rsync 0.3.2 → 0.3.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.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/lib/six/rsync/lib.rb +27 -9
  3. data/lib/six/rsync.rb +1 -1
  4. metadata +2 -2
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.3.2'
15
+ s.version = '0.3.3'
16
16
  s.has_rdoc = true
17
17
  s.extra_rdoc_files = ['README', 'LICENSE']
18
18
  s.summary = 'Your summary here'
data/lib/six/rsync/lib.rb CHANGED
@@ -418,8 +418,8 @@ module Six
418
418
  hosts -= [host]
419
419
  begin
420
420
  # TODO: Progress bar
421
- if mismatch.count > (@repos_remote[typ].count / 2)
422
- @logger.info "Many files mismatched (#{mismatch.count}), running full update on .pack folder"
421
+ if mismatch.size > (@repos_remote[typ].size / 2)
422
+ @logger.info "Many files mismatched (#{mismatch.size}), running full update on .pack folder"
423
423
  arr_opts = []
424
424
  arr_opts << PARAMS
425
425
  if host[/\A(\w)*\@/]
@@ -793,16 +793,33 @@ module Six
793
793
  #puts rsync_cmd
794
794
  s = nil
795
795
  out = ''
796
- $stdout.sync = true # Seems to fix C:/Packaging/six-updater/NEW - Copy/ruby/lib/ruby/gems/1.9.1/gems/log4r-1.0.5/lib/log4r/outputter/iooutputter.rb:43:in `flush': Broken pipe (Errno::EPIPE)
796
+ #$stdout.sync = true # Seems to fix C:/Packaging/six-updater/NEW - Copy/ruby/lib/ruby/gems/1.9.1/gems/log4r-1.0.5/lib/log4r/outputter/iooutputter.rb:43:in `flush': Broken pipe (Errno::EPIPE)
797
797
 
798
798
  # Simpler method but on windows the !? exitstatus is not working properly..
799
799
  # Does nicely display error output in logwindow though
800
- #io = IO.popen(rsync_cmd)
801
- #io.sync = true
802
- #io.each do |buffer|
803
- # process_msg buffer
804
- # out << buffer
805
- #end
800
+ io = IO.popen(rsync_cmd)
801
+ io.sync = true
802
+ io.each do |buffer|
803
+ process_msg buffer
804
+ out << buffer
805
+ end
806
+ status = 0
807
+ if out.to_s[/rsync error: .* \(code ([0-9]*)\)/]
808
+ status = $1.to_s.to_i
809
+ end
810
+ #puts "Status: #{status} Exitstatus: #{$?.exitstatus}"
811
+ if status > 0
812
+ if status == 1 && out == ''
813
+ return ''
814
+ end
815
+ if out.to_s =~ /max connections \((.*)\) reached/
816
+ @logger.warn "Server reached maximum connections."
817
+ end
818
+ raise Rsync::RsyncExecuteError.new(rsync_cmd + ':' + out.to_s)
819
+ end
820
+
821
+ =begin
822
+ #`#{rsync_cmd}`.chomp
806
823
  status = Open3.popen3(rsync_cmd) { |io_in, io_out, io_err, waitth|
807
824
  io_out.sync = true
808
825
  io_err.sync = true
@@ -837,6 +854,7 @@ module Six
837
854
  end
838
855
  raise Rsync::RsyncExecuteError.new(rsync_cmd + ':' + out.to_s)
839
856
  end
857
+ =end
840
858
  status
841
859
  end
842
860
 
data/lib/six/rsync.rb CHANGED
@@ -30,7 +30,7 @@ module Six
30
30
  end
31
31
 
32
32
  module Rsync
33
- VERSION = '0.3.2'
33
+ VERSION = '0.3.3'
34
34
  TOOLS_PATH = File.join(BASE_PATH, 'tools')
35
35
 
36
36
  FOLDER = /(.*)\/(.*)/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: six-rsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sickboy
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-26 00:00:00 +01:00
12
+ date: 2009-12-28 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15