durran-carrierwave 0.3.2.3 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Generators +1 -1
- data/History.txt +39 -2
- data/Manifest.txt +19 -5
- data/README.rdoc +180 -55
- data/Rakefile +11 -4
- data/features/grid_fs_storage.feature +32 -0
- data/features/step_definitions/general_steps.rb +6 -1
- data/features/support/activerecord.rb +1 -1
- data/features/support/env.rb +3 -16
- data/lib/carrierwave.rb +19 -74
- data/lib/carrierwave/compatibility/paperclip.rb +2 -2
- data/lib/carrierwave/core_ext/inheritable_attributes.rb +3 -3
- data/lib/carrierwave/mount.rb +36 -27
- data/lib/carrierwave/orm/activerecord.rb +3 -3
- data/lib/carrierwave/orm/datamapper.rb +2 -2
- data/lib/carrierwave/orm/mongoid.rb +23 -0
- data/lib/carrierwave/orm/mongomapper.rb +1 -1
- data/lib/carrierwave/orm/sequel.rb +4 -16
- data/lib/carrierwave/processing/image_science.rb +54 -25
- data/lib/carrierwave/processing/mini_magick.rb +269 -0
- data/lib/carrierwave/processing/rmagick.rb +4 -6
- data/lib/carrierwave/sanitized_file.rb +7 -6
- data/lib/carrierwave/storage/abstract.rb +0 -2
- data/lib/carrierwave/storage/file.rb +3 -5
- data/lib/carrierwave/storage/grid_fs.rb +92 -0
- data/lib/carrierwave/storage/right_s3.rb +183 -0
- data/lib/carrierwave/storage/s3.rb +37 -69
- data/lib/carrierwave/test/matchers.rb +22 -8
- data/lib/carrierwave/uploader.rb +2 -2
- data/lib/carrierwave/uploader/cache.rb +21 -18
- data/lib/carrierwave/uploader/configuration.rb +122 -0
- data/lib/carrierwave/uploader/default_url.rb +19 -0
- data/lib/carrierwave/uploader/processing.rb +4 -2
- data/lib/carrierwave/uploader/remove.rb +0 -1
- data/lib/carrierwave/uploader/store.rb +1 -68
- data/lib/carrierwave/uploader/url.rb +1 -1
- data/lib/carrierwave/uploader/versions.rb +3 -4
- data/{lib/generators → merb_generators}/uploader_generator.rb +0 -0
- data/rails_generators/uploader/templates/uploader.rb +4 -4
- data/spec/compatibility/paperclip_spec.rb +11 -2
- data/spec/fixtures/landscape.jpg +0 -0
- data/spec/fixtures/portrait.jpg +0 -0
- data/spec/mount_spec.rb +0 -25
- data/spec/orm/datamapper_spec.rb +55 -48
- data/spec/orm/mongoid_spec.rb +206 -0
- data/spec/orm/mongomapper_spec.rb +19 -1
- data/spec/orm/sequel_spec.rb +3 -12
- data/spec/processing/image_science_spec.rb +56 -0
- data/spec/processing/mini_magick_spec.rb +76 -0
- data/spec/processing/rmagick_spec.rb +68 -0
- data/spec/sanitized_file_spec.rb +84 -74
- data/spec/spec_helper.rb +1 -3
- data/spec/storage/grid_fs_spec.rb +78 -0
- data/spec/storage/right_s3_spec.rb +75 -0
- data/spec/storage/s3_spec.rb +83 -0
- data/spec/uploader/cache_spec.rb +1 -13
- data/spec/uploader/configuration_spec.rb +105 -0
- data/spec/uploader/{default_path_spec.rb → default_url_spec.rb} +22 -5
- data/spec/uploader/paths_spec.rb +1 -1
- data/spec/uploader/processing_spec.rb +11 -0
- data/spec/uploader/store_spec.rb +21 -47
- data/spec/uploader/versions_spec.rb +0 -8
- metadata +105 -17
- data/LICENSE +0 -8
- data/carrierwave.gemspec +0 -57
- data/lib/carrierwave/uploader/default_path.rb +0 -23
- data/lib/carrierwave/uploader/paths.rb +0 -27
@@ -1,23 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module CarrierWave
|
4
|
-
module Uploader
|
5
|
-
module DefaultPath
|
6
|
-
|
7
|
-
def initialize(*args)
|
8
|
-
super
|
9
|
-
if default_path
|
10
|
-
@file = CarrierWave::SanitizedFile.new(File.expand_path(default_path, public))
|
11
|
-
def @file.blank?; true; end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
##
|
16
|
-
# Override this method in your uploader to provide a default path
|
17
|
-
# in case no file has been cached/stored yet.
|
18
|
-
#
|
19
|
-
def default_path; end
|
20
|
-
|
21
|
-
end # DefaultPath
|
22
|
-
end # Uploader
|
23
|
-
end # CarrierWave
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module CarrierWave
|
4
|
-
module Uploader
|
5
|
-
module Paths
|
6
|
-
|
7
|
-
##
|
8
|
-
# === Returns
|
9
|
-
#
|
10
|
-
# [String] the directory that is the root of the application
|
11
|
-
#
|
12
|
-
def root
|
13
|
-
CarrierWave.config[:root]
|
14
|
-
end
|
15
|
-
|
16
|
-
##
|
17
|
-
# === Returns
|
18
|
-
#
|
19
|
-
# [String] the directory where files will be publically accessible
|
20
|
-
#
|
21
|
-
def public
|
22
|
-
CarrierWave.config[:public]
|
23
|
-
end
|
24
|
-
|
25
|
-
end # Paths
|
26
|
-
end # Uploader
|
27
|
-
end # CarrierWave
|