deb-s3 0.6.1 → 0.6.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83e22542e348437549fe9d78648659ce10f64dd4
4
- data.tar.gz: 1e0ca1bb8dc6c822b122c4e3d71199fa9e71398c
3
+ metadata.gz: bfc086aa33f2a9323c9857a09195870476722f30
4
+ data.tar.gz: cd183d45cd2c91600ea1ba93f441fd9c0ab2702f
5
5
  SHA512:
6
- metadata.gz: 448a9252b80774397270906a81b49bb6be58d87bc5d89056a0ea2b468d8fe3bf8132d997d47fbf017b3ca24a8dc79f9c78486214dc7e3e0cc9db249675bf723d
7
- data.tar.gz: 35f0553c9830f502bae6c587af1006096d1fb168fae984d580da4408d1500cb6d2bbc75d7e29bd8f98e3e3e0f0aa2e34d32b241aab52cfa9e079b0f18ca90c4f
6
+ metadata.gz: a5932bfec7b7de8859520e8dfbcf7cb2ce3cb9b2019aa1bde7a98f4b229d1f45240a30aaed12346e1d96ff9925e3db77c833eb72bab091c7d3d12cc2a2213eec
7
+ data.tar.gz: 3135fb0e0a7f31a2fe5329210514fc3faae5451a6e1f3b55aef4164a320bbb0f5784231e6dbbbcc3a845a538816c94feb33509a9a88a9e0daf7ea755154b1138
@@ -1,5 +1,5 @@
1
1
  module Deb
2
2
  module S3
3
- VERSION = "0.6.1"
3
+ VERSION = "0.6.2"
4
4
  end
5
5
  end
@@ -50,6 +50,15 @@ class Deb::S3::CLI < Thor
50
50
  :desc => "The region endpoint for connecting to S3.",
51
51
  :default => "s3.amazonaws.com"
52
52
 
53
+ class_option :proxy_uri,
54
+ :type => :string,
55
+ :desc => "The URI of the proxy to send service requests through."
56
+
57
+ class_option :use_ssl,
58
+ :default => true,
59
+ :type => :boolean,
60
+ :desc => "Whether to use HTTP or HTTPS for request transport."
61
+
53
62
  class_option :visibility,
54
63
  :default => "public",
55
64
  :type => :string,
@@ -286,7 +295,11 @@ class Deb::S3::CLI < Thor
286
295
  def configure_s3_client
287
296
  error("No value provided for required options '--bucket'") unless options[:bucket]
288
297
 
289
- settings = { :s3_endpoint => options[:endpoint] }
298
+ settings = {
299
+ :s3_endpoint => options[:endpoint],
300
+ :proxy_uri => options[:proxy_uri],
301
+ :use_ssl => options[:use_ssl]
302
+ }
290
303
  settings.merge!(provider.credentials)
291
304
 
292
305
  Deb::S3::Utils.s3 = AWS::S3.new(settings)
@@ -3,14 +3,14 @@ Date: <%= Time.now.utc.strftime("%a, %d %b %Y %T %Z") %>
3
3
  Architectures: <%= architectures.join(" ") %>
4
4
  Components: <%= components.join(" ") %>
5
5
  MD5Sum:
6
- <% files.each do |f,p| -%>
6
+ <% files.sort.each do |f,p| -%>
7
7
  <%= p[:md5] %> <%= p[:size].to_s.rjust(16) %> <%= f %>
8
8
  <% end -%>
9
9
  SHA1:
10
- <% files.each do |f,p| -%>
10
+ <% files.sort.each do |f,p| -%>
11
11
  <%= p[:sha1] %> <%= p[:size].to_s.rjust(16) %> <%= f %>
12
12
  <% end -%>
13
13
  SHA256:
14
- <% files.each do |f,p| -%>
14
+ <% files.sort.each do |f,p| -%>
15
15
  <%= p[:sha256] %> <%= p[:size].to_s.rjust(16) %> <%= f %>
16
16
  <% end -%>
@@ -64,14 +64,15 @@ module Deb::S3::Utils
64
64
  filename = File.basename(path) unless filename
65
65
  obj = Deb::S3::Utils.s3.buckets[Deb::S3::Utils.bucket].objects[s3_path(filename)]
66
66
 
67
+ file_md5 = Digest::MD5.file(path)
68
+
67
69
  # check if the object already exists
68
70
  if obj.exists?
69
- file_md5 = Digest::MD5.file(path)
70
- return if file_md5.to_s == obj.etag.gsub('"', '')
71
+ return if (file_md5.to_s == obj.etag.gsub('"', '') or file_md5.to_s == obj.metadata['md5'])
71
72
  end
72
73
 
73
74
  # upload the file
74
- obj.write(Pathname.new(path), :acl => Deb::S3::Utils.access_policy, :content_type => content_type)
75
+ obj.write(Pathname.new(path), :acl => Deb::S3::Utils.access_policy, :content_type => content_type, :metadata => {'md5' => file_md5})
75
76
  end
76
77
 
77
78
  def s3_remove(path)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deb-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Robertson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
11
+ date: 2014-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor