From d4f97345db514bc36f21f1ff23e1f2443d0bb054 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Sun, 7 Sep 2008 00:54:05 -0500 Subject: [PATCH] Rails 2.1.1 Among other things, a security fix. --- vendor/rails/actionmailer/CHANGELOG | 5 + vendor/rails/actionmailer/Rakefile | 11 +- .../actionmailer/lib/action_mailer/base.rb | 3 +- .../actionmailer/lib/action_mailer/version.rb | 2 +- .../rails/actionmailer/test/abstract_unit.rb | 19 +- vendor/rails/actionpack/CHANGELOG | 17 + vendor/rails/actionpack/Rakefile | 16 +- .../assertions/response_assertions.rb | 2 +- .../assertions/selector_assertions.rb | 74 +- .../actionpack/lib/action_controller/base.rb | 12 +- .../lib/action_controller/dispatcher.rb | 2 +- .../lib/action_controller/filters.rb | 389 +++--- .../action_controller/polymorphic_routes.rb | 37 +- .../action_controller/record_identifier.rb | 33 +- .../lib/action_controller/request.rb | 15 +- .../lib/action_controller/routing.rb | 6 +- .../lib/action_controller/routing/builder.rb | 3 +- .../lib/action_controller/routing/segments.rb | 2 +- .../templates/rescues/layout.erb | 2 +- .../lib/action_controller/test_process.rb | 6 +- .../vendor/html-scanner/html/document.rb | 2 +- .../lib/action_controller/verification.rb | 2 +- .../actionpack/lib/action_pack/version.rb | 2 +- .../rails/actionpack/lib/action_view/base.rb | 10 +- .../action_view/helpers/asset_tag_helper.rb | 27 +- .../lib/action_view/helpers/date_helper.rb | 6 +- .../lib/action_view/helpers/form_helper.rb | 6 +- .../helpers/form_options_helper.rb | 4 +- .../action_view/helpers/form_tag_helper.rb | 8 +- .../action_view/helpers/javascript_helper.rb | 8 +- .../action_view/helpers/prototype_helper.rb | 14 +- .../lib/action_view/helpers/tag_helper.rb | 7 +- .../lib/action_view/helpers/text_helper.rb | 2 +- .../lib/action_view/helpers/url_helper.rb | 8 +- .../lib/action_view/partial_template.rb | 2 +- .../controller/action_pack_assertions_test.rb | 29 +- .../test/controller/assert_select_test.rb | 7 +- .../actionpack/test/controller/base_test.rb | 38 +- .../test/controller/dispatcher_test.rb | 4 +- .../controller/html-scanner/document_test.rb | 25 + .../controller/integration_upload_test.rb | 2 +- .../test/controller/new_render_test.rb | 25 +- .../controller/polymorphic_routes_test.rb | 33 + .../actionpack/test/controller/render_test.rb | 2 +- .../test/controller/request_test.rb | 6 + .../test/controller/resources_test.rb | 32 +- .../test/controller/routing_test.rb | 24 +- .../actionpack/test/controller/test_test.rb | 13 +- .../test/controller/verification_test.rb | 51 +- .../test/render_file_from_template.html.erb | 1 + .../test/template/date_helper_test.rb | 67 +- .../template/deprecated_erb_variable_test.rb | 9 + .../test/template/form_options_helper_test.rb | 1057 ++++++++--------- .../test/template/form_tag_helper_test.rb | 13 + .../test/template/javascript_helper_test.rb | 11 +- .../test/template/prototype_helper_test.rb | 20 +- .../test/template/text_helper_test.rb | 1 + .../test/template/url_helper_test.rb | 12 +- vendor/rails/activemodel/Rakefile | 4 +- vendor/rails/activerecord/CHANGELOG | 34 + vendor/rails/activerecord/Rakefile | 11 +- .../rails/activerecord/lib/active_record.rb | 18 +- .../lib/active_record/association_preload.rb | 29 +- .../lib/active_record/associations.rb | 72 +- .../associations/association_collection.rb | 13 +- .../associations/association_proxy.rb | 8 +- .../has_and_belongs_to_many_association.rb | 5 +- .../associations/has_many_association.rb | 20 +- .../has_many_through_association.rb | 2 +- .../associations/has_one_association.rb | 4 +- .../has_one_through_association.rb | 4 + .../activerecord/lib/active_record/base.rb | 48 +- .../lib/active_record/calculations.rb | 27 +- .../abstract/schema_definitions.rb | 15 +- .../abstract/schema_statements.rb | 27 +- .../connection_adapters/mysql_adapter.rb | 77 +- .../connection_adapters/postgresql_adapter.rb | 86 +- .../connection_adapters/sqlite_adapter.rb | 12 + .../activerecord/lib/active_record/dirty.rb | 13 +- .../lib/active_record/locking/optimistic.rb | 1 + .../lib/active_record/migration.rb | 43 +- .../lib/active_record/named_scope.rb | 7 +- .../lib/active_record/observer.rb | 12 +- .../lib/active_record/test_case.rb | 17 +- .../lib/active_record/validations.rb | 28 +- .../activerecord/lib/active_record/version.rb | 2 +- .../cases/active_schema_test_postgresql.rb | 4 +- .../activerecord/test/cases/adapter_test.rb | 2 +- .../belongs_to_associations_test.rb | 19 + .../cascaded_eager_loading_test.rb | 14 +- ...eager_load_includes_full_sti_class_test.rb | 36 + .../test/cases/associations/eager_test.rb | 26 +- ...s_and_belongs_to_many_associations_test.rb | 32 +- .../has_many_associations_test.rb | 110 +- .../has_many_through_associations_test.rb | 10 + .../associations/has_one_associations_test.rb | 22 + .../has_one_through_associations_test.rb | 49 +- .../cases/associations/join_model_test.rb | 7 + .../test/cases/associations_test.rb | 4 +- .../test/cases/attribute_methods_test.rb | 20 +- .../activerecord/test/cases/base_test.rb | 55 +- .../test/cases/calculations_test.rb | 54 +- .../test/cases/column_definition_test.rb | 36 + .../test/cases/database_statements_test.rb | 12 + .../activerecord/test/cases/defaults_test.rb | 2 +- .../activerecord/test/cases/dirty_test.rb | 94 ++ .../activerecord/test/cases/finder_test.rb | 7 + .../rails/activerecord/test/cases/helper.rb | 10 +- .../test/cases/inheritance_test.rb | 11 +- .../activerecord/test/cases/lifecycle_test.rb | 55 +- .../activerecord/test/cases/locking_test.rb | 20 + .../test/cases/method_scoping_test.rb | 12 +- .../activerecord/test/cases/migration_test.rb | 169 ++- .../test/cases/multiple_db_test.rb | 2 +- .../test/cases/named_scope_test.rb | 51 +- .../test/cases/query_cache_test.rb | 7 +- .../test/cases/reflection_test.rb | 6 +- .../test/cases/schema_dumper_test.rb | 46 + .../test/cases/validations_test.rb | 35 +- .../rails/activerecord/test/models/author.rb | 4 + .../activerecord/test/models/category.rb | 1 + .../rails/activerecord/test/models/company.rb | 11 +- .../activerecord/test/models/developer.rb | 5 +- .../rails/activerecord/test/models/person.rb | 2 +- vendor/rails/activerecord/test/models/post.rb | 7 +- .../rails/activerecord/test/models/project.rb | 2 +- .../rails/activerecord/test/models/topic.rb | 1 + .../test/schema/mysql_specific_schema.rb | 4 +- .../rails/activerecord/test/schema/schema.rb | 8 + vendor/rails/activeresource/CHANGELOG | 5 + vendor/rails/activeresource/Rakefile | 12 +- .../lib/active_resource/base.rb | 24 +- .../lib/active_resource/connection.rb | 25 +- .../lib/active_resource/custom_methods.rb | 19 +- .../active_resource/formats/json_format.rb | 12 +- .../lib/active_resource/formats/xml_format.rb | 18 +- .../lib/active_resource/http_mock.rb | 2 +- .../lib/active_resource/version.rb | 2 +- .../activeresource/test/abstract_unit.rb | 24 +- .../test/base/custom_methods_test.rb | 3 +- vendor/rails/activeresource/test/base_test.rb | 61 +- .../activeresource/test/fixtures/customer.rb | 3 + .../rails/activeresource/test/format_test.rb | 34 +- vendor/rails/activesupport/CHANGELOG | 14 +- vendor/rails/activesupport/Rakefile | 15 +- .../rails/activesupport/lib/active_support.rb | 6 + .../activesupport/lib/active_support/cache.rb | 4 +- .../cache/compressed_mem_cache_store.rb | 8 +- .../active_support/core_ext/date/behavior.rb | 26 + .../core_ext/date/calculations.rb | 2 +- .../active_support/core_ext/hash/except.rb | 7 +- .../lib/active_support/core_ext/hash/slice.rb | 4 +- .../lib/active_support/core_ext/module.rb | 5 + .../core_ext/module/model_naming.rb | 22 + .../core_ext/object/extending.rb | 17 +- .../core_ext/range/blockless_step.rb | 4 +- .../lib/active_support/core_ext/rexml.rb | 35 + .../active_support/core_ext/string/unicode.rb | 24 +- .../lib/active_support/core_ext/time.rb | 23 +- .../lib/active_support/dependencies.rb | 803 ++++++------- .../lib/active_support/deprecation.rb | 36 +- .../lib/active_support/inflections.rb | 100 +- .../lib/active_support/inflector.rb | 579 ++++----- .../active_support/json/encoders/date_time.rb | 2 +- .../lib/active_support/ordered_options.rb | 26 +- .../lib/active_support/string_inquirer.rb | 11 + .../lib/active_support/time_with_zone.rb | 47 +- .../lib/active_support/values/time_zone.rb | 716 +++++------ .../lib/active_support/vendor.rb | 4 +- .../vendor/tzinfo-0.3.9/tzinfo.rb | 33 + .../tzinfo-0.3.9/tzinfo/data_timezone.rb | 47 + .../tzinfo-0.3.9/tzinfo/data_timezone_info.rb | 228 ++++ .../tzinfo/definitions/Africa/Algiers.rb | 55 + .../tzinfo/definitions/Africa/Cairo.rb | 219 ++++ .../tzinfo/definitions/Africa/Casablanca.rb | 40 + .../tzinfo/definitions/Africa/Harare.rb | 18 + .../tzinfo/definitions/Africa/Johannesburg.rb | 25 + .../tzinfo/definitions/Africa/Monrovia.rb | 22 + .../tzinfo/definitions/Africa/Nairobi.rb | 23 + .../America/Argentina/Buenos_Aires.rb | 166 +++ .../definitions/America/Argentina/San_Juan.rb | 170 +++ .../tzinfo/definitions/America/Bogota.rb | 23 + .../tzinfo/definitions/America/Caracas.rb | 23 + .../tzinfo/definitions/America/Chicago.rb | 283 +++++ .../tzinfo/definitions/America/Chihuahua.rb | 136 +++ .../tzinfo/definitions/America/Denver.rb | 204 ++++ .../tzinfo/definitions/America/Godthab.rb | 161 +++ .../tzinfo/definitions/America/Guatemala.rb | 27 + .../tzinfo/definitions/America/Halifax.rb | 274 +++++ .../America/Indiana/Indianapolis.rb | 149 +++ .../tzinfo/definitions/America/Juneau.rb | 194 +++ .../tzinfo/definitions/America/La_Paz.rb | 22 + .../tzinfo/definitions/America/Lima.rb | 35 + .../tzinfo/definitions/America/Los_Angeles.rb | 232 ++++ .../tzinfo/definitions/America/Mazatlan.rb | 139 +++ .../tzinfo/definitions/America/Mexico_City.rb | 144 +++ .../tzinfo/definitions/America/Monterrey.rb | 131 ++ .../tzinfo/definitions/America/New_York.rb | 282 +++++ .../tzinfo/definitions/America/Phoenix.rb | 30 + .../tzinfo/definitions/America/Regina.rb | 74 ++ .../tzinfo/definitions/America/Santiago.rb | 205 ++++ .../tzinfo/definitions/America/St_Johns.rb | 288 +++++ .../tzinfo/definitions/America/Tijuana.rb | 196 +++ .../tzinfo/definitions/Asia/Almaty.rb | 67 ++ .../tzinfo/definitions/Asia/Baghdad.rb | 73 ++ .../tzinfo/definitions/Asia/Baku.rb | 161 +++ .../tzinfo/definitions/Asia/Bangkok.rb | 20 + .../tzinfo/definitions/Asia/Chongqing.rb | 33 + .../tzinfo/definitions/Asia/Dhaka.rb | 27 + .../tzinfo/definitions/Asia/Hong_Kong.rb | 87 ++ .../tzinfo/definitions/Asia/Irkutsk.rb | 165 +++ .../tzinfo/definitions/Asia/Jakarta.rb | 30 + .../tzinfo/definitions/Asia/Jerusalem.rb | 163 +++ .../tzinfo/definitions/Asia/Kabul.rb | 20 + .../tzinfo/definitions/Asia/Kamchatka.rb | 163 +++ .../tzinfo/definitions/Asia/Karachi.rb | 30 + .../tzinfo/definitions/Asia/Katmandu.rb | 20 + .../tzinfo/definitions/Asia/Kolkata.rb | 25 + .../tzinfo/definitions/Asia/Krasnoyarsk.rb | 163 +++ .../tzinfo/definitions/Asia/Kuala_Lumpur.rb | 31 + .../tzinfo/definitions/Asia/Kuwait.rb | 18 + .../tzinfo/definitions/Asia/Magadan.rb | 163 +++ .../tzinfo/definitions/Asia/Muscat.rb | 18 + .../tzinfo/definitions/Asia/Novosibirsk.rb | 164 +++ .../tzinfo/definitions/Asia/Rangoon.rb | 24 + .../tzinfo/definitions/Asia/Riyadh.rb | 18 + .../tzinfo/definitions/Asia/Seoul.rb | 34 + .../tzinfo/definitions/Asia/Shanghai.rb | 35 + .../tzinfo/definitions/Asia/Singapore.rb | 33 + .../tzinfo/definitions/Asia/Taipei.rb | 59 + .../tzinfo/definitions/Asia/Tashkent.rb | 47 + .../tzinfo/definitions/Asia/Tbilisi.rb | 78 ++ .../tzinfo/definitions/Asia/Tehran.rb | 121 ++ .../tzinfo/definitions/Asia/Tokyo.rb | 30 + .../tzinfo/definitions/Asia/Ulaanbaatar.rb | 65 + .../tzinfo/definitions/Asia/Urumqi.rb | 33 + .../tzinfo/definitions/Asia/Vladivostok.rb | 164 +++ .../tzinfo/definitions/Asia/Yakutsk.rb | 163 +++ .../tzinfo/definitions/Asia/Yekaterinburg.rb | 165 +++ .../tzinfo/definitions/Asia/Yerevan.rb | 165 +++ .../tzinfo/definitions/Atlantic/Azores.rb | 270 +++++ .../tzinfo/definitions/Atlantic/Cape_Verde.rb | 23 + .../definitions/Atlantic/South_Georgia.rb | 18 + .../tzinfo/definitions/Australia/Adelaide.rb | 187 +++ .../tzinfo/definitions/Australia/Brisbane.rb | 35 + .../tzinfo/definitions/Australia/Darwin.rb | 29 + .../tzinfo/definitions/Australia/Hobart.rb | 193 +++ .../tzinfo/definitions/Australia/Melbourne.rb | 185 +++ .../tzinfo/definitions/Australia/Perth.rb | 37 + .../tzinfo/definitions/Australia/Sydney.rb | 185 +++ .../tzinfo/definitions/Etc/UTC.rb | 16 + .../tzinfo/definitions/Europe/Amsterdam.rb | 228 ++++ .../tzinfo/definitions/Europe/Athens.rb | 185 +++ .../tzinfo/definitions/Europe/Belgrade.rb | 163 +++ .../tzinfo/definitions/Europe/Berlin.rb | 188 +++ .../tzinfo/definitions/Europe/Bratislava.rb | 13 + .../tzinfo/definitions/Europe/Brussels.rb | 232 ++++ .../tzinfo/definitions/Europe/Bucharest.rb | 181 +++ .../tzinfo/definitions/Europe/Budapest.rb | 197 +++ .../tzinfo/definitions/Europe/Copenhagen.rb | 179 +++ .../tzinfo/definitions/Europe/Dublin.rb | 276 +++++ .../tzinfo/definitions/Europe/Helsinki.rb | 163 +++ .../tzinfo/definitions/Europe/Istanbul.rb | 218 ++++ .../tzinfo/definitions/Europe/Kiev.rb | 168 +++ .../tzinfo/definitions/Europe/Lisbon.rb | 268 +++++ .../tzinfo/definitions/Europe/Ljubljana.rb | 13 + .../tzinfo/definitions/Europe/London.rb | 288 +++++ .../tzinfo/definitions/Europe/Madrid.rb | 211 ++++ .../tzinfo/definitions/Europe/Minsk.rb | 170 +++ .../tzinfo/definitions/Europe/Moscow.rb | 181 +++ .../tzinfo/definitions/Europe/Paris.rb | 232 ++++ .../tzinfo/definitions/Europe/Prague.rb | 187 +++ .../tzinfo/definitions/Europe/Riga.rb | 176 +++ .../tzinfo/definitions/Europe/Rome.rb | 215 ++++ .../tzinfo/definitions/Europe/Sarajevo.rb | 13 + .../tzinfo/definitions/Europe/Skopje.rb | 13 + .../tzinfo/definitions/Europe/Sofia.rb | 173 +++ .../tzinfo/definitions/Europe/Stockholm.rb | 165 +++ .../tzinfo/definitions/Europe/Tallinn.rb | 172 +++ .../tzinfo/definitions/Europe/Vienna.rb | 183 +++ .../tzinfo/definitions/Europe/Vilnius.rb | 170 +++ .../tzinfo/definitions/Europe/Warsaw.rb | 212 ++++ .../tzinfo/definitions/Europe/Zagreb.rb | 13 + .../tzinfo/definitions/Pacific/Auckland.rb | 202 ++++ .../tzinfo/definitions/Pacific/Fiji.rb | 23 + .../tzinfo/definitions/Pacific/Guam.rb | 22 + .../tzinfo/definitions/Pacific/Honolulu.rb | 28 + .../tzinfo/definitions/Pacific/Majuro.rb | 20 + .../tzinfo/definitions/Pacific/Midway.rb | 25 + .../tzinfo/definitions/Pacific/Noumea.rb | 25 + .../tzinfo/definitions/Pacific/Pago_Pago.rb | 26 + .../definitions/Pacific/Port_Moresby.rb | 20 + .../tzinfo/definitions/Pacific/Tongatapu.rb | 27 + .../tzinfo-0.3.9/tzinfo/info_timezone.rb | 52 + .../tzinfo-0.3.9/tzinfo/linked_timezone.rb | 51 + .../tzinfo/linked_timezone_info.rb | 44 + .../tzinfo-0.3.9/tzinfo/offset_rationals.rb | 95 ++ .../tzinfo-0.3.9/tzinfo/time_or_datetime.rb | 292 +++++ .../vendor/tzinfo-0.3.9/tzinfo/timezone.rb | 508 ++++++++ .../tzinfo/timezone_definition.rb | 56 + .../tzinfo-0.3.9/tzinfo/timezone_info.rb | 40 + .../tzinfo/timezone_offset_info.rb | 94 ++ .../tzinfo-0.3.9/tzinfo/timezone_period.rb | 198 +++ .../tzinfo/timezone_transition_info.rb | 138 +++ .../lib/active_support/version.rb | 2 +- .../rails/activesupport/test/caching_test.rb | 6 + .../test/core_ext/array_ext_test.rb | 27 +- .../activesupport/test/core_ext/bigdecimal.rb | 1 + .../activesupport/test/core_ext/class_test.rb | 2 +- .../test/core_ext/date_ext_test.rb | 25 +- .../test/core_ext/date_time_ext_test.rb | 24 +- .../test/core_ext/duration_test.rb | 8 +- .../test/core_ext/hash_ext_test.rb | 21 + .../test/core_ext/module/model_naming_test.rb | 19 + .../test/core_ext/time_ext_test.rb | 81 +- .../test/core_ext/time_with_zone_test.rb | 450 ++++--- .../activesupport/test/dependencies_test.rb | 240 ++-- .../activesupport/test/deprecation_test.rb | 10 + vendor/rails/activesupport/test/gzip_test.rb | 7 + .../activesupport/test/inflector_test.rb | 124 +- .../test/ordered_options_test.rb | 6 +- .../test/string_inquirer_test.rb | 15 + .../activesupport/test/time_zone_test.rb | 135 ++- vendor/rails/railties/CHANGELOG | 15 + vendor/rails/railties/Rakefile | 20 +- vendor/rails/railties/bin/about | 3 +- .../rails_info/rails/info_controller.rb | 2 +- .../configs/initializers/inflections.rb | 2 +- .../initializers/new_rails_defaults.rb | 10 +- vendor/rails/railties/configs/routes.rb | 2 + vendor/rails/railties/environments/boot.rb | 8 +- .../railties/environments/environment.rb | 2 +- vendor/rails/railties/lib/commands/about.rb | 1 + .../rails/railties/lib/commands/dbconsole.rb | 2 + vendor/rails/railties/lib/commands/plugin.rb | 4 +- .../railties/lib/console_with_helpers.rb | 2 +- vendor/rails/railties/lib/initializer.rb | 59 +- .../railties/lib/rails/gem_dependency.rb | 53 +- vendor/rails/railties/lib/rails/plugin.rb | 21 +- .../rails/railties/lib/rails/plugin/loader.rb | 4 +- .../railties/lib/rails/plugin/locator.rb | 9 +- vendor/rails/railties/lib/rails/version.rb | 2 +- .../railties/lib/rails_generator/commands.rb | 19 +- .../observer/templates/unit_test.rb | 2 +- .../railties/lib/rails_generator/lookup.rb | 2 +- .../rails/railties/lib/tasks/databases.rake | 32 +- .../railties/lib/tasks/documentation.rake | 4 +- vendor/rails/railties/lib/tasks/misc.rake | 2 +- vendor/rails/railties/lib/tasks/rails.rb | 2 +- .../railties/test/gem_dependency_test.rb | 25 +- .../test/generators/generator_test_helper.rb | 3 +- .../rails/railties/test/initializer_test.rb | 34 +- .../rails/railties/test/plugin_loader_test.rb | 10 +- .../test/rails_info_controller_test.rb | 4 + 354 files changed, 21027 insertions(+), 3072 deletions(-) create mode 100644 vendor/rails/actionpack/test/fixtures/test/render_file_from_template.html.erb create mode 100644 vendor/rails/actionpack/test/template/deprecated_erb_variable_test.rb create mode 100644 vendor/rails/activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb create mode 100644 vendor/rails/activerecord/test/cases/column_definition_test.rb create mode 100644 vendor/rails/activerecord/test/cases/database_statements_test.rb create mode 100644 vendor/rails/activeresource/test/fixtures/customer.rb create mode 100644 vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb create mode 100644 vendor/rails/activesupport/lib/active_support/core_ext/rexml.rb create mode 100644 vendor/rails/activesupport/lib/active_support/string_inquirer.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/data_timezone.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/data_timezone_info.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Algiers.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Cairo.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Casablanca.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Harare.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Johannesburg.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Monrovia.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Africa/Nairobi.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Argentina/Buenos_Aires.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Argentina/San_Juan.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Bogota.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Caracas.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Chicago.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Chihuahua.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Denver.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Godthab.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Guatemala.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Halifax.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Indiana/Indianapolis.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Juneau.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/La_Paz.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Lima.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Los_Angeles.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Mazatlan.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Mexico_City.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Monterrey.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/New_York.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Phoenix.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Regina.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Santiago.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/St_Johns.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/America/Tijuana.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Almaty.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Baghdad.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Baku.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Bangkok.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Chongqing.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Dhaka.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Hong_Kong.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Irkutsk.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Jakarta.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Jerusalem.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kabul.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kamchatka.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Karachi.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Katmandu.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kolkata.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Krasnoyarsk.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kuala_Lumpur.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Kuwait.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Magadan.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Muscat.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Novosibirsk.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Rangoon.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Riyadh.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Seoul.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Shanghai.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Singapore.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Taipei.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Tashkent.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Tbilisi.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Tehran.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Tokyo.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Ulaanbaatar.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Urumqi.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Vladivostok.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Yakutsk.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Yekaterinburg.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Asia/Yerevan.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Atlantic/Azores.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Atlantic/Cape_Verde.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Atlantic/South_Georgia.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Adelaide.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Brisbane.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Darwin.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Hobart.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Melbourne.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Perth.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Australia/Sydney.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Etc/UTC.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Amsterdam.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Athens.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Belgrade.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Berlin.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Bratislava.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Brussels.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Bucharest.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Budapest.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Copenhagen.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Dublin.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Helsinki.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Istanbul.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Kiev.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Lisbon.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Ljubljana.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/London.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Madrid.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Minsk.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Moscow.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Paris.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Prague.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Riga.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Rome.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Sarajevo.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Skopje.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Sofia.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Stockholm.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Tallinn.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Vienna.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Vilnius.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Warsaw.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Europe/Zagreb.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Auckland.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Fiji.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Guam.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Honolulu.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Majuro.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Midway.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Noumea.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Pago_Pago.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Port_Moresby.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/definitions/Pacific/Tongatapu.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/info_timezone.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/linked_timezone.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/linked_timezone_info.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/offset_rationals.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/time_or_datetime.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_definition.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_info.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_offset_info.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_period.rb create mode 100644 vendor/rails/activesupport/lib/active_support/vendor/tzinfo-0.3.9/tzinfo/timezone_transition_info.rb create mode 100644 vendor/rails/activesupport/test/core_ext/module/model_naming_test.rb create mode 100644 vendor/rails/activesupport/test/gzip_test.rb create mode 100644 vendor/rails/activesupport/test/string_inquirer_test.rb diff --git a/vendor/rails/actionmailer/CHANGELOG b/vendor/rails/actionmailer/CHANGELOG index bdae0d4d..c873cbf1 100644 --- a/vendor/rails/actionmailer/CHANGELOG +++ b/vendor/rails/actionmailer/CHANGELOG @@ -1,3 +1,8 @@ +*2.1.1 (September 4th, 2008)* + +* Included in Rails 2.1.1 + + *2.1.0 (May 31st, 2008)* * Fixed that a return-path header would be ignored #7572 [joost] diff --git a/vendor/rails/actionmailer/Rakefile b/vendor/rails/actionmailer/Rakefile index c09526cb..db785c73 100755 --- a/vendor/rails/actionmailer/Rakefile +++ b/vendor/rails/actionmailer/Rakefile @@ -5,6 +5,8 @@ require 'rake/rdoctask' require 'rake/packagetask' require 'rake/gempackagetask' require 'rake/contrib/sshpublisher' +require 'rake/contrib/rubyforgepublisher' + require File.join(File.dirname(__FILE__), 'lib', 'action_mailer', 'version') PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : '' @@ -35,7 +37,7 @@ Rake::RDocTask.new { |rdoc| rdoc.title = "Action Mailer -- Easy email delivery and testing" rdoc.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object' rdoc.options << '--charset' << 'utf-8' - rdoc.template = "#{ENV['template']}.rb" if ENV['template'] + rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' rdoc.rdoc_files.include('README', 'CHANGELOG') rdoc.rdoc_files.include('lib/action_mailer.rb') rdoc.rdoc_files.include('lib/action_mailer/*.rb') @@ -55,7 +57,7 @@ spec = Gem::Specification.new do |s| s.rubyforge_project = "actionmailer" s.homepage = "http://www.rubyonrails.org" - s.add_dependency('actionpack', '= 2.1.0' + PKG_BUILD) + s.add_dependency('actionpack', '= 2.1.1' + PKG_BUILD) s.has_rdoc = true s.requirements << 'none' @@ -76,12 +78,13 @@ end desc "Publish the API documentation" task :pgem => [:package] do - Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload + Rake::SshFilePublisher.new("david@greed.loudthinking.com", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload + `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'` end desc "Publish the API documentation" task :pdoc => [:rdoc] do - Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/am", "doc").upload + Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/am", "doc").upload end desc "Publish the release files to RubyForge." diff --git a/vendor/rails/actionmailer/lib/action_mailer/base.rb b/vendor/rails/actionmailer/lib/action_mailer/base.rb index e0651321..51fc6032 100644 --- a/vendor/rails/actionmailer/lib/action_mailer/base.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/base.rb @@ -530,7 +530,7 @@ module ActionMailer #:nodoc: end def render_message(method_name, body) - render :file => method_name, :body => body + render :file => method_name, :body => body, :use_full_path => true end def render(opts) @@ -538,6 +538,7 @@ module ActionMailer #:nodoc: if opts[:file] && opts[:file] !~ /\// opts[:file] = "#{mailer_name}/#{opts[:file]}" end + opts[:use_full_path] = true initialize_template_class(body).render(opts) end diff --git a/vendor/rails/actionmailer/lib/action_mailer/version.rb b/vendor/rails/actionmailer/lib/action_mailer/version.rb index c35b648b..4c407b3f 100644 --- a/vendor/rails/actionmailer/lib/action_mailer/version.rb +++ b/vendor/rails/actionmailer/lib/action_mailer/version.rb @@ -2,7 +2,7 @@ module ActionMailer module VERSION #:nodoc: MAJOR = 2 MINOR = 1 - TINY = 0 + TINY = 1 STRING = [MAJOR, MINOR, TINY].join('.') end diff --git a/vendor/rails/actionmailer/test/abstract_unit.rb b/vendor/rails/actionmailer/test/abstract_unit.rb index 9b7a4661..107b2e8b 100644 --- a/vendor/rails/actionmailer/test/abstract_unit.rb +++ b/vendor/rails/actionmailer/test/abstract_unit.rb @@ -30,13 +30,20 @@ class Net::SMTP end end -# Wrap tests that use Mocha and skip if unavailable. -def uses_mocha(test_name) - gem 'mocha', ">=0.5" - require 'stubba' +def uses_gem(gem_name, test_name, version = '> 0') + require 'rubygems' + gem gem_name.to_s, version + require gem_name.to_s yield -rescue Gem::LoadError - $stderr.puts "Skipping #{test_name} tests (Mocha >= 0.5 is required). `gem install mocha` and try again." +rescue LoadError + $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again." +end + +# Wrap tests that use Mocha and skip if unavailable. +unless defined? uses_mocha + def uses_mocha(test_name, &block) + uses_gem('mocha', test_name, '>= 0.5.5', &block) + end end def set_delivery_method(delivery_method) diff --git a/vendor/rails/actionpack/CHANGELOG b/vendor/rails/actionpack/CHANGELOG index cb684a92..f44fc68f 100644 --- a/vendor/rails/actionpack/CHANGELOG +++ b/vendor/rails/actionpack/CHANGELOG @@ -1,3 +1,20 @@ +*2.1.1 (September 4th, 2008)* + +* All 2xx requests are considered successful [Josh Peek] + +* Deprecate the limited follow_redirect in functional tests. If you wish to follow redirects, use integration tests. [Michael Koziarski] + +* Fixed that AssetTagHelper#compute_public_path shouldn't cache the asset_host along with the source or per-request proc's won't run [DHH] + +* Deprecate define_javascript_functions, javascript_include_tag and friends are much better [Michael Koziarski] + +* Fix polymorphic_url with singleton resources. #461 [Tammer Saleh] + +* Deprecate ActionView::Base.erb_variable. Use the concat helper method instead of appending to it directly. [Jeremy Kemper] + +* Fixed Request#remote_ip to only raise hell if the HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR doesn't match (not just if they're both present) [Mark Imbriaco, Bradford Folkens] + + *2.1.0 (May 31st, 2008)* * InstanceTag#default_time_from_options overflows to DateTime [Geoff Buesing] diff --git a/vendor/rails/actionpack/Rakefile b/vendor/rails/actionpack/Rakefile index b37f756c..3ea18cb1 100644 --- a/vendor/rails/actionpack/Rakefile +++ b/vendor/rails/actionpack/Rakefile @@ -5,6 +5,8 @@ require 'rake/rdoctask' require 'rake/packagetask' require 'rake/gempackagetask' require 'rake/contrib/sshpublisher' +require 'rake/contrib/rubyforgepublisher' + require File.join(File.dirname(__FILE__), 'lib', 'action_pack', 'version') PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : '' @@ -49,12 +51,14 @@ Rake::RDocTask.new { |rdoc| rdoc.title = "Action Pack -- On rails from request to response" rdoc.options << '--line-numbers' << '--inline-source' rdoc.options << '--charset' << 'utf-8' - rdoc.template = "#{ENV['template']}.rb" if ENV['template'] + rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo' if ENV['DOC_FILES'] rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/)) else rdoc.rdoc_files.include('README', 'RUNNING_UNIT_TESTS', 'CHANGELOG') - rdoc.rdoc_files.include('lib/**/*.rb') + rdoc.rdoc_files.include(Dir['lib/**/*.rb'] - + Dir['lib/*/vendor/**/*.rb']) + rdoc.rdoc_files.exclude('lib/actionpack.rb') end } @@ -76,7 +80,7 @@ spec = Gem::Specification.new do |s| s.has_rdoc = true s.requirements << 'none' - s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD) + s.add_dependency('activesupport', '= 2.1.1' + PKG_BUILD) s.require_path = 'lib' s.autorequire = 'action_controller' @@ -132,13 +136,13 @@ task :update_js => [ :update_scriptaculous ] desc "Publish the API documentation" task :pgem => [:package] do - Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload - `ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'` + Rake::SshFilePublisher.new("david@greed.loudthinking.com", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload + `ssh david@greed.loudthinking.com '/u/sites/gems/gemupdate.sh'` end desc "Publish the API documentation" task :pdoc => [:rdoc] do - Rake::SshDirPublisher.new("davidhh@wrath.rubyonrails.org", "public_html/ap", "doc").upload + Rake::SshDirPublisher.new("wrath.rubyonrails.org", "public_html/ap", "doc").upload end desc "Publish the release files to RubyForge." diff --git a/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb b/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb index c5fc6c79..3deda0b4 100644 --- a/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +++ b/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb @@ -97,7 +97,7 @@ module ActionController value['controller'] = value['controller'].to_s if key == :actual && value['controller'].first != '/' && !value['controller'].include?('/') new_controller_path = ActionController::Routing.controller_relative_to(value['controller'], @controller.class.controller_path) - value['controller'] = new_controller_path if value['controller'] != new_controller_path && ActionController::Routing.possible_controllers.include?(new_controller_path) + value['controller'] = new_controller_path if value['controller'] != new_controller_path && ActionController::Routing.possible_controllers.include?(new_controller_path) && @response.redirected_to.is_a?(Hash) end value['controller'] = value['controller'][1..-1] if value['controller'].first == '/' # strip leading hash end diff --git a/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb b/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb index d3594e71..65e60bd4 100644 --- a/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +++ b/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb @@ -398,47 +398,31 @@ module ActionController # # The same, but shorter. # assert_select "ol>li", 4 def assert_select_rjs(*args, &block) - rjs_type = nil - arg = args.shift + rjs_type = args.first.is_a?(Symbol) ? args.shift : nil + id = args.first.is_a?(String) ? args.shift : nil # If the first argument is a symbol, it's the type of RJS statement we're looking # for (update, replace, insertion, etc). Otherwise, we're looking for just about # any RJS statement. - if arg.is_a?(Symbol) - rjs_type = arg - + if rjs_type if rjs_type == :insert - arg = args.shift - insertion = "insert_#{arg}".to_sym - raise ArgumentError, "Unknown RJS insertion type #{arg}" unless RJS_STATEMENTS[insertion] + position = args.shift + insertion = "insert_#{position}".to_sym + raise ArgumentError, "Unknown RJS insertion type #{position}" unless RJS_STATEMENTS[insertion] statement = "(#{RJS_STATEMENTS[insertion]})" else raise ArgumentError, "Unknown RJS statement type #{rjs_type}" unless RJS_STATEMENTS[rjs_type] statement = "(#{RJS_STATEMENTS[rjs_type]})" end - arg = args.shift else statement = "#{RJS_STATEMENTS[:any]}" end # Next argument we're looking for is the element identifier. If missing, we pick - # any element. - if arg.is_a?(String) - id = Regexp.quote(arg) - arg = args.shift - else - id = "[^\"]*" - end - - pattern = - case rjs_type - when :chained_replace, :chained_replace_html - Regexp.new("\\$\\(\"#{id}\"\\)#{statement}\\(#{RJS_PATTERN_HTML}\\)", Regexp::MULTILINE) - when :remove, :show, :hide, :toggle - Regexp.new("#{statement}\\(\"#{id}\"\\)") - else - Regexp.new("#{statement}\\(\"#{id}\", #{RJS_PATTERN_HTML}\\)", Regexp::MULTILINE) - end + # any element, otherwise we replace it in the statement. + pattern = Regexp.new( + id ? statement.gsub(RJS_ANY_ID, "\"#{id}\"") : statement + ) # Duplicate the body since the next step involves destroying it. matches = nil @@ -447,7 +431,7 @@ module ActionController matches = @response.body.match(pattern) else @response.body.gsub(pattern) do |match| - html = unescape_rjs($2) + html = unescape_rjs(match) matches ||= [] matches.concat HTML::Document.new(html).root.children.select { |n| n.tag? } "" @@ -577,27 +561,23 @@ module ActionController protected unless const_defined?(:RJS_STATEMENTS) - RJS_STATEMENTS = { - :replace => /Element\.replace/, - :replace_html => /Element\.update/, - :chained_replace => /\.replace/, - :chained_replace_html => /\.update/, - :remove => /Element\.remove/, - :show => /Element\.show/, - :hide => /Element\.hide/, - :toggle => /Element\.toggle/ + RJS_PATTERN_HTML = "\"((\\\\\"|[^\"])*)\"" + RJS_ANY_ID = "\"([^\"])*\"" + RJS_STATEMENTS = { + :chained_replace => "\\$\\(#{RJS_ANY_ID}\\)\\.replace\\(#{RJS_PATTERN_HTML}\\)", + :chained_replace_html => "\\$\\(#{RJS_ANY_ID}\\)\\.update\\(#{RJS_PATTERN_HTML}\\)", + :replace_html => "Element\\.update\\(#{RJS_ANY_ID}, #{RJS_PATTERN_HTML}\\)", + :replace => "Element\\.replace\\(#{RJS_ANY_ID}, #{RJS_PATTERN_HTML}\\)" } - RJS_INSERTIONS = [:top, :bottom, :before, :after] - RJS_INSERTIONS.each do |insertion| - RJS_STATEMENTS["insert_#{insertion}".to_sym] = Regexp.new(Regexp.quote("new Insertion.#{insertion.to_s.camelize}")) + [:remove, :show, :hide, :toggle].each do |action| + RJS_STATEMENTS[action] = "Element\\.#{action}\\(#{RJS_ANY_ID}\\)" end + RJS_INSERTIONS = ["top", "bottom", "before", "after"] + RJS_INSERTIONS.each do |insertion| + RJS_STATEMENTS["insert_#{insertion}".to_sym] = "Element.insert\\(#{RJS_ANY_ID}, \\{ #{insertion}: #{RJS_PATTERN_HTML} \\}\\)" + end + RJS_STATEMENTS[:insert_html] = "Element.insert\\(#{RJS_ANY_ID}, \\{ (#{RJS_INSERTIONS.join('|')}): #{RJS_PATTERN_HTML} \\}\\)" RJS_STATEMENTS[:any] = Regexp.new("(#{RJS_STATEMENTS.values.join('|')})") - RJS_STATEMENTS[:insert_html] = Regexp.new(RJS_INSERTIONS.collect do |insertion| - Regexp.quote("new Insertion.#{insertion.to_s.camelize}") - end.join('|')) - RJS_PATTERN_HTML = /"((\\"|[^"])*)"/ - RJS_PATTERN_EVERYTHING = Regexp.new("#{RJS_STATEMENTS[:any]}\\(\"([^\"]*)\", #{RJS_PATTERN_HTML}\\)", - Regexp::MULTILINE) RJS_PATTERN_UNICODE_ESCAPED_CHAR = /\\u([0-9a-zA-Z]{4})/ end @@ -611,8 +591,8 @@ module ActionController root = HTML::Node.new(nil) while true - next if body.sub!(RJS_PATTERN_EVERYTHING) do |match| - html = unescape_rjs($3) + next if body.sub!(RJS_STATEMENTS[:any]) do |match| + html = unescape_rjs(match) matches = HTML::Document.new(html).root.children.select { |n| n.tag? } root.children.concat matches "" diff --git a/vendor/rails/actionpack/lib/action_controller/base.rb b/vendor/rails/actionpack/lib/action_controller/base.rb index a036600c..d0c70a79 100755 --- a/vendor/rails/actionpack/lib/action_controller/base.rb +++ b/vendor/rails/actionpack/lib/action_controller/base.rb @@ -613,8 +613,9 @@ module ActionController #:nodoc: # # This takes the current URL as is and only exchanges the action. In contrast, url_for :action => 'print' # would have slashed-off the path components after the changed action. - def url_for(options = nil) #:doc: - case options || {} + def url_for(options = {}) + options ||= {} + case options when String options when Hash @@ -743,6 +744,9 @@ module ActionController #:nodoc: # # Renders the template located in [TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails, app/views/weblog/show.erb) # render :template => "weblog/show" # + # # Renders the template with a local variable + # render :template => "weblog/show", :locals => {:customer => Customer.new} + # # === Rendering a file # # File rendering works just like action rendering except that it takes a filesystem path. By default, the path @@ -865,7 +869,7 @@ module ActionController #:nodoc: render_for_file(file, options[:status], options[:use_full_path], options[:locals] || {}) elsif template = options[:template] - render_for_file(template, options[:status], true) + render_for_file(template, options[:status], true, options[:locals] || {}) elsif inline = options[:inline] add_variables_to_assigns @@ -1147,7 +1151,7 @@ module ActionController #:nodoc: def log_processing if logger && logger.info? - logger.info "\n\nProcessing #{controller_class_name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]" + logger.info "\n\nProcessing #{self.class.name}\##{action_name} (for #{request_origin}) [#{request.method.to_s.upcase}]" logger.info " Session ID: #{@_session.session_id}" if @_session and @_session.respond_to?(:session_id) logger.info " Parameters: #{respond_to?(:filter_parameters) ? filter_parameters(params).inspect : params.inspect}" end diff --git a/vendor/rails/actionpack/lib/action_controller/dispatcher.rb b/vendor/rails/actionpack/lib/action_controller/dispatcher.rb index 6e1e7a26..4389b296 100644 --- a/vendor/rails/actionpack/lib/action_controller/dispatcher.rb +++ b/vendor/rails/actionpack/lib/action_controller/dispatcher.rb @@ -135,7 +135,7 @@ module ActionController # be reloaded on the next request without restarting the server. def cleanup_application ActiveRecord::Base.reset_subclasses if defined?(ActiveRecord) - Dependencies.clear + ActiveSupport::Dependencies.clear ActiveRecord::Base.clear_reloadable_connections! if defined?(ActiveRecord) end diff --git a/vendor/rails/actionpack/lib/action_controller/filters.rb b/vendor/rails/actionpack/lib/action_controller/filters.rb index 60d92d9b..155d8b48 100644 --- a/vendor/rails/actionpack/lib/action_controller/filters.rb +++ b/vendor/rails/actionpack/lib/action_controller/filters.rb @@ -7,6 +7,200 @@ module ActionController #:nodoc: end end + class FilterChain < ActiveSupport::Callbacks::CallbackChain #:nodoc: + def append_filter_to_chain(filters, filter_type, &block) + pos = find_filter_append_position(filters, filter_type) + update_filter_chain(filters, filter_type, pos, &block) + end + + def prepend_filter_to_chain(filters, filter_type, &block) + pos = find_filter_prepend_position(filters, filter_type) + update_filter_chain(filters, filter_type, pos, &block) + end + + def create_filters(filters, filter_type, &block) + filters, conditions = extract_options(filters, &block) + filters.map! { |filter| find_or_create_filter(filter, filter_type, conditions) } + filters + end + + def skip_filter_in_chain(*filters, &test) + filters, conditions = extract_options(filters) + filters.each do |filter| + if callback = find(filter) then delete(callback) end + end if conditions.empty? + update_filter_in_chain(filters, :skip => conditions, &test) + end + + private + def update_filter_chain(filters, filter_type, pos, &block) + new_filters = create_filters(filters, filter_type, &block) + insert(pos, new_filters).flatten! + end + + def find_filter_append_position(filters, filter_type) + # appending an after filter puts it at the end of the call chain + # before and around filters go before the first after filter in the chain + unless filter_type == :after + each_with_index do |f,i| + return i if f.after? + end + end + return -1 + end + + def find_filter_prepend_position(filters, filter_type) + # prepending a before or around filter puts it at the front of the call chain + # after filters go before the first after filter in the chain + if filter_type == :after + each_with_index do |f,i| + return i if f.after? + end + return -1 + end + return 0 + end + + def find_or_create_filter(filter, filter_type, options = {}) + update_filter_in_chain([filter], options) + + if found_filter = find(filter) { |f| f.type == filter_type } + found_filter + else + filter_kind = case + when filter.respond_to?(:before) && filter_type == :before + :before + when filter.respond_to?(:after) && filter_type == :after + :after + else + :filter + end + + case filter_type + when :before + BeforeFilter.new(filter_kind, filter, options) + when :after + AfterFilter.new(filter_kind, filter, options) + else + AroundFilter.new(filter_kind, filter, options) + end + end + end + + def update_filter_in_chain(filters, options, &test) + filters.map! { |f| block_given? ? find(f, &test) : find(f) } + filters.compact! + + map! do |filter| + if filters.include?(filter) + new_filter = filter.dup + new_filter.options.merge!(options) + new_filter + else + filter + end + end + end + end + + class Filter < ActiveSupport::Callbacks::Callback #:nodoc: + def before? + self.class == BeforeFilter + end + + def after? + self.class == AfterFilter + end + + def around? + self.class == AroundFilter + end + + private + def should_not_skip?(controller) + if options[:skip] + !included_in_action?(controller, options[:skip]) + else + true + end + end + + def included_in_action?(controller, options) + if options[:only] + Array(options[:only]).map(&:to_s).include?(controller.action_name) + elsif options[:except] + !Array(options[:except]).map(&:to_s).include?(controller.action_name) + else + true + end + end + + def should_run_callback?(controller) + should_not_skip?(controller) && included_in_action?(controller, options) && super + end + end + + class AroundFilter < Filter #:nodoc: + def type + :around + end + + def call(controller, &block) + if should_run_callback?(controller) + method = filter_responds_to_before_and_after? ? around_proc : self.method + + # For around_filter do |controller, action| + if method.is_a?(Proc) && method.arity == 2 + evaluate_method(method, controller, block) + else + evaluate_method(method, controller, &block) + end + else + block.call + end + end + + private + def filter_responds_to_before_and_after? + method.respond_to?(:before) && method.respond_to?(:after) + end + + def around_proc + Proc.new do |controller, action| + method.before(controller) + + if controller.send!(:performed?) + controller.send!(:halt_filter_chain, method, :rendered_or_redirected) + else + begin + action.call + ensure + method.after(controller) + end + end + end + end + end + + class BeforeFilter < Filter #:nodoc: + def type + :before + end + + def call(controller, &block) + super + if controller.send!(:performed?) + controller.send!(:halt_filter_chain, method, :rendered_or_redirected) + end + end + end + + class AfterFilter < Filter #:nodoc: + def type + :after + end + end + # Filters enable controllers to run shared pre- and post-processing code for its actions. These filters can be used to do # authentication, caching, or auditing before the intended action is performed. Or to do localization or output # compression after the action has been performed. Filters have access to the request, response, and all the instance @@ -245,201 +439,6 @@ module ActionController #:nodoc: # filter and controller action will not be run. If +before+ renders or redirects, # the second half of +around+ and will still run but +after+ and the # action will not. If +around+ fails to yield, +after+ will not be run. - - class FilterChain < ActiveSupport::Callbacks::CallbackChain #:nodoc: - def append_filter_to_chain(filters, filter_type, &block) - pos = find_filter_append_position(filters, filter_type) - update_filter_chain(filters, filter_type, pos, &block) - end - - def prepend_filter_to_chain(filters, filter_type, &block) - pos = find_filter_prepend_position(filters, filter_type) - update_filter_chain(filters, filter_type, pos, &block) - end - - def create_filters(filters, filter_type, &block) - filters, conditions = extract_options(filters, &block) - filters.map! { |filter| find_or_create_filter(filter, filter_type, conditions) } - filters - end - - def skip_filter_in_chain(*filters, &test) - filters, conditions = extract_options(filters) - filters.each do |filter| - if callback = find(filter) then delete(callback) end - end if conditions.empty? - update_filter_in_chain(filters, :skip => conditions, &test) - end - - private - def update_filter_chain(filters, filter_type, pos, &block) - new_filters = create_filters(filters, filter_type, &block) - insert(pos, new_filters).flatten! - end - - def find_filter_append_position(filters, filter_type) - # appending an after filter puts it at the end of the call chain - # before and around filters go before the first after filter in the chain - unless filter_type == :after - each_with_index do |f,i| - return i if f.after? - end - end - return -1 - end - - def find_filter_prepend_position(filters, filter_type) - # prepending a before or around filter puts it at the front of the call chain - # after filters go before the first after filter in the chain - if filter_type == :after - each_with_index do |f,i| - return i if f.after? - end - return -1 - end - return 0 - end - - def find_or_create_filter(filter, filter_type, options = {}) - update_filter_in_chain([filter], options) - - if found_filter = find(filter) { |f| f.type == filter_type } - found_filter - else - filter_kind = case - when filter.respond_to?(:before) && filter_type == :before - :before - when filter.respond_to?(:after) && filter_type == :after - :after - else - :filter - end - - case filter_type - when :before - BeforeFilter.new(filter_kind, filter, options) - when :after - AfterFilter.new(filter_kind, filter, options) - else - AroundFilter.new(filter_kind, filter, options) - end - end - end - - def update_filter_in_chain(filters, options, &test) - filters.map! { |f| block_given? ? find(f, &test) : find(f) } - filters.compact! - - map! do |filter| - if filters.include?(filter) - new_filter = filter.dup - new_filter.options.merge!(options) - new_filter - else - filter - end - end - end - end - - class Filter < ActiveSupport::Callbacks::Callback #:nodoc: - def before? - self.class == BeforeFilter - end - - def after? - self.class == AfterFilter - end - - def around? - self.class == AroundFilter - end - - private - def should_not_skip?(controller) - if options[:skip] - !included_in_action?(controller, options[:skip]) - else - true - end - end - - def included_in_action?(controller, options) - if options[:only] - Array(options[:only]).map(&:to_s).include?(controller.action_name) - elsif options[:except] - !Array(options[:except]).map(&:to_s).include?(controller.action_name) - else - true - end - end - - def should_run_callback?(controller) - should_not_skip?(controller) && included_in_action?(controller, options) && super - end - end - - class AroundFilter < Filter #:nodoc: - def type - :around - end - - def call(controller, &block) - if should_run_callback?(controller) - method = filter_responds_to_before_and_after? ? around_proc : self.method - - # For around_filter do |controller, action| - if method.is_a?(Proc) && method.arity == 2 - evaluate_method(method, controller, block) - else - evaluate_method(method, controller, &block) - end - else - block.call - end - end - - private - def filter_responds_to_before_and_after? - method.respond_to?(:before) && method.respond_to?(:after) - end - - def around_proc - Proc.new do |controller, action| - method.before(controller) - - if controller.send!(:performed?) - controller.send!(:halt_filter_chain, method, :rendered_or_redirected) - else - begin - action.call - ensure - method.after(controller) - end - end - end - end - end - - class BeforeFilter < Filter #:nodoc: - def type - :before - end - - def call(controller, &block) - super - if controller.send!(:performed?) - controller.send!(:halt_filter_chain, method, :rendered_or_redirected) - end - end - end - - class AfterFilter < Filter #:nodoc: - def type - :after - end - end - module ClassMethods # The passed filters will be appended to the filter_chain and # will execute before the action on this controller is performed. diff --git a/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb b/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb index 509fa6a0..7c30bf07 100644 --- a/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb +++ b/vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb @@ -48,6 +48,9 @@ module ActionController # # # calls post_url(post) # polymorphic_url(post) # => "http://example.com/posts/1" + # polymorphic_url([blog, post]) # => "http://example.com/blogs/1/posts/1" + # polymorphic_url([:admin, blog, post]) # => "http://example.com/admin/blogs/1/posts/1" + # polymorphic_url([user, :blog, post]) # => "http://example.com/users/1/blog/posts/1" # # ==== Options # @@ -83,8 +86,6 @@ module ActionController else [ record_or_hash_or_array ] end - args << format if format - inflection = case when options[:action].to_s == "new" @@ -96,6 +97,9 @@ module ActionController else :singular end + + args.delete_if {|arg| arg.is_a?(Symbol) || arg.is_a?(String)} + args << format if format named_route = build_named_route_call(record_or_hash_or_array, namespace, inflection, options) send!(named_route, *args) @@ -136,11 +140,19 @@ module ActionController else record = records.pop route = records.inject("") do |string, parent| - string << "#{RecordIdentifier.send!("singular_class_name", parent)}_" + if parent.is_a?(Symbol) || parent.is_a?(String) + string << "#{parent}_" + else + string << "#{RecordIdentifier.send!("singular_class_name", parent)}_" + end end end - route << "#{RecordIdentifier.send!("#{inflection}_class_name", record)}_" + if record.is_a?(Symbol) || record.is_a?(String) + route << "#{record}_" + else + route << "#{RecordIdentifier.send!("#{inflection}_class_name", record)}_" + end action_prefix(options) + namespace + route + routing_type(options).to_s end @@ -163,16 +175,17 @@ module ActionController end end + # Remove the first symbols from the array and return the url prefix + # implied by those symbols. def extract_namespace(record_or_hash_or_array) - returning "" do |namespace| - if record_or_hash_or_array.is_a?(Array) - record_or_hash_or_array.delete_if do |record_or_namespace| - if record_or_namespace.is_a?(String) || record_or_namespace.is_a?(Symbol) - namespace << "#{record_or_namespace}_" - end - end - end + return "" unless record_or_hash_or_array.is_a?(Array) + + namespace_keys = [] + while (key = record_or_hash_or_array.first) && key.is_a?(String) || key.is_a?(Symbol) + namespace_keys << record_or_hash_or_array.shift end + + namespace_keys.map {|k| "#{k}_"}.join end end end diff --git a/vendor/rails/actionpack/lib/action_controller/record_identifier.rb b/vendor/rails/actionpack/lib/action_controller/record_identifier.rb index 643ff7e5..742d290a 100644 --- a/vendor/rails/actionpack/lib/action_controller/record_identifier.rb +++ b/vendor/rails/actionpack/lib/action_controller/record_identifier.rb @@ -31,18 +31,21 @@ module ActionController module RecordIdentifier extend self + JOIN = '_'.freeze + NEW = 'new'.freeze + # Returns plural/singular for a record or class. Example: # # partial_path(post) # => "posts/post" # partial_path(Person) # => "people/person" # partial_path(Person, "admin/games") # => "admin/people/person" def partial_path(record_or_class, controller_path = nil) - klass = class_from_record_or_class(record_or_class) + name = model_name_from_record_or_class(record_or_class) if controller_path && controller_path.include?("/") - "#{File.dirname(controller_path)}/#{klass.name.tableize}/#{klass.name.demodulize.underscore}" + "#{File.dirname(controller_path)}/#{name.partial_path}" else - "#{klass.name.tableize}/#{klass.name.demodulize.underscore}" + name.partial_path end end @@ -56,21 +59,25 @@ module ActionController # dom_class(post, :edit) # => "edit_post" # dom_class(Person, :edit) # => "edit_person" def dom_class(record_or_class, prefix = nil) - [ prefix, singular_class_name(record_or_class) ].compact * '_' + singular = singular_class_name(record_or_class) + prefix ? "#{prefix}#{JOIN}#{singular}" : singular end # The DOM id convention is to use the singular form of an object or class with the id following an underscore. # If no id is found, prefix with "new_" instead. Examples: # - # dom_id(Post.new(:id => 45)) # => "post_45" + # dom_id(Post.find(45)) # => "post_45" # dom_id(Post.new) # => "new_post" # # If you need to address multiple instances of the same class in the same view, you can prefix the dom_id: # - # dom_id(Post.new(:id => 45), :edit) # => "edit_post_45" + # dom_id(Post.find(45), :edit) # => "edit_post_45" def dom_id(record, prefix = nil) - prefix ||= 'new' unless record.id - [ prefix, singular_class_name(record), record.id ].compact * '_' + if record_id = record.id + "#{dom_class(record, prefix)}#{JOIN}#{record_id}" + else + dom_class(record, prefix || NEW) + end end # Returns the plural class name of a record or class. Examples: @@ -78,7 +85,7 @@ module ActionController # plural_class_name(post) # => "posts" # plural_class_name(Highrise::Person) # => "highrise_people" def plural_class_name(record_or_class) - singular_class_name(record_or_class).pluralize + model_name_from_record_or_class(record_or_class).plural end # Returns the singular class name of a record or class. Examples: @@ -86,12 +93,12 @@ module ActionController # singular_class_name(post) # => "post" # singular_class_name(Highrise::Person) # => "highrise_person" def singular_class_name(record_or_class) - class_from_record_or_class(record_or_class).name.underscore.tr('/', '_') + model_name_from_record_or_class(record_or_class).singular end private - def class_from_record_or_class(record_or_class) - record_or_class.is_a?(Class) ? record_or_class : record_or_class.class + def model_name_from_record_or_class(record_or_class) + (record_or_class.is_a?(Class) ? record_or_class : record_or_class.class).model_name end end -end \ No newline at end of file +end diff --git a/vendor/rails/actionpack/lib/action_controller/request.rb b/vendor/rails/actionpack/lib/action_controller/request.rb index a35b9041..ad1fe11d 100755 --- a/vendor/rails/actionpack/lib/action_controller/request.rb +++ b/vendor/rails/actionpack/lib/action_controller/request.rb @@ -134,14 +134,17 @@ module ActionController # REMOTE_ADDR is a proxy. HTTP_X_FORWARDED_FOR may be a comma- # delimited list in the case of multiple chained proxies; the last # address which is not trusted is the originating IP. - def remote_ip - if TRUSTED_PROXIES !~ @env['REMOTE_ADDR'] - return @env['REMOTE_ADDR'] + remote_addr_list = @env['REMOTE_ADDR'] && @env['REMOTE_ADDR'].split(',').collect(&:strip) + + unless remote_addr_list.blank? + not_trusted_addrs = remote_addr_list.reject {|addr| addr =~ TRUSTED_PROXIES} + return not_trusted_addrs.first unless not_trusted_addrs.empty? end + remote_ips = @env['HTTP_X_FORWARDED_FOR'] && @env['HTTP_X_FORWARDED_FOR'].split(',') if @env.include? 'HTTP_CLIENT_IP' - if @env.include? 'HTTP_X_FORWARDED_FOR' + if remote_ips && !remote_ips.include?(@env['HTTP_CLIENT_IP']) # We don't know which came from the proxy, and which from the user raise ActionControllerError.new(< 1 && TRUSTED_PROXIES =~ remote_ips.last.strip remote_ips.pop end diff --git a/vendor/rails/actionpack/lib/action_controller/routing.rb b/vendor/rails/actionpack/lib/action_controller/routing.rb index 6aa26651..dfbaa53b 100644 --- a/vendor/rails/actionpack/lib/action_controller/routing.rb +++ b/vendor/rails/actionpack/lib/action_controller/routing.rb @@ -88,6 +88,10 @@ module ActionController # # map.connect ':controller/:action/:id', :action => 'show', :defaults => { :page => 'Dashboard' } # + # Note: The default routes, as provided by the Rails generator, make all actions in every + # controller accessible via GET requests. You should consider removing them or commenting + # them out if you're using named routes and resources. + # # == Named routes # # Routes can be named with the syntax map.name_of_route options, @@ -369,7 +373,7 @@ module ActionController Routes = RouteSet.new - ::Inflector.module_eval do + ActiveSupport::Inflector.module_eval do # Ensures that routes are reloaded when Rails inflections are updated. def inflections_with_route_reloading(&block) returning(inflections_without_route_reloading(&block)) { diff --git a/vendor/rails/actionpack/lib/action_controller/routing/builder.rb b/vendor/rails/actionpack/lib/action_controller/routing/builder.rb index 4740113e..b8323847 100644 --- a/vendor/rails/actionpack/lib/action_controller/routing/builder.rb +++ b/vendor/rails/actionpack/lib/action_controller/routing/builder.rb @@ -67,10 +67,9 @@ module ActionController options = options.dup if options[:namespace] - options[:controller] = "#{options[:path_prefix]}/#{options[:controller]}" + options[:controller] = "#{options.delete(:namespace).sub(/\/$/, '')}/#{options[:controller]}" options.delete(:path_prefix) options.delete(:name_prefix) - options.delete(:namespace) end requirements = (options.delete(:requirements) || {}).dup diff --git a/vendor/rails/actionpack/lib/action_controller/routing/segments.rb b/vendor/rails/actionpack/lib/action_controller/routing/segments.rb index e6729201..3afe2e89 100644 --- a/vendor/rails/actionpack/lib/action_controller/routing/segments.rb +++ b/vendor/rails/actionpack/lib/action_controller/routing/segments.rb @@ -248,7 +248,7 @@ module ActionController end def extract_value - "#{local_name} = hash[:#{key}] && hash[:#{key}].collect { |path_component| CGI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}" + "#{local_name} = hash[:#{key}] && Array(hash[:#{key}]).collect { |path_component| CGI.escape(path_component.to_param, ActionController::Routing::Segment::UNSAFE_PCHAR) }.to_param #{"|| #{default.inspect}" if default}" end def default diff --git a/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb b/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb index d38f3e67..4a04742e 100644 --- a/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb +++ b/vendor/rails/actionpack/lib/action_controller/templates/rescues/layout.erb @@ -1,4 +1,4 @@ - + Action Controller: Exception caught