spree 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree might be problematic. Click here for more details.
- data/History.txt +24 -0
- data/License.txt +26 -0
- data/Manifest.txt +534 -0
- data/README.txt +1 -0
- data/Rakefile +4 -0
- data/bin/spree +157 -0
- data/config/hoe.rb +78 -0
- data/config/requirements.rb +15 -0
- data/lib/spree/version.rb +9 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +74 -0
- data/setup.rb +1585 -0
- data/starter-app/README +182 -0
- data/starter-app/Rakefile +10 -0
- data/starter-app/app/controllers/application.rb +14 -0
- data/starter-app/app/helpers/application_helper.rb +3 -0
- data/starter-app/app/models/role.rb +3 -0
- data/starter-app/app/models/tag.rb +37 -0
- data/starter-app/app/models/tagging.rb +16 -0
- data/starter-app/app/models/user.rb +102 -0
- data/starter-app/app/views/layouts/application.rhtml +46 -0
- data/starter-app/app/views/shared/_store_menu.rhtml +6 -0
- data/starter-app/config/boot.rb +45 -0
- data/starter-app/config/database.yml +23 -0
- data/starter-app/config/environment.rb +140 -0
- data/starter-app/config/environments/development.rb +21 -0
- data/starter-app/config/environments/production.rb +21 -0
- data/starter-app/config/environments/test.rb +19 -0
- data/starter-app/config/routes.rb +28 -0
- data/starter-app/db/migrate/001_create_users.rb +17 -0
- data/starter-app/db/migrate/002_create_roles.rb +20 -0
- data/starter-app/db/migrate/003_create_tags_and_taggings.rb +28 -0
- data/starter-app/db/migrate/004_spree_to_version_21.rb +9 -0
- data/starter-app/db/sample/addresses.yml +24 -0
- data/starter-app/db/sample/categories.yml +35 -0
- data/starter-app/db/sample/countries.yml +3 -0
- data/starter-app/db/sample/credit_cards.yml +12 -0
- data/starter-app/db/sample/images.yml +252 -0
- data/starter-app/db/sample/line_items.yml +23 -0
- data/starter-app/db/sample/option_types.yml +6 -0
- data/starter-app/db/sample/option_values.yml +35 -0
- data/starter-app/db/sample/orders.yml +15 -0
- data/starter-app/db/sample/product_option_types.yml +8 -0
- data/starter-app/db/sample/products.yml +35 -0
- data/starter-app/db/sample/roles.yml +3 -0
- data/starter-app/db/sample/skus.yml +28 -0
- data/starter-app/db/sample/states.yml +154 -0
- data/starter-app/db/sample/taggings.yml +16 -0
- data/starter-app/db/sample/tags.yml +6 -0
- data/starter-app/db/sample/txns.yml +7 -0
- data/starter-app/db/sample/users.yml +6 -0
- data/starter-app/db/sample/variations.yml +31 -0
- data/starter-app/doc/README_FOR_APP +2 -0
- data/starter-app/lib/authenticated_system.rb +116 -0
- data/starter-app/lib/authenticated_test_helper.rb +10 -0
- data/starter-app/lib/custom_fixtures.rb +7 -0
- data/starter-app/lib/hijacker.rb +78 -0
- data/starter-app/lib/role_requirement_system.rb +142 -0
- data/starter-app/lib/role_requirement_test_helper.rb +86 -0
- data/starter-app/lib/tagging_extensions.rb +104 -0
- data/starter-app/lib/tasks/sample/products/0000/0001/ror_tote.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0001/ror_tote_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0001/ror_tote_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0001/ror_tote_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0002/ror_tote_back.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0002/ror_tote_back_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0002/ror_tote_back_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0002/ror_tote_back_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0003/ror_bag.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0003/ror_bag_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0003/ror_bag_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0003/ror_bag_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0004/ror_baseball.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0004/ror_baseball_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0004/ror_baseball_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0004/ror_baseball_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0005/ror_baseball_back.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0005/ror_baseball_back_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0005/ror_baseball_back_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0005/ror_baseball_back_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0006/ror_jr_spaghetti.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0006/ror_jr_spaghetti_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0006/ror_jr_spaghetti_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0006/ror_jr_spaghetti_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0007/ror_mug.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0007/ror_mug_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0007/ror_mug_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0007/ror_mug_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0008/ror_mug_back.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0008/ror_mug_back_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0008/ror_mug_back_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0008/ror_mug_back_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0009/ror_ringer.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0009/ror_ringer_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0009/ror_ringer_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0009/ror_ringer_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0010/ror_ringer_back.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0010/ror_ringer_back_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0010/ror_ringer_back_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0010/ror_ringer_back_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0011/ror_stein.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0011/ror_stein_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0011/ror_stein_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0011/ror_stein_small.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0012/ror_stein_back.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0012/ror_stein_back_mini.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0012/ror_stein_back_product.jpeg +0 -0
- data/starter-app/lib/tasks/sample/products/0000/0012/ror_stein_back_small.jpeg +0 -0
- data/starter-app/lib/tasks/spree_sample_data.rake +38 -0
- data/starter-app/public/.htaccess +40 -0
- data/starter-app/public/404.html +30 -0
- data/starter-app/public/500.html +30 -0
- data/starter-app/public/dispatch.cgi +10 -0
- data/starter-app/public/dispatch.fcgi +24 -0
- data/starter-app/public/dispatch.rb +10 -0
- data/starter-app/public/favicon.ico +0 -0
- data/starter-app/public/images/rails.png +0 -0
- data/starter-app/public/index.html +277 -0
- data/starter-app/public/javascripts/application.js +2 -0
- data/starter-app/public/javascripts/controls.js +833 -0
- data/starter-app/public/javascripts/dragdrop.js +942 -0
- data/starter-app/public/javascripts/effects.js +1088 -0
- data/starter-app/public/javascripts/prototype.js +4184 -0
- data/starter-app/public/robots.txt +1 -0
- data/starter-app/public/stylesheets/application.css +209 -0
- data/starter-app/public/stylesheets/cart/_controller.css +4 -0
- data/starter-app/public/stylesheets/checkout/_controller.css +13 -0
- data/starter-app/script/about +3 -0
- data/starter-app/script/breakpointer +3 -0
- data/starter-app/script/console +3 -0
- data/starter-app/script/destroy +3 -0
- data/starter-app/script/generate +3 -0
- data/starter-app/script/performance/benchmarker +3 -0
- data/starter-app/script/performance/profiler +3 -0
- data/starter-app/script/plugin +3 -0
- data/starter-app/script/process/inspector +3 -0
- data/starter-app/script/process/reaper +3 -0
- data/starter-app/script/process/spawner +3 -0
- data/starter-app/script/runner +3 -0
- data/starter-app/script/server +3 -0
- data/starter-app/test/fixtures/users.yml +7 -0
- data/starter-app/test/test_helper.rb +28 -0
- data/starter-app/test/unit/user_test.rb +8 -0
- data/starter-app/vendor/plugins/acts_as_list/README +23 -0
- data/starter-app/vendor/plugins/acts_as_list/init.rb +3 -0
- data/starter-app/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
- data/starter-app/vendor/plugins/acts_as_list/test/list_test.rb +332 -0
- data/starter-app/vendor/plugins/acts_as_tree/README +26 -0
- data/starter-app/vendor/plugins/acts_as_tree/Rakefile +22 -0
- data/starter-app/vendor/plugins/acts_as_tree/init.rb +1 -0
- data/starter-app/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/abstract_unit.rb +0 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/acts_as_tree_test.rb +219 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/database.yml +0 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/fixtures/mixin.rb +0 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/fixtures/mixins.yml +0 -0
- data/starter-app/vendor/plugins/acts_as_tree/test/schema.rb +0 -0
- data/starter-app/vendor/plugins/attachment_fu/CHANGELOG +24 -0
- data/starter-app/vendor/plugins/attachment_fu/README +162 -0
- data/starter-app/vendor/plugins/attachment_fu/Rakefile +22 -0
- data/starter-app/vendor/plugins/attachment_fu/amazon_s3.yml.tpl +14 -0
- data/starter-app/vendor/plugins/attachment_fu/init.rb +14 -0
- data/starter-app/vendor/plugins/attachment_fu/install.rb +5 -0
- data/starter-app/vendor/plugins/attachment_fu/lib/geometry.rb +93 -0
- data/starter-app/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb +410 -0
- data/starter-app/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/db_file_backend.rb +39 -0
- data/starter-app/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb +97 -0
- data/starter-app/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb +309 -0
- data/starter-app/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/image_science_processor.rb +61 -0
- data/starter-app/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb +56 -0
- data/starter-app/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb +53 -0
- data/starter-app/vendor/plugins/attachment_fu/test/amazon_s3.yml +6 -0
- data/starter-app/vendor/plugins/attachment_fu/test/backends/db_file_test.rb +16 -0
- data/starter-app/vendor/plugins/attachment_fu/test/backends/file_system_test.rb +80 -0
- data/starter-app/vendor/plugins/attachment_fu/test/backends/remote/s3_test.rb +103 -0
- data/starter-app/vendor/plugins/attachment_fu/test/base_attachment_tests.rb +57 -0
- data/starter-app/vendor/plugins/attachment_fu/test/basic_test.rb +64 -0
- data/starter-app/vendor/plugins/attachment_fu/test/database.yml +18 -0
- data/starter-app/vendor/plugins/attachment_fu/test/extra_attachment_test.rb +57 -0
- data/starter-app/vendor/plugins/attachment_fu/test/fixtures/attachment.rb +127 -0
- data/starter-app/vendor/plugins/attachment_fu/test/fixtures/files/fake/rails.png +0 -0
- data/starter-app/vendor/plugins/attachment_fu/test/fixtures/files/foo.txt +1 -0
- data/starter-app/vendor/plugins/attachment_fu/test/fixtures/files/rails.png +0 -0
- data/starter-app/vendor/plugins/attachment_fu/test/geometry_test.rb +101 -0
- data/starter-app/vendor/plugins/attachment_fu/test/processors/image_science_test.rb +31 -0
- data/starter-app/vendor/plugins/attachment_fu/test/processors/mini_magick_test.rb +31 -0
- data/starter-app/vendor/plugins/attachment_fu/test/processors/rmagick_test.rb +241 -0
- data/starter-app/vendor/plugins/attachment_fu/test/schema.rb +86 -0
- data/starter-app/vendor/plugins/attachment_fu/test/test_helper.rb +142 -0
- data/starter-app/vendor/plugins/attachment_fu/test/validation_test.rb +55 -0
- data/starter-app/vendor/plugins/calendar_date_select/CHANGELOG +170 -0
- data/starter-app/vendor/plugins/calendar_date_select/MIT-LICENSE +20 -0
- data/starter-app/vendor/plugins/calendar_date_select/README +10 -0
- data/starter-app/vendor/plugins/calendar_date_select/init.rb +15 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/functional/cds_test.html +324 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/prototype.js +4184 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/test.css +40 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/unit/cds_helper_methods.html +46 -0
- data/starter-app/vendor/plugins/calendar_date_select/js_test/unittest.js +564 -0
- data/starter-app/vendor/plugins/calendar_date_select/lib/calendar_date_select.rb +192 -0
- data/starter-app/vendor/plugins/calendar_date_select/lib/includes_helper.rb +22 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/images/calendar_date_select/calendar.gif +0 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/calendar_date_select.js +439 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_american.js +34 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_euro_24hr.js +7 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_finnish.js +24 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_hyphen_ampm.js +36 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/format_italian.js +24 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/javascripts/calendar_date_select/locale/fi.js +10 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/blue.css +130 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/default.css +135 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/plain.css +128 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/red.css +135 -0
- data/starter-app/vendor/plugins/calendar_date_select/public/stylesheets/calendar_date_select/silver.css +133 -0
- data/starter-app/vendor/plugins/calendar_date_select/test/functional/calendar_date_select_test.rb +95 -0
- data/starter-app/vendor/plugins/calendar_date_select/test/functional/helper_methods_test.rb +15 -0
- data/starter-app/vendor/plugins/calendar_date_select/test/test_helper.rb +26 -0
- data/starter-app/vendor/plugins/engines/CHANGELOG +258 -0
- data/starter-app/vendor/plugins/engines/MIT-LICENSE +21 -0
- data/starter-app/vendor/plugins/engines/README +63 -0
- data/starter-app/vendor/plugins/engines/Rakefile +32 -0
- data/starter-app/vendor/plugins/engines/about.yml +7 -0
- data/starter-app/vendor/plugins/engines/boot.rb +18 -0
- data/starter-app/vendor/plugins/engines/generators/plugin_migration/USAGE +45 -0
- data/starter-app/vendor/plugins/engines/generators/plugin_migration/plugin_migration_generator.rb +79 -0
- data/starter-app/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.erb +13 -0
- data/starter-app/vendor/plugins/engines/init.rb +2 -0
- data/starter-app/vendor/plugins/engines/lib/engines.rb +169 -0
- data/starter-app/vendor/plugins/engines/lib/engines/assets.rb +38 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin.rb +125 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin/list.rb +30 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin/loader.rb +18 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin/locator.rb +11 -0
- data/starter-app/vendor/plugins/engines/lib/engines/plugin/migrator.rb +60 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/action_mailer.rb +85 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/active_record.rb +24 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/asset_helpers.rb +119 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/dependencies.rb +145 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/migrations.rb +161 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/rails.rb +11 -0
- data/starter-app/vendor/plugins/engines/lib/engines/rails_extensions/routing.rb +84 -0
- data/starter-app/vendor/plugins/engines/lib/engines/testing.rb +87 -0
- data/starter-app/vendor/plugins/engines/tasks/engines.rake +176 -0
- data/starter-app/vendor/plugins/in_place_editing/README +14 -0
- data/starter-app/vendor/plugins/in_place_editing/Rakefile +22 -0
- data/starter-app/vendor/plugins/in_place_editing/init.rb +2 -0
- data/starter-app/vendor/plugins/in_place_editing/lib/in_place_editing.rb +25 -0
- data/starter-app/vendor/plugins/in_place_editing/lib/in_place_macros_helper.rb +71 -0
- data/starter-app/vendor/plugins/in_place_editing/test/in_place_editing_test.rb +69 -0
- data/starter-app/vendor/plugins/paginating_find/CHANGELOG +120 -0
- data/starter-app/vendor/plugins/paginating_find/README +89 -0
- data/starter-app/vendor/plugins/paginating_find/init.rb +2 -0
- data/starter-app/vendor/plugins/paginating_find/lib/paginating_find.rb +138 -0
- data/starter-app/vendor/plugins/paginating_find/lib/paging_enumerator.rb +158 -0
- data/starter-app/vendor/plugins/paginating_find/lib/paging_helper.rb +47 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/Rakefile +10 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/app/controllers/application.rb +2 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/boot.rb +44 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/database.yml +6 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/environment.rb +53 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/environments/test.rb +19 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/config/routes.rb +22 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/db/schema.rb +16 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/script/breakpointer +3 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/script/console +3 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/fixtures/articles.yml +19 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/fixtures/authors.yml +7 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/fixtures/edits.yml +11 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/fixtures/models.rb +18 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/test_helper.rb +33 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/unit/abstract_test.rb +7 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/unit/group_test.rb +40 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/unit/paginating_find_test.rb +194 -0
- data/starter-app/vendor/plugins/paginating_find/test_app/test/unit/paging_enumerator_test.rb +143 -0
- data/starter-app/vendor/plugins/spree/.rakeTasks +7 -0
- data/starter-app/vendor/plugins/spree/CHANGELOG +1 -0
- data/starter-app/vendor/plugins/spree/LICENSE +26 -0
- data/starter-app/vendor/plugins/spree/README +1 -0
- data/starter-app/vendor/plugins/spree/Rakefile +10 -0
- data/starter-app/vendor/plugins/spree/VERSION +1 -0
- data/starter-app/vendor/plugins/spree/app/controllers/account_controller.rb +48 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/base_controller.rb +7 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/categories_controller.rb +107 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/images_controller.rb +15 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/option_types_controller.rb +70 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/orders_controller.rb +247 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/overview_controller.rb +14 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/products_controller.rb +207 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/reports_controller.rb +53 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/users_controller.rb +45 -0
- data/starter-app/vendor/plugins/spree/app/controllers/admin/variations_controller.rb +73 -0
- data/starter-app/vendor/plugins/spree/app/controllers/cart_controller.rb +45 -0
- data/starter-app/vendor/plugins/spree/app/controllers/checkout_controller.rb +184 -0
- data/starter-app/vendor/plugins/spree/app/controllers/rails_cart/base_controller.rb +47 -0
- data/starter-app/vendor/plugins/spree/app/controllers/store_controller.rb +27 -0
- data/starter-app/vendor/plugins/spree/app/helpers/account_helper.rb +2 -0
- data/starter-app/vendor/plugins/spree/app/helpers/admin/base_helper.rb +14 -0
- data/starter-app/vendor/plugins/spree/app/helpers/admin/categories_helper.rb +3 -0
- data/starter-app/vendor/plugins/spree/app/helpers/admin/option_values_helper.rb +2 -0
- data/starter-app/vendor/plugins/spree/app/helpers/admin/orders_helper.rb +11 -0
- data/starter-app/vendor/plugins/spree/app/helpers/admin/overview_helper.rb +12 -0
- data/starter-app/vendor/plugins/spree/app/helpers/admin/products_helper.rb +7 -0
- data/starter-app/vendor/plugins/spree/app/helpers/admin/users_helper.rb +2 -0
- data/starter-app/vendor/plugins/spree/app/helpers/admin/variations_helper.rb +2 -0
- data/starter-app/vendor/plugins/spree/app/helpers/cart_helper.rb +6 -0
- data/starter-app/vendor/plugins/spree/app/helpers/checkout_helper.rb +17 -0
- data/starter-app/vendor/plugins/spree/app/helpers/rails_cart/base_helper.rb +101 -0
- data/starter-app/vendor/plugins/spree/app/helpers/search_helper.rb +10 -0
- data/starter-app/vendor/plugins/spree/app/helpers/store_helper.rb +3 -0
- data/starter-app/vendor/plugins/spree/app/models/address.rb +17 -0
- data/starter-app/vendor/plugins/spree/app/models/cart.rb +37 -0
- data/starter-app/vendor/plugins/spree/app/models/cart_item.rb +29 -0
- data/starter-app/vendor/plugins/spree/app/models/category.rb +66 -0
- data/starter-app/vendor/plugins/spree/app/models/country.rb +3 -0
- data/starter-app/vendor/plugins/spree/app/models/credit_card.rb +24 -0
- data/starter-app/vendor/plugins/spree/app/models/image.rb +12 -0
- data/starter-app/vendor/plugins/spree/app/models/line_item.rb +24 -0
- data/starter-app/vendor/plugins/spree/app/models/option_type.rb +4 -0
- data/starter-app/vendor/plugins/spree/app/models/option_value.rb +5 -0
- data/starter-app/vendor/plugins/spree/app/models/order.rb +87 -0
- data/starter-app/vendor/plugins/spree/app/models/order_mailer.rb +22 -0
- data/starter-app/vendor/plugins/spree/app/models/order_operation.rb +7 -0
- data/starter-app/vendor/plugins/spree/app/models/payment.rb +49 -0
- data/starter-app/vendor/plugins/spree/app/models/product.rb +42 -0
- data/starter-app/vendor/plugins/spree/app/models/product_option_type.rb +5 -0
- data/starter-app/vendor/plugins/spree/app/models/search_criteria.rb +27 -0
- data/starter-app/vendor/plugins/spree/app/models/sku.rb +7 -0
- data/starter-app/vendor/plugins/spree/app/models/state.rb +3 -0
- data/starter-app/vendor/plugins/spree/app/models/tax_treatment.rb +2 -0
- data/starter-app/vendor/plugins/spree/app/models/txn.rb +7 -0
- data/starter-app/vendor/plugins/spree/app/models/variation.rb +8 -0
- data/starter-app/vendor/plugins/spree/app/views/account/index.rhtml +3 -0
- data/starter-app/vendor/plugins/spree/app/views/account/login.rhtml +12 -0
- data/starter-app/vendor/plugins/spree/app/views/account/signup.rhtml +16 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/categories/_form.rhtml +24 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/categories/edit.rhtml +9 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/categories/list.rhtml +47 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/categories/new.rhtml +8 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/images/new.html.erb +10 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/option_types/_form.rhtml +16 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/option_types/_new_option_value.rhtml +13 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/option_types/_option_values.rhtml +43 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/option_types/edit.rhtml +8 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/option_types/index.rhtml +23 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/option_types/new.rhtml +8 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/option_types/select.rhtml +28 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/option_types/test.rhtml +8 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/orders/_address.rhtml +37 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/orders/index.rhtml +99 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/orders/show.rhtml +72 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/overview/index.rhtml +0 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/products/_form.rhtml +65 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/products/_menu.rhtml +7 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/products/_new_variation.rhtml +11 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/products/_option_types.rhtml +42 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/products/_variations.rhtml +41 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/products/edit.rhtml +8 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/products/index.rhtml +66 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/products/new.rhtml +9 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/reports/index.rhtml +29 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/reports/sales_total.rhtml +28 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/users/_form.rhtml +29 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/users/_menu.rhtml +5 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/users/edit.rhtml +8 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/users/index.rhtml +26 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/users/new.rhtml +6 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/users/show.rhtml +9 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/variations/_form.rhtml +33 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/variations/_option_values.rhtml +5 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/variations/list.rhtml +23 -0
- data/starter-app/vendor/plugins/spree/app/views/admin/variations/new.rhtml +14 -0
- data/starter-app/vendor/plugins/spree/app/views/cart/index.rhtml +49 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/_address.rhtml +51 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/_address_ro.rhtml +18 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/_cart_item.rhtml +5 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/_extra.rhtml +1 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/addresses.rhtml +51 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/cvv.rhtml +15 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/empty_cart.rhtml +4 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/final_confirmation.rhtml +92 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/incomplete.rhtml +7 -0
- data/starter-app/vendor/plugins/spree/app/views/checkout/thank_you.rhtml +11 -0
- data/starter-app/vendor/plugins/spree/app/views/layouts/admin.rhtml +69 -0
- data/starter-app/vendor/plugins/spree/app/views/layouts/products.rhtml +20 -0
- data/starter-app/vendor/plugins/spree/app/views/layouts/simple.rhtml +37 -0
- data/starter-app/vendor/plugins/spree/app/views/order_mailer/cancel.rhtml +15 -0
- data/starter-app/vendor/plugins/spree/app/views/order_mailer/confirm.rhtml +18 -0
- data/starter-app/vendor/plugins/spree/app/views/shared/_images.html.erb +43 -0
- data/starter-app/vendor/plugins/spree/app/views/shared/_order_details.rhtml +35 -0
- data/starter-app/vendor/plugins/spree/app/views/shared/_paginate.rhtml +34 -0
- data/starter-app/vendor/plugins/spree/app/views/shared/_report_criteria.rhtml +32 -0
- data/starter-app/vendor/plugins/spree/app/views/shared/_tax_treatments.rhtml +12 -0
- data/starter-app/vendor/plugins/spree/app/views/store/_image.html.erb +5 -0
- data/starter-app/vendor/plugins/spree/app/views/store/_products.rhtml +10 -0
- data/starter-app/vendor/plugins/spree/app/views/store/_thumbnails.html.erb +9 -0
- data/starter-app/vendor/plugins/spree/app/views/store/list.rhtml +15 -0
- data/starter-app/vendor/plugins/spree/app/views/store/show.rhtml +69 -0
- data/starter-app/vendor/plugins/spree/assets/.htaccess +40 -0
- data/starter-app/vendor/plugins/spree/assets/404.html +30 -0
- data/starter-app/vendor/plugins/spree/assets/500.html +30 -0
- data/starter-app/vendor/plugins/spree/assets/dispatch.cgi +10 -0
- data/starter-app/vendor/plugins/spree/assets/dispatch.fcgi +24 -0
- data/starter-app/vendor/plugins/spree/assets/dispatch.rb +10 -0
- data/starter-app/vendor/plugins/spree/assets/favicon.ico +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/amex_cid.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/creditcard.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/discover_cid.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/master_cid.jpg +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/products/ror_bag.jpg +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/products/ror_baseball_jersey.jpg +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/products/ror_jr_spaghetti.jpg +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/products/ror_mug.jpg +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/products/ror_ringer_tshirt.jpg +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/products/ror_stein.jpg +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/products/ror_tote.jpg +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/rails.png +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/spinner.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/spree/progress.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/spree/spinner.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/spree/spree_logo142x65.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/spree/spree_logo245x112.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/images/visa_cid.gif +0 -0
- data/starter-app/vendor/plugins/spree/assets/javascripts/application.js +2 -0
- data/starter-app/vendor/plugins/spree/assets/javascripts/controls.js +833 -0
- data/starter-app/vendor/plugins/spree/assets/javascripts/dragdrop.js +942 -0
- data/starter-app/vendor/plugins/spree/assets/javascripts/effects.js +1088 -0
- data/starter-app/vendor/plugins/spree/assets/javascripts/lowpro.js +307 -0
- data/starter-app/vendor/plugins/spree/assets/javascripts/prototype.js +2515 -0
- data/starter-app/vendor/plugins/spree/assets/robots.txt +1 -0
- data/starter-app/vendor/plugins/spree/assets/stylesheets/cart/_controller.css +71 -0
- data/starter-app/vendor/plugins/spree/assets/stylesheets/checkout/_controller.css +31 -0
- data/starter-app/vendor/plugins/spree/assets/stylesheets/fullscreen.css +63 -0
- data/starter-app/vendor/plugins/spree/assets/stylesheets/orders/_controller.css +3 -0
- data/starter-app/vendor/plugins/spree/assets/stylesheets/products/_controller.css +38 -0
- data/starter-app/vendor/plugins/spree/assets/stylesheets/spree-admin.css +348 -0
- data/starter-app/vendor/plugins/spree/assets/stylesheets/spree.css +66 -0
- data/starter-app/vendor/plugins/spree/assets/stylesheets/store/_controller.css +23 -0
- data/starter-app/vendor/plugins/spree/db/migrate/001_create_addresses.rb +20 -0
- data/starter-app/vendor/plugins/spree/db/migrate/002_create_cart_items.rb +14 -0
- data/starter-app/vendor/plugins/spree/db/migrate/003_create_carts.rb +12 -0
- data/starter-app/vendor/plugins/spree/db/migrate/004_create_categories.rb +15 -0
- data/starter-app/vendor/plugins/spree/db/migrate/005_create_categories_products.rb +12 -0
- data/starter-app/vendor/plugins/spree/db/migrate/006_create_line_items.rb +17 -0
- data/starter-app/vendor/plugins/spree/db/migrate/007_create_option_values.rb +15 -0
- data/starter-app/vendor/plugins/spree/db/migrate/008_create_orders.rb +24 -0
- data/starter-app/vendor/plugins/spree/db/migrate/009_create_products.rb +20 -0
- data/starter-app/vendor/plugins/spree/db/migrate/010_create_txns.rb +18 -0
- data/starter-app/vendor/plugins/spree/db/migrate/011_create_variations.rb +11 -0
- data/starter-app/vendor/plugins/spree/db/migrate/012_create_tax_treatments.rb +23 -0
- data/starter-app/vendor/plugins/spree/db/migrate/013_create_skus.rb +13 -0
- data/starter-app/vendor/plugins/spree/db/migrate/014_create_countries.rb +11 -0
- data/starter-app/vendor/plugins/spree/db/migrate/015_create_states.rb +13 -0
- data/starter-app/vendor/plugins/spree/db/migrate/016_create_option_types.rb +13 -0
- data/starter-app/vendor/plugins/spree/db/migrate/017_create_product_option_types.rb +14 -0
- data/starter-app/vendor/plugins/spree/db/migrate/018_create_option_values_variations.rb +12 -0
- data/starter-app/vendor/plugins/spree/db/migrate/019_create_images.rb +19 -0
- data/starter-app/vendor/plugins/spree/db/migrate/020_create_credit_cards.rb +20 -0
- data/starter-app/vendor/plugins/spree/db/migrate/021_create_order_operations.rb +14 -0
- data/starter-app/vendor/plugins/spree/init.rb +11 -0
- data/starter-app/vendor/plugins/spree/install.rb +3 -0
- data/starter-app/vendor/plugins/spree/lib/constants/enumerable_constants.rb +207 -0
- data/starter-app/vendor/plugins/spree/lib/format.rb +12 -0
- data/starter-app/vendor/plugins/spree/lib/gateway/bogus_gateway.rb +63 -0
- data/starter-app/vendor/plugins/spree/lib/shipping/flat_rate.rb +10 -0
- data/starter-app/vendor/plugins/spree/lib/tasks/spree_bootstrap.rake +24 -0
- data/starter-app/vendor/plugins/spree/lib/tax/sales_tax.rb +26 -0
- data/starter-app/vendor/plugins/spree/routes.rb +3 -0
- data/starter-app/vendor/plugins/spree/script/about +3 -0
- data/starter-app/vendor/plugins/spree/script/breakpointer +3 -0
- data/starter-app/vendor/plugins/spree/script/console +3 -0
- data/starter-app/vendor/plugins/spree/script/destroy +3 -0
- data/starter-app/vendor/plugins/spree/script/generate +3 -0
- data/starter-app/vendor/plugins/spree/script/performance/benchmarker +3 -0
- data/starter-app/vendor/plugins/spree/script/performance/profiler +3 -0
- data/starter-app/vendor/plugins/spree/script/plugin +3 -0
- data/starter-app/vendor/plugins/spree/script/process/inspector +3 -0
- data/starter-app/vendor/plugins/spree/script/process/reaper +3 -0
- data/starter-app/vendor/plugins/spree/script/process/spawner +3 -0
- data/starter-app/vendor/plugins/spree/script/runner +3 -0
- data/starter-app/vendor/plugins/spree/script/server +3 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/addresses.yml +29 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/categories.yml +40 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/line_items.yml +32 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/orders.yml +17 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/products.yml +63 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/products_tags.yml +10 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/roles.yml +6 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/roles_users.yml +3 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/skus.yml +5 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/tags.yml +7 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/tax_treatments.yml +7 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/txns.yml +13 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/users.yml +40 -0
- data/starter-app/vendor/plugins/spree/test/fixtures/variations.yml +16 -0
- data/starter-app/vendor/plugins/spree/test/functional/account_controller_test.rb +129 -0
- data/starter-app/vendor/plugins/spree/test/functional/admin/base_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/spree/test/functional/admin/option_groups_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/spree/test/functional/admin/option_values_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/spree/test/functional/admin/orders_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/spree/test/functional/admin/overview_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/spree/test/functional/admin/products_controller_test.rb +125 -0
- data/starter-app/vendor/plugins/spree/test/functional/admin/users_controller_test.rb +58 -0
- data/starter-app/vendor/plugins/spree/test/functional/admin/variations_controller_test.rb +18 -0
- data/starter-app/vendor/plugins/spree/test/functional/application_controller_test.rb +30 -0
- data/starter-app/vendor/plugins/spree/test/functional/cart_controller_test.rb +76 -0
- data/starter-app/vendor/plugins/spree/test/functional/checkout_controller_test.rb +20 -0
- data/starter-app/vendor/plugins/spree/test/integration/authentication_test.rb +53 -0
- data/starter-app/vendor/plugins/spree/test/integration/product_admin_test.rb +135 -0
- data/starter-app/vendor/plugins/spree/test/integration/user_stories_test.rb +59 -0
- data/starter-app/vendor/plugins/spree/test/integration/variations_test.rb +24 -0
- data/starter-app/vendor/plugins/spree/test/test_helper.rb +45 -0
- data/starter-app/vendor/plugins/spree/test/unit/address_test.rb +10 -0
- data/starter-app/vendor/plugins/spree/test/unit/cart_item_test.rb +55 -0
- data/starter-app/vendor/plugins/spree/test/unit/cart_test.rb +35 -0
- data/starter-app/vendor/plugins/spree/test/unit/category_test.rb +52 -0
- data/starter-app/vendor/plugins/spree/test/unit/line_item_test.rb +61 -0
- data/starter-app/vendor/plugins/spree/test/unit/option_group_test.rb +12 -0
- data/starter-app/vendor/plugins/spree/test/unit/order_test.rb +49 -0
- data/starter-app/vendor/plugins/spree/test/unit/product_test.rb +107 -0
- data/starter-app/vendor/plugins/spree/test/unit/role_test.rb +10 -0
- data/starter-app/vendor/plugins/spree/test/unit/sales_tax_test.rb +46 -0
- data/starter-app/vendor/plugins/spree/test/unit/sku_test.rb +10 -0
- data/starter-app/vendor/plugins/spree/test/unit/tag_test.rb +9 -0
- data/starter-app/vendor/plugins/spree/test/unit/tax_treatment_test.rb +10 -0
- data/starter-app/vendor/plugins/spree/test/unit/txn_test.rb +10 -0
- data/starter-app/vendor/plugins/spree/test/unit/variation_test.rb +9 -0
- data/starter-app/vendor/plugins/spree/uninstall.rb +1 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +17 -0
- data/test/test_helper.rb +2 -0
- data/test/test_railscart.rb +11 -0
- metadata +628 -0
data/starter-app/README
ADDED
@@ -0,0 +1,182 @@
|
|
1
|
+
== Welcome to Rails
|
2
|
+
|
3
|
+
Rails is a web-application and persistence framework that includes everything
|
4
|
+
needed to create database-backed web-applications according to the
|
5
|
+
Model-View-Control pattern of separation. This pattern splits the view (also
|
6
|
+
called the presentation) into "dumb" templates that are primarily responsible
|
7
|
+
for inserting pre-built data in between HTML tags. The model contains the
|
8
|
+
"smart" domain objects (such as Account, Product, Person, Post) that holds all
|
9
|
+
the business logic and knows how to persist themselves to a database. The
|
10
|
+
controller handles the incoming requests (such as Save New Account, Update
|
11
|
+
Product, Show Post) by manipulating the model and directing data to the view.
|
12
|
+
|
13
|
+
In Rails, the model is handled by what's called an object-relational mapping
|
14
|
+
layer entitled Active Record. This layer allows you to present the data from
|
15
|
+
database rows as objects and embellish these data objects with business logic
|
16
|
+
methods. You can read more about Active Record in
|
17
|
+
link:files/vendor/rails/activerecord/README.html.
|
18
|
+
|
19
|
+
The controller and view are handled by the Action Pack, which handles both
|
20
|
+
layers by its two parts: Action View and Action Controller. These two layers
|
21
|
+
are bundled in a single package due to their heavy interdependence. This is
|
22
|
+
unlike the relationship between the Active Record and Action Pack that is much
|
23
|
+
more separate. Each of these packages can be used independently outside of
|
24
|
+
Rails. You can read more about Action Pack in
|
25
|
+
link:files/vendor/rails/actionpack/README.html.
|
26
|
+
|
27
|
+
|
28
|
+
== Getting started
|
29
|
+
|
30
|
+
1. At the command prompt, start a new rails application using the rails command
|
31
|
+
and your application name. Ex: rails myapp
|
32
|
+
(If you've downloaded rails in a complete tgz or zip, this step is already done)
|
33
|
+
2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
|
34
|
+
3. Go to http://localhost:3000/ and get "Welcome aboard: You’re riding the Rails!"
|
35
|
+
4. Follow the guidelines to start developing your application
|
36
|
+
|
37
|
+
|
38
|
+
== Web Servers
|
39
|
+
|
40
|
+
By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise
|
41
|
+
Rails will use the WEBrick, the webserver that ships with Ruby. When you run script/server,
|
42
|
+
Rails will check if Mongrel exists, then lighttpd and finally fall back to WEBrick. This ensures
|
43
|
+
that you can always get up and running quickly.
|
44
|
+
|
45
|
+
Mongrel is a Ruby-based webserver with a C-component (which requires compilation) that is
|
46
|
+
suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
|
47
|
+
getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
|
48
|
+
More info at: http://mongrel.rubyforge.org
|
49
|
+
|
50
|
+
If Mongrel is not installed, Rails will look for lighttpd. It's considerably faster than
|
51
|
+
Mongrel and WEBrick and also suited for production use, but requires additional
|
52
|
+
installation and currently only works well on OS X/Unix (Windows users are encouraged
|
53
|
+
to start with Mongrel). We recommend version 1.4.11 and higher. You can download it from
|
54
|
+
http://www.lighttpd.net.
|
55
|
+
|
56
|
+
And finally, if neither Mongrel or lighttpd are installed, Rails will use the built-in Ruby
|
57
|
+
web server, WEBrick. WEBrick is a small Ruby web server suitable for development, but not
|
58
|
+
for production.
|
59
|
+
|
60
|
+
But of course its also possible to run Rails on any platform that supports FCGI.
|
61
|
+
Apache, LiteSpeed, IIS are just a few. For more information on FCGI,
|
62
|
+
please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI
|
63
|
+
|
64
|
+
|
65
|
+
== Debugging Rails
|
66
|
+
|
67
|
+
Have "tail -f" commands running on the server.log and development.log. Rails will
|
68
|
+
automatically display debugging and runtime information to these files. Debugging
|
69
|
+
info will also be shown in the browser on requests from 127.0.0.1.
|
70
|
+
|
71
|
+
|
72
|
+
== Breakpoints
|
73
|
+
|
74
|
+
Breakpoint support is available through the script/breakpointer client. This
|
75
|
+
means that you can break out of execution at any point in the code, investigate
|
76
|
+
and change the model, AND then resume execution! Example:
|
77
|
+
|
78
|
+
class WeblogController < ActionController::Base
|
79
|
+
def index
|
80
|
+
@posts = Post.find(:all)
|
81
|
+
breakpoint "Breaking out from the list"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
So the controller will accept the action, run the first line, then present you
|
86
|
+
with a IRB prompt in the breakpointer window. Here you can do things like:
|
87
|
+
|
88
|
+
Executing breakpoint "Breaking out from the list" at .../webrick_server.rb:16 in 'breakpoint'
|
89
|
+
|
90
|
+
>> @posts.inspect
|
91
|
+
=> "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
|
92
|
+
#<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
|
93
|
+
>> @posts.first.title = "hello from a breakpoint"
|
94
|
+
=> "hello from a breakpoint"
|
95
|
+
|
96
|
+
...and even better is that you can examine how your runtime objects actually work:
|
97
|
+
|
98
|
+
>> f = @posts.first
|
99
|
+
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
|
100
|
+
>> f.
|
101
|
+
Display all 152 possibilities? (y or n)
|
102
|
+
|
103
|
+
Finally, when you're ready to resume execution, you press CTRL-D
|
104
|
+
|
105
|
+
|
106
|
+
== Console
|
107
|
+
|
108
|
+
You can interact with the domain model by starting the console through <tt>script/console</tt>.
|
109
|
+
Here you'll have all parts of the application configured, just like it is when the
|
110
|
+
application is running. You can inspect domain models, change values, and save to the
|
111
|
+
database. Starting the script without arguments will launch it in the development environment.
|
112
|
+
Passing an argument will specify a different environment, like <tt>script/console production</tt>.
|
113
|
+
|
114
|
+
To reload your controllers and models after launching the console run <tt>reload!</tt>
|
115
|
+
|
116
|
+
To reload your controllers and models after launching the console run <tt>reload!</tt>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
== Description of contents
|
121
|
+
|
122
|
+
app
|
123
|
+
Holds all the code that's specific to this particular application.
|
124
|
+
|
125
|
+
app/controllers
|
126
|
+
Holds controllers that should be named like weblogs_controller.rb for
|
127
|
+
automated URL mapping. All controllers should descend from ApplicationController
|
128
|
+
which itself descends from ActionController::Base.
|
129
|
+
|
130
|
+
app/models
|
131
|
+
Holds models that should be named like post.rb.
|
132
|
+
Most models will descend from ActiveRecord::Base.
|
133
|
+
|
134
|
+
app/views
|
135
|
+
Holds the template files for the view that should be named like
|
136
|
+
weblogs/index.rhtml for the WeblogsController#index action. All views use eRuby
|
137
|
+
syntax.
|
138
|
+
|
139
|
+
app/views/layouts
|
140
|
+
Holds the template files for layouts to be used with views. This models the common
|
141
|
+
header/footer method of wrapping views. In your views, define a layout using the
|
142
|
+
<tt>layout :default</tt> and create a file named default.rhtml. Inside default.rhtml,
|
143
|
+
call <% yield %> to render the view using this layout.
|
144
|
+
|
145
|
+
app/helpers
|
146
|
+
Holds view helpers that should be named like weblogs_helper.rb. These are generated
|
147
|
+
for you automatically when using script/generate for controllers. Helpers can be used to
|
148
|
+
wrap functionality for your views into methods.
|
149
|
+
|
150
|
+
config
|
151
|
+
Configuration files for the Rails environment, the routing map, the database, and other dependencies.
|
152
|
+
|
153
|
+
components
|
154
|
+
Self-contained mini-applications that can bundle together controllers, models, and views.
|
155
|
+
|
156
|
+
db
|
157
|
+
Contains the database schema in schema.rb. db/migrate contains all
|
158
|
+
the sequence of Migrations for your schema.
|
159
|
+
|
160
|
+
doc
|
161
|
+
This directory is where your application documentation will be stored when generated
|
162
|
+
using <tt>rake doc:app</tt>
|
163
|
+
|
164
|
+
lib
|
165
|
+
Application specific libraries. Basically, any kind of custom code that doesn't
|
166
|
+
belong under controllers, models, or helpers. This directory is in the load path.
|
167
|
+
|
168
|
+
public
|
169
|
+
The directory available for the web server. Contains subdirectories for images, stylesheets,
|
170
|
+
and javascripts. Also contains the dispatchers and the default HTML files. This should be
|
171
|
+
set as the DOCUMENT_ROOT of your web server.
|
172
|
+
|
173
|
+
script
|
174
|
+
Helper scripts for automation and generation.
|
175
|
+
|
176
|
+
test
|
177
|
+
Unit and functional tests along with fixtures. When using the script/generate scripts, template
|
178
|
+
test files will be generated for you and placed in this directory.
|
179
|
+
|
180
|
+
vendor
|
181
|
+
External libraries that the application depends on. Also includes the plugins subdirectory.
|
182
|
+
This directory is in the load path.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
|
5
|
+
|
6
|
+
require 'rake'
|
7
|
+
require 'rake/testtask'
|
8
|
+
require 'rake/rdoctask'
|
9
|
+
|
10
|
+
require 'tasks/rails'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Filters added to this controller apply to all controllers in the application.
|
2
|
+
# Likewise, all the methods added will be available for all controllers.
|
3
|
+
|
4
|
+
class ApplicationController < ActionController::Base
|
5
|
+
# Pick a unique cookie name to distinguish our session data from others'
|
6
|
+
session :session_key => '_spree_session_id'
|
7
|
+
|
8
|
+
# See ActionController::RequestForgeryProtection for details
|
9
|
+
# Uncomment the :secret if you're not using the cookie session store
|
10
|
+
protect_from_forgery #:secret => '55a66755bef2c41d411bd5486c001b16'
|
11
|
+
|
12
|
+
include AuthenticatedSystem
|
13
|
+
include RoleRequirementSystem
|
14
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
# The Tag model. This model is automatically generated and added to your app if you run the tagging generator included with has_many_polymorphs.
|
3
|
+
|
4
|
+
class Tag < ActiveRecord::Base
|
5
|
+
|
6
|
+
DELIMITER = " " # Controls how to split and join tagnames from strings. You may need to change the <tt>validates_format_of parameters</tt> if you change this.
|
7
|
+
|
8
|
+
# If database speed becomes an issue, you could remove these validations and rescue the ActiveRecord database constraint errors instead.
|
9
|
+
validates_presence_of :name
|
10
|
+
validates_uniqueness_of :name, :case_sensitive => false
|
11
|
+
|
12
|
+
# Change this validation if you need more complex tag names.
|
13
|
+
validates_format_of :name, :with => /^[a-zA-Z0-9\_\-]+$/, :message => "can not contain special characters"
|
14
|
+
|
15
|
+
# Set up the polymorphic relationship.
|
16
|
+
has_many_polymorphs :taggables,
|
17
|
+
:from => [:products],
|
18
|
+
:through => :taggings,
|
19
|
+
:dependent => :destroy,
|
20
|
+
:skip_duplicates => false,
|
21
|
+
:parent_extend => proc {
|
22
|
+
# Defined on the taggable models, not on Tag itself. Return the tagnames associated with this record as a string.
|
23
|
+
def to_s
|
24
|
+
self.map(&:name).sort.join(Tag::DELIMITER)
|
25
|
+
end
|
26
|
+
}
|
27
|
+
|
28
|
+
# Callback to strip extra spaces from the tagname before saving it. If you allow tags to be renamed later, you might want to use the <tt>before_save</tt> callback instead.
|
29
|
+
def before_create
|
30
|
+
self.name = name.downcase.strip.squeeze(" ")
|
31
|
+
end
|
32
|
+
|
33
|
+
# Tag::Error class. Raised by ActiveRecord::Base::TaggingExtensions if something goes wrong.
|
34
|
+
class Error < StandardError
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
# The Tagging join model. This model is automatically generated and added to your app if you run the tagging generator included with has_many_polymorphs.
|
3
|
+
|
4
|
+
class Tagging < ActiveRecord::Base
|
5
|
+
|
6
|
+
belongs_to :tag
|
7
|
+
belongs_to :taggable, :polymorphic => true
|
8
|
+
|
9
|
+
# If you also need to use <tt>acts_as_list</tt>, you will have to manage the tagging positions manually by creating decorated join records when you associate Tags with taggables.
|
10
|
+
# acts_as_list :scope => :taggable
|
11
|
+
|
12
|
+
# This callback makes sure that an orphaned <tt>Tag</tt> is deleted if it no longer tags anything.
|
13
|
+
def before_destroy
|
14
|
+
tag.destroy_without_callbacks if tag and tag.taggings.count == 1
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require 'digest/sha1'
|
2
|
+
class User < ActiveRecord::Base
|
3
|
+
# Virtual attribute for the unencrypted password
|
4
|
+
attr_accessor :password
|
5
|
+
|
6
|
+
validates_presence_of :login, :email
|
7
|
+
validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :message => 'email must be valid'
|
8
|
+
validates_presence_of :password, :if => :password_required?
|
9
|
+
validates_presence_of :password_confirmation, :if => :password_required?
|
10
|
+
validates_length_of :password, :within => 4..40, :if => :password_required?
|
11
|
+
validates_confirmation_of :password, :if => :password_required?
|
12
|
+
validates_length_of :login, :within => 3..40
|
13
|
+
validates_length_of :email, :within => 3..100
|
14
|
+
validates_uniqueness_of :login, :case_sensitive => false
|
15
|
+
before_save :encrypt_password
|
16
|
+
|
17
|
+
has_many :orders
|
18
|
+
has_many :ship_addresses, :class_name => "Address", :as => :addressable
|
19
|
+
has_many :bill_addresses, :class_name => "Address", :as => :addressable
|
20
|
+
has_and_belongs_to_many :roles
|
21
|
+
|
22
|
+
# prevents a user from submitting a crafted form that bypasses activation
|
23
|
+
# anything else you want your user to change should be added here.
|
24
|
+
attr_accessible :login, :email, :password, :password_confirmation
|
25
|
+
|
26
|
+
# has_role? simply needs to return true or false whether a user has a role or not.
|
27
|
+
def has_role?(role_in_question)
|
28
|
+
@_list ||= self.roles.collect(&:name)
|
29
|
+
return true if @_list.include?("admin")
|
30
|
+
(@_list.include?(role_in_question.to_s) )
|
31
|
+
end
|
32
|
+
|
33
|
+
# Authenticates a user by their login name and unencrypted password. Returns the user or nil.
|
34
|
+
def self.authenticate(login, password)
|
35
|
+
u = find_by_login(login) # need to get the salt
|
36
|
+
u && u.authenticated?(password) ? u : nil
|
37
|
+
end
|
38
|
+
|
39
|
+
# Encrypts some data with the salt.
|
40
|
+
def self.encrypt(password, salt)
|
41
|
+
Digest::SHA1.hexdigest("--#{salt}--#{password}--")
|
42
|
+
end
|
43
|
+
|
44
|
+
# Encrypts the password with the user salt
|
45
|
+
def encrypt(password)
|
46
|
+
self.class.encrypt(password, salt)
|
47
|
+
end
|
48
|
+
|
49
|
+
def authenticated?(password)
|
50
|
+
crypted_password == encrypt(password)
|
51
|
+
end
|
52
|
+
|
53
|
+
def remember_token?
|
54
|
+
exp_time = ParseDate.parsedate(remember_token_expires_at)
|
55
|
+
remember_token_expires_at && Time.now.utc < Time.gm(*exp_time)
|
56
|
+
end
|
57
|
+
|
58
|
+
# These create and unset the fields required for remembering users between browser closes
|
59
|
+
def remember_me
|
60
|
+
remember_me_for 2.weeks
|
61
|
+
end
|
62
|
+
|
63
|
+
def remember_me_for(time)
|
64
|
+
remember_me_until time.from_now.utc
|
65
|
+
end
|
66
|
+
|
67
|
+
def remember_me_until(time)
|
68
|
+
self.remember_token_expires_at = time
|
69
|
+
self.remember_token = encrypt("#{email}--#{remember_token_expires_at}")
|
70
|
+
save(false)
|
71
|
+
end
|
72
|
+
|
73
|
+
def forget_me
|
74
|
+
self.remember_token_expires_at = nil
|
75
|
+
self.remember_token = nil
|
76
|
+
save(false)
|
77
|
+
end
|
78
|
+
|
79
|
+
# for anonymous customer support
|
80
|
+
def self.generate_login
|
81
|
+
record = true
|
82
|
+
while record
|
83
|
+
login = "anon_" + Array.new(6){rand(6)}.join
|
84
|
+
record = find(:first, :conditions => ["login = ?", login])
|
85
|
+
end
|
86
|
+
return login
|
87
|
+
end
|
88
|
+
|
89
|
+
protected
|
90
|
+
# before filter
|
91
|
+
def encrypt_password
|
92
|
+
return if password.blank?
|
93
|
+
self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--") if new_record?
|
94
|
+
self.crypted_password = encrypt(password)
|
95
|
+
end
|
96
|
+
|
97
|
+
def password_required?
|
98
|
+
crypted_password.blank? || !password.blank?
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<!-- basic layout - feel free to replace with a more elaborate one -->
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
4
|
+
<head>
|
5
|
+
<title>RailsCart</title>
|
6
|
+
<%= stylesheet_link_tag 'application' %>
|
7
|
+
<%= javascript_include_tag :defaults %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div id="main">
|
11
|
+
<table id="main-table" border='1'>
|
12
|
+
<tr>
|
13
|
+
<td colspan="2">
|
14
|
+
<table width="100%">
|
15
|
+
<tr>
|
16
|
+
<td>
|
17
|
+
<h1>Welcome to Our Store</h1>
|
18
|
+
</td>
|
19
|
+
<td> </td>
|
20
|
+
<td align="right">
|
21
|
+
<%= render :partial => 'shared/store_menu' %>
|
22
|
+
</td>
|
23
|
+
</tr>
|
24
|
+
</table>
|
25
|
+
</td>
|
26
|
+
</tr>
|
27
|
+
<% if flash[:notice] %>
|
28
|
+
<tr><td colspan="2"><div id="flash-notice"><%= flash[:notice] %></div></td></tr>
|
29
|
+
<% end %>
|
30
|
+
<% if flash[:error] %>
|
31
|
+
<tr><td colspan="2"><div id="flash-errors"><%= flash[:error] %></div></td></tr>
|
32
|
+
<% end %>
|
33
|
+
<tr>
|
34
|
+
<td id="shop-by-col" valign="top">
|
35
|
+
<!--todo: add the category info here -->
|
36
|
+
</td>
|
37
|
+
<td>
|
38
|
+
<div id="main-content">
|
39
|
+
<%=@content_for_layout %>
|
40
|
+
</div>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
</table>
|
44
|
+
</div>
|
45
|
+
</body>
|
46
|
+
</html>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
|
2
|
+
|
3
|
+
unless defined?(RAILS_ROOT)
|
4
|
+
root_path = File.join(File.dirname(__FILE__), '..')
|
5
|
+
|
6
|
+
unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
|
7
|
+
require 'pathname'
|
8
|
+
root_path = Pathname.new(root_path).cleanpath(true).to_s
|
9
|
+
end
|
10
|
+
|
11
|
+
RAILS_ROOT = root_path
|
12
|
+
end
|
13
|
+
|
14
|
+
unless defined?(Rails::Initializer)
|
15
|
+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
|
16
|
+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
|
17
|
+
else
|
18
|
+
require 'rubygems'
|
19
|
+
|
20
|
+
environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
|
21
|
+
environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
|
22
|
+
rails_gem_version = $1
|
23
|
+
|
24
|
+
if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
|
25
|
+
# Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
|
26
|
+
rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
|
27
|
+
|
28
|
+
if rails_gem
|
29
|
+
gem "rails", "=#{rails_gem.version.version}"
|
30
|
+
require rails_gem.full_gem_path + '/lib/initializer'
|
31
|
+
else
|
32
|
+
STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
|
33
|
+
Install the missing gem with 'gem install -v=#{version} rails', or
|
34
|
+
change environment.rb to define RAILS_GEM_VERSION with your desired version.
|
35
|
+
)
|
36
|
+
exit 1
|
37
|
+
end
|
38
|
+
else
|
39
|
+
gem "rails"
|
40
|
+
require 'initializer'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
Rails::Initializer.run(:set_load_path)
|
45
|
+
end
|