s3_meta_sync 0.4.2 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ceaef9f69b6086aa41a91dcace544edd6854d81
4
- data.tar.gz: aae6b965be96ecb24486b3ff49daef5146fa8b0a
3
+ metadata.gz: 0452dfe946a8a1e9c79d516b1755435c6c46cdeb
4
+ data.tar.gz: fb29c38c0508f48a69a505fed4c14d9a2b382579
5
5
  SHA512:
6
- metadata.gz: 210869b7b243c91ef66750024edabff48643e03bf0fa487baa3345957ca33cceac43feb965dd2339019f9f4c718c6bea3144f368b51911b1e8095c242f2e0228
7
- data.tar.gz: dc0c3e89c49f7b58cc78d45079a6f50e73ac8651619867c1e4ef8a1ad673a21e9c6f896a2a3d6fc8ba64414c41f0855025bb92e1230deffa324db97b014342bd
6
+ metadata.gz: 974de199c5fc3ea6c2f94972a9353f3613eadb51c054a0d067848c47721237d528a134532ec534fee1cfed7c6023f2251b1745cdfc9f3663e16268691ed5a804
7
+ data.tar.gz: 5d0e8eeb264463f5a551143efb0675044896742886072074565c7385b4723aed7a6b2cbd80d2644e507abe5d19cc4d30dd5ddb1114c4f8eeefb1b28898974e8f
checksums.yaml.gz.sig CHANGED
Binary file
@@ -43,8 +43,7 @@ module S3MetaSync
43
43
  log "Remote has no .s3-meta-sync, uploading everything", true
44
44
  {files: {}}
45
45
  end
46
- generate_meta(source)
47
- local_files = read_meta(source)[:files]
46
+ local_files = generate_meta(source)[:files]
48
47
  remote_files = remote_meta[:files]
49
48
  upload = if @config[:zip] == remote_meta[:zip]
50
49
  local_files.select { |path, md5| remote_files[path] != md5 || corrupted.include?(path) }
@@ -62,7 +61,8 @@ module S3MetaSync
62
61
  def download(source, destination)
63
62
  raise if @config[:zip]
64
63
  remote_meta = download_meta(source)
65
- local_files = meta_data(destination)[:files]
64
+ local_files = ((@config[:no_local_changes] && read_meta(destination)) || meta_data(destination))[:files]
65
+
66
66
  download = remote_meta[:files].select { |path, md5| local_files[path] != md5 }.map(&:first)
67
67
  delete = local_files.keys - remote_meta[:files].keys
68
68
 
@@ -167,6 +167,7 @@ module S3MetaSync
167
167
  file = "#{source}/#{META_FILE}"
168
168
  FileUtils.mkdir_p(File.dirname(file))
169
169
  File.write(file, meta.to_yaml)
170
+ meta
170
171
  end
171
172
 
172
173
  def meta_data(source)
@@ -180,7 +181,7 @@ module S3MetaSync
180
181
 
181
182
  def read_meta(source)
182
183
  file = "#{source}/#{META_FILE}"
183
- File.exist?(file) ? YAML.load(File.read(file)) : {}
184
+ YAML.load(File.read(file)) if File.exist?(file)
184
185
  end
185
186
 
186
187
  def download_meta(destination)
@@ -1,3 +1,3 @@
1
1
  module S3MetaSync
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
data/lib/s3_meta_sync.rb CHANGED
@@ -41,6 +41,7 @@ module S3MetaSync
41
41
  opts.on("-p", "--parallel COUNT", Integer, "Use COUNT threads for download/upload default: 10") { |c| options[:parallel] = c }
42
42
  opts.on("--ssl-none", "Do not verify ssl certs") { options[:ssl_none] = true }
43
43
  opts.on("-z", "--zip", "Zip when uploading to save bandwidth") { options[:zip] = true }
44
+ opts.on("--no-local-changes", "Do not md5 all the local files, they did not change") { options[:no_local_changes] = true }
44
45
  opts.on("-V", "--verbose", "Verbose mode"){ options[:verbose] = true }
45
46
  opts.on("-h", "--help", "Show this.") { puts opts; exit }
46
47
  opts.on("-v", "--version", "Show Version"){ puts VERSION; exit}
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_meta_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
@@ -30,7 +30,7 @@ cert_chain:
30
30
  F5etKHZg0j3eHO31/i2HnswY04lqGImUu6aM5EnijFTB7PPW2KwKKM4+kKDYFdlw
31
31
  /0WV1Ng2/Y6qsHwmqGg2VlYj2h4=
32
32
  -----END CERTIFICATE-----
33
- date: 2014-12-11 00:00:00.000000000 Z
33
+ date: 2014-12-12 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: aws-sdk
metadata.gz.sig CHANGED
Binary file