six-rsync 0.4.12 → 0.4.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/lib/six/rsync/lib.rb +13 -12
  3. data/lib/six/rsync.rb +1 -1
  4. metadata +3 -3
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.4.12'
15
+ s.version = '0.4.13'
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
@@ -135,14 +135,14 @@ module Six
135
135
  arr_opts << "-I" if opts[:force]
136
136
  begin
137
137
  update('', arr_opts)
138
- rescue RsyncError
139
- @logger.error "Unable to sucessfully update, aborting..."
140
- @logger.debug "#{$!}"
138
+ rescue RsyncError => e
139
+ @logger.error "Unable to sucessfully update, aborting... (#{e.class}: #{e.message})"
140
+ @logger.debug e.backtrace.join("\n")
141
141
  FileUtils.rm_rf @rsync_work_dir if File.exists?(@rsync_work_dir)
142
142
  end
143
- rescue RsyncError
144
- @logger.error "Unable to initialize"
145
- @logger.debug "#{$!}"
143
+ rescue RsyncError => e
144
+ @logger.error "Unable to initialize (#{e.class}: #{e.message})"
145
+ @logger.debug e.backtrace.join("\n")
146
146
  end
147
147
 
148
148
  opts[:bare] ? {:repository => @rsync_work_dir} : {:working_directory => @rsync_work_dir}
@@ -178,7 +178,6 @@ module Six
178
178
  b = true
179
179
  hosts -= [host]
180
180
  @logger.info "Trying #{host}"
181
-
182
181
  begin
183
182
  arr_opts = []
184
183
  arr_opts << PARAMS
@@ -192,8 +191,9 @@ module Six
192
191
  calc
193
192
  save_repos
194
193
  done = true
195
- rescue
196
- @logger.debug "#{$!}"
194
+ rescue => e
195
+ @logger.warn "#{e.class}: #{e.message}"
196
+ @logger.debug e.backtrace.join("\n")
197
197
  end
198
198
  end
199
199
  @verbose = verbose
@@ -505,8 +505,9 @@ module Six
505
505
  raise RsyncError
506
506
  end
507
507
  done = true
508
- rescue
509
- @logger.debug "#{$!}"
508
+ rescue => e
509
+ @logger.warn "#{e.class}: #{e.message}"
510
+ @logger.debug e.backtrace.join("\n")
510
511
  ensure
511
512
  FileUtils.rm(rsync_path(".repository-pack.yml"))
512
513
  end
@@ -790,7 +791,7 @@ module Six
790
791
  end
791
792
 
792
793
  out[/rsync error: .* \(code ([0-9]*)\)/]
793
- status = $1 ? $1 : 0
794
+ status = $1 ? $1.to_i : 0
794
795
 
795
796
  if status > 0
796
797
  return '' if status == 1 && out == ''
data/lib/six/rsync.rb CHANGED
@@ -31,7 +31,7 @@ module Six
31
31
 
32
32
  module Rsync
33
33
  COMPONENT = 'six-rsync'
34
- VERSION = '0.4.12'
34
+ VERSION = '0.4.13'
35
35
  FOLDER = /(.*)\/(.*)/
36
36
 
37
37
  case RUBY_PLATFORM
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 12
9
- version: 0.4.12
8
+ - 13
9
+ version: 0.4.13
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-24 00:00:00 +02:00
17
+ date: 2010-04-27 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency