six-rsync 0.1.0 → 0.1.2

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.1.0'
15
+ s.version = '0.1.2'
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
@@ -110,7 +110,7 @@ module Six
110
110
  end
111
111
 
112
112
  def update(cmd, x_opts = [], opts = {})
113
- @logger.info "Checking for updates..."
113
+ @logger.debug "Checking for updates..."
114
114
  @config = load_config
115
115
  unless @config
116
116
  @logger.error "Not an Rsync repository!"
@@ -126,9 +126,9 @@ module Six
126
126
 
127
127
  # FIXME: This does not work when not forced, as host is sampled in comparesums :)
128
128
  host = config[:hosts].sample
129
- @logger.info "Trying: #{host}, please wait..."
130
129
 
131
130
  if opts[:force]
131
+ @logger.info "Trying: #{host}, please wait..."
132
132
  arr_opts = []
133
133
  arr_opts << PARAMS
134
134
  arr_opts += x_opts
@@ -232,7 +232,8 @@ module Six
232
232
  @logger.info "Packing #{i}/#{@repos_local[:wd].size}: #{key}"
233
233
  file = File.join(@rsync_work_dir, key)
234
234
  file[REGEX_FOLDER]
235
- folder = $2
235
+ folder = $1
236
+ folder.gsub!(@rsync_work_dir, '')
236
237
  gzip(file)
237
238
  @repos_local[:pack]["#{key}.gz"] = md5("#{file}.gz")
238
239
  FileUtils.mkdir_p pack_path(folder) if folder
@@ -445,11 +446,10 @@ module Six
445
446
  b = false
446
447
  while hosts.size > 0 && !done do
447
448
  # FIXME: Nasty
448
- if b
449
- host = hosts.sample
450
- end
449
+ host = hosts.sample if b
451
450
  b = true
452
451
  hosts -= [host]
452
+ @logger.info "Trying #{host}"
453
453
 
454
454
  begin
455
455
  verbose = @verbose
@@ -466,7 +466,7 @@ module Six
466
466
  end
467
467
  done = true
468
468
  rescue
469
- @logger.info "Failed #{host}, trying next.."
469
+ @logger.info "Failed!"
470
470
  end
471
471
  end
472
472
  # TODO: CLEANUP, Should depricate in time.
@@ -533,6 +533,7 @@ module Six
533
533
  end
534
534
 
535
535
  def calc
536
+ @logger.info "Calculating checksums"
536
537
  [:pack, :wd].each { |t| @repos_local[t] = calc_sums(t) }
537
538
  end
538
539
 
data/lib/six/rsync.rb CHANGED
@@ -28,7 +28,7 @@ module Six
28
28
  end
29
29
 
30
30
  module Rsync
31
- VERSION = '0.0.1'
31
+ VERSION = '0.1.1'
32
32
  BASE_PATH = Dir.pwd
33
33
  TOOLS_PATH = File.join(BASE_PATH, 'tools')
34
34
  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.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sickboy