card 1.19.0 → 1.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/card.gemspec +3 -3
- data/config/initializers/{02_extensions → 02_patches}/kaminari.rb +16 -5
- data/config/initializers/patches.rb +7 -0
- data/config/locales/en.yml +15 -6
- data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +11 -11
- data/db/migrate_core_cards/data/themes/bootstrap_default/_variables.scss +2 -1
- data/db/seed/new/card_actions.yml +915 -443
- data/db/seed/new/card_acts.yml +348 -186
- data/db/seed/new/card_changes.yml +4409 -3329
- data/db/seed/new/card_references.yml +220 -3
- data/db/seed/new/cards.yml +6687 -3445
- data/db/seed/test/fixtures/card_actions.yml +1953 -1513
- data/db/seed/test/fixtures/card_acts.yml +615 -453
- data/db/seed/test/fixtures/card_changes.yml +7596 -6516
- data/db/seed/test/fixtures/card_references.yml +892 -675
- data/db/seed/test/fixtures/cards.yml +8803 -5561
- data/db/seeds.rb +8 -0
- data/lib/card.rb +10 -0
- data/lib/card/auth/setup.rb +6 -6
- data/lib/card/mod/dirs.rb +13 -3
- data/lib/card/set/advanced_api.rb +5 -4
- data/lib/cardio.rb +7 -3
- data/mod/Modfile +2 -2
- data/mod/admin/set/self/admin.rb +47 -30
- data/mod/admin/set/self/admin_info.rb +11 -11
- data/mod/basic_formats/set/self/head.rb +1 -1
- data/mod/{basic_types → basic_formats}/spec/set/all/all_css_spec.rb +0 -0
- data/mod/{basic_types → basic_formats}/spec/set/all/all_csv_spec.rb +0 -0
- data/mod/{basic_types → basic_formats}/spec/set/all/base_spec.rb +0 -0
- data/mod/{basic_types → basic_formats}/spec/set/all/file_spec.rb +0 -0
- data/mod/{basic_types → basic_formats}/spec/set/all/json_spec.rb +0 -0
- data/mod/{basic_types → basic_formats}/spec/set/all/rss_spec.rb +0 -0
- data/mod/{basic_types → basic_formats}/spec/set/all/text_spec.rb +0 -0
- data/mod/bootstrap/lib/stylesheets/bootstrap/_variables.scss +1 -1
- data/mod/bootstrap/set/all/bootstrap/table.rb +1 -1
- data/mod/bootstrap/set/self/bootswatch_shared.rb +1 -1
- data/mod/carrierwave/Gemfile +4 -0
- data/mod/carrierwave/lib/carrier_wave/cardmount.rb +24 -13
- data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +189 -57
- data/mod/carrierwave/lib/carrier_wave/image_card_uploader.rb +5 -0
- data/mod/carrierwave/set/abstract/attachment.rb +26 -190
- data/mod/carrierwave/set/abstract/attachment/paths.rb +50 -0
- data/mod/carrierwave/set/abstract/attachment/storage_type.rb +319 -0
- data/mod/carrierwave/set/abstract/attachment/upload_cache.rb +77 -0
- data/mod/carrierwave/set/all/file_utils.rb +28 -0
- data/mod/carrierwave/set/self/admin.rb +23 -0
- data/mod/carrierwave/set/type/file.rb +26 -23
- data/mod/carrierwave/set/type/image.rb +1 -0
- data/mod/carrierwave/spec/lib/carrier_wave/file_card_uploader_spec.rb +67 -0
- data/mod/carrierwave/spec/set/type/file_spec.rb +557 -0
- data/mod/{standard → carrierwave}/spec/set/type/image_spec.rb +22 -4
- data/mod/core/set/abstract/code_file.rb +3 -3
- data/mod/core/set/all/debug.rb +23 -0
- data/mod/core/set/all/name.rb +1 -1
- data/mod/core/set/all/permissions.rb +22 -12
- data/mod/core/set/all/tracked_attributes.rb +0 -76
- data/mod/core/set/all/trash.rb +50 -0
- data/mod/core/set/all/update_read_rules.rb +84 -0
- data/mod/core/set/all/utils.rb +1 -75
- data/mod/email/set/type_plus_right/user/follow.rb +4 -8
- data/mod/history/lib/card/act.rb +3 -1
- data/mod/history/lib/card/action.rb +3 -1
- data/mod/history/lib/card/action/differ.rb +12 -1
- data/mod/history/set/all/history.rb +2 -1
- data/mod/machines/file/all_script_machine_output/file.js +211 -0
- data/mod/machines/file/all_style_machine_output/file.css +19 -0
- data/mod/machines/set/abstract/machine.rb +270 -0
- data/mod/machines/set/abstract/machine_input.rb +76 -0
- data/mod/machines/set/right/machine_output.rb +9 -1
- data/mod/machines/set/type/coffee_script.rb +2 -6
- data/mod/machines/set/type/css.rb +2 -2
- data/mod/machines/set/type/java_script.rb +2 -2
- data/mod/machines/set/type/skin.rb +2 -2
- data/mod/machines/spec/set/abstract/machine_spec.rb +10 -0
- data/mod/{basic_types → pointer}/spec/set/type/pointer_spec.rb +10 -26
- data/mod/settings/set/right/script.rb +1 -1
- data/mod/settings/set/right/style.rb +1 -1
- data/mod/solid_cache/set/all/solid_cache.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/all/links.rb +2 -2
- data/spec/spec_helper.rb +15 -3
- data/tmpsets/set/{mod014-admin → mod001-admin}/self/admin.rb +47 -30
- data/tmpsets/set/{mod014-admin → mod001-admin}/self/admin_info.rb +11 -11
- data/tmpsets/set/{mod014-admin → mod001-admin}/self/version.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/abstract/code_file.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/actify.rb +6 -5
- data/tmpsets/set/{mod001-core → mod002-core}/all/active_card.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/collection.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/content.rb +0 -0
- data/tmpsets/set/mod002-core/all/debug.rb +30 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/erb.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/event.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/export.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/fetch.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/haml.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/initialize.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/location_history.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/name.rb +1 -1
- data/tmpsets/set/{mod001-core → mod002-core}/all/name_validations.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/pattern.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/permissions.rb +22 -12
- data/tmpsets/set/{mod001-core → mod002-core}/all/phases.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/references.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/rules.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/stages.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/states.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/subcards.rb +0 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/templating.rb +0 -0
- data/tmpsets/set/mod002-core/all/tracked_attributes.rb +78 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/trash.rb +50 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/type.rb +0 -0
- data/tmpsets/set/mod002-core/all/update_read_rules.rb +91 -0
- data/tmpsets/set/mod002-core/all/utils.rb +62 -0
- data/tmpsets/set/{mod001-core → mod002-core}/all/view_cache.rb +0 -0
- data/tmpsets/set/{mod002-history → mod003-history}/all/actions.rb +0 -0
- data/tmpsets/set/{mod002-history → mod003-history}/all/content_history.rb +0 -0
- data/tmpsets/set/{mod002-history → mod003-history}/all/history.rb +2 -1
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/all_css.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/all_csv.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/all_js.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/base.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/file.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/json.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/rss.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/all/text.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/self/01_head/javascript.rb +0 -0
- data/tmpsets/set/{mod003-basic_formats → mod004-basic_formats}/self/head.rb +1 -1
- data/tmpsets/set/{mod004-pointer → mod005-pointer}/abstract/01_pointer.rb +0 -0
- data/tmpsets/set/{mod004-pointer → mod005-pointer}/abstract/01_pointer/edit.rb +0 -0
- data/tmpsets/set/{mod004-pointer → mod005-pointer}/abstract/code_pointer.rb +0 -0
- data/tmpsets/set/{mod004-pointer → mod005-pointer}/self/script_editors.rb +0 -0
- data/tmpsets/set/{mod004-pointer → mod005-pointer}/self/script_mods.rb +0 -0
- data/tmpsets/set/{mod004-pointer → mod005-pointer}/self/script_pointer_config.rb +0 -0
- data/tmpsets/set/{mod004-pointer → mod005-pointer}/type/pointer.rb +0 -0
- data/tmpsets/set/{mod005-ace_editor → mod006-ace_editor}/abstract/ace_editor.rb +0 -0
- data/tmpsets/set/{mod005-ace_editor → mod006-ace_editor}/self/script_ace.rb +0 -0
- data/tmpsets/set/{mod005-ace_editor → mod006-ace_editor}/self/script_ace_config.rb +0 -0
- data/tmpsets/set/{mod006-prosemirror_editor → mod007-prosemirror_editor}/abstract/prosemirror_editor.rb +0 -0
- data/tmpsets/set/{mod006-prosemirror_editor → mod007-prosemirror_editor}/self/script_prosemirror.rb +0 -0
- data/tmpsets/set/{mod006-prosemirror_editor → mod007-prosemirror_editor}/self/script_prosemirror_config.rb +0 -0
- data/tmpsets/set/{mod008-solid_cache → mod009-solid_cache}/abstract/solid_cache.rb +0 -0
- data/tmpsets/set/{mod008-solid_cache → mod009-solid_cache}/all/solid_cache.rb +0 -0
- data/tmpsets/set/{mod008-solid_cache → mod009-solid_cache}/right/solid_cache.rb +0 -0
- data/tmpsets/set/{mod009-basic_types → mod010-basic_types}/type/html.rb +0 -0
- data/tmpsets/set/{mod009-basic_types → mod010-basic_types}/type/plain_text.rb +0 -0
- data/tmpsets/set/mod011-machines/abstract/machine.rb +277 -0
- data/tmpsets/set/mod011-machines/abstract/machine_input.rb +83 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/abstract/script.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/all/reset_machines.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/right/machine_cache.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/right/machine_input.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/right/machine_output.rb +9 -1
- data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_card_menu.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_html5shiv_printshiv.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_jquery.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_jquery_helper.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/self/script_slot.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/self/style_bootstrap_compatible.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/self/style_cards.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/self/style_jquery_ui_smoothness.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/type/coffee_script.rb +2 -6
- data/tmpsets/set/{mod010-machines → mod011-machines}/type/css.rb +2 -2
- data/tmpsets/set/{mod010-machines → mod011-machines}/type/java_script.rb +2 -2
- data/tmpsets/set/{mod010-machines → mod011-machines}/type/scss.rb +0 -0
- data/tmpsets/set/{mod010-machines → mod011-machines}/type/skin.rb +2 -2
- data/tmpsets/set/{mod011-settings → mod012-settings}/abstract/permission.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/add_help.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/comment.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/create.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/default.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/delete.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/help.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/read.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/script.rb +1 -1
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/structure.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/style.rb +1 -1
- data/tmpsets/set/{mod011-settings → mod012-settings}/right/update.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/accountable.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/add_help.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/autoname.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/captcha.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/create.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/default.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/default_html_view.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/delete.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/follow_fields.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/help.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/input.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/layout.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/on_create.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/on_delete.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/on_update.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/options.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/options_label.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/read.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/recent_settings.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/script.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/structure.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/style.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/table_of_contents.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/thanks.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/self/update.rb +0 -0
- data/tmpsets/set/{mod011-settings → mod012-settings}/type/setting.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/all/email_html.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/all/email_text.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/all/follow.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/all/notify.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/all/observer.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/bcc.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/cc.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/follow.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/follow_fields.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/followers.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/following.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/from.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/html_message.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/right/to.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/self/always.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/self/created.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/self/edited.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/self/follow.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/self/follow_defaults.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/self/never.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/type/email_template.rb +0 -0
- data/tmpsets/set/{mod012-email → mod013-email}/type_plus_right/user/follow.rb +4 -8
- data/tmpsets/set/{mod015-developer → mod014-developer}/all/event_viz.rb +0 -0
- data/tmpsets/set/{mod015-developer → mod014-developer}/all/view_viz.rb +0 -0
- data/tmpsets/set/{mod015-developer → mod014-developer}/right/debug.rb +0 -0
- data/tmpsets/set/mod015-carrierwave/abstract/attachment.rb +118 -0
- data/tmpsets/set/mod015-carrierwave/abstract/attachment/paths.rb +57 -0
- data/tmpsets/set/mod015-carrierwave/abstract/attachment/storage_type.rb +326 -0
- data/tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb +84 -0
- data/tmpsets/set/mod015-carrierwave/all/file_utils.rb +35 -0
- data/tmpsets/set/mod015-carrierwave/self/admin.rb +30 -0
- data/tmpsets/set/{mod013-carrierwave → mod015-carrierwave}/type/file.rb +27 -24
- data/tmpsets/set/{mod013-carrierwave → mod015-carrierwave}/type/image.rb +1 -0
- data/tmpsets/set/mod016-standard/all/links.rb +2 -2
- data/tmpsets/set/mod018-bootstrap/all/bootstrap/table.rb +1 -1
- data/tmpsets/set/mod018-bootstrap/self/bootswatch_shared.rb +1 -1
- data/vendor/carrierwave/.gitignore +19 -0
- data/vendor/carrierwave/.rubocop.yml +262 -0
- data/vendor/carrierwave/.travis.yml +58 -0
- data/vendor/carrierwave/CHANGELOG.md +81 -0
- data/vendor/carrierwave/CONTRIBUTING.md +37 -0
- data/vendor/carrierwave/Gemfile +5 -0
- data/vendor/carrierwave/README.md +995 -0
- data/vendor/carrierwave/Rakefile +26 -0
- data/vendor/carrierwave/carrierwave.gemspec +45 -0
- data/vendor/carrierwave/cucumber.yml +2 -0
- data/vendor/carrierwave/features/caching.feature +28 -0
- data/vendor/carrierwave/features/download.feature +20 -0
- data/vendor/carrierwave/features/file_storage.feature +37 -0
- data/vendor/carrierwave/features/file_storage_overridden_filename.feature +38 -0
- data/vendor/carrierwave/features/file_storage_overridden_store_dir.feature +38 -0
- data/vendor/carrierwave/features/file_storage_reversing_processor.feature +43 -0
- data/vendor/carrierwave/features/fixtures/bork.txt +1 -0
- data/vendor/carrierwave/features/fixtures/monkey.txt +1 -0
- data/vendor/carrierwave/features/fixtures/upcased_bork.txt +1 -0
- data/vendor/carrierwave/features/mount_activerecord.feature +46 -0
- data/vendor/carrierwave/features/step_definitions/activerecord_steps.rb +20 -0
- data/vendor/carrierwave/features/step_definitions/caching_steps.rb +12 -0
- data/vendor/carrierwave/features/step_definitions/datamapper_steps.rb +27 -0
- data/vendor/carrierwave/features/step_definitions/download_steps.rb +8 -0
- data/vendor/carrierwave/features/step_definitions/file_steps.rb +51 -0
- data/vendor/carrierwave/features/step_definitions/general_steps.rb +102 -0
- data/vendor/carrierwave/features/step_definitions/mount_steps.rb +17 -0
- data/vendor/carrierwave/features/step_definitions/store_steps.rb +16 -0
- data/vendor/carrierwave/features/support/activerecord.rb +18 -0
- data/vendor/carrierwave/features/support/env.rb +19 -0
- data/vendor/carrierwave/features/versions_basics.feature +50 -0
- data/vendor/carrierwave/features/versions_caching_from_versions.feature +32 -0
- data/vendor/carrierwave/features/versions_nested_versions.feature +70 -0
- data/vendor/carrierwave/features/versions_overridden_filename.feature +51 -0
- data/vendor/carrierwave/features/versions_overriden_store_dir.feature +41 -0
- data/vendor/carrierwave/gemfiles/rails-4-0-stable.gemfile +5 -0
- data/vendor/carrierwave/gemfiles/rails-4-1-stable.gemfile +5 -0
- data/vendor/carrierwave/gemfiles/rails-4-2-stable.gemfile +5 -0
- data/vendor/carrierwave/gemfiles/rails-master.gemfile +11 -0
- data/vendor/carrierwave/lib/carrierwave.rb +93 -0
- data/vendor/carrierwave/lib/carrierwave/compatibility/paperclip.rb +103 -0
- data/vendor/carrierwave/lib/carrierwave/error.rb +8 -0
- data/vendor/carrierwave/lib/carrierwave/locale/cs.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/de.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/el.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/en.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/es.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/fr-CA.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/fr.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/id.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/ja.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/nb.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/nl.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/pl.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/pt-BR.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/pt-PT.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/ru.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/sk.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/tr.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/zh-CN.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/locale/zh-TW.yml +14 -0
- data/vendor/carrierwave/lib/carrierwave/mount.rb +444 -0
- data/vendor/carrierwave/lib/carrierwave/mounter.rb +163 -0
- data/vendor/carrierwave/lib/carrierwave/orm/activerecord.rb +103 -0
- data/vendor/carrierwave/lib/carrierwave/processing.rb +2 -0
- data/vendor/carrierwave/lib/carrierwave/processing/mini_magick.rb +328 -0
- data/vendor/carrierwave/lib/carrierwave/processing/rmagick.rb +379 -0
- data/vendor/carrierwave/lib/carrierwave/sanitized_file.rb +348 -0
- data/vendor/carrierwave/lib/carrierwave/storage.rb +2 -0
- data/vendor/carrierwave/lib/carrierwave/storage/abstract.rb +43 -0
- data/vendor/carrierwave/lib/carrierwave/storage/file.rb +118 -0
- data/vendor/carrierwave/lib/carrierwave/storage/fog.rb +462 -0
- data/vendor/carrierwave/lib/carrierwave/test/matchers.rb +394 -0
- data/vendor/carrierwave/lib/carrierwave/uploader.rb +67 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/cache.rb +207 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/callbacks.rb +33 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/configuration.rb +203 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/content_type_blacklist.rb +48 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/content_type_whitelist.rb +48 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/default_url.rb +17 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/download.rb +92 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/extension_blacklist.rb +51 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/extension_whitelist.rb +51 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/file_size.rb +41 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_blacklist.rb +94 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_whitelist.rb +94 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/mountable.rb +38 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/processing.rb +88 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/proxy.rb +86 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/remove.rb +21 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/serialization.rb +28 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/store.rb +93 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/url.rb +41 -0
- data/vendor/carrierwave/lib/carrierwave/uploader/versions.rb +295 -0
- data/vendor/carrierwave/lib/carrierwave/utilities.rb +6 -0
- data/vendor/carrierwave/lib/carrierwave/utilities/uri.rb +21 -0
- data/vendor/carrierwave/lib/carrierwave/validations/active_model.rb +78 -0
- data/vendor/carrierwave/lib/carrierwave/version.rb +3 -0
- data/vendor/carrierwave/lib/generators/templates/uploader.rb +49 -0
- data/vendor/carrierwave/lib/generators/uploader_generator.rb +7 -0
- data/vendor/carrierwave/script/console +10 -0
- data/vendor/carrierwave/script/destroy +14 -0
- data/vendor/carrierwave/script/generate +14 -0
- data/vendor/carrierwave/spec/compatibility/paperclip_spec.rb +138 -0
- data/vendor/carrierwave/spec/fixtures/Uppercase.jpg +1 -0
- data/vendor/carrierwave/spec/fixtures/bork.ttxt +1 -0
- data/vendor/carrierwave/spec/fixtures/bork.txt +1 -0
- data/vendor/carrierwave/spec/fixtures/bork.txtt +1 -0
- data/vendor/carrierwave/spec/fixtures/case.JPG +1 -0
- 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 +1 -0
- data/vendor/carrierwave/spec/fixtures/new.txt +1 -0
- data/vendor/carrierwave/spec/fixtures/old.jpeg +1 -0
- data/vendor/carrierwave/spec/fixtures/old.txt +1 -0
- 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 +1 -0
- data/vendor/carrierwave/spec/fixtures/test+.jpg +1 -0
- data/vendor/carrierwave/spec/fixtures/test.jpeg +1 -0
- data/vendor/carrierwave/spec/fixtures/test.jpg +1 -0
- data/vendor/carrierwave/spec/generators/uploader_generator_spec.rb +19 -0
- data/vendor/carrierwave/spec/mount_multiple_spec.rb +913 -0
- data/vendor/carrierwave/spec/mount_single_spec.rb +793 -0
- data/vendor/carrierwave/spec/orm/activerecord_spec.rb +1556 -0
- data/vendor/carrierwave/spec/processing/mini_magick_spec.rb +210 -0
- data/vendor/carrierwave/spec/processing/rmagick_spec.rb +250 -0
- data/vendor/carrierwave/spec/sanitized_file_spec.rb +805 -0
- data/vendor/carrierwave/spec/spec_helper.rb +105 -0
- data/vendor/carrierwave/spec/storage/file_spec.rb +82 -0
- data/vendor/carrierwave/spec/storage/fog_credentials.rb +46 -0
- data/vendor/carrierwave/spec/storage/fog_helper.rb +428 -0
- data/vendor/carrierwave/spec/storage/fog_spec.rb +48 -0
- data/vendor/carrierwave/spec/support/activerecord.rb +31 -0
- data/vendor/carrierwave/spec/support/file_utils_helper.rb +15 -0
- data/vendor/carrierwave/spec/uploader/cache_spec.rb +324 -0
- data/vendor/carrierwave/spec/uploader/callback_spec.rb +30 -0
- data/vendor/carrierwave/spec/uploader/configuration_spec.rb +133 -0
- data/vendor/carrierwave/spec/uploader/content_type_blacklist_spec.rb +61 -0
- data/vendor/carrierwave/spec/uploader/content_type_whitelist_spec.rb +63 -0
- data/vendor/carrierwave/spec/uploader/default_url_spec.rb +77 -0
- data/vendor/carrierwave/spec/uploader/download_spec.rb +204 -0
- data/vendor/carrierwave/spec/uploader/extension_blacklist_spec.rb +112 -0
- data/vendor/carrierwave/spec/uploader/extension_whitelist_spec.rb +102 -0
- data/vendor/carrierwave/spec/uploader/file_size_spec.rb +52 -0
- data/vendor/carrierwave/spec/uploader/mountable_spec.rb +26 -0
- data/vendor/carrierwave/spec/uploader/overrides_spec.rb +71 -0
- data/vendor/carrierwave/spec/uploader/paths_spec.rb +18 -0
- data/vendor/carrierwave/spec/uploader/processing_spec.rb +159 -0
- data/vendor/carrierwave/spec/uploader/proxy_spec.rb +79 -0
- data/vendor/carrierwave/spec/uploader/remove_spec.rb +71 -0
- data/vendor/carrierwave/spec/uploader/store_spec.rb +400 -0
- data/vendor/carrierwave/spec/uploader/url_spec.rb +273 -0
- data/vendor/carrierwave/spec/uploader/versions_spec.rb +633 -0
- metadata +339 -187
- data/config/initializers/extensions.rb +0 -3
- data/mod/05_standard/file/favicon/image-icon.png +0 -0
- data/mod/05_standard/file/favicon/image-large.png +0 -0
- data/mod/05_standard/file/favicon/image-medium.png +0 -0
- data/mod/05_standard/file/favicon/image-original.png +0 -0
- data/mod/05_standard/file/favicon/image-small.png +0 -0
- data/mod/machines/lib/card/machine.rb +0 -261
- data/mod/machines/lib/card/machine_input.rb +0 -80
- data/mod/standard/file/credit/icon-image.png +0 -0
- data/mod/standard/file/credit/large-image.png +0 -0
- data/mod/standard/file/credit/medium-image.png +0 -0
- data/mod/standard/file/credit/original-image.png +0 -0
- data/mod/standard/file/credit/small-image.png +0 -0
- data/mod/standard/spec/set/type/file_spec.rb +0 -99
- data/tmpsets/set/mod001-core/all/tracked_attributes.rb +0 -154
- data/tmpsets/set/mod001-core/all/utils.rb +0 -132
- data/tmpsets/set/mod013-carrierwave/abstract/attachment.rb +0 -282
@@ -0,0 +1,102 @@
|
|
1
|
+
Given /^an uploader class that uses the '(.*?)' storage$/ do |kind|
|
2
|
+
@klass = Class.new(CarrierWave::Uploader::Base)
|
3
|
+
@klass.storage = kind.to_sym
|
4
|
+
end
|
5
|
+
|
6
|
+
Given /^an instance of that class$/ do
|
7
|
+
@uploader = @klass.new
|
8
|
+
end
|
9
|
+
|
10
|
+
Given /^a processor method named :upcase$/ do
|
11
|
+
@klass.class_eval do
|
12
|
+
define_method(:upcase) do
|
13
|
+
content = File.read(current_path)
|
14
|
+
File.open(current_path, 'w') { |f| f.write content.upcase }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Then /^the contents of the file should be '(.*?)'$/ do |contents|
|
20
|
+
@uploader.read.chomp.should == contents
|
21
|
+
end
|
22
|
+
|
23
|
+
Given /^that the uploader reverses the filename$/ do
|
24
|
+
@klass.class_eval do
|
25
|
+
def filename
|
26
|
+
super.reverse unless super.blank?
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
Given /^that the uploader has the filename overridden to '(.*?)'$/ do |filename|
|
32
|
+
@klass.class_eval do
|
33
|
+
define_method(:filename) do
|
34
|
+
filename
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
Given /^that the uploader has the store_dir overridden to '(.*?)'$/ do |store_dir|
|
40
|
+
@klass.class_eval do
|
41
|
+
define_method(:store_dir) do
|
42
|
+
file_path(store_dir)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
Given /^that the version '(.*?)' has the store_dir overridden to '(.*?)'$/ do |version, store_dir|
|
48
|
+
@klass.versions[version.to_sym].class_eval do
|
49
|
+
define_method(:store_dir) do
|
50
|
+
file_path(store_dir)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
Given /^that the uploader class has a version named '([^\']+)'$/ do |name|
|
56
|
+
@klass.version(name)
|
57
|
+
end
|
58
|
+
|
59
|
+
Given /^that the uploader class has a version named '([^\']+)' which process '([a-zA-Z0-9\_\?!]*)'$/ do |name, processor_name|
|
60
|
+
@klass.version(name) do
|
61
|
+
process processor_name.to_sym
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
Given /^that the uploader class has a version named '([^\']+)' which is based on version '(.*?)'$/ do |name, based_version_name|
|
66
|
+
@klass.version(name, {:from_version => based_version_name.to_sym})
|
67
|
+
end
|
68
|
+
|
69
|
+
Given /^yo dawg, I put a version called '(.*?)' in your version called '(.*?)'$/ do |v2, v1|
|
70
|
+
@klass.version(v1) do
|
71
|
+
version(v2)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
Given /^the class has a method called 'reverse' that reverses the contents of a file$/ do
|
76
|
+
@klass.class_eval do
|
77
|
+
def reverse
|
78
|
+
text = File.read(current_path)
|
79
|
+
File.open(current_path, 'w') { |f| f.write(text.reverse) }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
Given /^the class will process '([a-zA-Z0-9\_\?!]*)'$/ do |name|
|
85
|
+
@klass.process name.to_sym
|
86
|
+
end
|
87
|
+
|
88
|
+
Then /^the uploader should have '(.*?)' as its current path$/ do |path|
|
89
|
+
@uploader.current_path.should == file_path(path)
|
90
|
+
end
|
91
|
+
|
92
|
+
Then /^the uploader should have the url '(.*?)'$/ do |url|
|
93
|
+
@uploader.url.should == url
|
94
|
+
end
|
95
|
+
|
96
|
+
Then /^the uploader's version '(.*?)' should have the url '(.*?)'$/ do |version, url|
|
97
|
+
@uploader.versions[version.to_sym].url.should == url
|
98
|
+
end
|
99
|
+
|
100
|
+
Then /^the uploader's nested version '(.*?)' nested in '(.*?)' should have the url '(.*?)'$/ do |v2, v1, url|
|
101
|
+
@uploader.versions[v1.to_sym].versions[v2.to_sym].url.should == url
|
102
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
When /^I assign the file '([^\']*)' to the '([^\']*)' column$/ do |path, column|
|
2
|
+
@instance.send("#{column}=", File.open(file_path(path)))
|
3
|
+
end
|
4
|
+
|
5
|
+
Given /^the uploader class is mounted on the '([^\']*)' column$/ do |column|
|
6
|
+
@mountee_klass.mount_uploader column.to_sym, @klass
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^I retrieve the file later from the cache name for the column '([^\']*)'$/ do |column|
|
10
|
+
new_instance = @instance.class.new
|
11
|
+
new_instance.send("#{column}_cache=", @instance.send("#{column}_cache"))
|
12
|
+
@instance = new_instance
|
13
|
+
end
|
14
|
+
|
15
|
+
Then /^the url for the column '([^\']*)' should be '([^\']*)'$/ do |column, url|
|
16
|
+
@instance.send("#{column}_url").should == url
|
17
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
Given /^the file '(.*?)' is stored at '(.*?)'$/ do |file, stored|
|
2
|
+
FileUtils.mkdir_p(File.dirname(file_path(stored)))
|
3
|
+
FileUtils.cp(file_path(file), file_path(stored))
|
4
|
+
end
|
5
|
+
|
6
|
+
When /^I store the file$/ do
|
7
|
+
@uploader.store!
|
8
|
+
end
|
9
|
+
|
10
|
+
When /^I store the file '(.*?)'$/ do |file|
|
11
|
+
@uploader.store!(File.open(file_path(file)))
|
12
|
+
end
|
13
|
+
|
14
|
+
When /^I retrieve the file '(.*?)' from the store$/ do |identifier|
|
15
|
+
@uploader.retrieve_from_store!(identifier)
|
16
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'carrierwave/mount'
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'spec', 'support', 'activerecord')
|
3
|
+
|
4
|
+
class TestMigration < ActiveRecord::Migration
|
5
|
+
def self.up
|
6
|
+
create_table :users, :force => true do |t|
|
7
|
+
t.column :avatar, :string
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.down
|
12
|
+
drop_table :users
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
Before do
|
17
|
+
TestMigration.up
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
$:.unshift File.expand_path(File.join('..', '..', 'lib'), File.dirname(__FILE__))
|
2
|
+
|
3
|
+
require File.join(File.dirname(__FILE__), 'activerecord')
|
4
|
+
|
5
|
+
require 'rspec'
|
6
|
+
require 'carrierwave'
|
7
|
+
require "webmock/cucumber"
|
8
|
+
|
9
|
+
alias :running :lambda
|
10
|
+
|
11
|
+
def file_path( *paths )
|
12
|
+
File.expand_path(File.join('..', *paths), File.dirname(__FILE__))
|
13
|
+
end
|
14
|
+
|
15
|
+
CarrierWave.root = file_path('public')
|
16
|
+
|
17
|
+
After do
|
18
|
+
FileUtils.rm_rf(file_path("public"))
|
19
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
Feature: uploader with file storage and versions
|
2
|
+
In order to be awesome
|
3
|
+
As a developer using CarrierWave
|
4
|
+
I want to upload files to the filesystem
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given an uploader class that uses the 'file' storage
|
8
|
+
And that the uploader class has a version named 'thumb'
|
9
|
+
And an instance of that class
|
10
|
+
|
11
|
+
Scenario: store a file
|
12
|
+
When I store the file 'fixtures/bork.txt'
|
13
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
14
|
+
Then there should be a file at 'public/uploads/thumb_bork.txt'
|
15
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
16
|
+
And the file at 'public/uploads/thumb_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
17
|
+
And the uploader should have the url '/uploads/bork.txt'
|
18
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_bork.txt'
|
19
|
+
|
20
|
+
Scenario: cache a file and then store it
|
21
|
+
When I cache the file 'fixtures/bork.txt'
|
22
|
+
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
23
|
+
Then there should be a file called 'thumb_bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
24
|
+
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
25
|
+
And there should not be a file at 'public/uploads/bork.txt'
|
26
|
+
And there should not be a file at 'public/uploads/thumb_bork.txt'
|
27
|
+
When I store the file
|
28
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
29
|
+
And there should be a file at 'public/uploads/thumb_bork.txt'
|
30
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
31
|
+
And the file at 'public/uploads/thumb_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
32
|
+
And the uploader should have the url '/uploads/bork.txt'
|
33
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_bork.txt'
|
34
|
+
|
35
|
+
Scenario: retrieving a file from cache then storing
|
36
|
+
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
37
|
+
Given the file 'fixtures/monkey.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/thumb_bork.txt'
|
38
|
+
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
39
|
+
And I store the file
|
40
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
41
|
+
Then there should be a file at 'public/uploads/thumb_bork.txt'
|
42
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
43
|
+
And the file at 'public/uploads/thumb_bork.txt' should be identical to the file at 'fixtures/monkey.txt'
|
44
|
+
|
45
|
+
Scenario: retrieving a file from store
|
46
|
+
Given the file 'fixtures/bork.txt' is stored at 'public/uploads/bork.txt'
|
47
|
+
Given the file 'fixtures/monkey.txt' is stored at 'public/uploads/thumb_bork.txt'
|
48
|
+
When I retrieve the file 'bork.txt' from the store
|
49
|
+
Then the uploader should have the url '/uploads/bork.txt'
|
50
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_bork.txt'
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Feature: uploader with file storage and versions with overridden store dir
|
2
|
+
In order to be awesome
|
3
|
+
As a developer using CarrierWave
|
4
|
+
I want to upload files to the filesystem
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given an uploader class that uses the 'file' storage
|
8
|
+
Given a processor method named :upcase
|
9
|
+
And that the uploader class has a version named 'thumb' which process 'upcase'
|
10
|
+
And that the version 'thumb' has the store_dir overridden to 'public/monkey/llama'
|
11
|
+
And that the uploader class has a version named 'small_thumb' which is based on version 'thumb'
|
12
|
+
And that the version 'small_thumb' has the store_dir overridden to 'public/monkey/toro'
|
13
|
+
And an instance of that class
|
14
|
+
|
15
|
+
Scenario: cache a file and then store it
|
16
|
+
When I cache the file 'fixtures/bork.txt'
|
17
|
+
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
18
|
+
Then there should be a file called 'thumb_bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
19
|
+
Then there should be a file called 'small_thumb_bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
20
|
+
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
21
|
+
And the file called 'thumb_bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/upcased_bork.txt'
|
22
|
+
And the file called 'small_thumb_bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/upcased_bork.txt'
|
23
|
+
And there should not be a file at 'public/uploads/bork.txt'
|
24
|
+
And there should not be a file at 'public/monkey/llama/thumb_bork.txt'
|
25
|
+
And there should not be a file at 'public/monkey/toro/small_thumb_bork.txt'
|
26
|
+
When I store the file
|
27
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
28
|
+
Then there should be a file at 'public/monkey/llama/thumb_bork.txt'
|
29
|
+
Then there should be a file at 'public/monkey/toro/small_thumb_bork.txt'
|
30
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
31
|
+
And the file at 'public/monkey/llama/thumb_bork.txt' should be identical to the file at 'fixtures/upcased_bork.txt'
|
32
|
+
And the file at 'public/monkey/toro/small_thumb_bork.txt' should be identical to the file at 'fixtures/upcased_bork.txt'
|
@@ -0,0 +1,70 @@
|
|
1
|
+
Feature: uploader with nested versions
|
2
|
+
In order to optimize performance for processing
|
3
|
+
As a developer using CarrierWave
|
4
|
+
I want to set nested versions
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given an uploader class that uses the 'file' storage
|
8
|
+
And that the uploader class has a version named 'thumb'
|
9
|
+
And yo dawg, I put a version called 'mini' in your version called 'thumb'
|
10
|
+
And yo dawg, I put a version called 'micro' in your version called 'thumb'
|
11
|
+
And an instance of that class
|
12
|
+
|
13
|
+
Scenario: store a file
|
14
|
+
When I store the file 'fixtures/bork.txt'
|
15
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
16
|
+
Then there should be a file at 'public/uploads/thumb_bork.txt'
|
17
|
+
Then there should be a file at 'public/uploads/thumb_mini_bork.txt'
|
18
|
+
Then there should be a file at 'public/uploads/thumb_micro_bork.txt'
|
19
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
20
|
+
And the file at 'public/uploads/thumb_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
21
|
+
And the file at 'public/uploads/thumb_mini_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
22
|
+
And the file at 'public/uploads/thumb_micro_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
23
|
+
And the uploader should have the url '/uploads/bork.txt'
|
24
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_bork.txt'
|
25
|
+
And the uploader's nested version 'mini' nested in 'thumb' should have the url '/uploads/thumb_mini_bork.txt'
|
26
|
+
And the uploader's nested version 'micro' nested in 'thumb' should have the url '/uploads/thumb_micro_bork.txt'
|
27
|
+
|
28
|
+
Scenario: cache a file and then store it
|
29
|
+
When I cache the file 'fixtures/bork.txt'
|
30
|
+
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
31
|
+
Then there should be a file called 'thumb_bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
32
|
+
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
33
|
+
And there should not be a file at 'public/uploads/bork.txt'
|
34
|
+
And there should not be a file at 'public/uploads/thumb_bork.txt'
|
35
|
+
When I store the file
|
36
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
37
|
+
And there should be a file at 'public/uploads/thumb_bork.txt'
|
38
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
39
|
+
And the file at 'public/uploads/thumb_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
40
|
+
And the uploader should have the url '/uploads/bork.txt'
|
41
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_bork.txt'
|
42
|
+
And the uploader's nested version 'mini' nested in 'thumb' should have the url '/uploads/thumb_mini_bork.txt'
|
43
|
+
And the uploader's nested version 'micro' nested in 'thumb' should have the url '/uploads/thumb_micro_bork.txt'
|
44
|
+
|
45
|
+
Scenario: retrieving a file from cache then storing
|
46
|
+
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
47
|
+
Given the file 'fixtures/monkey.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/thumb_bork.txt'
|
48
|
+
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/thumb_mini_bork.txt'
|
49
|
+
Given the file 'fixtures/monkey.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/thumb_micro_bork.txt'
|
50
|
+
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
51
|
+
And I store the file
|
52
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
53
|
+
Then there should be a file at 'public/uploads/thumb_bork.txt'
|
54
|
+
Then there should be a file at 'public/uploads/thumb_mini_bork.txt'
|
55
|
+
Then there should be a file at 'public/uploads/thumb_micro_bork.txt'
|
56
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
57
|
+
And the file at 'public/uploads/thumb_bork.txt' should be identical to the file at 'fixtures/monkey.txt'
|
58
|
+
And the file at 'public/uploads/thumb_mini_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
59
|
+
And the file at 'public/uploads/thumb_micro_bork.txt' should be identical to the file at 'fixtures/monkey.txt'
|
60
|
+
|
61
|
+
Scenario: retrieving a file from store
|
62
|
+
Given the file 'fixtures/bork.txt' is stored at 'public/uploads/bork.txt'
|
63
|
+
Given the file 'fixtures/monkey.txt' is stored at 'public/uploads/thumb_bork.txt'
|
64
|
+
Given the file 'fixtures/monkey.txt' is stored at 'public/uploads/thumb_mini_bork.txt'
|
65
|
+
Given the file 'fixtures/monkey.txt' is stored at 'public/uploads/thumb_micro_bork.txt'
|
66
|
+
When I retrieve the file 'bork.txt' from the store
|
67
|
+
Then the uploader should have the url '/uploads/bork.txt'
|
68
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_bork.txt'
|
69
|
+
And the uploader's nested version 'mini' nested in 'thumb' should have the url '/uploads/thumb_mini_bork.txt'
|
70
|
+
And the uploader's nested version 'micro' nested in 'thumb' should have the url '/uploads/thumb_micro_bork.txt'
|
@@ -0,0 +1,51 @@
|
|
1
|
+
Feature: uploader with file storage and overriden filename
|
2
|
+
In order to customize the filaname of uploaded files
|
3
|
+
As a developer using CarrierWave
|
4
|
+
I want to upload files to the filesystem with an overriden filename and different verions
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given an uploader class that uses the 'file' storage
|
8
|
+
And that the uploader class has a version named 'thumb'
|
9
|
+
And that the uploader has the filename overridden to 'grark.png'
|
10
|
+
And an instance of that class
|
11
|
+
|
12
|
+
Scenario: store a file
|
13
|
+
When I store the file 'fixtures/bork.txt'
|
14
|
+
Then there should be a file at 'public/uploads/grark.png'
|
15
|
+
Then there should be a file at 'public/uploads/thumb_grark.png'
|
16
|
+
And the file at 'public/uploads/grark.png' should be identical to the file at 'fixtures/bork.txt'
|
17
|
+
And the file at 'public/uploads/thumb_grark.png' should be identical to the file at 'fixtures/bork.txt'
|
18
|
+
And the uploader should have the url '/uploads/grark.png'
|
19
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_grark.png'
|
20
|
+
|
21
|
+
Scenario: cache a file and then store it
|
22
|
+
When I cache the file 'fixtures/bork.txt'
|
23
|
+
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
24
|
+
Then there should be a file called 'thumb_bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
25
|
+
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
26
|
+
And there should not be a file at 'public/uploads/grark.png'
|
27
|
+
And there should not be a file at 'public/uploads/thumb_grark.png'
|
28
|
+
When I store the file
|
29
|
+
Then there should be a file at 'public/uploads/grark.png'
|
30
|
+
And there should be a file at 'public/uploads/thumb_grark.png'
|
31
|
+
And the file at 'public/uploads/grark.png' should be identical to the file at 'fixtures/bork.txt'
|
32
|
+
And the file at 'public/uploads/thumb_grark.png' should be identical to the file at 'fixtures/bork.txt'
|
33
|
+
And the uploader should have the url '/uploads/grark.png'
|
34
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_grark.png'
|
35
|
+
|
36
|
+
Scenario: retrieving a file from cache then storing
|
37
|
+
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
38
|
+
Given the file 'fixtures/monkey.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/thumb_bork.txt'
|
39
|
+
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
40
|
+
And I store the file
|
41
|
+
Then there should be a file at 'public/uploads/grark.png'
|
42
|
+
Then there should be a file at 'public/uploads/thumb_grark.png'
|
43
|
+
And the file at 'public/uploads/grark.png' should be identical to the file at 'fixtures/bork.txt'
|
44
|
+
And the file at 'public/uploads/thumb_grark.png' should be identical to the file at 'fixtures/monkey.txt'
|
45
|
+
|
46
|
+
Scenario: retrieving a file from store
|
47
|
+
Given the file 'fixtures/bork.txt' is stored at 'public/uploads/bork.txt'
|
48
|
+
Given the file 'fixtures/monkey.txt' is stored at 'public/uploads/thumb_bork.txt'
|
49
|
+
When I retrieve the file 'bork.txt' from the store
|
50
|
+
Then the uploader should have the url '/uploads/bork.txt'
|
51
|
+
And the uploader's version 'thumb' should have the url '/uploads/thumb_bork.txt'
|
@@ -0,0 +1,41 @@
|
|
1
|
+
Feature: uploader with file storage and versions with overridden store dir
|
2
|
+
In order to be awesome
|
3
|
+
As a developer using CarrierWave
|
4
|
+
I want to upload files to the filesystem
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given an uploader class that uses the 'file' storage
|
8
|
+
And that the uploader class has a version named 'thumb'
|
9
|
+
And that the version 'thumb' has the store_dir overridden to 'public/monkey/llama'
|
10
|
+
And an instance of that class
|
11
|
+
|
12
|
+
Scenario: store a file
|
13
|
+
When I store the file 'fixtures/bork.txt'
|
14
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
15
|
+
Then there should be a file at 'public/monkey/llama/thumb_bork.txt'
|
16
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
17
|
+
And the file at 'public/monkey/llama/thumb_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
18
|
+
|
19
|
+
Scenario: cache a file and then store it
|
20
|
+
When I cache the file 'fixtures/bork.txt'
|
21
|
+
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
22
|
+
Then there should be a file called 'thumb_bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
23
|
+
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
24
|
+
And the file called 'thumb_bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
25
|
+
And there should not be a file at 'public/uploads/bork.txt'
|
26
|
+
And there should not be a file at 'public/monkey/llama/thumb_bork.txt'
|
27
|
+
When I store the file
|
28
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
29
|
+
Then there should be a file at 'public/monkey/llama/thumb_bork.txt'
|
30
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
31
|
+
And the file at 'public/monkey/llama/thumb_bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
32
|
+
|
33
|
+
Scenario: retrieving a file from cache then storing
|
34
|
+
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
35
|
+
Given the file 'fixtures/monkey.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/thumb_bork.txt'
|
36
|
+
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
37
|
+
And I store the file
|
38
|
+
Then there should be a file at 'public/uploads/bork.txt'
|
39
|
+
Then there should be a file at 'public/monkey/llama/thumb_bork.txt'
|
40
|
+
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
41
|
+
And the file at 'public/monkey/llama/thumb_bork.txt' should be identical to the file at 'fixtures/monkey.txt'
|