refinerycms 0.9.5.13 → 0.9.5.14
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +6 -1
- data/app/controllers/admin/base_controller.rb +2 -2
- data/app/controllers/application.rb +1 -1
- data/app/controllers/application_controller.rb +2 -2
- data/app/helpers/application_helper.rb +2 -2
- data/config/environment.rb +6 -6
- data/config/environments/development.rb +1 -1
- data/config/initializers/inflections.rb +1 -1
- data/config/preinitializer.rb +3 -3
- data/config/routes.rb +5 -5
- data/db/migrate/20091109012126_add_missing_indexes.rb +4 -4
- data/db/schema.rb +1 -2
- data/db/seeds.rb +35 -35
- data/lib/refinery_initializer.rb +2 -2
- data/public/404.html +15 -15
- data/public/422.html +8 -8
- data/public/500.html +8 -8
- data/public/images/refinery/logo-large.png +0 -0
- data/public/images/refinery/logo-medium.png +0 -0
- data/public/images/refinery/logo-small-medium.png +0 -0
- data/public/images/refinery/logo-small.png +0 -0
- data/public/images/refinery/resolve_digital_footer_logo.png +0 -0
- data/public/javascripts/builder.js +97 -97
- data/public/javascripts/controls.js +655 -655
- data/public/javascripts/dragdrop.js +936 -936
- data/public/javascripts/effects.js +713 -713
- data/public/javascripts/jquery/GPL-LICENSE.txt +96 -96
- data/public/javascripts/jquery/jquery.js +168 -168
- data/public/javascripts/lightbox.js +397 -397
- data/public/javascripts/livepipe.js +146 -146
- data/public/javascripts/prototype.js +2996 -2996
- data/public/javascripts/refinery/admin.js +20 -20
- data/public/javascripts/refinery/boot_wym.js +110 -110
- data/public/javascripts/refinery/dialog.js +1 -1
- data/public/javascripts/refinery/parse_url.js +27 -27
- data/public/javascripts/refinery/prototype.enhancements.js +17 -17
- data/public/javascripts/refinery/tooltips.js +34 -34
- data/public/javascripts/scriptaculous.js +22 -22
- data/public/javascripts/slider.js +239 -239
- data/public/javascripts/tabs.js +130 -130
- data/public/javascripts/thickbox.js +23 -23
- data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +23 -23
- data/public/javascripts/wymeditor/lang/ca.js +42 -42
- data/public/javascripts/wymeditor/lang/cs.js +42 -42
- data/public/javascripts/wymeditor/lang/de.js +42 -42
- data/public/javascripts/wymeditor/lang/en.js +44 -44
- data/public/javascripts/wymeditor/lang/es.js +42 -42
- data/public/javascripts/wymeditor/lang/fa.js +42 -42
- data/public/javascripts/wymeditor/lang/fr.js +42 -42
- data/public/javascripts/wymeditor/lang/he.js +42 -42
- data/public/javascripts/wymeditor/lang/hu.js +42 -42
- data/public/javascripts/wymeditor/lang/it.js +42 -42
- data/public/javascripts/wymeditor/lang/nb.js +42 -42
- data/public/javascripts/wymeditor/lang/nl.js +42 -42
- data/public/javascripts/wymeditor/lang/nn.js +42 -42
- data/public/javascripts/wymeditor/lang/pl.js +42 -42
- data/public/javascripts/wymeditor/lang/pt-br.js +42 -42
- data/public/javascripts/wymeditor/lang/pt.js +42 -42
- data/public/javascripts/wymeditor/lang/ru.js +42 -42
- data/public/javascripts/wymeditor/lang/sv.js +42 -42
- data/public/javascripts/wymeditor/lang/tr.js +42 -42
- data/public/javascripts/wymeditor/lang/zh_cn.js +44 -44
- data/public/javascripts/wymeditor/skins/refinery/skin.js +31 -31
- data/public/stylesheets/application.css +3 -3
- data/public/stylesheets/formatting.css +3 -3
- data/public/stylesheets/home.css +2 -2
- data/public/stylesheets/lightbox.css +1 -1
- data/public/stylesheets/refinery/application.css +13 -13
- data/public/stylesheets/refinery/formatting.css +3 -3
- data/public/stylesheets/refinery/refinery.css +49 -44
- data/public/stylesheets/refinery/theme.css +1 -1
- data/public/stylesheets/refinery/thickbox.css +4 -4
- data/public/stylesheets/wymeditor/skins/refinery/skin.css +115 -115
- data/public/stylesheets/wymeditor/skins/refinery/wymiframe.css +66 -66
- data/public/wymeditor/GPL-license.txt +96 -96
- data/script/performance/benchmarker +3 -0
- data/vendor/plugins/acts_as_indexed/lib/acts_as_indexed.rb +12 -12
- data/vendor/plugins/acts_as_indexed/lib/search_atom.rb +7 -7
- data/vendor/plugins/acts_as_indexed/lib/search_index.rb +7 -7
- data/vendor/plugins/acts_as_indexed/lib/will_paginate_search.rb +1 -1
- data/vendor/plugins/acts_as_indexed/test/abstract_unit.rb +5 -5
- data/vendor/plugins/acts_as_indexed/test/acts_as_indexed_test.rb +2 -2
- data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +140 -140
- data/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +18 -18
- data/vendor/plugins/attachment_fu/install.rb +1 -1
- data/vendor/plugins/attachment_fu/lib/geometry.rb +2 -2
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb +3 -3
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/db_file_backend.rb +4 -4
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb +11 -11
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb +7 -7
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/core_image_processor.rb +5 -5
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/gd2_processor.rb +4 -4
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/image_science_processor.rb +1 -1
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb +11 -11
- data/vendor/plugins/attachment_fu/test/backends/db_file_test.rb +2 -2
- data/vendor/plugins/attachment_fu/test/backends/file_system_test.rb +24 -24
- data/vendor/plugins/attachment_fu/test/backends/remote/cloudfiles_test.rb +14 -14
- data/vendor/plugins/attachment_fu/test/backends/remote/s3_test.rb +7 -7
- data/vendor/plugins/attachment_fu/test/base_attachment_tests.rb +10 -10
- data/vendor/plugins/attachment_fu/test/basic_test.rb +10 -10
- data/vendor/plugins/attachment_fu/test/extra_attachment_test.rb +9 -9
- data/vendor/plugins/attachment_fu/test/fixtures/attachment.rb +10 -10
- data/vendor/plugins/attachment_fu/test/geometry_test.rb +12 -12
- data/vendor/plugins/attachment_fu/test/processors/core_image_test.rb +6 -6
- data/vendor/plugins/attachment_fu/test/processors/gd2_test.rb +4 -4
- data/vendor/plugins/attachment_fu/test/processors/image_science_test.rb +4 -4
- data/vendor/plugins/attachment_fu/test/processors/mini_magick_test.rb +13 -13
- data/vendor/plugins/attachment_fu/test/processors/rmagick_test.rb +33 -33
- data/vendor/plugins/attachment_fu/test/schema.rb +14 -14
- data/vendor/plugins/attachment_fu/test/test_helper.rb +11 -11
- data/vendor/plugins/attachment_fu/test/validation_test.rb +7 -7
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/color.rb +7 -7
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/effects.rb +7 -7
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/perspective.rb +5 -5
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/quality.rb +7 -7
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/scale.rb +5 -5
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/watermark.rb +6 -6
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/processor.rb +16 -16
- data/vendor/plugins/authentication/app/controllers/admin/users_controller.rb +30 -30
- data/vendor/plugins/authentication/app/controllers/sessions_controller.rb +4 -4
- data/vendor/plugins/authentication/app/controllers/users_controller.rb +7 -7
- data/vendor/plugins/authentication/app/helpers/sessions_helper.rb +1 -1
- data/vendor/plugins/authentication/app/helpers/users_helper.rb +1 -1
- data/vendor/plugins/authentication/app/models/user.rb +56 -56
- data/vendor/plugins/authentication/app/models/user_mailer.rb +6 -6
- data/vendor/plugins/authentication/app/models/user_observer.rb +2 -2
- data/vendor/plugins/authentication/app/models/user_plugin.rb +4 -4
- data/vendor/plugins/authentication/app/views/admin/users/_form.html.erb +36 -36
- data/vendor/plugins/authentication/app/views/admin/users/edit.html.erb +1 -1
- data/vendor/plugins/authentication/app/views/admin/users/index.html.erb +1 -1
- data/vendor/plugins/authentication/app/views/admin/users/new.html.erb +1 -1
- data/vendor/plugins/authentication/app/views/sessions/new.html.erb +19 -19
- data/vendor/plugins/authentication/app/views/user_mailer/activation.html.erb +1 -1
- data/vendor/plugins/authentication/app/views/user_mailer/signup_notification.html.erb +1 -1
- data/vendor/plugins/authentication/app/views/users/new.html.erb +3 -3
- data/vendor/plugins/authentication/config/routes.rb +1 -1
- data/vendor/plugins/authentication/init.rb +5 -5
- data/vendor/plugins/authentication/lib/authenticated_system.rb +1 -1
- data/vendor/plugins/authentication/test/functional/sessions_controller_test.rb +2 -2
- data/vendor/plugins/authentication/test/functional/users_controller_test.rb +3 -3
- data/vendor/plugins/authentication/test/test_helper.rb +1 -1
- data/vendor/plugins/dashboard/app/controllers/admin/dashboard_controller.rb +1 -1
- data/vendor/plugins/dashboard/app/helpers/admin/dashboard_helper.rb +1 -1
- data/vendor/plugins/dashboard/app/views/admin/dashboard/_recent_activity.html.erb +10 -10
- data/vendor/plugins/dashboard/app/views/admin/dashboard/index.html.erb +30 -30
- data/vendor/plugins/dashboard/config/routes.rb +2 -2
- data/vendor/plugins/dashboard/init.rb +6 -6
- data/vendor/plugins/images/app/controllers/admin/images_controller.rb +28 -28
- data/vendor/plugins/images/app/helpers/admin/images_helper.rb +14 -14
- data/vendor/plugins/images/app/models/image.rb +11 -11
- data/vendor/plugins/images/app/views/admin/images/_form.html.erb +21 -21
- data/vendor/plugins/images/app/views/admin/images/_grid_view.html.erb +13 -13
- data/vendor/plugins/images/app/views/admin/images/_list_view.html.erb +1 -1
- data/vendor/plugins/images/app/views/admin/images/_list_view_image.html.erb +2 -2
- data/vendor/plugins/images/app/views/admin/images/edit.html.erb +1 -1
- data/vendor/plugins/images/app/views/admin/images/index.html.erb +15 -15
- data/vendor/plugins/images/app/views/admin/images/insert.html.erb +91 -91
- data/vendor/plugins/images/app/views/admin/images/new.html.erb +1 -1
- data/vendor/plugins/images/config/routes.rb +2 -2
- data/vendor/plugins/images/init.rb +7 -7
- data/vendor/plugins/inquiries/app/controllers/admin/inquiries_controller.rb +4 -4
- data/vendor/plugins/inquiries/app/controllers/admin/inquiry_settings_controller.rb +5 -5
- data/vendor/plugins/inquiries/app/controllers/inquiries_controller.rb +3 -3
- data/vendor/plugins/inquiries/app/helpers/inquiries_helper.rb +3 -3
- data/vendor/plugins/inquiries/app/models/inquiry.rb +6 -6
- data/vendor/plugins/inquiries/app/models/inquiry_mailer.rb +1 -1
- data/vendor/plugins/inquiries/app/models/inquiry_setting.rb +3 -3
- data/vendor/plugins/inquiries/app/views/admin/inquiries/_inquiry.html.erb +19 -19
- data/vendor/plugins/inquiries/app/views/admin/inquiries/index.html.erb +27 -27
- data/vendor/plugins/inquiries/app/views/admin/inquiries/show.html.erb +59 -59
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/_confirmation_email_form.html.erb +44 -44
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/_notification_recipients_form.html.erb +15 -15
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/edit.html.erb +3 -3
- data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/index.html.erb +29 -29
- data/vendor/plugins/inquiries/app/views/inquiries/new.html.erb +32 -32
- data/vendor/plugins/inquiries/app/views/inquiries/thank_you.html.erb +8 -8
- data/vendor/plugins/inquiries/app/views/inquiry_mailer/confirmation.html.erb +1 -1
- data/vendor/plugins/inquiries/app/views/inquiry_mailer/notification.html.erb +1 -1
- data/vendor/plugins/inquiries/config/routes.rb +3 -3
- data/vendor/plugins/inquiries/init.rb +10 -10
- data/vendor/plugins/news/app/controllers/admin/news_items_controller.rb +3 -3
- data/vendor/plugins/news/app/controllers/news_items_controller.rb +2 -2
- data/vendor/plugins/news/app/models/news_item.rb +5 -5
- data/vendor/plugins/news/app/views/admin/news_items/_form.html.erb +16 -16
- data/vendor/plugins/news/app/views/admin/news_items/_news_item.html.erb +14 -14
- data/vendor/plugins/news/app/views/admin/news_items/edit.html.erb +1 -1
- data/vendor/plugins/news/app/views/admin/news_items/index.html.erb +25 -25
- data/vendor/plugins/news/app/views/admin/news_items/new.html.erb +1 -1
- data/vendor/plugins/news/app/views/news_items/_recent_posts.html.erb +6 -6
- data/vendor/plugins/news/app/views/news_items/index.html.erb +20 -20
- data/vendor/plugins/news/app/views/news_items/show.html.erb +16 -16
- data/vendor/plugins/news/config/routes.rb +3 -3
- data/vendor/plugins/news/init.rb +7 -7
- data/vendor/plugins/pages/app/controllers/admin/page_dialogs_controller.rb +10 -10
- data/vendor/plugins/pages/app/controllers/admin/page_parts_controller.rb +4 -4
- data/vendor/plugins/pages/app/controllers/admin/pages_controller.rb +4 -4
- data/vendor/plugins/pages/app/controllers/pages_controller.rb +3 -3
- data/vendor/plugins/pages/app/helpers/pages_helper.rb +1 -1
- data/vendor/plugins/pages/app/models/page.rb +95 -95
- data/vendor/plugins/pages/app/models/page_part.rb +5 -5
- data/vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb +1 -1
- data/vendor/plugins/pages/app/views/admin/page_dialogs/link_to.html.erb +222 -222
- data/vendor/plugins/pages/app/views/admin/pages/_form.html.erb +232 -232
- data/vendor/plugins/pages/app/views/admin/pages/_list.html.erb +26 -26
- data/vendor/plugins/pages/app/views/admin/pages/_page_part_field.html.erb +3 -3
- data/vendor/plugins/pages/app/views/admin/pages/_sortable_list.html.erb +2 -2
- data/vendor/plugins/pages/app/views/admin/pages/edit.html.erb +1 -1
- data/vendor/plugins/pages/app/views/admin/pages/index.html.erb +37 -37
- data/vendor/plugins/pages/app/views/admin/pages/new.html.erb +1 -1
- data/vendor/plugins/pages/app/views/pages/home.html.erb +8 -8
- data/vendor/plugins/pages/app/views/pages/show.html.erb +11 -11
- data/vendor/plugins/pages/config/routes.rb +5 -5
- data/vendor/plugins/pages/init.rb +7 -7
- data/vendor/plugins/refinery/app/controllers/admin/refinery_core_controller.rb +7 -7
- data/vendor/plugins/refinery/app/views/admin/_head.html.erb +30 -30
- data/vendor/plugins/refinery/app/views/admin/_menu.html.erb +61 -61
- data/vendor/plugins/refinery/app/views/layouts/admin.html.erb +32 -32
- data/vendor/plugins/refinery/app/views/layouts/application.html.erb +28 -28
- data/vendor/plugins/refinery/app/views/shared/_footer.html.erb +4 -4
- data/vendor/plugins/refinery/app/views/shared/_google_analytics.html.erb +11 -11
- data/vendor/plugins/refinery/app/views/shared/_header.html.erb +3 -3
- data/vendor/plugins/refinery/app/views/shared/_ie6check.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/shared/_menu.html.erb +14 -14
- data/vendor/plugins/refinery/app/views/shared/_menu_branch.html.erb +21 -21
- data/vendor/plugins/refinery/app/views/shared/_message.html.erb +8 -8
- data/vendor/plugins/refinery/app/views/shared/_submenu.html.erb +2 -2
- data/vendor/plugins/refinery/app/views/shared/_submenu_branch.html.erb +7 -7
- data/vendor/plugins/refinery/app/views/shared/admin/_continue_editing.html.erb +41 -41
- data/vendor/plugins/refinery/app/views/shared/admin/_error_messages_for.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +13 -13
- data/vendor/plugins/refinery/app/views/shared/admin/_image_picker.html.erb +31 -31
- data/vendor/plugins/refinery/app/views/shared/admin/_make_sortable.html.erb +65 -65
- data/vendor/plugins/refinery/app/views/shared/admin/_resource_picker.html.erb +16 -16
- data/vendor/plugins/refinery/app/views/shared/admin/_search.html.erb +5 -5
- data/vendor/plugins/refinery/app/views/shared/admin/_sortable_list.html.erb +8 -8
- data/vendor/plugins/refinery/app/views/welcome.html.erb +1 -1
- data/vendor/plugins/refinery/app/views/wymiframe.html.erb +6 -6
- data/vendor/plugins/refinery/config/routes.rb +5 -5
- data/vendor/plugins/refinery/init.rb +8 -8
- data/vendor/plugins/refinery/lib/crud.rb +17 -17
- data/vendor/plugins/refinery/lib/generators/refinery/install.rb +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/refinery_generator.rb +17 -17
- data/vendor/plugins/refinery/lib/generators/refinery/templates/config/routes.rb +3 -3
- data/vendor/plugins/refinery/lib/generators/refinery/templates/controller.rb +2 -2
- data/vendor/plugins/refinery/lib/generators/refinery/templates/init.rb +6 -6
- data/vendor/plugins/refinery/lib/generators/refinery/templates/migration.rb +22 -22
- data/vendor/plugins/refinery/lib/generators/refinery/templates/model.rb +4 -4
- data/vendor/plugins/refinery/lib/generators/refinery/templates/public_controller.rb +10 -10
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_form.html.erb +3 -3
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_singular_name.html.erb +15 -15
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/_sortable_list.html.erb +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/edit.html.erb +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/index.html.erb +33 -33
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/new.html.erb +1 -1
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/index.html.erb +14 -14
- data/vendor/plugins/refinery/lib/generators/refinery/templates/views/show.html.erb +21 -21
- data/vendor/plugins/refinery/lib/indexer.rb +29 -29
- data/vendor/plugins/refinery/lib/refinery.rb +10 -10
- data/vendor/plugins/refinery/lib/refinery/activity.rb +5 -5
- data/vendor/plugins/refinery/lib/refinery/admin_base_controller.rb +15 -15
- data/vendor/plugins/refinery/lib/refinery/application_controller.rb +39 -39
- data/vendor/plugins/refinery/lib/refinery/application_helper.rb +69 -69
- data/vendor/plugins/refinery/lib/refinery/form_helpers.rb +18 -18
- data/vendor/plugins/refinery/lib/refinery/html_truncation_helper.rb +5 -5
- data/vendor/plugins/refinery/lib/refinery/initializer.rb +2 -2
- data/vendor/plugins/refinery/lib/refinery/link_renderer.rb +13 -13
- data/vendor/plugins/refinery/lib/refinery/plugin.rb +24 -24
- data/vendor/plugins/refinery/lib/refinery/plugins.rb +2 -2
- data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +8 -8
- data/vendor/plugins/refinery_dialogs/app/views/admin/dialogs/show.html.erb +19 -19
- data/vendor/plugins/refinery_dialogs/app/views/layouts/admin_dialog.html.erb +29 -29
- data/vendor/plugins/refinery_dialogs/config/routes.rb +2 -2
- data/vendor/plugins/refinery_dialogs/init.rb +7 -7
- data/vendor/plugins/refinery_settings/app/controllers/admin/refinery_settings_controller.rb +2 -2
- data/vendor/plugins/refinery_settings/app/models/refinery_setting.rb +52 -52
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_form.html.erb +11 -11
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_make_sortable.html.erb +3 -3
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/_refinery_setting.html.erb +12 -12
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/edit.html.erb +2 -2
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/index.html.erb +19 -19
- data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/new.html.erb +1 -1
- data/vendor/plugins/refinery_settings/config/routes.rb +3 -3
- data/vendor/plugins/refinery_settings/init.rb +8 -8
- data/vendor/plugins/resources/app/controllers/admin/resources_controller.rb +48 -48
- data/vendor/plugins/resources/app/models/resource.rb +12 -12
- data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +21 -21
- data/vendor/plugins/resources/app/views/admin/resources/_resource.html.erb +15 -15
- data/vendor/plugins/resources/app/views/admin/resources/edit.html.erb +1 -1
- data/vendor/plugins/resources/app/views/admin/resources/index.html.erb +19 -19
- data/vendor/plugins/resources/app/views/admin/resources/insert.html.erb +86 -86
- data/vendor/plugins/resources/app/views/admin/resources/new.html.erb +1 -1
- data/vendor/plugins/resources/config/routes.rb +2 -2
- data/vendor/plugins/resources/init.rb +6 -6
- metadata +31 -23
@@ -4,4 +4,4 @@ s3_config = File.dirname(__FILE__) + '/../../../config/amazon_s3.yml'
|
|
4
4
|
FileUtils.cp File.dirname(__FILE__) + '/amazon_s3.yml.tpl', s3_config unless File.exist?(s3_config)
|
5
5
|
cloudfiles_config = File.dirname(__FILE__) + '/../../../config/rackspace_cloudfiles.yml'
|
6
6
|
FileUtils.cp File.dirname(__FILE__) + '/rackspace_cloudfiles.yml.tpl', cloudfiles_config unless File.exist?(cloudfiles_config)
|
7
|
-
puts IO.read(File.join(File.dirname(__FILE__), 'README'))
|
7
|
+
puts IO.read(File.join(File.dirname(__FILE__), 'README'))
|
@@ -29,7 +29,7 @@ class Geometry
|
|
29
29
|
|
30
30
|
def self.from_s(str)
|
31
31
|
raise(ArgumentError, "no geometry string specified") unless str
|
32
|
-
|
32
|
+
|
33
33
|
if m = RE.match(str)
|
34
34
|
new(m[1].to_i, m[2].to_i, m[3].to_i, m[4].to_i, RFLAGS[m[5]])
|
35
35
|
else
|
@@ -46,7 +46,7 @@ class Geometry
|
|
46
46
|
str << "%+d%+d" % [@x, @y] if (@x != 0 || @y != 0)
|
47
47
|
str << FLAGS[@flag.to_i]
|
48
48
|
end
|
49
|
-
|
49
|
+
|
50
50
|
# attempts to get new dimensions for the current geometry string given these old dimensions.
|
51
51
|
# This doesn't implement the aspect flag (!) or the area flag (@). PDI
|
52
52
|
def new_dimensions_for(orig_width, orig_height)
|
data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb
CHANGED
@@ -9,13 +9,13 @@ module Technoweenie # :nodoc:
|
|
9
9
|
#
|
10
10
|
# == Requirements
|
11
11
|
#
|
12
|
-
# Requires the {Cloud Files Gem}[http://www.mosso.com/cloudfiles.jsp] by Rackspace
|
12
|
+
# Requires the {Cloud Files Gem}[http://www.mosso.com/cloudfiles.jsp] by Rackspace
|
13
13
|
#
|
14
14
|
# == Configuration
|
15
15
|
#
|
16
16
|
# Configuration is done via <tt>RAILS_ROOT/config/rackspace_cloudfiles.yml</tt> and is loaded according to the <tt>RAILS_ENV</tt>.
|
17
17
|
# The minimum connection options that you must specify are a container name, your Mosso login name and your Mosso API key.
|
18
|
-
# You can sign up for Cloud Files and get access keys by visiting https://www.mosso.com/buy.htm
|
18
|
+
# You can sign up for Cloud Files and get access keys by visiting https://www.mosso.com/buy.htm
|
19
19
|
#
|
20
20
|
# Example configuration (RAILS_ROOT/config/rackspace_cloudfiles.yml)
|
21
21
|
#
|
@@ -125,7 +125,7 @@ module Technoweenie # :nodoc:
|
|
125
125
|
@@container_name = @@cloudfiles_config[:container_name]
|
126
126
|
@@cf = CloudFiles::Connection.new(@@cloudfiles_config[:username], @@cloudfiles_config[:api_key])
|
127
127
|
@@container = @@cf.container(@@container_name)
|
128
|
-
|
128
|
+
|
129
129
|
base.before_update :rename_file
|
130
130
|
end
|
131
131
|
|
data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/db_file_backend.rb
CHANGED
@@ -12,18 +12,18 @@ module Technoweenie # :nodoc:
|
|
12
12
|
def create_temp_file
|
13
13
|
write_to_temp_file current_data
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
# Gets the current data from the database
|
17
17
|
def current_data
|
18
18
|
db_file.data
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
protected
|
22
22
|
# Destroys the file. Called in the after_destroy callback
|
23
23
|
def destroy_file
|
24
24
|
db_file.destroy if db_file
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
# Saves the data to the DbFile model
|
28
28
|
def save_to_storage
|
29
29
|
if save_attachment?
|
@@ -36,4 +36,4 @@ module Technoweenie # :nodoc:
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
end
|
39
|
-
end
|
39
|
+
end
|
data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb
CHANGED
@@ -9,11 +9,11 @@ module Technoweenie # :nodoc:
|
|
9
9
|
def self.included(base) #:nodoc:
|
10
10
|
base.before_update :rename_file
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
13
|
# Gets the full path to the filename in this format:
|
14
14
|
#
|
15
15
|
# # This assumes a model name like MyModel
|
16
|
-
# # public/#{table_name} is the default filesystem path
|
16
|
+
# # public/#{table_name} is the default filesystem path
|
17
17
|
# RAILS_ROOT/public/my_models/5/blah.jpg
|
18
18
|
#
|
19
19
|
# Overwrite this method in your model to customize the filename.
|
@@ -22,17 +22,17 @@ module Technoweenie # :nodoc:
|
|
22
22
|
file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix].to_s
|
23
23
|
File.join(RAILS_ROOT, file_system_path, *partitioned_path(thumbnail_name_for(thumbnail)))
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
# Used as the base path that #public_filename strips off full_filename to create the public path
|
27
27
|
def base_path
|
28
28
|
@base_path ||= File.join(RAILS_ROOT, 'public')
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
# The attachment ID used in the full path of a file
|
32
32
|
def attachment_path_id
|
33
33
|
((respond_to?(:parent_id) && parent_id) || id) || 0
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
# Partitions the given path into an array of path components.
|
37
37
|
#
|
38
38
|
# For example, given an <tt>*args</tt> of ["foo", "bar"], it will return
|
@@ -42,10 +42,10 @@ module Technoweenie # :nodoc:
|
|
42
42
|
# hashing the string value of the id with SHA-512, and splitting the result
|
43
43
|
# into 4 components. If the id a 128-bit UUID (as set by :uuid_primary_key => true)
|
44
44
|
# then it will be split into 2 components.
|
45
|
-
#
|
45
|
+
#
|
46
46
|
# To turn this off entirely, set :partition => false.
|
47
47
|
def partitioned_path(*args)
|
48
|
-
if respond_to?(:attachment_options) && attachment_options[:partition] == false
|
48
|
+
if respond_to?(:attachment_options) && attachment_options[:partition] == false
|
49
49
|
args
|
50
50
|
elsif attachment_options[:uuid_primary_key]
|
51
51
|
# Primary key is a 128-bit UUID in hex format. Split it into 2 components.
|
@@ -65,13 +65,13 @@ module Technoweenie # :nodoc:
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
# Gets the public path to the file
|
70
70
|
# The optional thumbnail argument will output the thumbnail's filename.
|
71
71
|
def public_filename(thumbnail = nil)
|
72
72
|
full_filename(thumbnail).gsub %r(^#{Regexp.escape(base_path)}), ''
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
def filename=(value)
|
76
76
|
@old_filename = full_filename unless filename.nil? || @old_filename
|
77
77
|
write_attribute :filename, sanitize_filename(value)
|
@@ -104,7 +104,7 @@ module Technoweenie # :nodoc:
|
|
104
104
|
@old_filename = nil
|
105
105
|
true
|
106
106
|
end
|
107
|
-
|
107
|
+
|
108
108
|
# Saves the file to the file system
|
109
109
|
def save_to_storage
|
110
110
|
if save_attachment?
|
@@ -116,7 +116,7 @@ module Technoweenie # :nodoc:
|
|
116
116
|
@old_filename = nil
|
117
117
|
true
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
def current_data
|
121
121
|
File.file?(full_filename) ? File.read(full_filename) : nil
|
122
122
|
end
|
@@ -158,9 +158,9 @@ module Technoweenie # :nodoc:
|
|
158
158
|
#
|
159
159
|
# Niether <tt>base_path</tt> or <tt>full_filename</tt> include the bucket name as part of the path.
|
160
160
|
# You can retrieve the bucket name using the <tt>bucket_name</tt> method.
|
161
|
-
#
|
161
|
+
#
|
162
162
|
# === Accessing CloudFront URLs
|
163
|
-
#
|
163
|
+
#
|
164
164
|
# You can get an object's CloudFront URL using the cloudfront_url accessor. Using the example from above:
|
165
165
|
# @postcard.cloudfront_url # => http://XXXX.cloudfront.net/photos/1/mexico.jpg
|
166
166
|
#
|
@@ -216,7 +216,7 @@ module Technoweenie # :nodoc:
|
|
216
216
|
def self.port_string
|
217
217
|
@port_string ||= (s3_config[:port].nil? || s3_config[:port] == (s3_config[:use_ssl] ? 443 : 80)) ? '' : ":#{s3_config[:port]}"
|
218
218
|
end
|
219
|
-
|
219
|
+
|
220
220
|
def self.distribution_domain
|
221
221
|
@distribution_domain = s3_config[:distribution_domain]
|
222
222
|
end
|
@@ -233,7 +233,7 @@ module Technoweenie # :nodoc:
|
|
233
233
|
def s3_port_string
|
234
234
|
Technoweenie::AttachmentFu::Backends::S3Backend.port_string
|
235
235
|
end
|
236
|
-
|
236
|
+
|
237
237
|
def cloudfront_distribution_domain
|
238
238
|
Technoweenie::AttachmentFu::Backends::S3Backend.distribution_domain
|
239
239
|
end
|
@@ -275,7 +275,7 @@ module Technoweenie # :nodoc:
|
|
275
275
|
def s3_url(thumbnail = nil)
|
276
276
|
File.join(s3_protocol + s3_hostname + s3_port_string, bucket_name, full_filename(thumbnail))
|
277
277
|
end
|
278
|
-
|
278
|
+
|
279
279
|
# All public objects are accessible via a GET request to CloudFront. You can generate a
|
280
280
|
# url for an object using the cloudfront_url method.
|
281
281
|
#
|
@@ -288,7 +288,7 @@ module Technoweenie # :nodoc:
|
|
288
288
|
def cloudfront_url(thumbnail = nil)
|
289
289
|
"http://" + cloudfront_distribution_domain + "/" + full_filename(thumbnail)
|
290
290
|
end
|
291
|
-
|
291
|
+
|
292
292
|
def public_filename(*args)
|
293
293
|
if attachment_options[:cloudfront]
|
294
294
|
cloudfront_url(args)
|
@@ -347,7 +347,7 @@ module Technoweenie # :nodoc:
|
|
347
347
|
def s3_port_string
|
348
348
|
Technoweenie::AttachmentFu::Backends::S3Backend.port_string
|
349
349
|
end
|
350
|
-
|
350
|
+
|
351
351
|
def cloudfront_distribution_domain
|
352
352
|
Technoweenie::AttachmentFu::Backends::S3Backend.distribution_domain
|
353
353
|
end
|
data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/core_image_processor.rb
CHANGED
@@ -8,13 +8,13 @@ module Technoweenie # :nodoc:
|
|
8
8
|
base.send :extend, ClassMethods
|
9
9
|
base.alias_method_chain :process_attachment, :processing
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
module ClassMethods
|
13
13
|
def with_image(file, &block)
|
14
14
|
block.call OSX::CIImage.from(file)
|
15
15
|
end
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
protected
|
19
19
|
def process_attachment_with_processing
|
20
20
|
return unless process_attachment_without_processing
|
@@ -40,17 +40,17 @@ module Technoweenie # :nodoc:
|
|
40
40
|
new_size = [img.extent.size.width, img.extent.size.height] / size.to_s
|
41
41
|
processor.resize(new_size[0], new_size[1])
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
processor.render do |result|
|
45
45
|
self.width = result.extent.size.width if respond_to?(:width)
|
46
46
|
self.height = result.extent.size.height if respond_to?(:height)
|
47
|
-
|
47
|
+
|
48
48
|
# Get a new temp_path for the image before saving
|
49
49
|
temp_paths.unshift Tempfile.new(random_tempfile_filename, Technoweenie::AttachmentFu.tempfile_path).path
|
50
50
|
result.save self.temp_path, OSX::NSJPEGFileType
|
51
51
|
self.size = File.size(self.temp_path)
|
52
52
|
end
|
53
|
-
end
|
53
|
+
end
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/gd2_processor.rb
CHANGED
@@ -8,7 +8,7 @@ module Technoweenie # :nodoc:
|
|
8
8
|
base.send :extend, ClassMethods
|
9
9
|
base.alias_method_chain :process_attachment, :processing
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
module ClassMethods
|
13
13
|
# Yields a block containing a GD2 Image for the given binary data.
|
14
14
|
def with_image(file, &block)
|
@@ -33,12 +33,12 @@ module Technoweenie # :nodoc:
|
|
33
33
|
size = size.first if size.is_a?(Array) && size.length == 1
|
34
34
|
if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))
|
35
35
|
if size.is_a?(Fixnum)
|
36
|
-
# Borrowed from image science's #thumbnail method and adapted
|
36
|
+
# Borrowed from image science's #thumbnail method and adapted
|
37
37
|
# for this.
|
38
38
|
scale = size.to_f / (img.width > img.height ? img.width.to_f : img.height.to_f)
|
39
39
|
img.resize!((img.width * scale).round(1), (img.height * scale).round(1), false)
|
40
40
|
else
|
41
|
-
img.resize!(size.first, size.last, false)
|
41
|
+
img.resize!(size.first, size.last, false)
|
42
42
|
end
|
43
43
|
else
|
44
44
|
w, h = [img.width, img.height] / size.to_s
|
@@ -51,4 +51,4 @@ module Technoweenie # :nodoc:
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
54
|
-
end
|
54
|
+
end
|
data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb
CHANGED
@@ -7,7 +7,7 @@ module Technoweenie # :nodoc:
|
|
7
7
|
base.send :extend, ClassMethods
|
8
8
|
base.alias_method_chain :process_attachment, :processing
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
module ClassMethods
|
12
12
|
# Yields a block containing an MiniMagick Image for the given binary data.
|
13
13
|
def with_image(file, &block)
|
@@ -23,7 +23,7 @@ module Technoweenie # :nodoc:
|
|
23
23
|
!binary_data.nil?
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
protected
|
28
28
|
def process_attachment_with_processing
|
29
29
|
return unless process_attachment_without_processing
|
@@ -34,7 +34,7 @@ module Technoweenie # :nodoc:
|
|
34
34
|
callback_with_args :after_resize, img
|
35
35
|
end if image?
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
# Performs the actual resizing operation for a thumbnail
|
39
39
|
def resize_image(img, size)
|
40
40
|
size = size.first if size.is_a?(Array) && size.length == 1
|
@@ -44,8 +44,8 @@ module Technoweenie # :nodoc:
|
|
44
44
|
# gif are not handled correct, this is a hack, but it seems to work.
|
45
45
|
if img.output =~ / GIF /
|
46
46
|
img.format("png")
|
47
|
-
end
|
48
|
-
|
47
|
+
end
|
48
|
+
|
49
49
|
if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))
|
50
50
|
if size.is_a?(Fixnum)
|
51
51
|
size = [size, size]
|
@@ -63,16 +63,16 @@ module Technoweenie # :nodoc:
|
|
63
63
|
# crop thumbnail, the smart way
|
64
64
|
elsif size.is_a?(String) and size =~ /c$/
|
65
65
|
size = size.gsub(/c/, '')
|
66
|
-
|
66
|
+
|
67
67
|
# calculate sizes and aspect ratio
|
68
68
|
thumb_width, thumb_height = size.split("x")
|
69
69
|
thumb_width = thumb_width.to_f
|
70
70
|
thumb_height = thumb_height.to_f
|
71
|
-
|
71
|
+
|
72
72
|
thumb_aspect = thumb_width.to_f / thumb_height.to_f
|
73
73
|
image_width, image_height = img[:width].to_f, img[:height].to_f
|
74
74
|
image_aspect = image_width / image_height
|
75
|
-
|
75
|
+
|
76
76
|
# only crop if image is not smaller in both dimensions
|
77
77
|
unless image_width < thumb_width and image_height < thumb_height
|
78
78
|
command = calculate_offset(image_width,image_height,image_aspect,thumb_width,thumb_height,thumb_aspect)
|
@@ -82,7 +82,7 @@ module Technoweenie # :nodoc:
|
|
82
82
|
end
|
83
83
|
|
84
84
|
# don not resize if image is not as height or width then thumbnail
|
85
|
-
if image_width < thumb_width or image_height < thumb_height
|
85
|
+
if image_width < thumb_width or image_height < thumb_height
|
86
86
|
commands.background('#ffffff')
|
87
87
|
commands.gravity('center')
|
88
88
|
commands.extent(size)
|
@@ -110,7 +110,7 @@ module Technoweenie # :nodoc:
|
|
110
110
|
command = "#{thumb_width}x#{image_height}+#{offset}+0"
|
111
111
|
|
112
112
|
# normal thumbnail generation
|
113
|
-
# calculate height and offset y, width is fixed
|
113
|
+
# calculate height and offset y, width is fixed
|
114
114
|
elsif (image_aspect <= thumb_aspect or image_width < thumb_width) and image_height > thumb_height
|
115
115
|
height = image_width / thumb_aspect
|
116
116
|
offset = (image_height / 2) - (height / 2)
|
@@ -129,4 +129,4 @@ module Technoweenie # :nodoc:
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
end
|
132
|
-
end
|
132
|
+
end
|
@@ -12,7 +12,7 @@ class FileSystemTest < Test::Unit::TestCase
|
|
12
12
|
assert_equal attachment.size, File.open(attachment.full_filename).stat.size
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
test_against_subclass :test_filesystem_size_for_file_attachment, FileAttachment
|
17
17
|
|
18
18
|
def test_should_not_overwrite_file_attachment(klass = FileAttachment)
|
@@ -22,15 +22,15 @@ class FileSystemTest < Test::Unit::TestCase
|
|
22
22
|
assert_valid real
|
23
23
|
assert !real.new_record?, real.errors.full_messages.join("\n")
|
24
24
|
assert !real.size.zero?
|
25
|
-
|
25
|
+
|
26
26
|
fake = upload_file :filename => '/files/fake/rails.png'
|
27
27
|
assert_valid fake
|
28
28
|
assert !fake.size.zero?
|
29
|
-
|
29
|
+
|
30
30
|
assert_not_equal File.open(real.full_filename).stat.size, File.open(fake.full_filename).stat.size
|
31
31
|
end
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
test_against_subclass :test_should_not_overwrite_file_attachment, FileAttachment
|
35
35
|
|
36
36
|
def test_should_store_file_attachment_in_filesystem(klass = FileAttachment)
|
@@ -39,13 +39,13 @@ class FileSystemTest < Test::Unit::TestCase
|
|
39
39
|
assert_created do
|
40
40
|
attachment = upload_file :filename => '/files/rails.png'
|
41
41
|
assert_valid attachment
|
42
|
-
assert File.exists?(attachment.full_filename), "#{attachment.full_filename} does not exist"
|
42
|
+
assert File.exists?(attachment.full_filename), "#{attachment.full_filename} does not exist"
|
43
43
|
end
|
44
44
|
attachment
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
47
|
test_against_subclass :test_should_store_file_attachment_in_filesystem, FileAttachment
|
48
|
-
|
48
|
+
|
49
49
|
def test_should_delete_old_file_when_updating(klass = FileAttachment)
|
50
50
|
attachment_model klass
|
51
51
|
attachment = upload_file :filename => '/files/rails.png'
|
@@ -55,14 +55,14 @@ class FileSystemTest < Test::Unit::TestCase
|
|
55
55
|
attachment.filename = 'rails2.png'
|
56
56
|
attachment.temp_paths.unshift File.join(fixture_path, file)
|
57
57
|
attachment.save!
|
58
|
-
assert File.exists?(attachment.full_filename), "#{attachment.full_filename} does not exist"
|
58
|
+
assert File.exists?(attachment.full_filename), "#{attachment.full_filename} does not exist"
|
59
59
|
assert !File.exists?(old_filename), "#{old_filename} still exists"
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
test_against_subclass :test_should_delete_old_file_when_updating, FileAttachment
|
65
|
-
|
65
|
+
|
66
66
|
def test_should_delete_old_file_when_renaming(klass = FileAttachment)
|
67
67
|
attachment_model klass
|
68
68
|
attachment = upload_file :filename => '/files/rails.png'
|
@@ -70,41 +70,41 @@ class FileSystemTest < Test::Unit::TestCase
|
|
70
70
|
assert_not_created do
|
71
71
|
attachment.filename = 'rails2.png'
|
72
72
|
attachment.save
|
73
|
-
assert File.exists?(attachment.full_filename), "#{attachment.full_filename} does not exist"
|
73
|
+
assert File.exists?(attachment.full_filename), "#{attachment.full_filename} does not exist"
|
74
74
|
assert !File.exists?(old_filename), "#{old_filename} still exists"
|
75
75
|
assert !attachment.reload.size.zero?
|
76
76
|
assert_equal 'rails2.png', attachment.filename
|
77
77
|
end
|
78
78
|
end
|
79
|
-
|
79
|
+
|
80
80
|
test_against_subclass :test_should_delete_old_file_when_renaming, FileAttachment
|
81
|
-
|
81
|
+
|
82
82
|
def test_path_partitioning_works_on_integer_id(klass = FileAttachment)
|
83
83
|
attachment_model klass
|
84
|
-
|
84
|
+
|
85
85
|
# Create a random attachment object, doesn't matter what.
|
86
86
|
attachment = upload_file :filename => '/files/rails.png'
|
87
87
|
old_id = attachment.id
|
88
88
|
attachment.id = 1
|
89
|
-
|
89
|
+
|
90
90
|
begin
|
91
91
|
assert_equal ["0000", "0001", "bar.txt"], attachment.send(:partitioned_path, "bar.txt")
|
92
92
|
ensure
|
93
93
|
attachment.id = old_id
|
94
94
|
end
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
test_against_subclass :test_path_partitioning_works_on_integer_id, FileAttachment
|
98
|
-
|
98
|
+
|
99
99
|
def test_path_partitioning_with_string_id_works_by_generating_hash(klass = FileAttachmentWithStringId)
|
100
100
|
attachment_model klass
|
101
|
-
|
101
|
+
|
102
102
|
# Create a random attachment object, doesn't matter what.
|
103
103
|
attachment = upload_file :filename => '/files/rails.png'
|
104
104
|
old_id = attachment.id
|
105
105
|
attachment.id = "hello world some long string"
|
106
106
|
hash = Digest::SHA512.hexdigest("hello world some long string")
|
107
|
-
|
107
|
+
|
108
108
|
begin
|
109
109
|
assert_equal [
|
110
110
|
hash[0..31],
|
@@ -117,17 +117,17 @@ class FileSystemTest < Test::Unit::TestCase
|
|
117
117
|
attachment.id = old_id
|
118
118
|
end
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
test_against_subclass :test_path_partitioning_with_string_id_works_by_generating_hash, FileAttachmentWithStringId
|
122
|
-
|
122
|
+
|
123
123
|
def test_path_partition_string_id_hashing_is_turned_off_if_id_is_uuid(klass = FileAttachmentWithUuid)
|
124
124
|
attachment_model klass
|
125
|
-
|
125
|
+
|
126
126
|
# Create a random attachment object, doesn't matter what.
|
127
127
|
attachment = upload_file :filename => '/files/rails.png'
|
128
128
|
old_id = attachment.id
|
129
129
|
attachment.id = "0c0743b698483569dc65909a8cdb3bf9"
|
130
|
-
|
130
|
+
|
131
131
|
begin
|
132
132
|
assert_equal [
|
133
133
|
"0c0743b698483569",
|
@@ -138,6 +138,6 @@ class FileSystemTest < Test::Unit::TestCase
|
|
138
138
|
attachment.id = old_id
|
139
139
|
end
|
140
140
|
end
|
141
|
-
|
141
|
+
|
142
142
|
test_against_subclass :test_path_partition_string_id_hashing_is_turned_off_if_id_is_uuid, FileAttachmentWithUuid
|
143
143
|
end
|