card 1.19.3 → 1.19.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/VERSION +1 -1
- data/card.gemspec +1 -3
- data/db/migrate_core_cards/20160914132636_fix_mod_files.rb +25 -0
- data/lib/card.rb +0 -2
- data/lib/card/content/diff.rb +3 -4
- data/lib/card/format/error.rb +1 -1
- data/mod/admin/set/self/admin.rb +2 -2
- data/mod/admin/set/self/trash.rb +9 -3
- data/mod/basic_types/set/type/html.rb +1 -1
- data/mod/bootstrap/set/all/bootstrap/layout.rb +58 -0
- data/mod/bootstrap/spec/set/all/bootstrap/layout_spec.rb +32 -0
- data/mod/carrierwave/lib/carrier_wave/cardmount.rb +0 -2
- data/mod/carrierwave/set/abstract/attachment/upload_cache.rb +2 -1
- data/mod/core/set/all/stages.rb +6 -4
- data/mod/history/lib/card/act.rb +8 -7
- data/mod/history/set/all/history.rb +10 -8
- data/mod/machines/set/abstract/script.rb +1 -1
- data/mod/machines/set/type/css.rb +1 -1
- data/mod/pointer/set/abstract/01_pointer.rb +1 -1
- data/mod/standard/file/credit_image/image-icon.png +0 -0
- data/mod/standard/file/credit_image/image-large.png +0 -0
- data/mod/standard/file/credit_image/image-medium.png +0 -0
- data/mod/standard/file/credit_image/image-small.png +0 -0
- data/mod/standard/file/favicon/image-icon.png +0 -0
- data/mod/standard/file/favicon/image-large.png +0 -0
- data/mod/standard/file/favicon/image-medium.png +0 -0
- data/mod/standard/file/favicon/image-small.png +0 -0
- data/mod/standard/file/logo/image-icon.png +0 -0
- data/mod/standard/file/logo/image-large.png +0 -0
- data/mod/standard/file/logo/image-medium.png +0 -0
- data/mod/standard/file/logo/image-small.png +0 -0
- data/mod/standard/set/self/recent.rb +2 -2
- data/spec/lib/card/diff_spec.rb +9 -9
- metadata +19 -156
- data/vendor/carrierwave/.gitignore +0 -19
- data/vendor/carrierwave/.rubocop.yml +0 -262
- data/vendor/carrierwave/.travis.yml +0 -58
- data/vendor/carrierwave/CHANGELOG.md +0 -81
- data/vendor/carrierwave/CONTRIBUTING.md +0 -37
- data/vendor/carrierwave/Gemfile +0 -5
- data/vendor/carrierwave/README.md +0 -995
- data/vendor/carrierwave/Rakefile +0 -26
- data/vendor/carrierwave/carrierwave.gemspec +0 -45
- data/vendor/carrierwave/cucumber.yml +0 -2
- data/vendor/carrierwave/features/caching.feature +0 -28
- data/vendor/carrierwave/features/download.feature +0 -20
- data/vendor/carrierwave/features/file_storage.feature +0 -37
- data/vendor/carrierwave/features/file_storage_overridden_filename.feature +0 -38
- data/vendor/carrierwave/features/file_storage_overridden_store_dir.feature +0 -38
- data/vendor/carrierwave/features/file_storage_reversing_processor.feature +0 -43
- data/vendor/carrierwave/features/fixtures/bork.txt +0 -1
- data/vendor/carrierwave/features/fixtures/monkey.txt +0 -1
- data/vendor/carrierwave/features/fixtures/upcased_bork.txt +0 -1
- data/vendor/carrierwave/features/mount_activerecord.feature +0 -46
- data/vendor/carrierwave/features/step_definitions/activerecord_steps.rb +0 -20
- data/vendor/carrierwave/features/step_definitions/caching_steps.rb +0 -12
- data/vendor/carrierwave/features/step_definitions/datamapper_steps.rb +0 -27
- data/vendor/carrierwave/features/step_definitions/download_steps.rb +0 -8
- data/vendor/carrierwave/features/step_definitions/file_steps.rb +0 -51
- data/vendor/carrierwave/features/step_definitions/general_steps.rb +0 -102
- data/vendor/carrierwave/features/step_definitions/mount_steps.rb +0 -17
- data/vendor/carrierwave/features/step_definitions/store_steps.rb +0 -16
- data/vendor/carrierwave/features/support/activerecord.rb +0 -18
- data/vendor/carrierwave/features/support/env.rb +0 -19
- data/vendor/carrierwave/features/versions_basics.feature +0 -50
- data/vendor/carrierwave/features/versions_caching_from_versions.feature +0 -32
- data/vendor/carrierwave/features/versions_nested_versions.feature +0 -70
- data/vendor/carrierwave/features/versions_overridden_filename.feature +0 -51
- data/vendor/carrierwave/features/versions_overriden_store_dir.feature +0 -41
- data/vendor/carrierwave/gemfiles/rails-4-0-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-4-1-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-4-2-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-master.gemfile +0 -11
- data/vendor/carrierwave/lib/carrierwave.rb +0 -93
- data/vendor/carrierwave/lib/carrierwave/compatibility/paperclip.rb +0 -103
- data/vendor/carrierwave/lib/carrierwave/error.rb +0 -8
- data/vendor/carrierwave/lib/carrierwave/locale/cs.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/de.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/el.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/en.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/es.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/fr-CA.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/fr.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/id.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/ja.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/nb.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/nl.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pl.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pt-BR.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pt-PT.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/ru.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/sk.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/tr.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/zh-CN.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/zh-TW.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/mount.rb +0 -444
- data/vendor/carrierwave/lib/carrierwave/mounter.rb +0 -163
- data/vendor/carrierwave/lib/carrierwave/orm/activerecord.rb +0 -103
- data/vendor/carrierwave/lib/carrierwave/processing.rb +0 -2
- data/vendor/carrierwave/lib/carrierwave/processing/mini_magick.rb +0 -328
- data/vendor/carrierwave/lib/carrierwave/processing/rmagick.rb +0 -379
- data/vendor/carrierwave/lib/carrierwave/sanitized_file.rb +0 -348
- data/vendor/carrierwave/lib/carrierwave/storage.rb +0 -2
- data/vendor/carrierwave/lib/carrierwave/storage/abstract.rb +0 -43
- data/vendor/carrierwave/lib/carrierwave/storage/file.rb +0 -118
- data/vendor/carrierwave/lib/carrierwave/storage/fog.rb +0 -462
- data/vendor/carrierwave/lib/carrierwave/test/matchers.rb +0 -394
- data/vendor/carrierwave/lib/carrierwave/uploader.rb +0 -67
- data/vendor/carrierwave/lib/carrierwave/uploader/cache.rb +0 -207
- data/vendor/carrierwave/lib/carrierwave/uploader/callbacks.rb +0 -33
- data/vendor/carrierwave/lib/carrierwave/uploader/configuration.rb +0 -203
- data/vendor/carrierwave/lib/carrierwave/uploader/content_type_blacklist.rb +0 -48
- data/vendor/carrierwave/lib/carrierwave/uploader/content_type_whitelist.rb +0 -48
- data/vendor/carrierwave/lib/carrierwave/uploader/default_url.rb +0 -17
- data/vendor/carrierwave/lib/carrierwave/uploader/download.rb +0 -92
- data/vendor/carrierwave/lib/carrierwave/uploader/extension_blacklist.rb +0 -51
- data/vendor/carrierwave/lib/carrierwave/uploader/extension_whitelist.rb +0 -51
- data/vendor/carrierwave/lib/carrierwave/uploader/file_size.rb +0 -41
- data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_blacklist.rb +0 -94
- data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_whitelist.rb +0 -94
- data/vendor/carrierwave/lib/carrierwave/uploader/mountable.rb +0 -38
- data/vendor/carrierwave/lib/carrierwave/uploader/processing.rb +0 -88
- data/vendor/carrierwave/lib/carrierwave/uploader/proxy.rb +0 -86
- data/vendor/carrierwave/lib/carrierwave/uploader/remove.rb +0 -21
- data/vendor/carrierwave/lib/carrierwave/uploader/serialization.rb +0 -28
- data/vendor/carrierwave/lib/carrierwave/uploader/store.rb +0 -93
- data/vendor/carrierwave/lib/carrierwave/uploader/url.rb +0 -41
- data/vendor/carrierwave/lib/carrierwave/uploader/versions.rb +0 -295
- data/vendor/carrierwave/lib/carrierwave/utilities.rb +0 -6
- data/vendor/carrierwave/lib/carrierwave/utilities/uri.rb +0 -21
- data/vendor/carrierwave/lib/carrierwave/validations/active_model.rb +0 -78
- data/vendor/carrierwave/lib/carrierwave/version.rb +0 -3
- data/vendor/carrierwave/lib/generators/templates/uploader.rb +0 -49
- data/vendor/carrierwave/lib/generators/uploader_generator.rb +0 -7
- data/vendor/carrierwave/script/console +0 -10
- data/vendor/carrierwave/script/destroy +0 -14
- data/vendor/carrierwave/script/generate +0 -14
- data/vendor/carrierwave/spec/compatibility/paperclip_spec.rb +0 -138
- data/vendor/carrierwave/spec/fixtures/Uppercase.jpg +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.ttxt +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.txtt +0 -1
- data/vendor/carrierwave/spec/fixtures/case.JPG +0 -1
- data/vendor/carrierwave/spec/fixtures/landscape.jpg +0 -0
- data/vendor/carrierwave/spec/fixtures/multi_page.pdf +0 -0
- data/vendor/carrierwave/spec/fixtures/new.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/new.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/old.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/old.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/portrait.jpg +0 -0
- data/vendor/carrierwave/spec/fixtures/ruby.gif +0 -0
- data/vendor/carrierwave/spec/fixtures/sponsored.doc +0 -1
- data/vendor/carrierwave/spec/fixtures/test+.jpg +0 -1
- data/vendor/carrierwave/spec/fixtures/test.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/test.jpg +0 -1
- data/vendor/carrierwave/spec/generators/uploader_generator_spec.rb +0 -19
- data/vendor/carrierwave/spec/mount_multiple_spec.rb +0 -913
- data/vendor/carrierwave/spec/mount_single_spec.rb +0 -793
- data/vendor/carrierwave/spec/orm/activerecord_spec.rb +0 -1556
- data/vendor/carrierwave/spec/processing/mini_magick_spec.rb +0 -210
- data/vendor/carrierwave/spec/processing/rmagick_spec.rb +0 -250
- data/vendor/carrierwave/spec/sanitized_file_spec.rb +0 -805
- data/vendor/carrierwave/spec/spec_helper.rb +0 -105
- data/vendor/carrierwave/spec/storage/file_spec.rb +0 -82
- data/vendor/carrierwave/spec/storage/fog_credentials.rb +0 -46
- data/vendor/carrierwave/spec/storage/fog_helper.rb +0 -428
- data/vendor/carrierwave/spec/storage/fog_spec.rb +0 -48
- data/vendor/carrierwave/spec/support/activerecord.rb +0 -31
- data/vendor/carrierwave/spec/support/file_utils_helper.rb +0 -15
- data/vendor/carrierwave/spec/uploader/cache_spec.rb +0 -324
- data/vendor/carrierwave/spec/uploader/callback_spec.rb +0 -30
- data/vendor/carrierwave/spec/uploader/configuration_spec.rb +0 -133
- data/vendor/carrierwave/spec/uploader/content_type_blacklist_spec.rb +0 -61
- data/vendor/carrierwave/spec/uploader/content_type_whitelist_spec.rb +0 -63
- data/vendor/carrierwave/spec/uploader/default_url_spec.rb +0 -77
- data/vendor/carrierwave/spec/uploader/download_spec.rb +0 -204
- data/vendor/carrierwave/spec/uploader/extension_blacklist_spec.rb +0 -112
- data/vendor/carrierwave/spec/uploader/extension_whitelist_spec.rb +0 -102
- data/vendor/carrierwave/spec/uploader/file_size_spec.rb +0 -52
- data/vendor/carrierwave/spec/uploader/mountable_spec.rb +0 -26
- data/vendor/carrierwave/spec/uploader/overrides_spec.rb +0 -71
- data/vendor/carrierwave/spec/uploader/paths_spec.rb +0 -18
- data/vendor/carrierwave/spec/uploader/processing_spec.rb +0 -159
- data/vendor/carrierwave/spec/uploader/proxy_spec.rb +0 -79
- data/vendor/carrierwave/spec/uploader/remove_spec.rb +0 -71
- data/vendor/carrierwave/spec/uploader/store_spec.rb +0 -400
- data/vendor/carrierwave/spec/uploader/url_spec.rb +0 -273
- data/vendor/carrierwave/spec/uploader/versions_spec.rb +0 -633
@@ -1,58 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
cache: bundler
|
4
|
-
|
5
|
-
rvm:
|
6
|
-
- 2.0
|
7
|
-
- 2.1
|
8
|
-
- 2.2.5
|
9
|
-
- 2.3.1
|
10
|
-
- ruby-head
|
11
|
-
- jruby
|
12
|
-
- jruby-head
|
13
|
-
|
14
|
-
env:
|
15
|
-
global:
|
16
|
-
- JRUBY_OPTS="--2.0"
|
17
|
-
|
18
|
-
gemfile:
|
19
|
-
- Gemfile
|
20
|
-
- gemfiles/rails-4-0-stable.gemfile
|
21
|
-
- gemfiles/rails-4-1-stable.gemfile
|
22
|
-
- gemfiles/rails-4-2-stable.gemfile
|
23
|
-
- gemfiles/rails-master.gemfile
|
24
|
-
|
25
|
-
sudo: false
|
26
|
-
|
27
|
-
before_script:
|
28
|
-
- psql -c 'create database carrierwave_test;' -U postgres
|
29
|
-
|
30
|
-
matrix:
|
31
|
-
exclude:
|
32
|
-
- rvm: 2.0
|
33
|
-
gemfile: Gemfile
|
34
|
-
- rvm: 2.0
|
35
|
-
gemfile: gemfiles/rails-master.gemfile
|
36
|
-
- rvm: 2.1
|
37
|
-
gemfile: Gemfile
|
38
|
-
- rvm: 2.1
|
39
|
-
gemfile: gemfiles/rails-master.gemfile
|
40
|
-
- rvm: jruby
|
41
|
-
gemfile: Gemfile
|
42
|
-
- rvm: jruby
|
43
|
-
gemfile: gemfiles/rails-master.gemfile
|
44
|
-
- rvm: jruby-head
|
45
|
-
gemfile: gemfiles/rails-master.gemfile
|
46
|
-
allow_failures:
|
47
|
-
- rvm: ruby-head
|
48
|
-
- rvm: jruby-head
|
49
|
-
- gemfile: gemfiles/rails-master.gemfile
|
50
|
-
fast_finish: true
|
51
|
-
|
52
|
-
notifications:
|
53
|
-
email: false
|
54
|
-
slack:
|
55
|
-
secure: Npzanyv/LXLIRlrNs8iTUbZNRhXlP+K2ZpjZoS2UKkr09jYyP1qdf5a//R3Lu7Yat7g2b4qTJGbaZBEMUQSVaJ6UX6quiBJjVWxjxjQ4Ugk8k/yOIAcGEGYPfS6YzRXemRwo9j4uy76cmwlv8cwEuYTSTBRK4XrdYHslX6pKSXM=
|
56
|
-
|
57
|
-
addons:
|
58
|
-
postgresql: "9.3"
|
@@ -1,81 +0,0 @@
|
|
1
|
-
# Carrierwave History/Changelog
|
2
|
-
|
3
|
-
All notable changes to this project will be documented in this file.
|
4
|
-
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
|
-
|
6
|
-
## [Unreleased]
|
7
|
-
|
8
|
-
### Added
|
9
|
-
* Add a test matcher for the format (@yanivpr [#1758](https://github.com/carrierwaveuploader/carrierwave/pull/1758))
|
10
|
-
* Support of MiniMagick's Combine options (@bernabas [#1754](https://github.com/carrierwaveuploader/carrierwave/pull/1754))
|
11
|
-
* Validate with the actual content-type of files (@eavgerinos)
|
12
|
-
* Support for multiple file uploads with `mount_uploaders` method (@jnicklas and @lisarutan [#1481](https://github.com/carrierwaveuploader/carrierwave/pull/1481))
|
13
|
-
* Add a `cache_only` configuration option, useful for testing (@jeffkreeftmeijer [#1456](https://github.com/carrierwaveuploader/carrierwave/pull/1456))
|
14
|
-
* Add `#width` and `#height` methods to MiniMagick processor (@ShivaVS [#1405](https://github.com/carrierwaveuploader/carrierwave/pull/1405))
|
15
|
-
* Add `#width` and `#height` methods to the RMagick processor (@mehlah [#1805](https://github.com/carrierwaveuploader/carrierwave/pull/1805))
|
16
|
-
* Support for jRuby (@lephyrius [#1377](https://github.com/carrierwaveuploader/carrierwave/pull/1377))
|
17
|
-
* Make cache storage configurable (@mshibuya [#1312](https://github.com/carrierwaveuploader/carrierwave/pull/1312))
|
18
|
-
* Errors on file size (@gautampunhani [#1026](https://github.com/carrierwaveuploader/carrierwave/pull/1026))
|
19
|
-
* Add Indonesian, Taiwanese and Chinese i18n translations for errors (@saveav, @st0012, @msyesyan)
|
20
|
-
|
21
|
-
### Changed
|
22
|
-
* [BREAKING CHANGE] Allow non-ASCII filename by default (@shuhei [#1772](https://github.com/carrierwaveuploader/carrierwave/pull/1772))
|
23
|
-
* [BREAKING CHANGE] `to_json` behavior changed when serializing an uploader (@jnicklas and @lisarutan [#1481](https://github.com/carrierwaveuploader/carrierwave/pull/1481))
|
24
|
-
* [BREAKING CHANGE] Rename `extension_white_list` ~> `extension_whitelist` (@mehlah [#1819](https://github.com/carrierwaveuploader/carrierwave/pull/1819))
|
25
|
-
* [BREAKING CHANGE] Rename `extension_black_list` ~> `extension_blacklist` (@mehlah [#1819](https://github.com/carrierwaveuploader/carrierwave/pull/1819))
|
26
|
-
* [BREAKING CHANGE] Rename i18n keys `extension_black_list_error` ~> `extension_blacklist_error` and `extension_white_list_error` ~> `extension_whitelist_error` (@mehlah)
|
27
|
-
* Better error when the configured storage is unknown (@st0012 [#1779](https://github.com/carrierwaveuploader/carrierwave/pull/1779))
|
28
|
-
* Allow to pass additionnal options to Rackspace `authenticated_url` (@duhast [#1722](https://github.com/carrierwaveuploader/carrierwave/pull/1722))
|
29
|
-
* Reduced memory footprint (@schneems [#1652](https://github.com/carrierwaveuploader/carrierwave/pull/1652), @simonprev [#1706](https://github.com/carrierwaveuploader/carrierwave/pull/1706))
|
30
|
-
* Improve Fog Loading (@plribeiro3000 [#1620](https://github.com/carrierwaveuploader/carrierwave/pull/1620), @eavgerinos)
|
31
|
-
* All locales from `config.i18n.available_locales` are added to load_path (@printercu [#1521](https://github.com/carrierwaveuploader/carrierwave/pull/1521))
|
32
|
-
* Do not display RMagick exception in I18n message (manuelpradal [#1361](https://github.com/carrierwaveuploader/carrierwave/pull/1361))
|
33
|
-
* `#default_url` now accepts the same args passed to `#url` (@shekibobo [#1347](https://github.com/carrierwaveuploader/carrierwave/pull/1347))
|
34
|
-
* Accept an array of strings or regexps to white/blacklist content types (@mehlah [#1816](https://github.com/carrierwaveuploader/carrierwave/pull/1816))
|
35
|
-
* `#content_type_whitelist` and `extension_whitelist` now takes either a string, a regexp, or an array of values (same thing for blacklists) (@mehlah [#1825](https://github.com/carrierwaveuploader/carrierwave/pull/1825))
|
36
|
-
* Blank uploaders are now memoized on the model instance (@DarthSim [#1860](https://github.com/carrierwaveuploader/carrierwave/pull/1860))
|
37
|
-
|
38
|
-
### Removed
|
39
|
-
* Remove `CarrierWave::MimeTypes` processor module (@mehlah [#1813](https://github.com/carrierwaveuploader/carrierwave/pull/1813))
|
40
|
-
* Remove `CarrierWave::MagicMimeTypes` processor module (@mehlah [#1816](https://github.com/carrierwaveuploader/carrierwave/pull/1816))
|
41
|
-
* Remove dependency on `ruby-filemagic` in white/blacklist content types (@mehlah [#1816](https://github.com/carrierwaveuploader/carrierwave/pull/1816))
|
42
|
-
|
43
|
-
### Fixed
|
44
|
-
* Fix `Mounter.blank?` method (@Bonias [#1746](https://github.com/carrierwaveuploader/carrierwave/pull/1746))
|
45
|
-
* Reset `remove_#{column}` after invoking `remove_#{column}` (@eavgerinos [#1668](https://github.com/carrierwaveuploader/carrierwave/pull/1668))
|
46
|
-
* Change Google's url to the `public_url` (@m7moud [#1683](https://github.com/carrierwaveuploader/carrierwave/pull/1683))
|
47
|
-
* Do not write to `ActiveModel::Dirty` changes when assigning something blank to a mounter that was originally blank (@eavgerinos [#1635](https://github.com/carrierwaveuploader/carrierwave/pull/1635))
|
48
|
-
* Various grammar and typos fixes to error messages translations
|
49
|
-
* Don't error when size is called on a deleted file (@danielevans [#1561](https://github.com/carrierwaveuploader/carrierwave/pull/1561))
|
50
|
-
* Flush mounters on `#dup` of active record model (@danielevans [#1544](https://github.com/carrierwaveuploader/carrierwave/pull/1544))
|
51
|
-
* `Fog::File.read` returns its contents after upload instead of "closed stream" error (@stormsilver [#1517](https://github.com/carrierwaveuploader/carrierwave/pull/1517))
|
52
|
-
* Don't read file twice when calling `sanitized_file` or `cache!` (@felixbuenemann [#1476](https://github.com/carrierwaveuploader/carrierwave/pull/1476))
|
53
|
-
* Change image extension when converting formats (@nashby [#1446](https://github.com/carrierwaveuploader/carrierwave/pull/1446))
|
54
|
-
* Fix file delete being called twice on remove (@adamcrown [#1441](https://github.com/carrierwaveuploader/carrierwave/pull/1441))
|
55
|
-
* RSpec 3 support (@randoum #1421[](https://github.com/carrierwaveuploader/carrierwave/pull/1421), @akiomik [#1370](https://github.com/carrierwaveuploader/carrierwave/pull/1370))
|
56
|
-
* MiniMagick convert to a format all the pages by default and accept an optional page number parameter to convert specific pages (@harikrishnan83 [#1408](https://github.com/carrierwaveuploader/carrierwave/pull/1408))
|
57
|
-
* Fix cache workfile collision between versions (@jvdp [#1399](https://github.com/carrierwaveuploader/carrierwave/pull/1399))
|
58
|
-
* Reset mounter cache on record reload (@semenyukdmitriy [#1383](https://github.com/carrierwaveuploader/carrierwave/pull/1383))
|
59
|
-
* Retrieve only active versions of files (@filipegiusti [#1351](https://github.com/carrierwaveuploader/carrierwave/pull/1351))
|
60
|
-
* Fix default gravity in MiniMagick `resize_and_pad` (@abevoelker [#1358](https://github.com/carrierwaveuploader/carrierwave/pull/1358))
|
61
|
-
* Skip loading RMagick if already loaded (@mshibuya [#1346](https://github.com/carrierwaveuploader/carrierwave/pull/1346))
|
62
|
-
* Make the `#remove_#{column}` accessor set the mounted column as changed (@nikz [#1326](https://github.com/carrierwaveuploader/carrierwave/pull/1326))
|
63
|
-
* Tempfile and @content_type assignment (@bensie [#1487](https://github.com/carrierwaveuploader/carrierwave/issues/1487))
|
64
|
-
|
65
|
-
## 0.11.0 - 2016-03-29
|
66
|
-
|
67
|
-
### Added
|
68
|
-
|
69
|
-
### Changed
|
70
|
-
* `cache_id` is now less collision-prone thanks to a counter (@stillwaiting and @mtsmfm [#1866](https://github.com/carrierwaveuploader/carrierwave/pull/1866))
|
71
|
-
|
72
|
-
### Removed
|
73
|
-
|
74
|
-
### Fixed
|
75
|
-
* Fix require RMagick deprecation warning (@thomasfedb and @bensie [#1788](https://github.com/carrierwaveuploader/carrierwave/pull/1788))
|
76
|
-
|
77
|
-
## 0.10.0 - 2014-02-26
|
78
|
-
|
79
|
-
Please check [0.10-stable] for previous changes.
|
80
|
-
|
81
|
-
[0.10-stable]: https://github.com/carrierwaveuploader/carrierwave/blob/0.10-stable/History.txt
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# Contributing to CarrierWave
|
2
|
-
|
3
|
-
CarrierWave thrives on a large number of [contributors](https://github.com/carrierwaveuploader/carrierwave/contributors),
|
4
|
-
and pull requests are very welcome. Before submitting a pull request, please make sure that your changes are well tested.
|
5
|
-
|
6
|
-
First, make sure you have `imagemagick` and `ghostscript` installed. You may need `libmagic` as well.
|
7
|
-
|
8
|
-
Then, you'll need to install bundler and the gem dependencies:
|
9
|
-
|
10
|
-
`gem install bundler && bundle install`
|
11
|
-
|
12
|
-
You should now be able to run the local tests:
|
13
|
-
|
14
|
-
`bundle exec rake`
|
15
|
-
|
16
|
-
You can also run the remote specs by creating a ~/.fog file:
|
17
|
-
|
18
|
-
```yaml
|
19
|
-
:carrierwave:
|
20
|
-
:aws_access_key_id: xxx
|
21
|
-
:aws_secret_access_key: yyy
|
22
|
-
:rackspace_username: xxx
|
23
|
-
:rackspace_api_key: yyy
|
24
|
-
:google_storage_access_key_id: xxx
|
25
|
-
:google_storage_secret_access_key: yyy
|
26
|
-
```
|
27
|
-
|
28
|
-
You should now be able to run the remote tests:
|
29
|
-
|
30
|
-
REMOTE=true bundle exec rake
|
31
|
-
|
32
|
-
Please test with the latest Ruby 2.2.x version using RVM if possible.
|
33
|
-
|
34
|
-
## Running active record tests
|
35
|
-
|
36
|
-
Make sure you have a local PostgreSQL database named `carrierwave_test` with the username
|
37
|
-
`postgres`
|
data/vendor/carrierwave/Gemfile
DELETED
@@ -1,995 +0,0 @@
|
|
1
|
-
# CarrierWave
|
2
|
-
|
3
|
-
This gem provides a simple and extremely flexible way to upload files from Ruby applications.
|
4
|
-
It works well with Rack based web applications, such as Ruby on Rails.
|
5
|
-
|
6
|
-
[![Build Status](https://travis-ci.org/carrierwaveuploader/carrierwave.svg?branch=master)](http://travis-ci.org/carrierwaveuploader/carrierwave)
|
7
|
-
[![Code Climate](http://img.shields.io/codeclimate/github/carrierwaveuploader/carrierwave.svg)](https://codeclimate.com/github/carrierwaveuploader/carrierwave)
|
8
|
-
|
9
|
-
|
10
|
-
> ## carrierwave version disclaimer
|
11
|
-
> ***This README is for a branch which is still in development.
|
12
|
-
> Please switch to latest `0.x` branch for stable version.***
|
13
|
-
|
14
|
-
|
15
|
-
## Information
|
16
|
-
|
17
|
-
* RDoc documentation [available on RubyDoc.info](http://rubydoc.info/gems/carrierwave/frames)
|
18
|
-
* Source code [available on GitHub](http://github.com/carrierwaveuploader/carrierwave)
|
19
|
-
* More information, known limitations, and how-tos [available on the wiki](https://github.com/carrierwaveuploader/carrierwave/wiki)
|
20
|
-
|
21
|
-
## Getting Help
|
22
|
-
|
23
|
-
* Please ask the community on [Stack Overflow](http://stackoverflow.com/) for help if you have any questions. Please do not post usage questions on the issue tracker.
|
24
|
-
* Please report bugs on the [issue tracker](http://github.com/carrierwaveuploader/carrierwave/issues) but read the "getting help" section in the wiki first.
|
25
|
-
|
26
|
-
## Installation
|
27
|
-
|
28
|
-
Install the latest stable release:
|
29
|
-
|
30
|
-
```
|
31
|
-
$ gem install carrierwave
|
32
|
-
```
|
33
|
-
|
34
|
-
In Rails, add it to your Gemfile:
|
35
|
-
|
36
|
-
```ruby
|
37
|
-
gem 'carrierwave'
|
38
|
-
```
|
39
|
-
|
40
|
-
Finally, restart the server to apply the changes.
|
41
|
-
|
42
|
-
As of version 1.0.0 (forthcoming), CarrierWave requires Rails 4.0 or higher and Ruby 2.0
|
43
|
-
or higher. If you're on Rails 3, you should use v0.11.0.
|
44
|
-
|
45
|
-
## Getting Started
|
46
|
-
|
47
|
-
Start off by generating an uploader:
|
48
|
-
|
49
|
-
rails generate uploader Avatar
|
50
|
-
|
51
|
-
this should give you a file in:
|
52
|
-
|
53
|
-
app/uploaders/avatar_uploader.rb
|
54
|
-
|
55
|
-
Check out this file for some hints on how you can customize your uploader. It
|
56
|
-
should look something like this:
|
57
|
-
|
58
|
-
```ruby
|
59
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
60
|
-
storage :file
|
61
|
-
end
|
62
|
-
```
|
63
|
-
|
64
|
-
You can use your uploader class to store and retrieve files like this:
|
65
|
-
|
66
|
-
```ruby
|
67
|
-
uploader = AvatarUploader.new
|
68
|
-
|
69
|
-
uploader.store!(my_file)
|
70
|
-
|
71
|
-
uploader.retrieve_from_store!('my_file.png')
|
72
|
-
```
|
73
|
-
|
74
|
-
CarrierWave gives you a `store` for permanent storage, and a `cache` for
|
75
|
-
temporary storage. You can use different stores, including filesystem
|
76
|
-
and cloud storage.
|
77
|
-
|
78
|
-
Most of the time you are going to want to use CarrierWave together with an ORM.
|
79
|
-
It is quite simple to mount uploaders on columns in your model, so you can
|
80
|
-
simply assign files and get going:
|
81
|
-
|
82
|
-
### ActiveRecord
|
83
|
-
|
84
|
-
Make sure you are loading CarrierWave after loading your ORM, otherwise you'll
|
85
|
-
need to require the relevant extension manually, e.g.:
|
86
|
-
|
87
|
-
```ruby
|
88
|
-
require 'carrierwave/orm/activerecord'
|
89
|
-
```
|
90
|
-
|
91
|
-
Add a string column to the model you want to mount the uploader by creating
|
92
|
-
a migration:
|
93
|
-
|
94
|
-
|
95
|
-
rails g migration add_avatar_to_users avatar:string
|
96
|
-
rake db:migrate
|
97
|
-
|
98
|
-
Open your model file and mount the uploader:
|
99
|
-
|
100
|
-
```ruby
|
101
|
-
class User < ActiveRecord::Base
|
102
|
-
mount_uploader :avatar, AvatarUploader
|
103
|
-
end
|
104
|
-
```
|
105
|
-
|
106
|
-
Now you can cache files by assigning them to the attribute, they will
|
107
|
-
automatically be stored when the record is saved.
|
108
|
-
|
109
|
-
```ruby
|
110
|
-
u = User.new
|
111
|
-
u.avatar = params[:file] # Assign a file like this, or
|
112
|
-
|
113
|
-
# like this
|
114
|
-
File.open('somewhere') do |f|
|
115
|
-
u.avatar = f
|
116
|
-
end
|
117
|
-
|
118
|
-
u.save!
|
119
|
-
u.avatar.url # => '/url/to/file.png'
|
120
|
-
u.avatar.current_path # => 'path/to/file.png'
|
121
|
-
u.avatar_identifier # => 'file.png'
|
122
|
-
```
|
123
|
-
|
124
|
-
**Note**: `u.avatar` will never return nil, even if there is no photo associated to it.
|
125
|
-
To check if a photo was saved to the model, use `u.avatar.file.nil?` instead.
|
126
|
-
|
127
|
-
### DataMapper, Mongoid, Sequel
|
128
|
-
|
129
|
-
Other ORM support has been extracted into separate gems:
|
130
|
-
|
131
|
-
* [carrierwave-datamapper](https://github.com/carrierwaveuploader/carrierwave-datamapper)
|
132
|
-
* [carrierwave-mongoid](https://github.com/carrierwaveuploader/carrierwave-mongoid)
|
133
|
-
* [carrierwave-sequel](https://github.com/carrierwaveuploader/carrierwave-sequel)
|
134
|
-
|
135
|
-
There are more extensions listed in [the wiki](https://github.com/carrierwaveuploader/carrierwave/wiki)
|
136
|
-
|
137
|
-
## Multiple file uploads
|
138
|
-
**Note:** You must specify using the master branch to enable this feature:
|
139
|
-
|
140
|
-
`gem 'carrierwave', github: 'carrierwaveuploader/carrierwave'`.
|
141
|
-
|
142
|
-
CarrierWave also has convenient support for multiple file upload fields.
|
143
|
-
|
144
|
-
### ActiveRecord
|
145
|
-
|
146
|
-
Add a column which can store an array. This could be an array column or a JSON
|
147
|
-
column for example. Your choice depends on what your database supports. For
|
148
|
-
example, create a migration like this:
|
149
|
-
|
150
|
-
|
151
|
-
rails g migration add_avatars_to_users avatars:json
|
152
|
-
rake db:migrate
|
153
|
-
|
154
|
-
Open your model file and mount the uploader:
|
155
|
-
|
156
|
-
```ruby
|
157
|
-
class User < ActiveRecord::Base
|
158
|
-
mount_uploaders :avatars, AvatarUploader
|
159
|
-
end
|
160
|
-
```
|
161
|
-
|
162
|
-
Make sure your file input fields are set up as multiple file fields. For
|
163
|
-
example in Rails you'll want to do something like this:
|
164
|
-
|
165
|
-
```erb
|
166
|
-
<%= form.file_field :avatars, multiple: true %>
|
167
|
-
```
|
168
|
-
|
169
|
-
Also, make sure your upload controller permits the multiple file upload attribute, *pointing to an empty array in a hash*. For example:
|
170
|
-
|
171
|
-
```ruby
|
172
|
-
params.require(:user).permit(:email, :first_name, :last_name, {avatars: []})
|
173
|
-
```
|
174
|
-
|
175
|
-
Now you can select multiple files in the upload dialog (e.g. SHIFT+SELECT), and they will
|
176
|
-
automatically be stored when the record is saved.
|
177
|
-
|
178
|
-
```ruby
|
179
|
-
u = User.new(params[:user])
|
180
|
-
u.save!
|
181
|
-
u.avatars[0].url # => '/url/to/file.png'
|
182
|
-
u.avatars[0].current_path # => 'path/to/file.png'
|
183
|
-
u.avatars[0].identifier # => 'file.png'
|
184
|
-
```
|
185
|
-
|
186
|
-
## Changing the storage directory
|
187
|
-
|
188
|
-
In order to change where uploaded files are put, just override the `store_dir`
|
189
|
-
method:
|
190
|
-
|
191
|
-
```ruby
|
192
|
-
class MyUploader < CarrierWave::Uploader::Base
|
193
|
-
def store_dir
|
194
|
-
'public/my/upload/directory'
|
195
|
-
end
|
196
|
-
end
|
197
|
-
```
|
198
|
-
|
199
|
-
This works for the file storage as well as Amazon S3 and Rackspace Cloud Files.
|
200
|
-
Define `store_dir` as `nil` if you'd like to store files at the root level.
|
201
|
-
|
202
|
-
If you store files outside the project root folder, you may want to define `cache_dir` in the same way:
|
203
|
-
|
204
|
-
```ruby
|
205
|
-
class MyUploader < CarrierWave::Uploader::Base
|
206
|
-
def cache_dir
|
207
|
-
'/tmp/projectname-cache'
|
208
|
-
end
|
209
|
-
end
|
210
|
-
```
|
211
|
-
|
212
|
-
## Securing uploads
|
213
|
-
|
214
|
-
Certain files might be dangerous if uploaded to the wrong location, such as PHP
|
215
|
-
files or other script files. CarrierWave allows you to specify a whitelist of
|
216
|
-
allowed extensions or content types.
|
217
|
-
|
218
|
-
If you're mounting the uploader, uploading a file with the wrong extension will
|
219
|
-
make the record invalid instead. Otherwise, an error is raised.
|
220
|
-
|
221
|
-
```ruby
|
222
|
-
class MyUploader < CarrierWave::Uploader::Base
|
223
|
-
def extension_whitelist
|
224
|
-
%w(jpg jpeg gif png)
|
225
|
-
end
|
226
|
-
end
|
227
|
-
```
|
228
|
-
|
229
|
-
The same thing could be done using content types.
|
230
|
-
Let's say we need an uploader that accepts only images. This can be done like this
|
231
|
-
|
232
|
-
```ruby
|
233
|
-
class MyUploader < CarrierWave::Uploader::Base
|
234
|
-
def content_type_whitelist
|
235
|
-
/image\//
|
236
|
-
end
|
237
|
-
end
|
238
|
-
```
|
239
|
-
|
240
|
-
You can use a blacklist to reject content types.
|
241
|
-
Let's say we need an uploader that reject JSON files. This can be done like this
|
242
|
-
|
243
|
-
```ruby
|
244
|
-
class NoJsonUploader < CarrierWave::Uploader::Base
|
245
|
-
def content_type_blacklist
|
246
|
-
['application/text', 'application/json']
|
247
|
-
end
|
248
|
-
end
|
249
|
-
```
|
250
|
-
|
251
|
-
### Filenames and unicode chars
|
252
|
-
|
253
|
-
Another security issue you should care for is the file names (see
|
254
|
-
[Ruby On Rails Security Guide](http://guides.rubyonrails.org/security.html#file-uploads)).
|
255
|
-
By default, CarrierWave provides only English letters, arabic numerals and some symbols as
|
256
|
-
white-listed characters in the file name. If you want to support local scripts (Cyrillic letters, letters with diacritics and so on), you
|
257
|
-
have to override `sanitize_regexp` method. It should return regular expression which would match
|
258
|
-
all *non*-allowed symbols.
|
259
|
-
|
260
|
-
```ruby
|
261
|
-
CarrierWave::SanitizedFile.sanitize_regexp = /[^[:word:]\.\-\+]/
|
262
|
-
```
|
263
|
-
|
264
|
-
Also make sure that allowing non-latin characters won't cause a compatibility issue with a third-party
|
265
|
-
plugins or client-side software.
|
266
|
-
|
267
|
-
## Setting the content type
|
268
|
-
|
269
|
-
As of v0.11.0, the `mime-types` gem is a runtime dependency and the content type is set automatically.
|
270
|
-
You no longer need to do this manually.
|
271
|
-
|
272
|
-
## Adding versions
|
273
|
-
|
274
|
-
Often you'll want to add different versions of the same file. The classic example is image thumbnails. There is built in support for this*:
|
275
|
-
|
276
|
-
*Note:* You must have Imagemagick and MiniMagick installed to do image resizing. MiniMagick is a Ruby interface for Imagemagick which is a C program. This is why MiniMagick fails on 'bundle install' without Imagemagick installed.
|
277
|
-
|
278
|
-
Some documentation refers to RMagick instead of MiniMagick but MiniMagick is recommended.
|
279
|
-
|
280
|
-
To install Imagemagick on OSX with homebrew type the following:
|
281
|
-
|
282
|
-
```
|
283
|
-
$ brew install imagemagick
|
284
|
-
```
|
285
|
-
|
286
|
-
```ruby
|
287
|
-
class MyUploader < CarrierWave::Uploader::Base
|
288
|
-
include CarrierWave::MiniMagick
|
289
|
-
|
290
|
-
process resize_to_fit: [800, 800]
|
291
|
-
|
292
|
-
version :thumb do
|
293
|
-
process resize_to_fill: [200,200]
|
294
|
-
end
|
295
|
-
|
296
|
-
end
|
297
|
-
```
|
298
|
-
|
299
|
-
When this uploader is used, an uploaded image would be scaled to be no larger
|
300
|
-
than 800 by 800 pixels. A version called thumb is then created, which is scaled
|
301
|
-
and cropped to exactly 200 by 200 pixels. The uploader could be used like this:
|
302
|
-
|
303
|
-
```ruby
|
304
|
-
uploader = AvatarUploader.new
|
305
|
-
uploader.store!(my_file) # size: 1024x768
|
306
|
-
|
307
|
-
uploader.url # => '/url/to/my_file.png' # size: 800x600
|
308
|
-
uploader.thumb.url # => '/url/to/thumb_my_file.png' # size: 200x200
|
309
|
-
```
|
310
|
-
|
311
|
-
One important thing to remember is that process is called *before* versions are
|
312
|
-
created. This can cut down on processing cost.
|
313
|
-
|
314
|
-
It is possible to nest versions within versions:
|
315
|
-
|
316
|
-
```ruby
|
317
|
-
class MyUploader < CarrierWave::Uploader::Base
|
318
|
-
|
319
|
-
version :animal do
|
320
|
-
version :human
|
321
|
-
version :monkey
|
322
|
-
version :llama
|
323
|
-
end
|
324
|
-
end
|
325
|
-
```
|
326
|
-
|
327
|
-
### Conditional versions
|
328
|
-
|
329
|
-
Occasionally you want to restrict the creation of versions on certain
|
330
|
-
properties within the model or based on the picture itself.
|
331
|
-
|
332
|
-
```ruby
|
333
|
-
class MyUploader < CarrierWave::Uploader::Base
|
334
|
-
|
335
|
-
version :human, if: :is_human?
|
336
|
-
version :monkey, if: :is_monkey?
|
337
|
-
version :banner, if: :is_landscape?
|
338
|
-
|
339
|
-
private
|
340
|
-
|
341
|
-
def is_human? picture
|
342
|
-
model.can_program?(:ruby)
|
343
|
-
end
|
344
|
-
|
345
|
-
def is_monkey? picture
|
346
|
-
model.favorite_food == 'banana'
|
347
|
-
end
|
348
|
-
|
349
|
-
def is_landscape? picture
|
350
|
-
image = MiniMagick::Image.open(picture.path)
|
351
|
-
image[:width] > image[:height]
|
352
|
-
end
|
353
|
-
|
354
|
-
end
|
355
|
-
```
|
356
|
-
|
357
|
-
The `model` variable points to the instance object the uploader is attached to.
|
358
|
-
|
359
|
-
### Create versions from existing versions
|
360
|
-
|
361
|
-
For performance reasons, it is often useful to create versions from existing ones
|
362
|
-
instead of using the original file. If your uploader generates several versions
|
363
|
-
where the next is smaller than the last, it will take less time to generate from
|
364
|
-
a smaller, already processed image.
|
365
|
-
|
366
|
-
```ruby
|
367
|
-
class MyUploader < CarrierWave::Uploader::Base
|
368
|
-
|
369
|
-
version :thumb do
|
370
|
-
process resize_to_fill: [280, 280]
|
371
|
-
end
|
372
|
-
|
373
|
-
version :small_thumb, from_version: :thumb do
|
374
|
-
process resize_to_fill: [20, 20]
|
375
|
-
end
|
376
|
-
|
377
|
-
end
|
378
|
-
```
|
379
|
-
|
380
|
-
The option `:from_version` uses the file cached in the `:thumb` version instead
|
381
|
-
of the original version, potentially resulting in faster processing.
|
382
|
-
|
383
|
-
## Making uploads work across form redisplays
|
384
|
-
|
385
|
-
Often you'll notice that uploaded files disappear when a validation fails.
|
386
|
-
CarrierWave has a feature that makes it easy to remember the uploaded file even
|
387
|
-
in that case. Suppose your `user` model has an uploader mounted on `avatar`
|
388
|
-
file, just add a hidden field called `avatar_cache` (don't forget to add it to
|
389
|
-
the attr_accessible list as necessary). In Rails, this would look like this:
|
390
|
-
|
391
|
-
```erb
|
392
|
-
<%= form_for @user, html: { multipart: true } do |f| %>
|
393
|
-
<p>
|
394
|
-
<label>My Avatar</label>
|
395
|
-
<%= f.file_field :avatar %>
|
396
|
-
<%= f.hidden_field :avatar_cache %>
|
397
|
-
</p>
|
398
|
-
<% end %>
|
399
|
-
````
|
400
|
-
|
401
|
-
It might be a good idea to show the user that a file has been uploaded, in the
|
402
|
-
case of images, a small thumbnail would be a good indicator:
|
403
|
-
|
404
|
-
```erb
|
405
|
-
<%= form_for @user, html: { multipart: true } do |f| %>
|
406
|
-
<p>
|
407
|
-
<label>My Avatar</label>
|
408
|
-
<%= image_tag(@user.avatar_url) if @user.avatar? %>
|
409
|
-
<%= f.file_field :avatar %>
|
410
|
-
<%= f.hidden_field :avatar_cache %>
|
411
|
-
</p>
|
412
|
-
<% end %>
|
413
|
-
```
|
414
|
-
|
415
|
-
## Removing uploaded files
|
416
|
-
|
417
|
-
If you want to remove a previously uploaded file on a mounted uploader, you can
|
418
|
-
easily add a checkbox to the form which will remove the file when checked.
|
419
|
-
|
420
|
-
```erb
|
421
|
-
<%= form_for @user, html: { multipart: true } do |f| %>
|
422
|
-
<p>
|
423
|
-
<label>My Avatar</label>
|
424
|
-
<%= image_tag(@user.avatar_url) if @user.avatar? %>
|
425
|
-
<%= f.file_field :avatar %>
|
426
|
-
</p>
|
427
|
-
|
428
|
-
<p>
|
429
|
-
<label>
|
430
|
-
<%= f.check_box :remove_avatar %>
|
431
|
-
Remove avatar
|
432
|
-
</label>
|
433
|
-
</p>
|
434
|
-
<% end %>
|
435
|
-
```
|
436
|
-
|
437
|
-
If you want to remove the file manually, you can call <code>remove_avatar!</code>, then save the object.
|
438
|
-
|
439
|
-
```erb
|
440
|
-
@user.remove_avatar!
|
441
|
-
@user.save
|
442
|
-
#=> true
|
443
|
-
```
|
444
|
-
|
445
|
-
## Uploading files from a remote location
|
446
|
-
|
447
|
-
Your users may find it convenient to upload a file from a location on the Internet
|
448
|
-
via a URL. CarrierWave makes this simple, just add the appropriate attribute to your
|
449
|
-
form and you're good to go:
|
450
|
-
|
451
|
-
```erb
|
452
|
-
<%= form_for @user, html: { multipart: true } do |f| %>
|
453
|
-
<p>
|
454
|
-
<label>My Avatar URL:</label>
|
455
|
-
<%= image_tag(@user.avatar_url) if @user.avatar? %>
|
456
|
-
<%= f.text_field :remote_avatar_url %>
|
457
|
-
</p>
|
458
|
-
<% end %>
|
459
|
-
```
|
460
|
-
|
461
|
-
If you're using ActiveRecord, CarrierWave will indicate invalid URLs and download
|
462
|
-
failures automatically with attribute validation errors. If you aren't, or you
|
463
|
-
disable CarrierWave's `validate_download` option, you'll need to handle those
|
464
|
-
errors yourself.
|
465
|
-
|
466
|
-
## Providing a default URL
|
467
|
-
|
468
|
-
In many cases, especially when working with images, it might be a good idea to
|
469
|
-
provide a default url, a fallback in case no file has been uploaded. You can do
|
470
|
-
this easily by overriding the `default_url` method in your uploader:
|
471
|
-
|
472
|
-
```ruby
|
473
|
-
class MyUploader < CarrierWave::Uploader::Base
|
474
|
-
def default_url(*args)
|
475
|
-
"/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
476
|
-
end
|
477
|
-
end
|
478
|
-
```
|
479
|
-
|
480
|
-
Or if you are using the Rails asset pipeline:
|
481
|
-
|
482
|
-
```ruby
|
483
|
-
class MyUploader < CarrierWave::Uploader::Base
|
484
|
-
def default_url(*args)
|
485
|
-
ActionController::Base.helpers.asset_path("fallback/" + [version_name, "default.png"].compact.join('_'))
|
486
|
-
end
|
487
|
-
end
|
488
|
-
```
|
489
|
-
|
490
|
-
## Recreating versions
|
491
|
-
|
492
|
-
You might come to a situation where you want to retroactively change a version
|
493
|
-
or add a new one. You can use the `recreate_versions!` method to recreate the
|
494
|
-
versions from the base file. This uses a naive approach which will re-upload and
|
495
|
-
process the specified version or all versions, if none is passed as an argument.
|
496
|
-
|
497
|
-
When you are generating random unique filenames you have to call `save!` on
|
498
|
-
the model after using `recreate_versions!`. This is necessary because
|
499
|
-
`recreate_versions!` doesn't save the new filename to the database. Calling
|
500
|
-
`save!` yourself will prevent that the database and file system are running
|
501
|
-
out of sync.
|
502
|
-
|
503
|
-
```ruby
|
504
|
-
instance = MyUploader.new
|
505
|
-
instance.recreate_versions!(:thumb, :large)
|
506
|
-
```
|
507
|
-
|
508
|
-
Or on a mounted uploader:
|
509
|
-
|
510
|
-
```ruby
|
511
|
-
User.find_each do |user|
|
512
|
-
user.avatar.recreate_versions!
|
513
|
-
end
|
514
|
-
```
|
515
|
-
|
516
|
-
Note: `recreate_versions!` will throw an exception on records without an image. To avoid this, scope the records to those with images or check if an image exists within the block. If you're using ActiveRecord, recreating versions for a user avatar might look like this:
|
517
|
-
|
518
|
-
```ruby
|
519
|
-
User.find_each do |user|
|
520
|
-
user.avatar.recreate_versions! if user.avatar?
|
521
|
-
end
|
522
|
-
```
|
523
|
-
|
524
|
-
## Configuring CarrierWave
|
525
|
-
|
526
|
-
CarrierWave has a broad range of configuration options, which you can configure,
|
527
|
-
both globally and on a per-uploader basis:
|
528
|
-
|
529
|
-
```ruby
|
530
|
-
CarrierWave.configure do |config|
|
531
|
-
config.permissions = 0666
|
532
|
-
config.directory_permissions = 0777
|
533
|
-
config.storage = :file
|
534
|
-
end
|
535
|
-
```
|
536
|
-
|
537
|
-
Or alternatively:
|
538
|
-
|
539
|
-
```ruby
|
540
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
541
|
-
permissions 0777
|
542
|
-
end
|
543
|
-
```
|
544
|
-
|
545
|
-
If you're using Rails, create an initializer for this:
|
546
|
-
|
547
|
-
config/initializers/carrierwave.rb
|
548
|
-
|
549
|
-
If you want CarrierWave to fail noisily in development, you can change these configs in your environment file:
|
550
|
-
|
551
|
-
```ruby
|
552
|
-
CarrierWave.configure do |config|
|
553
|
-
config.ignore_integrity_errors = false
|
554
|
-
config.ignore_processing_errors = false
|
555
|
-
config.ignore_download_errors = false
|
556
|
-
end
|
557
|
-
```
|
558
|
-
|
559
|
-
|
560
|
-
## Testing with CarrierWave
|
561
|
-
|
562
|
-
It's a good idea to test your uploaders in isolation. In order to speed up your
|
563
|
-
tests, it's recommended to switch off processing in your tests, and to use the
|
564
|
-
file storage. In Rails you could do that by adding an initializer with:
|
565
|
-
|
566
|
-
```ruby
|
567
|
-
if Rails.env.test? or Rails.env.cucumber?
|
568
|
-
CarrierWave.configure do |config|
|
569
|
-
config.storage = :file
|
570
|
-
config.enable_processing = false
|
571
|
-
end
|
572
|
-
end
|
573
|
-
```
|
574
|
-
|
575
|
-
Remember, if you have already set `storage :something` in your uploader, the `storage`
|
576
|
-
setting from this initializer will be ignored.
|
577
|
-
|
578
|
-
If you need to test your processing, you should test it in isolation, and enable
|
579
|
-
processing only for those tests that need it.
|
580
|
-
|
581
|
-
CarrierWave comes with some RSpec matchers which you may find useful:
|
582
|
-
|
583
|
-
```ruby
|
584
|
-
require 'carrierwave/test/matchers'
|
585
|
-
|
586
|
-
describe MyUploader do
|
587
|
-
include CarrierWave::Test::Matchers
|
588
|
-
|
589
|
-
let(:user) { double('user') }
|
590
|
-
let(:uploader) { MyUploader.new(user, :avatar) }
|
591
|
-
|
592
|
-
before do
|
593
|
-
MyUploader.enable_processing = true
|
594
|
-
File.open(path_to_file) { |f| uploader.store!(f) }
|
595
|
-
end
|
596
|
-
|
597
|
-
after do
|
598
|
-
MyUploader.enable_processing = false
|
599
|
-
uploader.remove!
|
600
|
-
end
|
601
|
-
|
602
|
-
context 'the thumb version' do
|
603
|
-
it "scales down a landscape image to be exactly 64 by 64 pixels" do
|
604
|
-
expect(uploader.thumb).to have_dimensions(64, 64)
|
605
|
-
end
|
606
|
-
end
|
607
|
-
|
608
|
-
context 'the small version' do
|
609
|
-
it "scales down a landscape image to fit within 200 by 200 pixels" do
|
610
|
-
expect(uploader.small).to be_no_larger_than(200, 200)
|
611
|
-
end
|
612
|
-
end
|
613
|
-
|
614
|
-
it "makes the image readable only to the owner and not executable" do
|
615
|
-
expect(uploader).to have_permissions(0600)
|
616
|
-
end
|
617
|
-
|
618
|
-
it "has the correct format" do
|
619
|
-
expect(uploader).to be_format('png')
|
620
|
-
end
|
621
|
-
end
|
622
|
-
```
|
623
|
-
|
624
|
-
Setting the enable_processing flag on an uploader will prevent any of the versions from processing as well.
|
625
|
-
Processing can be enabled for a single version by setting the processing flag on the version like so:
|
626
|
-
|
627
|
-
```ruby
|
628
|
-
@uploader.thumb.enable_processing = true
|
629
|
-
```
|
630
|
-
|
631
|
-
## Fog
|
632
|
-
|
633
|
-
If you want to use fog you must add in your CarrierWave initializer the
|
634
|
-
following lines
|
635
|
-
|
636
|
-
```ruby
|
637
|
-
config.fog_provider = 'fog' # 'fog/aws' etc. Defaults to 'fog'
|
638
|
-
config.fog_credentials = { ... } # Provider specific credentials
|
639
|
-
```
|
640
|
-
|
641
|
-
## Using Amazon S3
|
642
|
-
|
643
|
-
[Fog AWS](http://github.com/fog/fog-aws) is used to support Amazon S3. Ensure you have it in your Gemfile:
|
644
|
-
|
645
|
-
```ruby
|
646
|
-
gem "fog-aws"
|
647
|
-
```
|
648
|
-
|
649
|
-
You'll need to provide your fog_credentials and a fog_directory (also known as a bucket) in an initializer.
|
650
|
-
For the sake of performance it is assumed that the directory already exists, so please create it if it needs to be.
|
651
|
-
You can also pass in additional options, as documented fully in lib/carrierwave/storage/fog.rb. Here's a full example:
|
652
|
-
|
653
|
-
```ruby
|
654
|
-
CarrierWave.configure do |config|
|
655
|
-
config.fog_provider = 'fog/aws' # required
|
656
|
-
config.fog_credentials = {
|
657
|
-
provider: 'AWS', # required
|
658
|
-
aws_access_key_id: 'xxx', # required
|
659
|
-
aws_secret_access_key: 'yyy', # required
|
660
|
-
region: 'eu-west-1', # optional, defaults to 'us-east-1'
|
661
|
-
host: 's3.example.com', # optional, defaults to nil
|
662
|
-
endpoint: 'https://s3.example.com:8080' # optional, defaults to nil
|
663
|
-
}
|
664
|
-
config.fog_directory = 'name_of_directory' # required
|
665
|
-
config.fog_public = false # optional, defaults to true
|
666
|
-
config.fog_attributes = { 'Cache-Control' => "max-age=#{365.day.to_i}" } # optional, defaults to {}
|
667
|
-
end
|
668
|
-
```
|
669
|
-
|
670
|
-
In your uploader, set the storage to :fog
|
671
|
-
|
672
|
-
```ruby
|
673
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
674
|
-
storage :fog
|
675
|
-
end
|
676
|
-
```
|
677
|
-
|
678
|
-
That's it! You can still use the `CarrierWave::Uploader#url` method to return the url to the file on Amazon S3.
|
679
|
-
|
680
|
-
## Using Rackspace Cloud Files
|
681
|
-
|
682
|
-
[Fog](http://github.com/fog/fog) is used to support Rackspace Cloud Files. Ensure you have it in your Gemfile:
|
683
|
-
|
684
|
-
```ruby
|
685
|
-
gem "fog"
|
686
|
-
```
|
687
|
-
|
688
|
-
You'll need to configure a directory (also known as a container), username and API key in the initializer.
|
689
|
-
For the sake of performance it is assumed that the directory already exists, so please create it if need be.
|
690
|
-
|
691
|
-
Using a US-based account:
|
692
|
-
|
693
|
-
```ruby
|
694
|
-
CarrierWave.configure do |config|
|
695
|
-
config.fog_provider = "fog/rackspace/storage" # optional, defaults to "fog"
|
696
|
-
config.fog_credentials = {
|
697
|
-
provider: 'Rackspace',
|
698
|
-
rackspace_username: 'xxxxxx',
|
699
|
-
rackspace_api_key: 'yyyyyy',
|
700
|
-
rackspace_region: :ord # optional, defaults to :dfw
|
701
|
-
}
|
702
|
-
config.fog_directory = 'name_of_directory'
|
703
|
-
end
|
704
|
-
```
|
705
|
-
|
706
|
-
Using a UK-based account:
|
707
|
-
|
708
|
-
```ruby
|
709
|
-
CarrierWave.configure do |config|
|
710
|
-
config.fog_provider = "fog/rackspace/storage" # optional, defaults to "fog"
|
711
|
-
config.fog_credentials = {
|
712
|
-
provider: 'Rackspace',
|
713
|
-
rackspace_username: 'xxxxxx',
|
714
|
-
rackspace_api_key: 'yyyyyy',
|
715
|
-
rackspace_auth_url: Fog::Rackspace::UK_AUTH_ENDPOINT,
|
716
|
-
rackspace_region: :lon
|
717
|
-
}
|
718
|
-
config.fog_directory = 'name_of_directory'
|
719
|
-
end
|
720
|
-
```
|
721
|
-
|
722
|
-
You can optionally include your CDN host name in the configuration.
|
723
|
-
This is *highly* recommended, as without it every request requires a lookup
|
724
|
-
of this information.
|
725
|
-
|
726
|
-
```ruby
|
727
|
-
config.asset_host = "http://c000000.cdn.rackspacecloud.com"
|
728
|
-
```
|
729
|
-
|
730
|
-
In your uploader, set the storage to :fog
|
731
|
-
|
732
|
-
```ruby
|
733
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
734
|
-
storage :fog
|
735
|
-
end
|
736
|
-
```
|
737
|
-
|
738
|
-
That's it! You can still use the `CarrierWave::Uploader#url` method to return
|
739
|
-
the url to the file on Rackspace Cloud Files.
|
740
|
-
|
741
|
-
## Using Google Storage for Developers
|
742
|
-
|
743
|
-
[Fog](http://github.com/fog/fog-google) is used to support Google Storage for Developers. Ensure you have it in your Gemfile:
|
744
|
-
|
745
|
-
```ruby
|
746
|
-
gem "fog-google"
|
747
|
-
gem "google-api-client", "< 0.9", ">= 0.6.2"
|
748
|
-
gem "mime-types"
|
749
|
-
```
|
750
|
-
|
751
|
-
You'll need to configure a directory (also known as a bucket), access key id and secret access key in the initializer.
|
752
|
-
For the sake of performance it is assumed that the directory already exists, so please create it if need be.
|
753
|
-
|
754
|
-
Please read the [fog-google README](https://github.com/fog/fog-google/blob/master/README.md) on how to get credentials.
|
755
|
-
|
756
|
-
|
757
|
-
```ruby
|
758
|
-
CarrierWave.configure do |config|
|
759
|
-
config.fog_provider = 'fog/google' # required
|
760
|
-
config.fog_credentials = {
|
761
|
-
provider: 'Google',
|
762
|
-
google_storage_access_key_id: 'xxxxxx',
|
763
|
-
google_storage_secret_access_key: 'yyyyyy'
|
764
|
-
}
|
765
|
-
config.fog_directory = 'name_of_directory'
|
766
|
-
end
|
767
|
-
```
|
768
|
-
|
769
|
-
In your uploader, set the storage to :fog
|
770
|
-
|
771
|
-
```ruby
|
772
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
773
|
-
storage :fog
|
774
|
-
end
|
775
|
-
```
|
776
|
-
|
777
|
-
That's it! You can still use the `CarrierWave::Uploader#url` method to return
|
778
|
-
the url to the file on Google.
|
779
|
-
|
780
|
-
## Optimized Loading of Fog
|
781
|
-
|
782
|
-
Since Carrierwave doesn't know which parts of Fog you intend to use, it will just load the entire library (unless you use e.g. [`fog-aws`, `fog-google`] instead of fog proper). If you prefer to load fewer classes into your application, you need to load those parts of Fog yourself *before* loading CarrierWave in your Gemfile. Ex:
|
783
|
-
|
784
|
-
```ruby
|
785
|
-
gem "fog", "~> 1.27", require: "fog/rackspace/storage"
|
786
|
-
gem "carrierwave"
|
787
|
-
```
|
788
|
-
|
789
|
-
A couple of notes about versions:
|
790
|
-
* This functionality was introduced in Fog v1.20.
|
791
|
-
* This functionality is slated for CarrierWave v1.0.0.
|
792
|
-
|
793
|
-
If you're not relying on Gemfile entries alone and are requiring "carrierwave" anywhere, ensure you require "fog/rackspace/storage" before it. Ex:
|
794
|
-
|
795
|
-
```ruby
|
796
|
-
require "fog/rackspace/storage"
|
797
|
-
require "carrierwave"
|
798
|
-
```
|
799
|
-
|
800
|
-
Beware that this specific require is only needed when working with a fog provider that was not extracted to its own gem yet.
|
801
|
-
A list of the extracted providers can be found in the page of the `fog` organizations [here](https://github.com/fog).
|
802
|
-
|
803
|
-
When in doubt, inspect `Fog.constants` to see what has been loaded.
|
804
|
-
|
805
|
-
## Dynamic Asset Host
|
806
|
-
|
807
|
-
The `asset_host` config property can be assigned a proc (or anything that responds to `call`) for generating the host dynamically. The proc-compliant object gets an instance of the current `CarrierWave::Storage::Fog::File` or `CarrierWave::SanitizedFile` as its only argument.
|
808
|
-
|
809
|
-
```ruby
|
810
|
-
CarrierWave.configure do |config|
|
811
|
-
config.asset_host = proc do |file|
|
812
|
-
identifier = # some logic
|
813
|
-
"http://#{identifier}.cdn.rackspacecloud.com"
|
814
|
-
end
|
815
|
-
end
|
816
|
-
```
|
817
|
-
|
818
|
-
## Using RMagick
|
819
|
-
|
820
|
-
If you're uploading images, you'll probably want to manipulate them in some way,
|
821
|
-
you might want to create thumbnail images for example. CarrierWave comes with a
|
822
|
-
small library to make manipulating images with RMagick easier, you'll need to
|
823
|
-
include it in your Uploader:
|
824
|
-
|
825
|
-
```ruby
|
826
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
827
|
-
include CarrierWave::RMagick
|
828
|
-
end
|
829
|
-
```
|
830
|
-
|
831
|
-
The RMagick module gives you a few methods, like
|
832
|
-
`CarrierWave::RMagick#resize_to_fill` which manipulate the image file in some
|
833
|
-
way. You can set a `process` callback, which will call that method any time a
|
834
|
-
file is uploaded.
|
835
|
-
There is a demonstration of convert here.
|
836
|
-
Convert will only work if the file has the same file extension, thus the use of the filename method.
|
837
|
-
|
838
|
-
```ruby
|
839
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
840
|
-
include CarrierWave::RMagick
|
841
|
-
|
842
|
-
process resize_to_fill: [200, 200]
|
843
|
-
process convert: 'png'
|
844
|
-
|
845
|
-
def filename
|
846
|
-
super.chomp(File.extname(super)) + '.png' if original_filename.present?
|
847
|
-
end
|
848
|
-
end
|
849
|
-
```
|
850
|
-
|
851
|
-
Check out the manipulate! method, which makes it easy for you to write your own
|
852
|
-
manipulation methods.
|
853
|
-
|
854
|
-
## Using MiniMagick
|
855
|
-
|
856
|
-
MiniMagick is similar to RMagick but performs all the operations using the 'mogrify'
|
857
|
-
command which is part of the standard ImageMagick kit. This allows you to have the power
|
858
|
-
of ImageMagick without having to worry about installing all the RMagick libraries.
|
859
|
-
|
860
|
-
See the MiniMagick site for more details:
|
861
|
-
|
862
|
-
https://github.com/minimagick/minimagick
|
863
|
-
|
864
|
-
And the ImageMagick command line options for more for whats on offer:
|
865
|
-
|
866
|
-
http://www.imagemagick.org/script/command-line-options.php
|
867
|
-
|
868
|
-
Currently, the MiniMagick carrierwave processor provides exactly the same methods as
|
869
|
-
for the RMagick processor.
|
870
|
-
|
871
|
-
```ruby
|
872
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
873
|
-
include CarrierWave::MiniMagick
|
874
|
-
|
875
|
-
process resize_to_fill: [200, 200]
|
876
|
-
end
|
877
|
-
```
|
878
|
-
|
879
|
-
## Migrating from Paperclip
|
880
|
-
|
881
|
-
If you are using Paperclip, you can use the provided compatibility module:
|
882
|
-
|
883
|
-
```ruby
|
884
|
-
class AvatarUploader < CarrierWave::Uploader::Base
|
885
|
-
include CarrierWave::Compatibility::Paperclip
|
886
|
-
end
|
887
|
-
```
|
888
|
-
|
889
|
-
See the documentation for `CarrierWave::Compatibility::Paperclip` for more
|
890
|
-
details.
|
891
|
-
|
892
|
-
Be sure to use mount_on to specify the correct column:
|
893
|
-
|
894
|
-
```ruby
|
895
|
-
mount_uploader :avatar, AvatarUploader, mount_on: :avatar_file_name
|
896
|
-
```
|
897
|
-
|
898
|
-
## I18n
|
899
|
-
|
900
|
-
The Active Record validations use the Rails i18n framework. Add these keys to
|
901
|
-
your translations file:
|
902
|
-
|
903
|
-
```yaml
|
904
|
-
errors:
|
905
|
-
messages:
|
906
|
-
carrierwave_processing_error: "Cannot resize image."
|
907
|
-
carrierwave_integrity_error: "Not an image."
|
908
|
-
carrierwave_download_error: "Couldn't download image."
|
909
|
-
extension_whitelist_error: "You are not allowed to upload %{extension} files, allowed types: %{allowed_types}"
|
910
|
-
extension_blacklist_error: "You are not allowed to upload %{extension} files, prohibited types: %{prohibited_types}"
|
911
|
-
```
|
912
|
-
|
913
|
-
## Large files
|
914
|
-
|
915
|
-
By default, CarrierWave copies an uploaded file twice, first copying the file into the cache, then
|
916
|
-
copying the file into the store. For large files, this can be prohibitively time consuming.
|
917
|
-
|
918
|
-
You may change this behavior by overriding either or both of the `move_to_cache` and
|
919
|
-
`move_to_store` methods:
|
920
|
-
|
921
|
-
```ruby
|
922
|
-
class MyUploader < CarrierWave::Uploader::Base
|
923
|
-
def move_to_cache
|
924
|
-
true
|
925
|
-
end
|
926
|
-
|
927
|
-
def move_to_store
|
928
|
-
true
|
929
|
-
end
|
930
|
-
end
|
931
|
-
```
|
932
|
-
|
933
|
-
When the `move_to_cache` and/or `move_to_store` methods return true, files will be moved (instead of copied) to the cache and store respectively.
|
934
|
-
|
935
|
-
This has only been tested with the local filesystem store.
|
936
|
-
|
937
|
-
## Skipping ActiveRecord callbacks
|
938
|
-
|
939
|
-
By default, mounting an uploader into an ActiveRecord model will add a few
|
940
|
-
callbacks. For example, this code:
|
941
|
-
|
942
|
-
```ruby
|
943
|
-
class User
|
944
|
-
mount_uploader :avatar, AvatarUploader
|
945
|
-
end
|
946
|
-
```
|
947
|
-
|
948
|
-
Will add these callbacks:
|
949
|
-
|
950
|
-
```ruby
|
951
|
-
after_save :store_avatar!
|
952
|
-
before_save :write_avatar_identifier
|
953
|
-
after_commit :remove_avatar!, on: :destroy
|
954
|
-
after_commit :mark_remove_avatar_false, on: :update
|
955
|
-
after_save :store_previous_changes_for_avatar
|
956
|
-
after_commit :remove_previously_stored_avatar, on: :update
|
957
|
-
```
|
958
|
-
|
959
|
-
If you want to skip any of these callbacks (eg. you want to keep the existing
|
960
|
-
avatar, even after uploading a new one), you can use ActiveRecord’s
|
961
|
-
`skip_callback` method.
|
962
|
-
|
963
|
-
```ruby
|
964
|
-
class User
|
965
|
-
mount_uploader :avatar, AvatarUploader
|
966
|
-
skip_callback :commit, :after, :remove_previously_stored_avatar
|
967
|
-
end
|
968
|
-
```
|
969
|
-
|
970
|
-
## Contributing to CarrierWave
|
971
|
-
|
972
|
-
See [CONTRIBUTING.md](https://github.com/carrierwaveuploader/carrierwave/blob/master/CONTRIBUTING.md)
|
973
|
-
|
974
|
-
## License
|
975
|
-
|
976
|
-
Copyright (c) 2008-2015 Jonas Nicklas
|
977
|
-
|
978
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
979
|
-
a copy of this software and associated documentation files (the
|
980
|
-
"Software"), to deal in the Software without restriction, including
|
981
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
982
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
983
|
-
permit persons to whom the Software is furnished to do so, subject to
|
984
|
-
the following conditions:
|
985
|
-
|
986
|
-
The above copyright notice and this permission notice shall be
|
987
|
-
included in all copies or substantial portions of the Software.
|
988
|
-
|
989
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
990
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
991
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
992
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
993
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
994
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
995
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|