carrierwave_direct 0.0.11 → 0.0.12
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/README.md +2 -2
- data/carrierwave_direct.gemspec +1 -1
- data/lib/carrierwave_direct.rb +1 -2
- data/lib/carrierwave_direct/uploader.rb +5 -5
- data/lib/carrierwave_direct/version.rb +1 -1
- metadata +22 -8
data/README.md
CHANGED
@@ -310,11 +310,11 @@ Validates that your mounted model has an avatar attached. This checks whether th
|
|
310
310
|
|
311
311
|
Validates that the filename in the database is unique. Turned *on* by default
|
312
312
|
|
313
|
-
validates :avatar :filename_format => true
|
313
|
+
validates :avatar, :filename_format => true
|
314
314
|
|
315
315
|
Validates that the uploaded filename is valid. As well as validating the extension against the `extension_white_list` it also validates that the `upload_dir` is correct. Turned *on* by default
|
316
316
|
|
317
|
-
validates :avatar :remote_net_url_format => true
|
317
|
+
validates :avatar, :remote_net_url_format => true
|
318
318
|
|
319
319
|
Validates that the remote net url is valid. As well as validating the extension against the `extension_white_list` it also validates that url is valid and has only the schemes specified in the `url_scheme_whitelist`. Turned *on* by default
|
320
320
|
|
data/carrierwave_direct.gemspec
CHANGED
data/lib/carrierwave_direct.rb
CHANGED
@@ -22,8 +22,8 @@ module CarrierWaveDirect
|
|
22
22
|
def direct_fog_url(options = {})
|
23
23
|
fog_uri = CarrierWave::Storage::Fog::File.new(self, CarrierWave::Storage::Fog.new(self), nil).public_url
|
24
24
|
if options[:with_path]
|
25
|
-
uri = URI.parse(fog_uri)
|
26
|
-
path = "
|
25
|
+
uri = URI.parse(fog_uri.chomp('/'))
|
26
|
+
path = "/#{key}"
|
27
27
|
uri.path += URI.escape(path)
|
28
28
|
fog_uri = uri.to_s
|
29
29
|
end
|
@@ -31,7 +31,7 @@ module CarrierWaveDirect
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def guid
|
34
|
-
UUID.
|
34
|
+
UUIDTools::UUID.random_create
|
35
35
|
end
|
36
36
|
|
37
37
|
def key=(k)
|
@@ -42,7 +42,7 @@ module CarrierWaveDirect
|
|
42
42
|
def key
|
43
43
|
return @key if @key.present?
|
44
44
|
if url.present?
|
45
|
-
self.key =
|
45
|
+
self.key = URI.parse(URI.encode(url)).path # explicitly set key
|
46
46
|
else
|
47
47
|
@key = "#{store_dir}/#{guid}/#{FILENAME_WILDCARD}"
|
48
48
|
end
|
@@ -61,7 +61,7 @@ module CarrierWaveDirect
|
|
61
61
|
options[:expiration] ||= self.class.upload_expiration
|
62
62
|
options[:min_file_size] ||= self.class.min_file_size
|
63
63
|
options[:max_file_size] ||= self.class.max_file_size
|
64
|
-
|
64
|
+
|
65
65
|
conditions = [ ["starts-with", "$utf8", ""], ["starts-with", "$key", store_dir] ]
|
66
66
|
conditions << ["starts-with", "$Content-Type", ""] if self.class.will_include_content_type
|
67
67
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave_direct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03
|
12
|
+
date: 2013-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: carrierwave
|
@@ -28,7 +28,7 @@ dependencies:
|
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
31
|
+
name: uuidtools
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
@@ -200,13 +200,27 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
- - ! '>='
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: '0'
|
203
|
-
segments:
|
204
|
-
- 0
|
205
|
-
hash: 681164957
|
206
203
|
requirements: []
|
207
204
|
rubyforge_project: carrierwave_direct
|
208
|
-
rubygems_version: 1.8.
|
205
|
+
rubygems_version: 1.8.23
|
209
206
|
signing_key:
|
210
207
|
specification_version: 3
|
211
208
|
summary: Upload direct to S3 using CarrierWave
|
212
|
-
test_files:
|
209
|
+
test_files:
|
210
|
+
- spec/action_view_extensions/form_helper_spec.rb
|
211
|
+
- spec/form_builder_spec.rb
|
212
|
+
- spec/mount_spec.rb
|
213
|
+
- spec/orm/activerecord_spec.rb
|
214
|
+
- spec/orm/indirect_activerecord_spec.rb
|
215
|
+
- spec/spec_helper.rb
|
216
|
+
- spec/support/carrier_wave_config.rb
|
217
|
+
- spec/support/direct_uploader.rb
|
218
|
+
- spec/support/form_builder_helpers.rb
|
219
|
+
- spec/support/global_helpers.rb
|
220
|
+
- spec/support/model_helpers.rb
|
221
|
+
- spec/support/mounted_class.rb
|
222
|
+
- spec/support/uploader_helpers.rb
|
223
|
+
- spec/support/view_helpers.rb
|
224
|
+
- spec/test/capybara_helpers_spec.rb
|
225
|
+
- spec/test/helpers_spec.rb
|
226
|
+
- spec/uploader_spec.rb
|