pictrails 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +8 -0
- data/History.txt +80 -0
- data/MIT-LICENSE +21 -0
- data/Manifest.txt +943 -0
- data/README.txt +88 -0
- data/Rakefile +10 -0
- data/app/controllers/admin/base_controller.rb +12 -0
- data/app/controllers/admin/comments_controller.rb +49 -0
- data/app/controllers/admin/galleries_controller.rb +110 -0
- data/app/controllers/admin/pictures_controller.rb +85 -0
- data/app/controllers/admin/sessions_controller.rb +26 -0
- data/app/controllers/admin/settings_controller.rb +44 -0
- data/app/controllers/admin/users_controller.rb +40 -0
- data/app/controllers/application.rb +54 -0
- data/app/controllers/galleries_controller.rb +61 -0
- data/app/controllers/pictures_controller.rb +57 -0
- data/app/controllers/tags_controller.rb +12 -0
- data/app/helpers/admin/base_helper.rb +36 -0
- data/app/helpers/admin/comments_helper.rb +2 -0
- data/app/helpers/admin/galleries_helper.rb +2 -0
- data/app/helpers/admin/pictures_helper.rb +2 -0
- data/app/helpers/admin/sessions_helper.rb +2 -0
- data/app/helpers/admin/users_helper.rb +2 -0
- data/app/helpers/application_helper.rb +87 -0
- data/app/helpers/galleries_helper.rb +2 -0
- data/app/helpers/pictures_helper.rb +12 -0
- data/app/models/comment.rb +6 -0
- data/app/models/gallery.rb +173 -0
- data/app/models/import.rb +25 -0
- data/app/models/picture.rb +104 -0
- data/app/models/setting.rb +102 -0
- data/app/models/tag.rb +30 -0
- data/app/models/thumbnail.rb +8 -0
- data/app/models/user.rb +52 -0
- data/app/sweepers/gallery_sweeper.rb +25 -0
- data/app/sweepers/page_cache.rb +66 -0
- data/app/sweepers/picture_sweeper.rb +26 -0
- data/app/sweepers/setting_sweeper.rb +11 -0
- data/app/views/admin/comments/edit.html.erb +35 -0
- data/app/views/admin/comments/index.html.erb +38 -0
- data/app/views/admin/comments/show.html.erb +16 -0
- data/app/views/admin/galleries/_follow_import.html.erb +17 -0
- data/app/views/admin/galleries/edit.html.erb +90 -0
- data/app/views/admin/galleries/follow_import.html.erb +7 -0
- data/app/views/admin/galleries/follow_import.js.rjs +6 -0
- data/app/views/admin/galleries/index.html.erb +43 -0
- data/app/views/admin/galleries/new.html.erb +44 -0
- data/app/views/admin/galleries/new_by_mass_upload.html.erb +28 -0
- data/app/views/admin/galleries/show.html.erb +54 -0
- data/app/views/admin/pictures/_picture.html.erb +12 -0
- data/app/views/admin/pictures/edit.html.erb +59 -0
- data/app/views/admin/pictures/index.html.erb +17 -0
- data/app/views/admin/pictures/new.html.erb +56 -0
- data/app/views/admin/pictures/show.html.erb +55 -0
- data/app/views/admin/sessions/new.html.erb +28 -0
- data/app/views/admin/settings/_follow_setting_update.html.erb +16 -0
- data/app/views/admin/settings/follow_setting_update.html.erb +7 -0
- data/app/views/admin/settings/follow_setting_update.js.rjs +6 -0
- data/app/views/admin/settings/index.html.erb +65 -0
- data/app/views/admin/users/new.html.erb +32 -0
- data/app/views/comments/_comment.html.erb +6 -0
- data/app/views/galleries/_gallery.html.erb +6 -0
- data/app/views/galleries/_list_pictures.html.erb +22 -0
- data/app/views/galleries/_sidebar_gallery.html.erb +13 -0
- data/app/views/galleries/_top_show.html.erb +10 -0
- data/app/views/galleries/index.html.erb +11 -0
- data/app/views/galleries/show.atom.builder +22 -0
- data/app/views/galleries/show.html.erb +28 -0
- data/app/views/layouts/administration.html.erb +48 -0
- data/app/views/layouts/application.html.erb +38 -0
- data/app/views/pictures/_picture.html.erb +13 -0
- data/app/views/pictures/index.html.erb +11 -0
- data/app/views/pictures/show.html.erb +51 -0
- data/app/views/tags/_sidebar_tag.html.erb +20 -0
- data/app/views/tags/show.html.erb +14 -0
- data/config/boot.rb +109 -0
- data/config/database.yml.example +25 -0
- data/config/environment.rb +63 -0
- data/config/environments/development.rb +19 -0
- data/config/environments/production.rb +18 -0
- data/config/environments/stories.rb +19 -0
- data/config/environments/test.rb +22 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/new_rails_defaults.rb +15 -0
- data/config/routes.rb +66 -0
- data/db/migrate/001_create_galleries.rb +20 -0
- data/db/migrate/002_create_pictures.rb +28 -0
- data/db/migrate/003_create_thumbnails_table.rb +17 -0
- data/db/migrate/004_create_users.rb +20 -0
- data/db/migrate/005_create_settings.rb +12 -0
- data/db/migrate/006_add_permalink_to_galleries.rb +15 -0
- data/db/migrate/007_add_permalink_to_picture.rb +15 -0
- data/db/migrate/008_create_imports.rb +15 -0
- data/db/migrate/009_delete_timestamp_and_add_number.rb +13 -0
- data/db/migrate/010_add_parent_id_for_gallery.rb +9 -0
- data/db/migrate/20080618220812_acts_as_taggable_migration.rb +26 -0
- data/db/migrate/20080824170446_add_picture_id_in_import.rb +11 -0
- data/db/migrate/20080910173454_create_comments.rb +19 -0
- data/db/schema.rb +110 -0
- data/lib/authenticated_system.rb +116 -0
- data/lib/authenticated_test_helper.rb +10 -0
- data/lib/config_manager.rb +96 -0
- data/lib/pictrails/caching_methods.rb +15 -0
- data/lib/pictrails/import_system.rb +37 -0
- data/lib/pictrails/mass_upload.rb +29 -0
- data/lib/pictrails/version.rb +9 -0
- data/lib/tasks/cache.rake +6 -0
- data/lib/tasks/rspec.rake +132 -0
- data/lib/tasks/story.rake +12 -0
- data/log/keep +0 -0
- data/public/.htaccess +40 -0
- data/public/404.html +30 -0
- data/public/422.html +30 -0
- data/public/500.html +30 -0
- data/public/dispatch.cgi +10 -0
- data/public/dispatch.fcgi +24 -0
- data/public/dispatch.rb +10 -0
- data/public/favicon.ico +0 -0
- data/public/images/README +2 -0
- data/public/images/accept.png +0 -0
- data/public/images/accept50.png +0 -0
- data/public/images/admin/bc-bg.gif +0 -0
- data/public/images/admin/bgdivider.gif +0 -0
- data/public/images/admin/bgdivider.png +0 -0
- data/public/images/admin/bgoff.png +0 -0
- data/public/images/admin/bgoff2.png +0 -0
- data/public/images/admin/bgon.png +0 -0
- data/public/images/admin/bgover.png +0 -0
- data/public/images/admin/bgselected.png +0 -0
- data/public/images/admin/cancel.png +0 -0
- data/public/images/admin/checked.png +0 -0
- data/public/images/admin/delete.png +0 -0
- data/public/images/admin/edit.png +0 -0
- data/public/images/admin/error.png +0 -0
- data/public/images/admin/foot.jpg +0 -0
- data/public/images/admin/help.png +0 -0
- data/public/images/admin/loginformbg.png +0 -0
- data/public/images/admin/remove.png +0 -0
- data/public/images/admin/show.png +0 -0
- data/public/images/admin/table-header-first.png +0 -0
- data/public/images/admin/table-header-last.png +0 -0
- data/public/images/admin/table-header.png +0 -0
- data/public/images/admin/top.gif +0 -0
- data/public/images/bg_white.png +0 -0
- data/public/images/email_open.png +0 -0
- data/public/images/email_open50.png +0 -0
- data/public/images/page_edit50.png +0 -0
- data/public/images/user.png +0 -0
- data/public/images/user50.png +0 -0
- data/public/images/world_link.png +0 -0
- data/public/images/world_link50.png +0 -0
- data/public/javascripts/application.js +2 -0
- data/public/javascripts/controls.js +963 -0
- data/public/javascripts/dragdrop.js +972 -0
- data/public/javascripts/effects.js +1120 -0
- data/public/javascripts/follow_import.js +7 -0
- data/public/javascripts/follow_setting_update.js +7 -0
- data/public/javascripts/prototype.js +4225 -0
- data/public/no_picture.png +0 -0
- data/public/robots.txt +5 -0
- data/public/stylesheets/administration.css +998 -0
- data/public/stylesheets/pictrails.css +260 -0
- data/script/about +3 -0
- data/script/autospec +3 -0
- data/script/console +3 -0
- data/script/dbconsole +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/performance/request +3 -0
- data/script/plugin +3 -0
- data/script/process/inspector +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/script/spec +4 -0
- data/script/spec_server +116 -0
- data/spec/controllers/admin/comments_controller_spec.rb +117 -0
- data/spec/controllers/admin/galleries_controller_spec.rb +247 -0
- data/spec/controllers/admin/pictures_controller_spec.rb +114 -0
- data/spec/controllers/admin/sessions_controller_spec.rb +36 -0
- data/spec/controllers/admin/settings_controller_spec.rb +54 -0
- data/spec/controllers/admin/users_controller_spec.rb +48 -0
- data/spec/controllers/galleries_controller_spec.rb +138 -0
- data/spec/controllers/pictures_controller_spec.rb +78 -0
- data/spec/fixtures/files/foo-2.PNG +0 -0
- data/spec/fixtures/files/foo.png +0 -0
- data/spec/fixtures/files/rails-2.png +0 -0
- data/spec/fixtures/files/rails-3.png +0 -0
- data/spec/fixtures/files/rails.png +0 -0
- data/spec/fixtures/galleries.yml +38 -0
- data/spec/fixtures/imports.yml +19 -0
- data/spec/fixtures/pictures.yml +108 -0
- data/spec/fixtures/settings.yml +8 -0
- data/spec/fixtures/taggings.yml +17 -0
- data/spec/fixtures/tags.yml +6 -0
- data/spec/fixtures/thumbnails.yml +30 -0
- data/spec/fixtures/users.yml +15 -0
- data/spec/helpers/admin/admin_base_helper_spec.rb +15 -0
- data/spec/helpers/admin/comments_helper_spec.rb +11 -0
- data/spec/helpers/admin/pictures_helper_spec.rb +5 -0
- data/spec/helpers/application_helper_spec.rb +37 -0
- data/spec/lib/import_spec.rb +115 -0
- data/spec/lib/mass_upload_spec.rb +35 -0
- data/spec/models/comment_spec.rb +24 -0
- data/spec/models/gallery_spec.rb +256 -0
- data/spec/models/import_spec.rb +11 -0
- data/spec/models/picture_spec.rb +139 -0
- data/spec/models/setting_spec.rb +74 -0
- data/spec/models/user_spec.rb +52 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +39 -0
- data/stories/add_gallery_story +29 -0
- data/stories/all.rb +18 -0
- data/stories/helper.rb +16 -0
- data/stories/integration_test_file_upload_deep.rb +60 -0
- data/stories/signup_story +37 -0
- data/stories/steps/admin_steps.rb +6 -0
- data/stories/steps/gallery_steps.rb +38 -0
- data/stories/steps/general_steps.rb +71 -0
- data/stories/steps/signup_steps.rb +25 -0
- data/stories/view_gallery_story +37 -0
- data/test/fixtures/comments.yml +15 -0
- data/test/functional/comment_controller_test.rb +8 -0
- data/test/functional/comments_controller_test.rb +8 -0
- data/test/unit/comment_test.rb +8 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/CHANGELOG +167 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/MIT-LICENSE +20 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/README +148 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/Rakefile +22 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/generators/acts_as_taggable_migration/acts_as_taggable_migration_generator.rb +11 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/generators/acts_as_taggable_migration/templates/migration.rb +26 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/init.rb +1 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/lib/acts_as_taggable.rb +214 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/lib/tag.rb +26 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/lib/tag_counts_extension.rb +3 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/lib/tag_list.rb +91 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/lib/tagging.rb +12 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/lib/tags_helper.rb +13 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/abstract_unit.rb +97 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/acts_as_taggable_test.rb +347 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/database.yml +10 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/magazine.rb +3 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/magazines.yml +7 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/photo.rb +8 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/photos.yml +24 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/post.rb +7 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/posts.yml +34 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/special_post.rb +2 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/subscription.rb +4 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/subscriptions.yml +3 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/taggings.yml +149 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/tags.yml +19 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/user.rb +7 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/fixtures/users.yml +7 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/schema.rb +37 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/tag_list_test.rb +106 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/tag_test.rb +34 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/tagging_test.rb +13 -0
- data/vendor/plugins/acts_as_taggable_on_steroids/test/tags_helper_test.rb +28 -0
- data/vendor/plugins/acts_as_tree/README +26 -0
- data/vendor/plugins/acts_as_tree/Rakefile +22 -0
- data/vendor/plugins/acts_as_tree/init.rb +1 -0
- data/vendor/plugins/acts_as_tree/lib/active_record/acts/tree.rb +96 -0
- data/vendor/plugins/atom_feed_helper/CHANGELOG +5 -0
- data/vendor/plugins/atom_feed_helper/MIT-LICENSE +20 -0
- data/vendor/plugins/atom_feed_helper/README +72 -0
- data/vendor/plugins/atom_feed_helper/Rakefile +22 -0
- data/vendor/plugins/atom_feed_helper/init.rb +2 -0
- data/vendor/plugins/atom_feed_helper/lib/atom_feed_helper.rb +111 -0
- data/vendor/plugins/atom_feed_helper/test/atom_feed_helper_test.rb +8 -0
- data/vendor/plugins/attachment_fu/CHANGELOG +35 -0
- data/vendor/plugins/attachment_fu/README +186 -0
- data/vendor/plugins/attachment_fu/Rakefile +22 -0
- data/vendor/plugins/attachment_fu/amazon_s3.yml.tpl +14 -0
- data/vendor/plugins/attachment_fu/init.rb +16 -0
- data/vendor/plugins/attachment_fu/install.rb +5 -0
- data/vendor/plugins/attachment_fu/lib/geometry.rb +93 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb +473 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/db_file_backend.rb +39 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb +101 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb +303 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/core_image_processor.rb +59 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/gd2_processor.rb +54 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/image_science_processor.rb +61 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb +59 -0
- data/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb +54 -0
- data/vendor/plugins/attachment_fu/test/backends/db_file_test.rb +16 -0
- data/vendor/plugins/attachment_fu/test/backends/file_system_test.rb +80 -0
- data/vendor/plugins/attachment_fu/test/backends/remote/s3_test.rb +107 -0
- data/vendor/plugins/attachment_fu/test/base_attachment_tests.rb +77 -0
- data/vendor/plugins/attachment_fu/test/basic_test.rb +70 -0
- data/vendor/plugins/attachment_fu/test/database.yml +18 -0
- data/vendor/plugins/attachment_fu/test/extra_attachment_test.rb +67 -0
- data/vendor/plugins/attachment_fu/test/fixtures/attachment.rb +148 -0
- data/vendor/plugins/attachment_fu/test/fixtures/files/fake/rails.png +0 -0
- data/vendor/plugins/attachment_fu/test/fixtures/files/foo.txt +1 -0
- data/vendor/plugins/attachment_fu/test/fixtures/files/rails.png +0 -0
- data/vendor/plugins/attachment_fu/test/geometry_test.rb +101 -0
- data/vendor/plugins/attachment_fu/test/processors/core_image_test.rb +37 -0
- data/vendor/plugins/attachment_fu/test/processors/gd2_test.rb +31 -0
- data/vendor/plugins/attachment_fu/test/processors/image_science_test.rb +31 -0
- data/vendor/plugins/attachment_fu/test/processors/mini_magick_test.rb +31 -0
- data/vendor/plugins/attachment_fu/test/processors/rmagick_test.rb +255 -0
- data/vendor/plugins/attachment_fu/test/schema.rb +108 -0
- data/vendor/plugins/attachment_fu/test/test_helper.rb +150 -0
- data/vendor/plugins/attachment_fu/test/validation_test.rb +55 -0
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/color.rb +27 -0
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/effects.rb +31 -0
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/perspective.rb +25 -0
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/quality.rb +25 -0
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/scale.rb +47 -0
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/watermark.rb +32 -0
- data/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/processor.rb +123 -0
- data/vendor/plugins/mimetype-fu/MIT-LICENSE +20 -0
- data/vendor/plugins/mimetype-fu/README +16 -0
- data/vendor/plugins/mimetype-fu/Rakefile +22 -0
- data/vendor/plugins/mimetype-fu/init.rb +2 -0
- data/vendor/plugins/mimetype-fu/install.rb +1 -0
- data/vendor/plugins/mimetype-fu/lib/extensions_const.rb +1 -0
- data/vendor/plugins/mimetype-fu/lib/mime_types.yml +776 -0
- data/vendor/plugins/mimetype-fu/lib/mimetype_fu.rb +35 -0
- data/vendor/plugins/mimetype-fu/spec/fixtures/file.jpg +0 -0
- data/vendor/plugins/mimetype-fu/spec/fixtures/file.rb +0 -0
- data/vendor/plugins/mimetype-fu/spec/fixtures/file.unknown +0 -0
- data/vendor/plugins/mimetype-fu/spec/mime_type_spec.rb +57 -0
- data/vendor/plugins/mimetype-fu/spec/spec_helper.rb +4 -0
- data/vendor/plugins/mimetype-fu/tasks/mimetype_fu_tasks.rake +4 -0
- data/vendor/plugins/mimetype-fu/test/mimetype_fu_test.rb +8 -0
- data/vendor/plugins/mimetype-fu/uninstall.rb +1 -0
- data/vendor/plugins/rspec-rails/History.txt +57 -0
- data/vendor/plugins/rspec-rails/Manifest.txt +158 -0
- data/vendor/plugins/rspec-rails/README.txt +81 -0
- data/vendor/plugins/rspec-rails/Rakefile +39 -0
- data/vendor/plugins/rspec-rails/UPGRADE +7 -0
- data/vendor/plugins/rspec-rails/generators/rspec/CHANGES +1 -0
- data/vendor/plugins/rspec-rails/generators/rspec/rspec_generator.rb +40 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/all_stories.rb +4 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/previous_failures.txt +0 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/rcov.opts +2 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/rspec.rake +132 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/script/autospec +3 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/script/spec +4 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/script/spec_server +116 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/spec.opts +4 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/spec_helper.rb +47 -0
- data/vendor/plugins/rspec-rails/generators/rspec/templates/stories_helper.rb +3 -0
- data/vendor/plugins/rspec-rails/generators/rspec_controller/USAGE +33 -0
- data/vendor/plugins/rspec-rails/generators/rspec_controller/rspec_controller_generator.rb +49 -0
- data/vendor/plugins/rspec-rails/generators/rspec_controller/templates/controller_spec.rb +25 -0
- data/vendor/plugins/rspec-rails/generators/rspec_controller/templates/helper_spec.rb +11 -0
- data/vendor/plugins/rspec-rails/generators/rspec_controller/templates/view_spec.rb +12 -0
- data/vendor/plugins/rspec-rails/generators/rspec_default_values.rb +19 -0
- data/vendor/plugins/rspec-rails/generators/rspec_model/USAGE +18 -0
- data/vendor/plugins/rspec-rails/generators/rspec_model/rspec_model_generator.rb +35 -0
- data/vendor/plugins/rspec-rails/generators/rspec_model/templates/model_spec.rb +15 -0
- data/vendor/plugins/rspec-rails/generators/rspec_scaffold/rspec_scaffold_generator.rb +154 -0
- data/vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/controller_spec.rb +173 -0
- data/vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/edit_erb_spec.rb +26 -0
- data/vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/helper_spec.rb +11 -0
- data/vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/index_erb_spec.rb +27 -0
- data/vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/new_erb_spec.rb +26 -0
- data/vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/routing_spec.rb +59 -0
- data/vendor/plugins/rspec-rails/generators/rspec_scaffold/templates/show_erb_spec.rb +23 -0
- data/vendor/plugins/rspec-rails/init.rb +9 -0
- data/vendor/plugins/rspec-rails/lib/autotest/discover.rb +1 -0
- data/vendor/plugins/rspec-rails/lib/autotest/rails_rspec.rb +76 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails.rb +15 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example.rb +47 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/assigns_hash_proxy.rb +43 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/controller_example_group.rb +256 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/cookies_proxy.rb +25 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/functional_example_group.rb +87 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/helper_example_group.rb +166 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/model_example_group.rb +14 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/rails_example_group.rb +33 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/render_observer.rb +93 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/example/view_example_group.rb +183 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions.rb +12 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_controller/base.rb +14 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_controller/rescue.rb +21 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_controller/test_response.rb +11 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions/action_view/base.rb +31 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions/active_record/base.rb +30 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions/object.rb +5 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions/spec/example/configuration.rb +71 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/extensions/spec/matchers/have.rb +21 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/interop/testcase.rb +14 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/matchers.rb +31 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/matchers/assert_select.rb +131 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/matchers/change.rb +11 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/matchers/have_text.rb +57 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/matchers/include_text.rb +54 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/matchers/redirect_to.rb +113 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/matchers/render_template.rb +90 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/mocks.rb +132 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/story_adapter.rb +79 -0
- data/vendor/plugins/rspec-rails/lib/spec/rails/version.rb +15 -0
- data/vendor/plugins/rspec-rails/output_buffer_fix.diff +34 -0
- data/vendor/plugins/rspec-rails/rspec-rails.gemspec +35 -0
- data/vendor/plugins/rspec-rails/spec/rails/autotest/mappings_spec.rb +36 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/assigns_hash_proxy_spec.rb +65 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/configuration_spec.rb +83 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/controller_isolation_spec.rb +62 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/controller_spec_spec.rb +272 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/cookies_proxy_spec.rb +74 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/example_group_factory_spec.rb +112 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/helper_spec_spec.rb +161 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/model_spec_spec.rb +18 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/shared_behaviour_spec.rb +16 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/test_unit_assertion_accessibility_spec.rb +33 -0
- data/vendor/plugins/rspec-rails/spec/rails/example/view_spec_spec.rb +280 -0
- data/vendor/plugins/rspec-rails/spec/rails/extensions/action_controller_rescue_action_spec.rb +54 -0
- data/vendor/plugins/rspec-rails/spec/rails/extensions/action_view_base_spec.rb +48 -0
- data/vendor/plugins/rspec-rails/spec/rails/extensions/active_record_spec.rb +14 -0
- data/vendor/plugins/rspec-rails/spec/rails/interop/testcase_spec.rb +66 -0
- data/vendor/plugins/rspec-rails/spec/rails/matchers/assert_select_spec.rb +814 -0
- data/vendor/plugins/rspec-rails/spec/rails/matchers/description_generation_spec.rb +37 -0
- data/vendor/plugins/rspec-rails/spec/rails/matchers/errors_on_spec.rb +13 -0
- data/vendor/plugins/rspec-rails/spec/rails/matchers/have_text_spec.rb +62 -0
- data/vendor/plugins/rspec-rails/spec/rails/matchers/include_text_spec.rb +64 -0
- data/vendor/plugins/rspec-rails/spec/rails/matchers/redirect_to_spec.rb +209 -0
- data/vendor/plugins/rspec-rails/spec/rails/matchers/render_template_spec.rb +176 -0
- data/vendor/plugins/rspec-rails/spec/rails/matchers/should_change_spec.rb +15 -0
- data/vendor/plugins/rspec-rails/spec/rails/mocks/ar_classes.rb +10 -0
- data/vendor/plugins/rspec-rails/spec/rails/mocks/mock_model_spec.rb +106 -0
- data/vendor/plugins/rspec-rails/spec/rails/mocks/stub_model_spec.rb +80 -0
- data/vendor/plugins/rspec-rails/spec/rails/sample_modified_fixture.rb +8 -0
- data/vendor/plugins/rspec-rails/spec/rails/sample_spec.rb +8 -0
- data/vendor/plugins/rspec-rails/spec/rails/spec_server_spec.rb +96 -0
- data/vendor/plugins/rspec-rails/spec/rails/spec_spec.rb +11 -0
- data/vendor/plugins/rspec-rails/spec/rails_suite.rb +7 -0
- data/vendor/plugins/rspec-rails/spec/spec_helper.rb +57 -0
- data/vendor/plugins/rspec-rails/spec_resources/controllers/action_view_base_spec_controller.rb +2 -0
- data/vendor/plugins/rspec-rails/spec_resources/controllers/controller_spec_controller.rb +94 -0
- data/vendor/plugins/rspec-rails/spec_resources/controllers/redirect_spec_controller.rb +59 -0
- data/vendor/plugins/rspec-rails/spec_resources/controllers/render_spec_controller.rb +30 -0
- data/vendor/plugins/rspec-rails/spec_resources/controllers/rjs_spec_controller.rb +58 -0
- data/vendor/plugins/rspec-rails/spec_resources/helpers/explicit_helper.rb +38 -0
- data/vendor/plugins/rspec-rails/spec_resources/helpers/more_explicit_helper.rb +5 -0
- data/vendor/plugins/rspec-rails/spec_resources/helpers/plugin_application_helper.rb +6 -0
- data/vendor/plugins/rspec-rails/spec_resources/helpers/view_spec_helper.rb +13 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/controller_spec/_partial.rhtml +0 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/controller_spec/action_setting_flash_after_session_reset.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/controller_spec/action_setting_flash_before_session_reset.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/controller_spec/action_setting_the_assigns_hash.rhtml +0 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/controller_spec/action_with_errors_in_template.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/controller_spec/action_with_template.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/layouts/application.rhtml +0 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/layouts/simple.rhtml +0 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/objects/_object.html.erb +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/render_spec/_a_partial.rhtml +0 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/render_spec/action_with_alternate_layout.rhtml +0 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/render_spec/some_action.js.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/render_spec/some_action.rhtml +0 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/render_spec/some_action.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/_replacement_partial.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/hide_div.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/hide_page_element.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/insert_html.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/replace.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/replace_html.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/replace_html_with_partial.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/visual_effect.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/rjs_spec/visual_toggle_effect.rjs +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/tag_spec/no_tags.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/tag_spec/single_div_with_no_attributes.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/tag_spec/single_div_with_one_attribute.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/_partial.rhtml +2 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/_partial_used_twice.rhtml +0 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/_partial_with_local_variable.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/_partial_with_sub_partial.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/_spacer.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/accessor.rhtml +5 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/block_helper.rhtml +3 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/entry_form.rhtml +2 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/explicit_helper.rhtml +2 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/foo/show.rhtml +1 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/implicit_helper.rhtml +2 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/multiple_helpers.rhtml +3 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/should_not_receive.rhtml +3 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/template_with_partial.rhtml +5 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/template_with_partial_using_collection.rhtml +3 -0
- data/vendor/plugins/rspec-rails/spec_resources/views/view_spec/template_with_partial_with_array.rhtml +1 -0
- data/vendor/plugins/rspec-rails/stories/all.rb +10 -0
- data/vendor/plugins/rspec-rails/stories/configuration/stories.rb +5 -0
- data/vendor/plugins/rspec-rails/stories/helper.rb +6 -0
- data/vendor/plugins/rspec-rails/stories/steps/people.rb +8 -0
- data/vendor/plugins/rspec-rails/stories/transactions_should_rollback +15 -0
- data/vendor/plugins/rspec-rails/stories/transactions_should_rollback.rb +25 -0
- data/vendor/plugins/rspec/.autotest +3 -0
- data/vendor/plugins/rspec/History.txt +1132 -0
- data/vendor/plugins/rspec/Manifest.txt +403 -0
- data/vendor/plugins/rspec/README.txt +63 -0
- data/vendor/plugins/rspec/Rakefile +89 -0
- data/vendor/plugins/rspec/TODO.txt +1 -0
- data/vendor/plugins/rspec/bin/autospec +4 -0
- data/vendor/plugins/rspec/bin/spec +4 -0
- data/vendor/plugins/rspec/examples/pure/autogenerated_docstrings_example.rb +19 -0
- data/vendor/plugins/rspec/examples/pure/before_and_after_example.rb +40 -0
- data/vendor/plugins/rspec/examples/pure/behave_as_example.rb +45 -0
- data/vendor/plugins/rspec/examples/pure/custom_expectation_matchers.rb +54 -0
- data/vendor/plugins/rspec/examples/pure/custom_formatter.rb +12 -0
- data/vendor/plugins/rspec/examples/pure/dynamic_spec.rb +9 -0
- data/vendor/plugins/rspec/examples/pure/file_accessor.rb +19 -0
- data/vendor/plugins/rspec/examples/pure/file_accessor_spec.rb +38 -0
- data/vendor/plugins/rspec/examples/pure/greeter_spec.rb +31 -0
- data/vendor/plugins/rspec/examples/pure/helper_method_example.rb +14 -0
- data/vendor/plugins/rspec/examples/pure/io_processor.rb +8 -0
- data/vendor/plugins/rspec/examples/pure/io_processor_spec.rb +21 -0
- data/vendor/plugins/rspec/examples/pure/legacy_spec.rb +11 -0
- data/vendor/plugins/rspec/examples/pure/mocking_example.rb +27 -0
- data/vendor/plugins/rspec/examples/pure/multi_threaded_behaviour_runner.rb +28 -0
- data/vendor/plugins/rspec/examples/pure/nested_classes_example.rb +36 -0
- data/vendor/plugins/rspec/examples/pure/partial_mock_example.rb +29 -0
- data/vendor/plugins/rspec/examples/pure/pending_example.rb +20 -0
- data/vendor/plugins/rspec/examples/pure/predicate_example.rb +27 -0
- data/vendor/plugins/rspec/examples/pure/priority.txt +1 -0
- data/vendor/plugins/rspec/examples/pure/shared_example_group_example.rb +81 -0
- data/vendor/plugins/rspec/examples/pure/shared_stack_examples.rb +38 -0
- data/vendor/plugins/rspec/examples/pure/spec_helper.rb +3 -0
- data/vendor/plugins/rspec/examples/pure/stack.rb +36 -0
- data/vendor/plugins/rspec/examples/pure/stack_spec.rb +63 -0
- data/vendor/plugins/rspec/examples/pure/stack_spec_with_nested_example_groups.rb +67 -0
- data/vendor/plugins/rspec/examples/pure/stubbing_example.rb +69 -0
- data/vendor/plugins/rspec/examples/pure/yielding_example.rb +33 -0
- data/vendor/plugins/rspec/examples/stories/adder.rb +13 -0
- data/vendor/plugins/rspec/examples/stories/addition +34 -0
- data/vendor/plugins/rspec/examples/stories/addition.rb +9 -0
- data/vendor/plugins/rspec/examples/stories/calculator.rb +65 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/.loadpath +5 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/README.txt +21 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/everything.rb +6 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/examples.rb +3 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/game_behaviour.rb +35 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/examples/grid_behaviour.rb +66 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithLessThanTwoNeighboursDie.story +21 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/CellsWithMoreThanThreeNeighboursDie.story +21 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/EmptySpacesWithThreeNeighboursCreateACell.story +42 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanCreateACell.story +42 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/ICanKillACell.story +17 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/TheGridWraps.story +53 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/create_a_cell.rb +52 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/helper.rb +6 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/kill_a_cell.rb +26 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/steps.rb +5 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.rb +3 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/behaviour/stories/stories.txt +22 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/life.rb +3 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/game.rb +23 -0
- data/vendor/plugins/rspec/examples/stories/game-of-life/life/grid.rb +43 -0
- data/vendor/plugins/rspec/examples/stories/helper.rb +9 -0
- data/vendor/plugins/rspec/examples/stories/steps/addition_steps.rb +18 -0
- data/vendor/plugins/rspec/failing_examples/README.txt +7 -0
- data/vendor/plugins/rspec/failing_examples/diffing_spec.rb +36 -0
- data/vendor/plugins/rspec/failing_examples/failing_autogenerated_docstrings_example.rb +19 -0
- data/vendor/plugins/rspec/failing_examples/failure_in_setup.rb +10 -0
- data/vendor/plugins/rspec/failing_examples/failure_in_teardown.rb +10 -0
- data/vendor/plugins/rspec/failing_examples/mocking_example.rb +40 -0
- data/vendor/plugins/rspec/failing_examples/mocking_with_flexmock.rb +26 -0
- data/vendor/plugins/rspec/failing_examples/mocking_with_mocha.rb +25 -0
- data/vendor/plugins/rspec/failing_examples/mocking_with_rr.rb +27 -0
- data/vendor/plugins/rspec/failing_examples/partial_mock_example.rb +20 -0
- data/vendor/plugins/rspec/failing_examples/predicate_example.rb +29 -0
- data/vendor/plugins/rspec/failing_examples/raising_example.rb +47 -0
- data/vendor/plugins/rspec/failing_examples/spec_helper.rb +3 -0
- data/vendor/plugins/rspec/failing_examples/syntax_error_example.rb +7 -0
- data/vendor/plugins/rspec/failing_examples/team_spec.rb +44 -0
- data/vendor/plugins/rspec/failing_examples/timeout_behaviour.rb +7 -0
- data/vendor/plugins/rspec/init.rb +9 -0
- data/vendor/plugins/rspec/lib/autotest/discover.rb +3 -0
- data/vendor/plugins/rspec/lib/autotest/rspec.rb +46 -0
- data/vendor/plugins/rspec/lib/spec.rb +28 -0
- data/vendor/plugins/rspec/lib/spec/adapters.rb +1 -0
- data/vendor/plugins/rspec/lib/spec/adapters/ruby_engine.rb +26 -0
- data/vendor/plugins/rspec/lib/spec/adapters/ruby_engine/mri.rb +8 -0
- data/vendor/plugins/rspec/lib/spec/adapters/ruby_engine/rubinius.rb +8 -0
- data/vendor/plugins/rspec/lib/spec/example.rb +12 -0
- data/vendor/plugins/rspec/lib/spec/example/configuration.rb +158 -0
- data/vendor/plugins/rspec/lib/spec/example/errors.rb +15 -0
- data/vendor/plugins/rspec/lib/spec/example/example_group.rb +17 -0
- data/vendor/plugins/rspec/lib/spec/example/example_group_factory.rb +64 -0
- data/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb +440 -0
- data/vendor/plugins/rspec/lib/spec/example/example_matcher.rb +44 -0
- data/vendor/plugins/rspec/lib/spec/example/example_methods.rb +107 -0
- data/vendor/plugins/rspec/lib/spec/example/module_inclusion_warnings.rb +38 -0
- data/vendor/plugins/rspec/lib/spec/example/module_reopening_fix.rb +21 -0
- data/vendor/plugins/rspec/lib/spec/example/pending.rb +18 -0
- data/vendor/plugins/rspec/lib/spec/example/shared_example_group.rb +58 -0
- data/vendor/plugins/rspec/lib/spec/expectations.rb +56 -0
- data/vendor/plugins/rspec/lib/spec/expectations/differs/default.rb +66 -0
- data/vendor/plugins/rspec/lib/spec/expectations/errors.rb +12 -0
- data/vendor/plugins/rspec/lib/spec/expectations/extensions.rb +2 -0
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/object.rb +63 -0
- data/vendor/plugins/rspec/lib/spec/expectations/extensions/string_and_symbol.rb +17 -0
- data/vendor/plugins/rspec/lib/spec/expectations/handler.rb +52 -0
- data/vendor/plugins/rspec/lib/spec/extensions.rb +4 -0
- data/vendor/plugins/rspec/lib/spec/extensions/class.rb +24 -0
- data/vendor/plugins/rspec/lib/spec/extensions/main.rb +87 -0
- data/vendor/plugins/rspec/lib/spec/extensions/metaclass.rb +7 -0
- data/vendor/plugins/rspec/lib/spec/extensions/object.rb +6 -0
- data/vendor/plugins/rspec/lib/spec/interop/test.rb +12 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/autorunner.rb +6 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testcase.rb +61 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testresult.rb +6 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/testsuite_adapter.rb +34 -0
- data/vendor/plugins/rspec/lib/spec/interop/test/unit/ui/console/testrunner.rb +61 -0
- data/vendor/plugins/rspec/lib/spec/matchers.rb +162 -0
- data/vendor/plugins/rspec/lib/spec/matchers/be.rb +221 -0
- data/vendor/plugins/rspec/lib/spec/matchers/be_close.rb +37 -0
- data/vendor/plugins/rspec/lib/spec/matchers/change.rb +148 -0
- data/vendor/plugins/rspec/lib/spec/matchers/eql.rb +43 -0
- data/vendor/plugins/rspec/lib/spec/matchers/equal.rb +43 -0
- data/vendor/plugins/rspec/lib/spec/matchers/exist.rb +17 -0
- data/vendor/plugins/rspec/lib/spec/matchers/has.rb +34 -0
- data/vendor/plugins/rspec/lib/spec/matchers/have.rb +150 -0
- data/vendor/plugins/rspec/lib/spec/matchers/include.rb +70 -0
- data/vendor/plugins/rspec/lib/spec/matchers/match.rb +41 -0
- data/vendor/plugins/rspec/lib/spec/matchers/operator_matcher.rb +79 -0
- data/vendor/plugins/rspec/lib/spec/matchers/raise_error.rb +132 -0
- data/vendor/plugins/rspec/lib/spec/matchers/respond_to.rb +45 -0
- data/vendor/plugins/rspec/lib/spec/matchers/satisfy.rb +47 -0
- data/vendor/plugins/rspec/lib/spec/matchers/simple_matcher.rb +132 -0
- data/vendor/plugins/rspec/lib/spec/matchers/throw_symbol.rb +74 -0
- data/vendor/plugins/rspec/lib/spec/mocks.rb +211 -0
- data/vendor/plugins/rspec/lib/spec/mocks/argument_constraints.rb +185 -0
- data/vendor/plugins/rspec/lib/spec/mocks/argument_expectation.rb +71 -0
- data/vendor/plugins/rspec/lib/spec/mocks/error_generator.rb +84 -0
- data/vendor/plugins/rspec/lib/spec/mocks/errors.rb +10 -0
- data/vendor/plugins/rspec/lib/spec/mocks/extensions.rb +1 -0
- data/vendor/plugins/rspec/lib/spec/mocks/extensions/object.rb +3 -0
- data/vendor/plugins/rspec/lib/spec/mocks/framework.rb +15 -0
- data/vendor/plugins/rspec/lib/spec/mocks/message_expectation.rb +316 -0
- data/vendor/plugins/rspec/lib/spec/mocks/methods.rb +51 -0
- data/vendor/plugins/rspec/lib/spec/mocks/mock.rb +56 -0
- data/vendor/plugins/rspec/lib/spec/mocks/order_group.rb +29 -0
- data/vendor/plugins/rspec/lib/spec/mocks/proxy.rb +225 -0
- data/vendor/plugins/rspec/lib/spec/mocks/space.rb +28 -0
- data/vendor/plugins/rspec/lib/spec/mocks/spec_methods.rb +46 -0
- data/vendor/plugins/rspec/lib/spec/rake/spectask.rb +227 -0
- data/vendor/plugins/rspec/lib/spec/rake/verify_rcov.rb +52 -0
- data/vendor/plugins/rspec/lib/spec/runner.rb +214 -0
- data/vendor/plugins/rspec/lib/spec/runner/backtrace_tweaker.rb +56 -0
- data/vendor/plugins/rspec/lib/spec/runner/class_and_arguments_parser.rb +16 -0
- data/vendor/plugins/rspec/lib/spec/runner/command_line.rb +17 -0
- data/vendor/plugins/rspec/lib/spec/runner/drb_command_line.rb +20 -0
- data/vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb +59 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_formatter.rb +79 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/base_text_formatter.rb +126 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_example_groups_formatter.rb +27 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/failing_examples_formatter.rb +20 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/html_formatter.rb +337 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/nested_text_formatter.rb +65 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/profile_formatter.rb +51 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/progress_bar_formatter.rb +34 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/snippet_extractor.rb +52 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/specdoc_formatter.rb +39 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/html_formatter.rb +174 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/plain_text_formatter.rb +194 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/story/progress_bar_formatter.rb +42 -0
- data/vendor/plugins/rspec/lib/spec/runner/formatter/text_mate_formatter.rb +16 -0
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner.rb +72 -0
- data/vendor/plugins/rspec/lib/spec/runner/heckle_runner_unsupported.rb +10 -0
- data/vendor/plugins/rspec/lib/spec/runner/option_parser.rb +204 -0
- data/vendor/plugins/rspec/lib/spec/runner/options.rb +318 -0
- data/vendor/plugins/rspec/lib/spec/runner/reporter.rb +167 -0
- data/vendor/plugins/rspec/lib/spec/runner/spec_parser.rb +71 -0
- data/vendor/plugins/rspec/lib/spec/story.rb +10 -0
- data/vendor/plugins/rspec/lib/spec/story/extensions.rb +3 -0
- data/vendor/plugins/rspec/lib/spec/story/extensions/main.rb +86 -0
- data/vendor/plugins/rspec/lib/spec/story/extensions/regexp.rb +9 -0
- data/vendor/plugins/rspec/lib/spec/story/extensions/string.rb +9 -0
- data/vendor/plugins/rspec/lib/spec/story/given_scenario.rb +14 -0
- data/vendor/plugins/rspec/lib/spec/story/runner.rb +59 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/plain_text_story_runner.rb +48 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_collector.rb +18 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/scenario_runner.rb +54 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb +137 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/story_parser.rb +247 -0
- data/vendor/plugins/rspec/lib/spec/story/runner/story_runner.rb +70 -0
- data/vendor/plugins/rspec/lib/spec/story/scenario.rb +14 -0
- data/vendor/plugins/rspec/lib/spec/story/step.rb +70 -0
- data/vendor/plugins/rspec/lib/spec/story/step_group.rb +89 -0
- data/vendor/plugins/rspec/lib/spec/story/step_mother.rb +38 -0
- data/vendor/plugins/rspec/lib/spec/story/story.rb +39 -0
- data/vendor/plugins/rspec/lib/spec/story/world.rb +128 -0
- data/vendor/plugins/rspec/lib/spec/version.rb +13 -0
- data/vendor/plugins/rspec/plugins/mock_frameworks/flexmock.rb +23 -0
- data/vendor/plugins/rspec/plugins/mock_frameworks/mocha.rb +19 -0
- data/vendor/plugins/rspec/plugins/mock_frameworks/rr.rb +21 -0
- data/vendor/plugins/rspec/plugins/mock_frameworks/rspec.rb +20 -0
- data/vendor/plugins/rspec/rake_tasks/examples.rake +7 -0
- data/vendor/plugins/rspec/rake_tasks/examples_with_rcov.rake +9 -0
- data/vendor/plugins/rspec/rake_tasks/failing_examples_with_html.rake +9 -0
- data/vendor/plugins/rspec/rake_tasks/verify_rcov.rake +7 -0
- data/vendor/plugins/rspec/rspec.gemspec +33 -0
- data/vendor/plugins/rspec/spec/README.jruby +15 -0
- data/vendor/plugins/rspec/spec/autotest/discover_spec.rb +19 -0
- data/vendor/plugins/rspec/spec/autotest/rspec_spec.rb +146 -0
- data/vendor/plugins/rspec/spec/autotest_helper.rb +6 -0
- data/vendor/plugins/rspec/spec/autotest_matchers.rb +47 -0
- data/vendor/plugins/rspec/spec/rspec_suite.rb +7 -0
- data/vendor/plugins/rspec/spec/ruby_forker.rb +13 -0
- data/vendor/plugins/rspec/spec/spec.opts +6 -0
- data/vendor/plugins/rspec/spec/spec/adapters/ruby_engine_spec.rb +16 -0
- data/vendor/plugins/rspec/spec/spec/example/base_formatter_spec.rb +112 -0
- data/vendor/plugins/rspec/spec/spec/example/configuration_spec.rb +282 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group/described_module_spec.rb +20 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group/warning_messages_spec.rb +76 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group_class_definition_spec.rb +48 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group_factory_spec.rb +144 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group_methods_spec.rb +574 -0
- data/vendor/plugins/rspec/spec/spec/example/example_group_spec.rb +724 -0
- data/vendor/plugins/rspec/spec/spec/example/example_matcher_spec.rb +96 -0
- data/vendor/plugins/rspec/spec/spec/example/example_methods_spec.rb +130 -0
- data/vendor/plugins/rspec/spec/spec/example/example_runner_spec.rb +194 -0
- data/vendor/plugins/rspec/spec/spec/example/nested_example_group_spec.rb +71 -0
- data/vendor/plugins/rspec/spec/spec/example/pending_module_spec.rb +69 -0
- data/vendor/plugins/rspec/spec/spec/example/predicate_matcher_spec.rb +21 -0
- data/vendor/plugins/rspec/spec/spec/example/shared_example_group_spec.rb +265 -0
- data/vendor/plugins/rspec/spec/spec/example/subclassing_example_group_spec.rb +25 -0
- data/vendor/plugins/rspec/spec/spec/expectations/differs/default_spec.rb +127 -0
- data/vendor/plugins/rspec/spec/spec/expectations/extensions/object_spec.rb +95 -0
- data/vendor/plugins/rspec/spec/spec/expectations/fail_with_spec.rb +71 -0
- data/vendor/plugins/rspec/spec/spec/extensions/main_spec.rb +71 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_fails.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_that_passes.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/spec_with_errors.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_fails.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_that_passes.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/test_case_with_errors.rb +10 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/resources/testsuite_adapter_spec_with_test_unit.rb +38 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/spec_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/test_unit_spec_helper.rb +14 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testcase_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +9 -0
- data/vendor/plugins/rspec/spec/spec/matchers/be_close_spec.rb +39 -0
- data/vendor/plugins/rspec/spec/spec/matchers/be_spec.rb +248 -0
- data/vendor/plugins/rspec/spec/spec/matchers/change_spec.rb +329 -0
- data/vendor/plugins/rspec/spec/spec/matchers/description_generation_spec.rb +153 -0
- data/vendor/plugins/rspec/spec/spec/matchers/eql_spec.rb +28 -0
- data/vendor/plugins/rspec/spec/spec/matchers/equal_spec.rb +28 -0
- data/vendor/plugins/rspec/spec/spec/matchers/exist_spec.rb +57 -0
- data/vendor/plugins/rspec/spec/spec/matchers/handler_spec.rb +150 -0
- data/vendor/plugins/rspec/spec/spec/matchers/has_spec.rb +63 -0
- data/vendor/plugins/rspec/spec/spec/matchers/have_spec.rb +394 -0
- data/vendor/plugins/rspec/spec/spec/matchers/include_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/matchers/match_spec.rb +37 -0
- data/vendor/plugins/rspec/spec/spec/matchers/matcher_methods_spec.rb +78 -0
- data/vendor/plugins/rspec/spec/spec/matchers/mock_constraint_matchers_spec.rb +24 -0
- data/vendor/plugins/rspec/spec/spec/matchers/operator_matcher_spec.rb +191 -0
- data/vendor/plugins/rspec/spec/spec/matchers/raise_error_spec.rb +315 -0
- data/vendor/plugins/rspec/spec/spec/matchers/respond_to_spec.rb +54 -0
- data/vendor/plugins/rspec/spec/spec/matchers/satisfy_spec.rb +36 -0
- data/vendor/plugins/rspec/spec/spec/matchers/simple_matcher_spec.rb +93 -0
- data/vendor/plugins/rspec/spec/spec/matchers/throw_symbol_spec.rb +54 -0
- data/vendor/plugins/rspec/spec/spec/mocks/any_number_of_times_spec.rb +36 -0
- data/vendor/plugins/rspec/spec/spec/mocks/argument_expectation_spec.rb +23 -0
- data/vendor/plugins/rspec/spec/spec/mocks/at_least_spec.rb +97 -0
- data/vendor/plugins/rspec/spec/spec/mocks/at_most_spec.rb +93 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10260_spec.rb +8 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_10263_spec.rb +24 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_11545_spec.rb +33 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_15719_spec.rb +30 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_496.rb +17 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7611_spec.rb +19 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb +22 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8165_spec.rb +31 -0
- data/vendor/plugins/rspec/spec/spec/mocks/bug_report_8302_spec.rb +26 -0
- data/vendor/plugins/rspec/spec/spec/mocks/failing_mock_argument_constraints_spec.rb +129 -0
- data/vendor/plugins/rspec/spec/spec/mocks/hash_including_matcher_spec.rb +53 -0
- data/vendor/plugins/rspec/spec/spec/mocks/mock_ordering_spec.rb +84 -0
- data/vendor/plugins/rspec/spec/spec/mocks/mock_space_spec.rb +54 -0
- data/vendor/plugins/rspec/spec/spec/mocks/mock_spec.rb +539 -0
- data/vendor/plugins/rspec/spec/spec/mocks/multiple_return_value_spec.rb +113 -0
- data/vendor/plugins/rspec/spec/spec/mocks/nil_expectation_warning_spec.rb +54 -0
- data/vendor/plugins/rspec/spec/spec/mocks/null_object_mock_spec.rb +54 -0
- data/vendor/plugins/rspec/spec/spec/mocks/once_counts_spec.rb +53 -0
- data/vendor/plugins/rspec/spec/spec/mocks/options_hash_spec.rb +35 -0
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_spec.rb +144 -0
- data/vendor/plugins/rspec/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +66 -0
- data/vendor/plugins/rspec/spec/spec/mocks/passing_mock_argument_constraints_spec.rb +174 -0
- data/vendor/plugins/rspec/spec/spec/mocks/precise_counts_spec.rb +52 -0
- data/vendor/plugins/rspec/spec/spec/mocks/record_messages_spec.rb +26 -0
- data/vendor/plugins/rspec/spec/spec/mocks/stub_spec.rb +188 -0
- data/vendor/plugins/rspec/spec/spec/mocks/twice_counts_spec.rb +67 -0
- data/vendor/plugins/rspec/spec/spec/package/bin_spec_spec.rb +14 -0
- data/vendor/plugins/rspec/spec/spec/runner/class_and_argument_parser_spec.rb +23 -0
- data/vendor/plugins/rspec/spec/spec/runner/command_line_spec.rb +140 -0
- data/vendor/plugins/rspec/spec/spec/runner/drb_command_line_spec.rb +99 -0
- data/vendor/plugins/rspec/spec/spec/runner/empty_file.txt +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/examples.txt +2 -0
- data/vendor/plugins/rspec/spec/spec/runner/failed.txt +3 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +33 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.4.html +365 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +387 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.5.html +371 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +381 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatted-1.8.6.html +370 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/html_formatter_spec.rb +64 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/nested_text_formatter_spec.rb +333 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/profile_formatter_spec.rb +65 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +155 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/snippet_extractor_spec.rb +18 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/spec_mate_formatter_spec.rb +104 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/specdoc_formatter_spec.rb +158 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/html_formatter_spec.rb +135 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/plain_text_formatter_spec.rb +600 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb +82 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.4.html +365 -0
- data/vendor/plugins/rspec/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +370 -0
- data/vendor/plugins/rspec/spec/spec/runner/heckle_runner_spec.rb +78 -0
- data/vendor/plugins/rspec/spec/spec/runner/heckler_spec.rb +13 -0
- data/vendor/plugins/rspec/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +45 -0
- data/vendor/plugins/rspec/spec/spec/runner/option_parser_spec.rb +409 -0
- data/vendor/plugins/rspec/spec/spec/runner/options_spec.rb +450 -0
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture.rb +7 -0
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_fixture_runner.rb +8 -0
- data/vendor/plugins/rspec/spec/spec/runner/output_one_time_spec.rb +16 -0
- data/vendor/plugins/rspec/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +62 -0
- data/vendor/plugins/rspec/spec/spec/runner/reporter_spec.rb +238 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_bar.rb +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_foo.rb +0 -0
- data/vendor/plugins/rspec/spec/spec/runner/resources/a_spec.rb +1 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec.opts +2 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec_drb.opts +1 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser/spec_parser_fixture.rb +70 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec_parser_spec.rb +85 -0
- data/vendor/plugins/rspec/spec/spec/runner/spec_spaced.opts +2 -0
- data/vendor/plugins/rspec/spec/spec/runner_spec.rb +11 -0
- data/vendor/plugins/rspec/spec/spec/spec_classes.rb +133 -0
- data/vendor/plugins/rspec/spec/spec/story/builders.rb +46 -0
- data/vendor/plugins/rspec/spec/spec/story/extensions/main_spec.rb +161 -0
- data/vendor/plugins/rspec/spec/spec/story/extensions_spec.rb +14 -0
- data/vendor/plugins/rspec/spec/spec/story/given_scenario_spec.rb +27 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/plain_text_story_runner_spec.rb +90 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_collector_spec.rb +27 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/scenario_runner_spec.rb +214 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/story_mediator_spec.rb +143 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/story_parser_spec.rb +401 -0
- data/vendor/plugins/rspec/spec/spec/story/runner/story_runner_spec.rb +294 -0
- data/vendor/plugins/rspec/spec/spec/story/runner_spec.rb +93 -0
- data/vendor/plugins/rspec/spec/spec/story/scenario_spec.rb +18 -0
- data/vendor/plugins/rspec/spec/spec/story/step_group_spec.rb +157 -0
- data/vendor/plugins/rspec/spec/spec/story/step_mother_spec.rb +84 -0
- data/vendor/plugins/rspec/spec/spec/story/step_spec.rb +272 -0
- data/vendor/plugins/rspec/spec/spec/story/story_helper.rb +2 -0
- data/vendor/plugins/rspec/spec/spec/story/story_spec.rb +84 -0
- data/vendor/plugins/rspec/spec/spec/story/world_spec.rb +423 -0
- data/vendor/plugins/rspec/spec/spec_helper.rb +56 -0
- data/vendor/plugins/rspec/stories/all.rb +5 -0
- data/vendor/plugins/rspec/stories/configuration/before_blocks.story +21 -0
- data/vendor/plugins/rspec/stories/configuration/stories.rb +7 -0
- data/vendor/plugins/rspec/stories/example_groups/autogenerated_docstrings +45 -0
- data/vendor/plugins/rspec/stories/example_groups/example_group_with_should_methods +17 -0
- data/vendor/plugins/rspec/stories/example_groups/nested_groups +17 -0
- data/vendor/plugins/rspec/stories/example_groups/output +25 -0
- data/vendor/plugins/rspec/stories/example_groups/stories.rb +7 -0
- data/vendor/plugins/rspec/stories/helper.rb +6 -0
- data/vendor/plugins/rspec/stories/interop/examples_and_tests_together +30 -0
- data/vendor/plugins/rspec/stories/interop/stories.rb +7 -0
- data/vendor/plugins/rspec/stories/interop/test_case_with_should_methods +17 -0
- data/vendor/plugins/rspec/stories/mock_framework_integration/stories.rb +7 -0
- data/vendor/plugins/rspec/stories/mock_framework_integration/use_flexmock.story +9 -0
- data/vendor/plugins/rspec/stories/pending_stories/README +3 -0
- data/vendor/plugins/rspec/stories/resources/helpers/cmdline.rb +9 -0
- data/vendor/plugins/rspec/stories/resources/helpers/story_helper.rb +16 -0
- data/vendor/plugins/rspec/stories/resources/matchers/smart_match.rb +37 -0
- data/vendor/plugins/rspec/stories/resources/spec/before_blocks_example.rb +32 -0
- data/vendor/plugins/rspec/stories/resources/spec/example_group_with_should_methods.rb +12 -0
- data/vendor/plugins/rspec/stories/resources/spec/simple_spec.rb +8 -0
- data/vendor/plugins/rspec/stories/resources/spec/spec_with_flexmock.rb +18 -0
- data/vendor/plugins/rspec/stories/resources/steps/running_rspec.rb +50 -0
- data/vendor/plugins/rspec/stories/resources/stories/failing_story.rb +15 -0
- data/vendor/plugins/rspec/stories/resources/test/spec_and_test_together.rb +57 -0
- data/vendor/plugins/rspec/stories/resources/test/test_case_with_should_methods.rb +30 -0
- data/vendor/plugins/rspec/stories/stories/multiline_steps.story +23 -0
- data/vendor/plugins/rspec/stories/stories/steps/multiline_steps.rb +13 -0
- data/vendor/plugins/rspec/stories/stories/stories.rb +6 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/builder.js +136 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/controls.js +972 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/dragdrop.js +976 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/effects.js +1117 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/prototype.js +4140 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/rspec.js +149 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/scriptaculous.js +58 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/slider.js +276 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/sound.js +55 -0
- data/vendor/plugins/rspec/story_server/prototype/javascripts/unittest.js +568 -0
- data/vendor/plugins/rspec/story_server/prototype/lib/server.rb +24 -0
- data/vendor/plugins/rspec/story_server/prototype/stories.html +176 -0
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/rspec.css +136 -0
- data/vendor/plugins/rspec/story_server/prototype/stylesheets/test.css +90 -0
- data/vendor/plugins/will_paginate/.manifest +49 -0
- data/vendor/plugins/will_paginate/CHANGELOG.rdoc +94 -0
- data/vendor/plugins/will_paginate/LICENSE +18 -0
- data/vendor/plugins/will_paginate/README.rdoc +106 -0
- data/vendor/plugins/will_paginate/Rakefile +62 -0
- data/vendor/plugins/will_paginate/examples/apple-circle.gif +0 -0
- data/vendor/plugins/will_paginate/examples/index.haml +69 -0
- data/vendor/plugins/will_paginate/examples/index.html +92 -0
- data/vendor/plugins/will_paginate/examples/pagination.css +90 -0
- data/vendor/plugins/will_paginate/examples/pagination.sass +91 -0
- data/vendor/plugins/will_paginate/init.rb +1 -0
- data/vendor/plugins/will_paginate/lib/will_paginate.rb +82 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/array.rb +16 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/collection.rb +146 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb +32 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/finder.rb +253 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/named_scope.rb +132 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/named_scope_patch.rb +39 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/version.rb +9 -0
- data/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +383 -0
- data/vendor/plugins/will_paginate/test/boot.rb +21 -0
- data/vendor/plugins/will_paginate/test/collection_test.rb +140 -0
- data/vendor/plugins/will_paginate/test/console +8 -0
- data/vendor/plugins/will_paginate/test/database.yml +22 -0
- data/vendor/plugins/will_paginate/test/finder_test.rb +443 -0
- data/vendor/plugins/will_paginate/test/fixtures/admin.rb +3 -0
- data/vendor/plugins/will_paginate/test/fixtures/developer.rb +13 -0
- data/vendor/plugins/will_paginate/test/fixtures/developers_projects.yml +13 -0
- data/vendor/plugins/will_paginate/test/fixtures/project.rb +15 -0
- data/vendor/plugins/will_paginate/test/fixtures/projects.yml +6 -0
- data/vendor/plugins/will_paginate/test/fixtures/replies.yml +29 -0
- data/vendor/plugins/will_paginate/test/fixtures/reply.rb +7 -0
- data/vendor/plugins/will_paginate/test/fixtures/schema.rb +38 -0
- data/vendor/plugins/will_paginate/test/fixtures/topic.rb +6 -0
- data/vendor/plugins/will_paginate/test/fixtures/topics.yml +30 -0
- data/vendor/plugins/will_paginate/test/fixtures/user.rb +2 -0
- data/vendor/plugins/will_paginate/test/fixtures/users.yml +35 -0
- data/vendor/plugins/will_paginate/test/helper.rb +37 -0
- data/vendor/plugins/will_paginate/test/lib/activerecord_test_case.rb +36 -0
- data/vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb +69 -0
- data/vendor/plugins/will_paginate/test/lib/load_fixtures.rb +11 -0
- data/vendor/plugins/will_paginate/test/lib/view_test_process.rb +165 -0
- data/vendor/plugins/will_paginate/test/tasks.rake +59 -0
- data/vendor/plugins/will_paginate/test/view_test.rb +363 -0
- data/vendor/plugins/will_paginate/will_paginate.gemspec +21 -0
- metadata +995 -0
@@ -0,0 +1,253 @@
|
|
1
|
+
require 'will_paginate/core_ext'
|
2
|
+
|
3
|
+
module WillPaginate
|
4
|
+
# A mixin for ActiveRecord::Base. Provides +per_page+ class method
|
5
|
+
# and hooks things up to provide paginating finders.
|
6
|
+
#
|
7
|
+
# Find out more in WillPaginate::Finder::ClassMethods
|
8
|
+
#
|
9
|
+
module Finder
|
10
|
+
def self.included(base)
|
11
|
+
base.extend ClassMethods
|
12
|
+
class << base
|
13
|
+
alias_method_chain :method_missing, :paginate
|
14
|
+
# alias_method_chain :find_every, :paginate
|
15
|
+
define_method(:per_page) { 30 } unless respond_to?(:per_page)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# = Paginating finders for ActiveRecord models
|
20
|
+
#
|
21
|
+
# WillPaginate adds +paginate+, +per_page+ and other methods to
|
22
|
+
# ActiveRecord::Base class methods and associations. It also hooks into
|
23
|
+
# +method_missing+ to intercept pagination calls to dynamic finders such as
|
24
|
+
# +paginate_by_user_id+ and translate them to ordinary finders
|
25
|
+
# (+find_all_by_user_id+ in this case).
|
26
|
+
#
|
27
|
+
# In short, paginating finders are equivalent to ActiveRecord finders; the
|
28
|
+
# only difference is that we start with "paginate" instead of "find" and
|
29
|
+
# that <tt>:page</tt> is required parameter:
|
30
|
+
#
|
31
|
+
# @posts = Post.paginate :all, :page => params[:page], :order => 'created_at DESC'
|
32
|
+
#
|
33
|
+
# In paginating finders, "all" is implicit. There is no sense in paginating
|
34
|
+
# a single record, right? So, you can drop the <tt>:all</tt> argument:
|
35
|
+
#
|
36
|
+
# Post.paginate(...) => Post.find :all
|
37
|
+
# Post.paginate_all_by_something => Post.find_all_by_something
|
38
|
+
# Post.paginate_by_something => Post.find_all_by_something
|
39
|
+
#
|
40
|
+
# == The importance of the <tt>:order</tt> parameter
|
41
|
+
#
|
42
|
+
# In ActiveRecord finders, <tt>:order</tt> parameter specifies columns for
|
43
|
+
# the <tt>ORDER BY</tt> clause in SQL. It is important to have it, since
|
44
|
+
# pagination only makes sense with ordered sets. Without the <tt>ORDER
|
45
|
+
# BY</tt> clause, databases aren't required to do consistent ordering when
|
46
|
+
# performing <tt>SELECT</tt> queries; this is especially true for
|
47
|
+
# PostgreSQL.
|
48
|
+
#
|
49
|
+
# Therefore, make sure you are doing ordering on a column that makes the
|
50
|
+
# most sense in the current context. Make that obvious to the user, also.
|
51
|
+
# For perfomance reasons you will also want to add an index to that column.
|
52
|
+
module ClassMethods
|
53
|
+
# This is the main paginating finder.
|
54
|
+
#
|
55
|
+
# == Special parameters for paginating finders
|
56
|
+
# * <tt>:page</tt> -- REQUIRED, but defaults to 1 if false or nil
|
57
|
+
# * <tt>:per_page</tt> -- defaults to <tt>CurrentModel.per_page</tt> (which is 30 if not overridden)
|
58
|
+
# * <tt>:total_entries</tt> -- use only if you manually count total entries
|
59
|
+
# * <tt>:count</tt> -- additional options that are passed on to +count+
|
60
|
+
# * <tt>:finder</tt> -- name of the ActiveRecord finder used (default: "find")
|
61
|
+
# * <tt>:shift</tt> -- the shift before for the offset
|
62
|
+
#
|
63
|
+
# All other options (+conditions+, +order+, ...) are forwarded to +find+
|
64
|
+
# and +count+ calls.
|
65
|
+
def paginate(*args, &block)
|
66
|
+
options = args.pop
|
67
|
+
page, per_page, total_entries = wp_parse_options(options)
|
68
|
+
finder = (options[:finder] || 'find').to_s
|
69
|
+
|
70
|
+
if finder == 'find'
|
71
|
+
# an array of IDs may have been given:
|
72
|
+
total_entries ||= (Array === args.first and args.first.size)
|
73
|
+
# :all is implicit
|
74
|
+
args.unshift(:all) if args.empty?
|
75
|
+
end
|
76
|
+
|
77
|
+
WillPaginate::Collection.create(page, per_page, total_entries) do |pager|
|
78
|
+
count_options = options.except :page, :per_page, :total_entries, :finder, :shift
|
79
|
+
if options[:shift]
|
80
|
+
offset = pager.offset - options[:shift]
|
81
|
+
else
|
82
|
+
offset = pager.offset
|
83
|
+
end
|
84
|
+
find_options = count_options.except(:count).update(:offset => offset, :limit => pager.per_page)
|
85
|
+
|
86
|
+
args << find_options
|
87
|
+
# @options_from_last_find = nil
|
88
|
+
pager.replace send(finder, *args, &block)
|
89
|
+
|
90
|
+
# magic counting for user convenience:
|
91
|
+
pager.total_entries = wp_count(count_options, args, finder) unless pager.total_entries
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# Iterates through all records by loading one page at a time. This is useful
|
96
|
+
# for migrations or any other use case where you don't want to load all the
|
97
|
+
# records in memory at once.
|
98
|
+
#
|
99
|
+
# It uses +paginate+ internally; therefore it accepts all of its options.
|
100
|
+
# You can specify a starting page with <tt>:page</tt> (default is 1). Default
|
101
|
+
# <tt>:order</tt> is <tt>"id"</tt>, override if necessary.
|
102
|
+
#
|
103
|
+
# See {Faking Cursors in ActiveRecord}[http://weblog.jamisbuck.org/2007/4/6/faking-cursors-in-activerecord]
|
104
|
+
# where Jamis Buck describes this and a more efficient way for MySQL.
|
105
|
+
def paginated_each(options = {}, &block)
|
106
|
+
options = { :order => 'id', :page => 1 }.merge options
|
107
|
+
options[:page] = options[:page].to_i
|
108
|
+
options[:total_entries] = 0 # skip the individual count queries
|
109
|
+
total = 0
|
110
|
+
|
111
|
+
begin
|
112
|
+
collection = paginate(options)
|
113
|
+
total += collection.each(&block).size
|
114
|
+
options[:page] += 1
|
115
|
+
end until collection.size < collection.per_page
|
116
|
+
|
117
|
+
total
|
118
|
+
end
|
119
|
+
|
120
|
+
# Wraps +find_by_sql+ by simply adding LIMIT and OFFSET to your SQL string
|
121
|
+
# based on the params otherwise used by paginating finds: +page+ and
|
122
|
+
# +per_page+.
|
123
|
+
#
|
124
|
+
# Example:
|
125
|
+
#
|
126
|
+
# @developers = Developer.paginate_by_sql ['select * from developers where salary > ?', 80000],
|
127
|
+
# :page => params[:page], :per_page => 3
|
128
|
+
#
|
129
|
+
# A query for counting rows will automatically be generated if you don't
|
130
|
+
# supply <tt>:total_entries</tt>. If you experience problems with this
|
131
|
+
# generated SQL, you might want to perform the count manually in your
|
132
|
+
# application.
|
133
|
+
#
|
134
|
+
def paginate_by_sql(sql, options)
|
135
|
+
WillPaginate::Collection.create(*wp_parse_options(options)) do |pager|
|
136
|
+
query = sanitize_sql(sql.dup)
|
137
|
+
original_query = query.dup
|
138
|
+
# add limit, offset
|
139
|
+
add_limit! query, :offset => pager.offset, :limit => pager.per_page
|
140
|
+
# perfom the find
|
141
|
+
pager.replace find_by_sql(query)
|
142
|
+
|
143
|
+
unless pager.total_entries
|
144
|
+
count_query = original_query.sub /\bORDER\s+BY\s+[\w`,\s]+$/mi, ''
|
145
|
+
count_query = "SELECT COUNT(*) FROM (#{count_query})"
|
146
|
+
|
147
|
+
unless ['oracle', 'oci'].include?(self.connection.adapter_name.downcase)
|
148
|
+
count_query << ' AS count_table'
|
149
|
+
end
|
150
|
+
# perform the count query
|
151
|
+
pager.total_entries = count_by_sql(count_query)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
def respond_to?(method, include_priv = false) #:nodoc:
|
157
|
+
case method.to_sym
|
158
|
+
when :paginate, :paginate_by_sql
|
159
|
+
true
|
160
|
+
else
|
161
|
+
super(method.to_s.sub(/^paginate/, 'find'), include_priv)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
protected
|
166
|
+
|
167
|
+
def method_missing_with_paginate(method, *args, &block) #:nodoc:
|
168
|
+
# did somebody tried to paginate? if not, let them be
|
169
|
+
unless method.to_s.index('paginate') == 0
|
170
|
+
return method_missing_without_paginate(method, *args, &block)
|
171
|
+
end
|
172
|
+
|
173
|
+
# paginate finders are really just find_* with limit and offset
|
174
|
+
finder = method.to_s.sub('paginate', 'find')
|
175
|
+
finder.sub!('find', 'find_all') if finder.index('find_by_') == 0
|
176
|
+
|
177
|
+
options = args.pop
|
178
|
+
raise ArgumentError, 'parameter hash expected' unless options.respond_to? :symbolize_keys
|
179
|
+
options = options.dup
|
180
|
+
options[:finder] = finder
|
181
|
+
args << options
|
182
|
+
|
183
|
+
paginate(*args, &block)
|
184
|
+
end
|
185
|
+
|
186
|
+
# Does the not-so-trivial job of finding out the total number of entries
|
187
|
+
# in the database. It relies on the ActiveRecord +count+ method.
|
188
|
+
def wp_count(options, args, finder)
|
189
|
+
excludees = [:count, :order, :limit, :offset, :readonly]
|
190
|
+
unless options[:select] and options[:select] =~ /^\s*DISTINCT\b/i
|
191
|
+
excludees << :select # only exclude the select param if it doesn't begin with DISTINCT
|
192
|
+
end
|
193
|
+
|
194
|
+
# count expects (almost) the same options as find
|
195
|
+
count_options = options.except *excludees
|
196
|
+
|
197
|
+
# merge the hash found in :count
|
198
|
+
# this allows you to specify :select, :order, or anything else just for the count query
|
199
|
+
count_options.update options[:count] if options[:count]
|
200
|
+
|
201
|
+
# we may be in a model or an association proxy
|
202
|
+
klass = (@owner and @reflection) ? @reflection.klass : self
|
203
|
+
|
204
|
+
# forget about includes if they are irrelevant (Rails 2.1)
|
205
|
+
if count_options[:include] and
|
206
|
+
klass.private_methods.include?('references_eager_loaded_tables?') and
|
207
|
+
!klass.send(:references_eager_loaded_tables?, count_options)
|
208
|
+
count_options.delete :include
|
209
|
+
end
|
210
|
+
|
211
|
+
# we may have to scope ...
|
212
|
+
counter = Proc.new { count(count_options) }
|
213
|
+
|
214
|
+
count = if finder.index('find_') == 0 and klass.respond_to?(scoper = finder.sub('find', 'with'))
|
215
|
+
# scope_out adds a 'with_finder' method which acts like with_scope, if it's present
|
216
|
+
# then execute the count with the scoping provided by the with_finder
|
217
|
+
send(scoper, &counter)
|
218
|
+
elsif match = /^find_(all_by|by)_([_a-zA-Z]\w*)$/.match(finder)
|
219
|
+
# extract conditions from calls like "paginate_by_foo_and_bar"
|
220
|
+
attribute_names = extract_attribute_names_from_match(match)
|
221
|
+
conditions = construct_attributes_from_arguments(attribute_names, args)
|
222
|
+
with_scope(:find => { :conditions => conditions }, &counter)
|
223
|
+
else
|
224
|
+
counter.call
|
225
|
+
end
|
226
|
+
|
227
|
+
count.respond_to?(:length) ? count.length : count
|
228
|
+
end
|
229
|
+
|
230
|
+
def wp_parse_options(options) #:nodoc:
|
231
|
+
raise ArgumentError, 'parameter hash expected' unless options.respond_to? :symbolize_keys
|
232
|
+
options = options.symbolize_keys
|
233
|
+
raise ArgumentError, ':page parameter required' unless options.key? :page
|
234
|
+
|
235
|
+
if options[:count] and options[:total_entries]
|
236
|
+
raise ArgumentError, ':count and :total_entries are mutually exclusive'
|
237
|
+
end
|
238
|
+
|
239
|
+
page = options[:page] || 1
|
240
|
+
per_page = options[:per_page] || self.per_page
|
241
|
+
total = options[:total_entries]
|
242
|
+
[page, per_page, total]
|
243
|
+
end
|
244
|
+
|
245
|
+
private
|
246
|
+
|
247
|
+
# def find_every_with_paginate(options)
|
248
|
+
# @options_from_last_find = options
|
249
|
+
# find_every_without_paginate(options)
|
250
|
+
# end
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
## stolen from: http://dev.rubyonrails.org/browser/trunk/activerecord/lib/active_record/named_scope.rb?rev=9084
|
2
|
+
|
3
|
+
module WillPaginate
|
4
|
+
# This is a feature backported from Rails 2.1 because of its usefullness not only with will_paginate,
|
5
|
+
# but in other aspects when managing complex conditions that you want to be reusable.
|
6
|
+
module NamedScope
|
7
|
+
# All subclasses of ActiveRecord::Base have two named_scopes:
|
8
|
+
# * <tt>all</tt>, which is similar to a <tt>find(:all)</tt> query, and
|
9
|
+
# * <tt>scoped</tt>, which allows for the creation of anonymous scopes, on the fly:
|
10
|
+
#
|
11
|
+
# Shirt.scoped(:conditions => {:color => 'red'}).scoped(:include => :washing_instructions)
|
12
|
+
#
|
13
|
+
# These anonymous scopes tend to be useful when procedurally generating complex queries, where passing
|
14
|
+
# intermediate values (scopes) around as first-class objects is convenient.
|
15
|
+
def self.included(base)
|
16
|
+
base.class_eval do
|
17
|
+
extend ClassMethods
|
18
|
+
named_scope :all
|
19
|
+
named_scope :scoped, lambda { |scope| scope }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
module ClassMethods
|
24
|
+
def scopes #:nodoc:
|
25
|
+
read_inheritable_attribute(:scopes) || write_inheritable_attribute(:scopes, {})
|
26
|
+
end
|
27
|
+
|
28
|
+
# Adds a class method for retrieving and querying objects. A scope represents a narrowing of a database query,
|
29
|
+
# such as <tt>:conditions => {:color => :red}, :select => 'shirts.*', :include => :washing_instructions</tt>.
|
30
|
+
#
|
31
|
+
# class Shirt < ActiveRecord::Base
|
32
|
+
# named_scope :red, :conditions => {:color => 'red'}
|
33
|
+
# named_scope :dry_clean_only, :joins => :washing_instructions, :conditions => ['washing_instructions.dry_clean_only = ?', true]
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# The above calls to <tt>named_scope</tt> define class methods <tt>Shirt.red</tt> and <tt>Shirt.dry_clean_only</tt>. <tt>Shirt.red</tt>,
|
37
|
+
# in effect, represents the query <tt>Shirt.find(:all, :conditions => {:color => 'red'})</tt>.
|
38
|
+
#
|
39
|
+
# Unlike Shirt.find(...), however, the object returned by <tt>Shirt.red</tt> is not an Array; it resembles the association object
|
40
|
+
# constructed by a <tt>has_many</tt> declaration. For instance, you can invoke <tt>Shirt.red.find(:first)</tt>, <tt>Shirt.red.count</tt>,
|
41
|
+
# <tt>Shirt.red.find(:all, :conditions => {:size => 'small'})</tt>. Also, just
|
42
|
+
# as with the association objects, name scopes acts like an Array, implementing Enumerable; <tt>Shirt.red.each(&block)</tt>,
|
43
|
+
# <tt>Shirt.red.first</tt>, and <tt>Shirt.red.inject(memo, &block)</tt> all behave as if Shirt.red really were an Array.
|
44
|
+
#
|
45
|
+
# These named scopes are composable. For instance, <tt>Shirt.red.dry_clean_only</tt> will produce all shirts that are both red and dry clean only.
|
46
|
+
# Nested finds and calculations also work with these compositions: <tt>Shirt.red.dry_clean_only.count</tt> returns the number of garments
|
47
|
+
# for which these criteria obtain. Similarly with <tt>Shirt.red.dry_clean_only.average(:thread_count)</tt>.
|
48
|
+
#
|
49
|
+
# All scopes are available as class methods on the ActiveRecord descendent upon which the scopes were defined. But they are also available to
|
50
|
+
# <tt>has_many</tt> associations. If,
|
51
|
+
#
|
52
|
+
# class Person < ActiveRecord::Base
|
53
|
+
# has_many :shirts
|
54
|
+
# end
|
55
|
+
#
|
56
|
+
# then <tt>elton.shirts.red.dry_clean_only</tt> will return all of Elton's red, dry clean
|
57
|
+
# only shirts.
|
58
|
+
#
|
59
|
+
# Named scopes can also be procedural.
|
60
|
+
#
|
61
|
+
# class Shirt < ActiveRecord::Base
|
62
|
+
# named_scope :colored, lambda { |color|
|
63
|
+
# { :conditions => { :color => color } }
|
64
|
+
# }
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
# In this example, <tt>Shirt.colored('puce')</tt> finds all puce shirts.
|
68
|
+
#
|
69
|
+
# Named scopes can also have extensions, just as with <tt>has_many</tt> declarations:
|
70
|
+
#
|
71
|
+
# class Shirt < ActiveRecord::Base
|
72
|
+
# named_scope :red, :conditions => {:color => 'red'} do
|
73
|
+
# def dom_id
|
74
|
+
# 'red_shirts'
|
75
|
+
# end
|
76
|
+
# end
|
77
|
+
# end
|
78
|
+
#
|
79
|
+
def named_scope(name, options = {}, &block)
|
80
|
+
scopes[name] = lambda do |parent_scope, *args|
|
81
|
+
Scope.new(parent_scope, case options
|
82
|
+
when Hash
|
83
|
+
options
|
84
|
+
when Proc
|
85
|
+
options.call(*args)
|
86
|
+
end, &block)
|
87
|
+
end
|
88
|
+
(class << self; self end).instance_eval do
|
89
|
+
define_method name do |*args|
|
90
|
+
scopes[name].call(self, *args)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
class Scope #:nodoc:
|
97
|
+
attr_reader :proxy_scope, :proxy_options
|
98
|
+
[].methods.each { |m| delegate m, :to => :proxy_found unless m =~ /(^__|^nil\?|^send|class|extend|find|count|sum|average|maximum|minimum|paginate)/ }
|
99
|
+
delegate :scopes, :with_scope, :to => :proxy_scope
|
100
|
+
|
101
|
+
def initialize(proxy_scope, options, &block)
|
102
|
+
[options[:extend]].flatten.each { |extension| extend extension } if options[:extend]
|
103
|
+
extend Module.new(&block) if block_given?
|
104
|
+
@proxy_scope, @proxy_options = proxy_scope, options.except(:extend)
|
105
|
+
end
|
106
|
+
|
107
|
+
def reload
|
108
|
+
load_found; self
|
109
|
+
end
|
110
|
+
|
111
|
+
protected
|
112
|
+
def proxy_found
|
113
|
+
@found || load_found
|
114
|
+
end
|
115
|
+
|
116
|
+
private
|
117
|
+
def method_missing(method, *args, &block)
|
118
|
+
if scopes.include?(method)
|
119
|
+
scopes[method].call(self, *args)
|
120
|
+
else
|
121
|
+
with_scope :find => proxy_options do
|
122
|
+
proxy_scope.send(method, *args, &block)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
def load_found
|
128
|
+
@found = find(:all)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
## based on http://dev.rubyonrails.org/changeset/9084
|
2
|
+
|
3
|
+
ActiveRecord::Associations::AssociationProxy.class_eval do
|
4
|
+
protected
|
5
|
+
def with_scope(*args, &block)
|
6
|
+
@reflection.klass.send :with_scope, *args, &block
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
[ ActiveRecord::Associations::AssociationCollection,
|
11
|
+
ActiveRecord::Associations::HasManyThroughAssociation ].each do |klass|
|
12
|
+
klass.class_eval do
|
13
|
+
protected
|
14
|
+
alias :method_missing_without_scopes :method_missing_without_paginate
|
15
|
+
def method_missing_without_paginate(method, *args, &block)
|
16
|
+
if @reflection.klass.scopes.include?(method)
|
17
|
+
@reflection.klass.scopes[method].call(self, *args, &block)
|
18
|
+
else
|
19
|
+
method_missing_without_scopes(method, *args, &block)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Rails 1.2.6
|
26
|
+
ActiveRecord::Associations::HasAndBelongsToManyAssociation.class_eval do
|
27
|
+
protected
|
28
|
+
def method_missing(method, *args, &block)
|
29
|
+
if @target.respond_to?(method) || (!@reflection.klass.respond_to?(method) && Class.respond_to?(method))
|
30
|
+
super
|
31
|
+
elsif @reflection.klass.scopes.include?(method)
|
32
|
+
@reflection.klass.scopes[method].call(self, *args)
|
33
|
+
else
|
34
|
+
@reflection.klass.with_scope(:find => { :conditions => @finder_sql, :joins => @join_sql, :readonly => false }) do
|
35
|
+
@reflection.klass.send(method, *args, &block)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end if ActiveRecord::Base.respond_to? :find_first
|
@@ -0,0 +1,383 @@
|
|
1
|
+
require 'will_paginate/core_ext'
|
2
|
+
|
3
|
+
module WillPaginate
|
4
|
+
# = Will Paginate view helpers
|
5
|
+
#
|
6
|
+
# The main view helper, #will_paginate, renders
|
7
|
+
# pagination links for the given collection. The helper itself is lightweight
|
8
|
+
# and serves only as a wrapper around LinkRenderer instantiation; the
|
9
|
+
# renderer then does all the hard work of generating the HTML.
|
10
|
+
#
|
11
|
+
# == Global options for helpers
|
12
|
+
#
|
13
|
+
# Options for pagination helpers are optional and get their default values from the
|
14
|
+
# <tt>WillPaginate::ViewHelpers.pagination_options</tt> hash. You can write to this hash to
|
15
|
+
# override default options on the global level:
|
16
|
+
#
|
17
|
+
# WillPaginate::ViewHelpers.pagination_options[:previous_label] = 'Previous page'
|
18
|
+
#
|
19
|
+
# By putting this into "config/initializers/will_paginate.rb" (or simply environment.rb in
|
20
|
+
# older versions of Rails) you can easily translate link texts to previous
|
21
|
+
# and next pages, as well as override some other defaults to your liking.
|
22
|
+
module ViewHelpers
|
23
|
+
# default options that can be overridden on the global level
|
24
|
+
@@pagination_options = {
|
25
|
+
:class => 'pagination',
|
26
|
+
:previous_label => '« Previous',
|
27
|
+
:next_label => 'Next »',
|
28
|
+
:inner_window => 4, # links around the current page
|
29
|
+
:outer_window => 1, # links around beginning and end
|
30
|
+
:separator => ' ', # single space is friendly to spiders and non-graphic browsers
|
31
|
+
:param_name => :page,
|
32
|
+
:params => nil,
|
33
|
+
:renderer => 'WillPaginate::LinkRenderer',
|
34
|
+
:page_links => true,
|
35
|
+
:container => true
|
36
|
+
}
|
37
|
+
mattr_reader :pagination_options
|
38
|
+
|
39
|
+
# Renders Digg/Flickr-style pagination for a WillPaginate::Collection
|
40
|
+
# object. Nil is returned if there is only one page in total; no point in
|
41
|
+
# rendering the pagination in that case...
|
42
|
+
#
|
43
|
+
# ==== Options
|
44
|
+
# Display options:
|
45
|
+
# * <tt>:previous_label</tt> -- default: "« Previous" (this parameter is called <tt>:prev_label</tt> in versions <b>2.3.2</b> and older!)
|
46
|
+
# * <tt>:next_label</tt> -- default: "Next »"
|
47
|
+
# * <tt>:page_links</tt> -- when false, only previous/next links are rendered (default: true)
|
48
|
+
# * <tt>:inner_window</tt> -- how many links are shown around the current page (default: 4)
|
49
|
+
# * <tt>:outer_window</tt> -- how many links are around the first and the last page (default: 1)
|
50
|
+
# * <tt>:separator</tt> -- string separator for page HTML elements (default: single space)
|
51
|
+
#
|
52
|
+
# HTML options:
|
53
|
+
# * <tt>:class</tt> -- CSS class name for the generated DIV (default: "pagination")
|
54
|
+
# * <tt>:container</tt> -- toggles rendering of the DIV container for pagination links, set to
|
55
|
+
# false only when you are rendering your own pagination markup (default: true)
|
56
|
+
# * <tt>:id</tt> -- HTML ID for the container (default: nil). Pass +true+ to have the ID
|
57
|
+
# automatically generated from the class name of objects in collection: for example, paginating
|
58
|
+
# ArticleComment models would yield an ID of "article_comments_pagination".
|
59
|
+
#
|
60
|
+
# Advanced options:
|
61
|
+
# * <tt>:param_name</tt> -- parameter name for page number in URLs (default: <tt>:page</tt>)
|
62
|
+
# * <tt>:params</tt> -- additional parameters when generating pagination links
|
63
|
+
# (eg. <tt>:controller => "foo", :action => nil</tt>)
|
64
|
+
# * <tt>:renderer</tt> -- class name, class or instance of a link renderer (default:
|
65
|
+
# <tt>WillPaginate::LinkRenderer</tt>)
|
66
|
+
#
|
67
|
+
# All options not recognized by will_paginate will become HTML attributes on the container
|
68
|
+
# element for pagination links (the DIV). For example:
|
69
|
+
#
|
70
|
+
# <%= will_paginate @posts, :style => 'font-size: small' %>
|
71
|
+
#
|
72
|
+
# ... will result in:
|
73
|
+
#
|
74
|
+
# <div class="pagination" style="font-size: small"> ... </div>
|
75
|
+
#
|
76
|
+
# ==== Using the helper without arguments
|
77
|
+
# If the helper is called without passing in the collection object, it will
|
78
|
+
# try to read from the instance variable inferred by the controller name.
|
79
|
+
# For example, calling +will_paginate+ while the current controller is
|
80
|
+
# PostsController will result in trying to read from the <tt>@posts</tt>
|
81
|
+
# variable. Example:
|
82
|
+
#
|
83
|
+
# <%= will_paginate :id => true %>
|
84
|
+
#
|
85
|
+
# ... will result in <tt>@post</tt> collection getting paginated:
|
86
|
+
#
|
87
|
+
# <div class="pagination" id="posts_pagination"> ... </div>
|
88
|
+
#
|
89
|
+
def will_paginate(collection = nil, options = {})
|
90
|
+
options, collection = collection, nil if collection.is_a? Hash
|
91
|
+
unless collection or !controller
|
92
|
+
collection_name = "@#{controller.controller_name}"
|
93
|
+
collection = instance_variable_get(collection_name)
|
94
|
+
raise ArgumentError, "The #{collection_name} variable appears to be empty. Did you " +
|
95
|
+
"forget to pass the collection object for will_paginate?" unless collection
|
96
|
+
end
|
97
|
+
# early exit if there is nothing to render
|
98
|
+
return nil unless WillPaginate::ViewHelpers.total_pages_for_collection(collection) > 1
|
99
|
+
|
100
|
+
options = options.symbolize_keys.reverse_merge WillPaginate::ViewHelpers.pagination_options
|
101
|
+
if options[:prev_label]
|
102
|
+
WillPaginate::Deprecation::warn(":prev_label view parameter is now :previous_label; the old name has been deprecated.")
|
103
|
+
options[:previous_label] = options.delete(:prev_label)
|
104
|
+
end
|
105
|
+
|
106
|
+
# get the renderer instance
|
107
|
+
renderer = case options[:renderer]
|
108
|
+
when String
|
109
|
+
options[:renderer].to_s.constantize.new
|
110
|
+
when Class
|
111
|
+
options[:renderer].new
|
112
|
+
else
|
113
|
+
options[:renderer]
|
114
|
+
end
|
115
|
+
# render HTML for pagination
|
116
|
+
renderer.prepare collection, options, self
|
117
|
+
renderer.to_html
|
118
|
+
end
|
119
|
+
|
120
|
+
# Wrapper for rendering pagination links at both top and bottom of a block
|
121
|
+
# of content.
|
122
|
+
#
|
123
|
+
# <% paginated_section @posts do %>
|
124
|
+
# <ol id="posts">
|
125
|
+
# <% for post in @posts %>
|
126
|
+
# <li> ... </li>
|
127
|
+
# <% end %>
|
128
|
+
# </ol>
|
129
|
+
# <% end %>
|
130
|
+
#
|
131
|
+
# will result in:
|
132
|
+
#
|
133
|
+
# <div class="pagination"> ... </div>
|
134
|
+
# <ol id="posts">
|
135
|
+
# ...
|
136
|
+
# </ol>
|
137
|
+
# <div class="pagination"> ... </div>
|
138
|
+
#
|
139
|
+
# Arguments are passed to a <tt>will_paginate</tt> call, so the same options
|
140
|
+
# apply. Don't use the <tt>:id</tt> option; otherwise you'll finish with two
|
141
|
+
# blocks of pagination links sharing the same ID (which is invalid HTML).
|
142
|
+
def paginated_section(*args, &block)
|
143
|
+
pagination = will_paginate(*args).to_s
|
144
|
+
content = pagination + capture(&block) + pagination
|
145
|
+
concat content, block.binding
|
146
|
+
end
|
147
|
+
|
148
|
+
# Renders a helpful message with numbers of displayed vs. total entries.
|
149
|
+
# You can use this as a blueprint for your own, similar helpers.
|
150
|
+
#
|
151
|
+
# <%= page_entries_info @posts %>
|
152
|
+
# #-> Displaying posts 6 - 10 of 26 in total
|
153
|
+
#
|
154
|
+
# By default, the message will use the humanized class name of objects
|
155
|
+
# in collection: for instance, "project types" for ProjectType models.
|
156
|
+
# Override this with the <tt>:entry_name</tt> parameter:
|
157
|
+
#
|
158
|
+
# <%= page_entries_info @posts, :entry_name => 'item' %>
|
159
|
+
# #-> Displaying items 6 - 10 of 26 in total
|
160
|
+
def page_entries_info(collection, options = {})
|
161
|
+
entry_name = options[:entry_name] ||
|
162
|
+
(collection.empty?? 'entry' : collection.first.class.name.underscore.sub('_', ' '))
|
163
|
+
|
164
|
+
if collection.total_pages < 2
|
165
|
+
case collection.size
|
166
|
+
when 0; "No #{entry_name.pluralize} found"
|
167
|
+
when 1; "Displaying <b>1</b> #{entry_name}"
|
168
|
+
else; "Displaying <b>all #{collection.size}</b> #{entry_name.pluralize}"
|
169
|
+
end
|
170
|
+
else
|
171
|
+
%{Displaying #{entry_name.pluralize} <b>%d - %d</b> of <b>%d</b> in total} % [
|
172
|
+
collection.offset + 1,
|
173
|
+
collection.offset + collection.length,
|
174
|
+
collection.total_entries
|
175
|
+
]
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
def self.total_pages_for_collection(collection) #:nodoc:
|
180
|
+
if collection.respond_to?('page_count') and !collection.respond_to?('total_pages')
|
181
|
+
WillPaginate::Deprecation.warn <<-MSG
|
182
|
+
You are using a paginated collection of class #{collection.class.name}
|
183
|
+
which conforms to the old API of WillPaginate::Collection by using
|
184
|
+
`page_count`, while the current method name is `total_pages`. Please
|
185
|
+
upgrade yours or 3rd-party code that provides the paginated collection.
|
186
|
+
MSG
|
187
|
+
class << collection
|
188
|
+
def total_pages; page_count; end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
collection.total_pages
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# This class does the heavy lifting of actually building the pagination
|
196
|
+
# links. It is used by the <tt>will_paginate</tt> helper internally.
|
197
|
+
class LinkRenderer
|
198
|
+
|
199
|
+
# The gap in page links is represented by:
|
200
|
+
#
|
201
|
+
# <span class="gap">…</span>
|
202
|
+
attr_accessor :gap_marker
|
203
|
+
|
204
|
+
def initialize
|
205
|
+
@gap_marker = '<span class="gap">…</span>'
|
206
|
+
end
|
207
|
+
|
208
|
+
# * +collection+ is a WillPaginate::Collection instance or any other object
|
209
|
+
# that conforms to that API
|
210
|
+
# * +options+ are forwarded from +will_paginate+ view helper
|
211
|
+
# * +template+ is the reference to the template being rendered
|
212
|
+
def prepare(collection, options, template)
|
213
|
+
@collection = collection
|
214
|
+
@options = options
|
215
|
+
@template = template
|
216
|
+
|
217
|
+
# reset values in case we're re-using this instance
|
218
|
+
@total_pages = @param_name = @url_string = nil
|
219
|
+
end
|
220
|
+
|
221
|
+
# Process it! This method returns the complete HTML string which contains
|
222
|
+
# pagination links. Feel free to subclass LinkRenderer and change this
|
223
|
+
# method as you see fit.
|
224
|
+
def to_html
|
225
|
+
links = @options[:page_links] ? windowed_links : []
|
226
|
+
# previous/next buttons
|
227
|
+
links.unshift page_link_or_span(@collection.previous_page, 'disabled prev_page', @options[:previous_label])
|
228
|
+
links.push page_link_or_span(@collection.next_page, 'disabled next_page', @options[:next_label])
|
229
|
+
|
230
|
+
html = links.join(@options[:separator])
|
231
|
+
@options[:container] ? @template.content_tag(:div, html, html_attributes) : html
|
232
|
+
end
|
233
|
+
|
234
|
+
# Returns the subset of +options+ this instance was initialized with that
|
235
|
+
# represent HTML attributes for the container element of pagination links.
|
236
|
+
def html_attributes
|
237
|
+
return @html_attributes if @html_attributes
|
238
|
+
@html_attributes = @options.except *(WillPaginate::ViewHelpers.pagination_options.keys - [:class])
|
239
|
+
# pagination of Post models will have the ID of "posts_pagination"
|
240
|
+
if @options[:container] and @options[:id] === true
|
241
|
+
@html_attributes[:id] = @collection.first.class.name.underscore.pluralize + '_pagination'
|
242
|
+
end
|
243
|
+
@html_attributes
|
244
|
+
end
|
245
|
+
|
246
|
+
protected
|
247
|
+
|
248
|
+
# Collects link items for visible page numbers.
|
249
|
+
def windowed_links
|
250
|
+
prev = nil
|
251
|
+
|
252
|
+
visible_page_numbers.inject [] do |links, n|
|
253
|
+
# detect gaps:
|
254
|
+
links << gap_marker if prev and n > prev + 1
|
255
|
+
links << page_link_or_span(n, 'current')
|
256
|
+
prev = n
|
257
|
+
links
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
# Calculates visible page numbers using the <tt>:inner_window</tt> and
|
262
|
+
# <tt>:outer_window</tt> options.
|
263
|
+
def visible_page_numbers
|
264
|
+
inner_window, outer_window = @options[:inner_window].to_i, @options[:outer_window].to_i
|
265
|
+
window_from = current_page - inner_window
|
266
|
+
window_to = current_page + inner_window
|
267
|
+
|
268
|
+
# adjust lower or upper limit if other is out of bounds
|
269
|
+
if window_to > total_pages
|
270
|
+
window_from -= window_to - total_pages
|
271
|
+
window_to = total_pages
|
272
|
+
end
|
273
|
+
if window_from < 1
|
274
|
+
window_to += 1 - window_from
|
275
|
+
window_from = 1
|
276
|
+
window_to = total_pages if window_to > total_pages
|
277
|
+
end
|
278
|
+
|
279
|
+
visible = (1..total_pages).to_a
|
280
|
+
left_gap = (2 + outer_window)...window_from
|
281
|
+
right_gap = (window_to + 1)...(total_pages - outer_window)
|
282
|
+
visible -= left_gap.to_a if left_gap.last - left_gap.first > 1
|
283
|
+
visible -= right_gap.to_a if right_gap.last - right_gap.first > 1
|
284
|
+
|
285
|
+
visible
|
286
|
+
end
|
287
|
+
|
288
|
+
def page_link_or_span(page, span_class, text = nil)
|
289
|
+
text ||= page.to_s
|
290
|
+
|
291
|
+
if page and page != current_page
|
292
|
+
classnames = span_class && span_class.index(' ') && span_class.split(' ', 2).last
|
293
|
+
page_link page, text, :rel => rel_value(page), :class => classnames
|
294
|
+
else
|
295
|
+
page_span page, text, :class => span_class
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
def page_link(page, text, attributes = {})
|
300
|
+
@template.link_to text, url_for(page), attributes
|
301
|
+
end
|
302
|
+
|
303
|
+
def page_span(page, text, attributes = {})
|
304
|
+
@template.content_tag :span, text, attributes
|
305
|
+
end
|
306
|
+
|
307
|
+
# Returns URL params for +page_link_or_span+, taking the current GET params
|
308
|
+
# and <tt>:params</tt> option into account.
|
309
|
+
def url_for(page)
|
310
|
+
page_one = page == 1
|
311
|
+
unless @url_string and !page_one
|
312
|
+
@url_params = {}
|
313
|
+
# page links should preserve GET parameters
|
314
|
+
stringified_merge @url_params, @template.params if @template.request.get?
|
315
|
+
stringified_merge @url_params, @options[:params] if @options[:params]
|
316
|
+
|
317
|
+
if complex = param_name.index(/[^\w-]/)
|
318
|
+
page_param = (defined?(CGIMethods) ? CGIMethods : ActionController::AbstractRequest).
|
319
|
+
parse_query_parameters("#{param_name}=#{page}")
|
320
|
+
|
321
|
+
stringified_merge @url_params, page_param
|
322
|
+
else
|
323
|
+
@url_params[param_name] = page_one ? 1 : 2
|
324
|
+
end
|
325
|
+
|
326
|
+
url = @template.url_for(@url_params)
|
327
|
+
return url if page_one
|
328
|
+
|
329
|
+
if complex
|
330
|
+
@url_string = url.sub(%r!((?:\?|&)#{CGI.escape param_name}=)#{page}!, '\1@')
|
331
|
+
return url
|
332
|
+
else
|
333
|
+
@url_string = url
|
334
|
+
@url_params[param_name] = 3
|
335
|
+
@template.url_for(@url_params).split(//).each_with_index do |char, i|
|
336
|
+
if char == '3' and url[i, 1] == '2'
|
337
|
+
@url_string[i] = '@'
|
338
|
+
break
|
339
|
+
end
|
340
|
+
end
|
341
|
+
end
|
342
|
+
end
|
343
|
+
# finally!
|
344
|
+
@url_string.sub '@', page.to_s
|
345
|
+
end
|
346
|
+
|
347
|
+
private
|
348
|
+
|
349
|
+
def rel_value(page)
|
350
|
+
case page
|
351
|
+
when @collection.previous_page; 'prev' + (page == 1 ? ' start' : '')
|
352
|
+
when @collection.next_page; 'next'
|
353
|
+
when 1; 'start'
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
def current_page
|
358
|
+
@collection.current_page
|
359
|
+
end
|
360
|
+
|
361
|
+
def total_pages
|
362
|
+
@total_pages ||= WillPaginate::ViewHelpers.total_pages_for_collection(@collection)
|
363
|
+
end
|
364
|
+
|
365
|
+
def param_name
|
366
|
+
@param_name ||= @options[:param_name].to_s
|
367
|
+
end
|
368
|
+
|
369
|
+
# Recursively merge into target hash by using stringified keys from the other one
|
370
|
+
def stringified_merge(target, other)
|
371
|
+
other.each do |key, value|
|
372
|
+
key = key.to_s # this line is what it's all about!
|
373
|
+
existing = target[key]
|
374
|
+
|
375
|
+
if value.is_a?(Hash) and (existing.is_a?(Hash) or existing.nil?)
|
376
|
+
stringified_merge(existing || (target[key] = {}), value)
|
377
|
+
else
|
378
|
+
target[key] = value
|
379
|
+
end
|
380
|
+
end
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|