carrierwave_direct 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
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
 
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rubyforge_project = "carrierwave_direct"
16
16
 
17
17
  s.add_dependency "carrierwave"
18
- s.add_dependency "uuid"
18
+ s.add_dependency "uuidtools"
19
19
  s.add_dependency "fog"
20
20
 
21
21
  s.add_development_dependency "rspec"
@@ -3,10 +3,9 @@
3
3
  require "carrierwave_direct/version"
4
4
 
5
5
  require "carrierwave"
6
+ require "uuidtools"
6
7
  require "fog"
7
8
 
8
- autoload :UUID, "uuid"
9
-
10
9
  module CarrierWaveDirect
11
10
 
12
11
  autoload :Uploader, "carrierwave_direct/uploader"
@@ -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 = "#{key}"
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.generate
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 = CGI.unescape(URI.parse(url).path) # explicitly set 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
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module CarrierwaveDirect
4
- VERSION = "0.0.11"
4
+ VERSION = "0.0.12"
5
5
  end
6
6
 
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.11
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-18 00:00:00.000000000 Z
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: uuid
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.24
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