paperclip-azure 0.2.14 → 0.3.0

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: 7185e7fab828ec02a6a12192d45b2eae01bf788e
4
- data.tar.gz: 724f00e0499f88ac8a875d88eabe0f630fad5c5d
3
+ metadata.gz: 17e6b86faff7b35971eacd5057c1cb931478aced
4
+ data.tar.gz: 25e9be870ea14459cb3994da22aac9c27cbc503f
5
5
  SHA512:
6
- metadata.gz: 7001d2d6a2b650fad8e1e7f75997e4eb6ef903e90e20765d2af7256c44e2af467fd1b81f8b9315dad8c3d1bce3d41d7aa36a335860e30c4cace16d3cb4e742de
7
- data.tar.gz: aa3db4be4ea46949f28b98ba8dadb3fa766b0fcb61b28ca7b6fd87383024b195b9ef004b2959c736b4105e4cdfe8e1184e9f402100cfa817968e8700e49b27b7
6
+ metadata.gz: 11bfcb5f43ec0e14e0fd11fb38f2b611653d58a8849f34085a65dfbf6948fda11f547ff678cc0b3ef30694a4afa0e45dfc6c131e3b38d26dd3931a0ef21a68dd
7
+ data.tar.gz: cb22f8a0c5d563e5f4828263ada454d8ca314f37ab0bfa821d8f208090b1caf6fb92d3c8770df69bb37fce8ef420737188339b729e6513e1cc4f2eb9084af8f1
data/README.md CHANGED
@@ -6,7 +6,7 @@ Paperclip-Azure is a [Paperclip](https://github.com/thoughtbot/paperclip) storag
6
6
 
7
7
  Add this line to your application's Gemfile after the Paperclip gem:
8
8
 
9
- gem 'paperclip-optimizer'
9
+ gem 'paperclip-azure'
10
10
 
11
11
  And then execute:
12
12
 
@@ -206,8 +206,13 @@ module Paperclip
206
206
  retries = 0
207
207
  begin
208
208
  log("saving #{path(style)}")
209
+
210
+ write_options = {
211
+ content_type: file.content_type,
212
+ }
213
+
209
214
  if azure_container
210
- save_blob container_name, path(style).sub(%r{\A/},''), file
215
+ save_blob container_name, path(style).sub(%r{\A/},''), file, write_options
211
216
  end
212
217
  rescue ::Azure::Core::Http::HTTPError => e
213
218
  if e.status_code == 404
@@ -226,14 +231,15 @@ module Paperclip
226
231
  @queued_for_write = {}
227
232
  end
228
233
 
229
- def save_blob(container_name, storage_path, file)
234
+ def save_blob(container_name, storage_path, file, write_options)
235
+
230
236
  if file.size < 64.megabytes
231
- azure_interface.create_block_blob container_name, storage_path, file.read
232
- else
237
+ azure_interface.create_block_blob container_name, storage_path, file.read, write_options
238
+ else
233
239
  blocks = []; count = 0
234
240
  while data = file.read(4.megabytes)
235
241
  block_id = "block_#{(count += 1).to_s.rjust(5, '0')}"
236
-
242
+
237
243
  azure_interface.create_blob_block container_name, storage_path, block_id, data
238
244
 
239
245
  blocks << [block_id]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-azure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Yaker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-01 00:00:00.000000000 Z
12
+ date: 2016-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: azure
@@ -145,11 +145,11 @@ extra_rdoc_files:
145
145
  - LICENSE.txt
146
146
  - README.md
147
147
  files:
148
+ - LICENSE.txt
149
+ - README.md
148
150
  - lib/azure/core/auth/shared_access_signature.rb
149
151
  - lib/paperclip-azure.rb
150
152
  - lib/paperclip/storage/azure.rb
151
- - LICENSE.txt
152
- - README.md
153
153
  homepage: http://github.com/supportify/paperclip-azure
154
154
  licenses:
155
155
  - MIT
@@ -170,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  version: '0'
171
171
  requirements: []
172
172
  rubyforge_project:
173
- rubygems_version: 2.0.6
173
+ rubygems_version: 2.4.8
174
174
  signing_key:
175
175
  specification_version: 4
176
176
  summary: An Azure Blob Storage implementation for Paperclip.