Permalink
Browse files

Merge branch 'master' of git@github.com:rails/rails

  • Loading branch information...
2 parents eea5dc3 + 2dd0ec4 commit f3f67ce6212e2ae35470ab2960bb4967ae967ee2 @dhh dhh committed Nov 24, 2008
Showing with 415 additions and 458 deletions.
  1. +24 −14 actionmailer/lib/action_mailer.rb
  2. +8 −9 actionmailer/lib/action_mailer/base.rb
  3. +0 −2 actionmailer/lib/action_mailer/mail_helper.rb
  4. +2 −8 actionmailer/lib/action_mailer/part.rb
  5. +1 −1 actionmailer/lib/action_mailer/test_case.rb
  6. +1 −0 actionmailer/lib/action_mailer/test_helper.rb
  7. +0 −1 actionmailer/lib/action_mailer/utils.rb
  8. +0 −14 actionmailer/lib/action_mailer/vendor.rb
  9. +10 −0 actionmailer/lib/action_mailer/vendor/text_format.rb
  10. +17 −0 actionmailer/lib/action_mailer/vendor/tmail.rb
  11. +0 −1 actionmailer/test/quoting_test.rb
  12. +3 −1 actionpack/CHANGELOG
  13. +56 −40 actionpack/lib/action_controller.rb
  14. +0 −3 actionpack/lib/action_controller/assertions/response_assertions.rb
  15. +1 −2 actionpack/lib/action_controller/assertions/selector_assertions.rb
  16. +1 −4 actionpack/lib/action_controller/assertions/tag_assertions.rb
  17. +7 −8 actionpack/lib/action_controller/base.rb
  18. +8 −10 actionpack/lib/action_controller/caching.rb
  19. +0 −1 actionpack/lib/action_controller/cgi_process.rb
  20. +0 −4 actionpack/lib/action_controller/integration.rb
  21. +0 −1 actionpack/lib/action_controller/performance_test.rb
  22. +0 −1 actionpack/lib/action_controller/rack_process.rb
  23. +0 −1 actionpack/lib/action_controller/request_profiler.rb
  24. +0 −4 actionpack/lib/action_controller/resources.rb
  25. +0 −1 actionpack/lib/action_controller/routing.rb
  26. +2 −0 actionpack/lib/action_controller/routing/route_set.rb
  27. +0 −7 actionpack/lib/action_controller/session_management.rb
  28. +9 −0 actionpack/lib/action_controller/vendor/html-scanner.rb
  29. +21 −15 actionpack/lib/action_view.rb
  30. +1 −1 actionpack/lib/action_view/base.rb
  31. +38 −0 actionpack/lib/action_view/erb/util.rb
  32. +24 −5 actionpack/lib/action_view/helpers.rb
  33. +3 −4 actionpack/lib/action_view/helpers/number_helper.rb
  34. +1 −10 actionpack/lib/action_view/helpers/sanitize_helper.rb
  35. +0 −10 actionpack/lib/action_view/helpers/text_helper.rb
  36. +1 −0 actionpack/lib/action_view/locale/en.yml
  37. +23 −3 actionpack/lib/action_view/template_handler.rb
  38. +4 −5 actionpack/lib/action_view/template_handlers.rb
  39. +0 −39 actionpack/lib/action_view/template_handlers/erb.rb
  40. +0 −2 actionpack/lib/action_view/test_case.rb
  41. +1 −1 actionpack/test/abstract_unit.rb
  42. +0 −1 actionpack/test/activerecord/active_record_store_test.rb
  43. +3 −2 actionpack/test/controller/assert_select_test.rb
  44. +0 −1 actionpack/test/controller/cgi_test.rb
  45. +0 −2 actionpack/test/controller/dispatcher_test.rb
  46. +0 −2 actionpack/test/controller/integration_test.rb
  47. +0 −2 actionpack/test/controller/integration_upload_test.rb
  48. +0 −1 actionpack/test/controller/rack_test.rb
  49. +0 −1 actionpack/test/controller/request_test.rb
  50. +0 −1 actionpack/test/controller/routing_test.rb
  51. +0 −3 actionpack/test/controller/session/cookie_store_test.rb
  52. +0 −3 actionpack/test/controller/session/mem_cache_store_test.rb
  53. +2 −1 actionpack/test/template/form_options_helper_test.rb
  54. +3 −0 actionpack/test/template/number_helper_i18n_test.rb
  55. +11 −0 actionpack/test/template/render_test.rb
  56. +1 −1 activemodel/test/test_helper.rb
  57. +14 −15 activesupport/lib/active_support.rb
  58. +7 −6 activesupport/lib/active_support/cache.rb
  59. +2 −3 activesupport/lib/active_support/cache/drb_store.rb
  60. +1 −1 activesupport/lib/active_support/core_ext.rb
  61. +1 −2 activesupport/lib/active_support/core_ext/array/conversions.rb
  62. +2 −2 activesupport/lib/active_support/core_ext/file/atomic.rb
  63. +4 −3 activesupport/lib/active_support/core_ext/hash/conversions.rb
  64. +3 −1 activesupport/lib/active_support/core_ext/object/conversions.rb
  65. +0 −59 activesupport/lib/active_support/deprecation.rb
  66. +2 −0 activesupport/lib/active_support/duration.rb
  67. +8 −20 activesupport/lib/active_support/json/encoding.rb
  68. +2 −1 activesupport/lib/active_support/message_verifier.rb
  69. +8 −6 activesupport/lib/active_support/secure_random.rb
  70. +8 −10 activesupport/lib/active_support/test_case.rb
  71. +55 −0 activesupport/lib/active_support/testing/deprecation.rb
  72. +0 −45 activesupport/lib/active_support/testing/mocha_minitest_adapter.rb
  73. +1 −0 activesupport/lib/active_support/time_with_zone.rb
  74. +1 −0 activesupport/lib/active_support/values/time_zone.rb
  75. +2 −2 activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb
  76. +1 −1 activesupport/test/abstract_unit.rb
  77. +1 −0 activesupport/test/core_ext/hash_ext_test.rb
  78. +2 −21 railties/lib/console_with_helpers.rb
  79. +3 −6 railties/test/abstract_unit.rb
@@ -31,22 +31,32 @@
end
end
-require 'action_mailer/vendor'
-require 'tmail'
-
-require 'action_mailer/base'
-require 'action_mailer/helpers'
-require 'action_mailer/mail_helper'
-require 'action_mailer/quoting'
-require 'action_mailer/test_helper'
+module ActionMailer
+ def self.load_all!
+ [Base, Part, ::Text::Format, ::Net::SMTP]
+ end
-require 'net/smtp'
+ autoload :AdvAttrAccessor, 'action_mailer/adv_attr_accessor'
+ autoload :Base, 'action_mailer/base'
+ autoload :Helpers, 'action_mailer/helpers'
+ autoload :Part, 'action_mailer/part'
+ autoload :PartContainer, 'action_mailer/part_container'
+ autoload :Quoting, 'action_mailer/quoting'
+ autoload :TestCase, 'action_mailer/test_case'
+ autoload :TestHelper, 'action_mailer/test_helper'
+ autoload :Utils, 'action_mailer/utils'
+end
-ActionMailer::Base.class_eval do
- include ActionMailer::Quoting
- include ActionMailer::Helpers
+module Text
+ autoload :Format, 'action_mailer/vendor/text_format'
+end
- helper MailHelper
+module Net
+ autoload :SMTP, 'net/smtp'
end
-silence_warnings { TMail::Encoder.const_set("MAX_LINE_LEN", 200) }
+autoload :MailHelper, 'action_mailer/mail_helper'
+autoload :TMail, 'action_mailer/vendor/tmail'
+
+# TODO: Don't explicitly load entire lib
+ActionMailer.load_all!
@@ -1,9 +1,3 @@
-require 'action_mailer/adv_attr_accessor'
-require 'action_mailer/part'
-require 'action_mailer/part_container'
-require 'action_mailer/utils'
-require 'tmail/net'
-
module ActionMailer #:nodoc:
# Action Mailer allows you to send email from your application using a mailer model and views.
#
@@ -245,7 +239,7 @@ module ActionMailer #:nodoc:
# and appear last in the mime encoded message. You can also pick a different order from inside a method with
# +implicit_parts_order+.
class Base
- include AdvAttrAccessor, PartContainer
+ include AdvAttrAccessor, PartContainer, Quoting, Utils
if Object.const_defined?(:ActionController)
include ActionController::UrlWriter
include ActionController::Layout
@@ -648,11 +642,11 @@ def create_mail
if @parts.empty?
m.set_content_type(real_content_type, nil, ctype_attrs)
- m.body = Utils.normalize_new_lines(body)
+ m.body = normalize_new_lines(body)
else
if String === body
part = TMail::Mail.new
- part.body = Utils.normalize_new_lines(body)
+ part.body = normalize_new_lines(body)
part.set_content_type(real_content_type, nil, ctype_attrs)
part.set_content_disposition "inline"
m.parts << part
@@ -698,4 +692,9 @@ def perform_delivery_test(mail)
deliveries << mail
end
end
+
+ Base.class_eval do
+ include Helpers
+ helper MailHelper
+ end
end
@@ -1,5 +1,3 @@
-require 'text/format'
-
module MailHelper
# Uses Text::Format to take the text and format it, indented two spaces for
# each line, and wrapped at 72 columns.
@@ -1,15 +1,10 @@
-require 'action_mailer/adv_attr_accessor'
-require 'action_mailer/part_container'
-require 'action_mailer/utils'
-
module ActionMailer
# Represents a subpart of an email message. It shares many similar
# attributes of ActionMailer::Base. Although you can create parts manually
# and add them to the +parts+ list of the mailer, it is easier
# to use the helper methods in ActionMailer::PartContainer.
class Part
- include ActionMailer::AdvAttrAccessor
- include ActionMailer::PartContainer
+ include AdvAttrAccessor, PartContainer, Utils
# Represents the body of the part, as a string. This should not be a
# Hash (like ActionMailer::Base), but if you want a template to be rendered
@@ -64,7 +59,7 @@ def to_mail(defaults)
when "base64" then
part.body = TMail::Base64.folding_encode(body)
when "quoted-printable"
- part.body = [Utils.normalize_new_lines(body)].pack("M*")
+ part.body = [normalize_new_lines(body)].pack("M*")
else
part.body = body
end
@@ -102,7 +97,6 @@ def to_mail(defaults)
end
private
-
def squish(values={})
values.delete_if { |k,v| v.nil? }
end
@@ -10,7 +10,7 @@ def initialize(name)
end
class TestCase < ActiveSupport::TestCase
- include ActionMailer::Quoting
+ include Quoting, TestHelper
setup :initialize_test_deliveries
setup :set_expected_mail
@@ -58,6 +58,7 @@ def assert_no_emails(&block)
end
end
+# TODO: Deprecate this
module Test
module Unit
class TestCase
@@ -3,6 +3,5 @@ module Utils #:nodoc:
def normalize_new_lines(text)
text.to_s.gsub(/\r\n?/, "\n")
end
- module_function :normalize_new_lines
end
end
@@ -1,14 +0,0 @@
-# Prefer gems to the bundled libs.
-require 'rubygems'
-
-begin
- gem 'tmail', '~> 1.2.3'
-rescue Gem::LoadError
- $:.unshift "#{File.dirname(__FILE__)}/vendor/tmail-1.2.3"
-end
-
-begin
- gem 'text-format', '>= 0.6.3'
-rescue Gem::LoadError
- $:.unshift "#{File.dirname(__FILE__)}/vendor/text-format-0.6.3"
-end
@@ -0,0 +1,10 @@
+# Prefer gems to the bundled libs.
+require 'rubygems'
+
+begin
+ gem 'text-format', '>= 0.6.3'
+rescue Gem::LoadError
+ $:.unshift "#{File.dirname(__FILE__)}/text-format-0.6.3"
+end
+
+require 'text/format'
@@ -0,0 +1,17 @@
+# Prefer gems to the bundled libs.
+require 'rubygems'
+
+begin
+ gem 'tmail', '~> 1.2.3'
+rescue Gem::LoadError
+ $:.unshift "#{File.dirname(__FILE__)}/tmail-1.2.3"
+end
+
+module TMail
+end
+
+require 'tmail'
+
+silence_warnings do
+ TMail::Encoder.const_set("MAX_LINE_LEN", 200)
+end
@@ -1,6 +1,5 @@
# encoding: utf-8
require 'abstract_unit'
-require 'tmail'
require 'tempfile'
class QuotingTest < Test::Unit::TestCase
View
@@ -27,7 +27,9 @@
* Fixed RedCloth and BlueCloth shouldn't preload. Instead just assume that they're available if you want to use textilize and markdown and let autoload require them [DHH]
-*2.2.1 [RC2] (November 14th, 2008)*
+*2.2.2 (November 21st, 2008)*
+
+* I18n: translate number_to_human_size. Add storage_units: [Bytes, KB, MB, GB, TB] to your translations. #1448 [Yaroslav Markin]
* Restore backwards compatible functionality for setting relative_url_root. Include deprecation
@@ -32,47 +32,63 @@
end
$:.unshift "#{File.dirname(__FILE__)}/action_controller/vendor/html-scanner"
-require 'action_controller/vendor/rack'
-require 'action_controller/base'
-require 'action_controller/request'
-require 'action_controller/rescue'
-require 'action_controller/benchmarking'
-require 'action_controller/flash'
-require 'action_controller/filters'
-require 'action_controller/layout'
-require 'action_controller/mime_responds'
-require 'action_controller/helpers'
-require 'action_controller/cookies'
-require 'action_controller/cgi_process'
-require 'action_controller/caching'
-require 'action_controller/verification'
-require 'action_controller/streaming'
-require 'action_controller/session_management'
-require 'action_controller/http_authentication'
-require 'action_controller/rack_process'
-require 'action_controller/record_identifier'
-require 'action_controller/request_forgery_protection'
-require 'action_controller/headers'
-require 'action_controller/translation'
+module ActionController
+ # TODO: Review explicit to see if they will automatically be handled by
+ # the initilizer if they are really needed.
+ def self.load_all!
+ [Base, CgiRequest, CgiResponse, RackRequest, RackRequest, Http::Headers, UrlRewriter, UrlWriter]
+ end
-require 'action_view'
+ autoload :AbstractRequest, 'action_controller/request'
+ autoload :AbstractResponse, 'action_controller/response'
+ autoload :Base, 'action_controller/base'
+ autoload :Benchmarking, 'action_controller/benchmarking'
+ autoload :Caching, 'action_controller/caching'
+ autoload :CgiRequest, 'action_controller/cgi_process'
+ autoload :CgiResponse, 'action_controller/cgi_process'
+ autoload :Cookies, 'action_controller/cookies'
+ autoload :Dispatcher, 'action_controller/dispatcher'
+ autoload :Filters, 'action_controller/filters'
+ autoload :Flash, 'action_controller/flash'
+ autoload :Helpers, 'action_controller/helpers'
+ autoload :HttpAuthentication, 'action_controller/http_authentication'
+ autoload :IntegrationTest, 'action_controller/integration'
+ autoload :Layout, 'action_controller/layout'
+ autoload :MimeResponds, 'action_controller/mime_responds'
+ autoload :PolymorphicRoutes, 'action_controller/polymorphic_routes'
+ autoload :RackRequest, 'action_controller/rack_process'
+ autoload :RackResponse, 'action_controller/rack_process'
+ autoload :RecordIdentifier, 'action_controller/record_identifier'
+ autoload :RequestForgeryProtection, 'action_controller/request_forgery_protection'
+ autoload :Rescue, 'action_controller/rescue'
+ autoload :Resources, 'action_controller/resources'
+ autoload :Routing, 'action_controller/routing'
+ autoload :SessionManagement, 'action_controller/session_management'
+ autoload :StatusCodes, 'action_controller/status_codes'
+ autoload :Streaming, 'action_controller/streaming'
+ autoload :TestCase, 'action_controller/test_case'
+ autoload :TestProcess, 'action_controller/test_process'
+ autoload :Translation, 'action_controller/translation'
+ autoload :UrlRewriter, 'action_controller/url_rewriter'
+ autoload :UrlWriter, 'action_controller/url_rewriter'
+ autoload :Verification, 'action_controller/verification'
-ActionController::Base.class_eval do
- include ActionController::Flash
- include ActionController::Filters
- include ActionController::Layout
- include ActionController::Benchmarking
- include ActionController::Rescue
- include ActionController::MimeResponds
- include ActionController::Helpers
- include ActionController::Cookies
- include ActionController::Caching
- include ActionController::Verification
- include ActionController::Streaming
- include ActionController::SessionManagement
- include ActionController::HttpAuthentication::Basic::ControllerMethods
- include ActionController::RecordIdentifier
- include ActionController::RequestForgeryProtection
- include ActionController::Translation
+ module Http
+ autoload :Headers, 'action_controller/headers'
+ end
end
+
+class CGI
+ class Session
+ autoload :ActiveRecordStore, 'action_controller/session/active_record_store'
+ autoload :CookieStore, 'action_controller/session/cookie_store'
+ autoload :DRbStore, 'action_controller/session/drb_store'
+ autoload :MemCacheStore, 'action_controller/session/mem_cache_store'
+ end
+end
+
+autoload :Mime, 'action_controller/mime_type'
+autoload :Rack, 'action_controller/vendor/rack'
+
+ActionController.load_all!
@@ -1,6 +1,3 @@
-require 'rexml/document'
-require 'html/document'
-
module ActionController
module Assertions
# A small suite of assertions that test responses from Rails applications.
@@ -3,8 +3,7 @@
# Under MIT and/or CC By license.
#++
-require 'rexml/document'
-require 'html/document'
+require 'action_controller/vendor/html-scanner'
module ActionController
module Assertions
@@ -1,6 +1,3 @@
-require 'rexml/document'
-require 'html/document'
-
module ActionController
module Assertions
# Pair of assertions to testing elements in the HTML output of the response.
@@ -127,4 +124,4 @@ def assert_no_tag(*opts)
end
end
end
-end
+end
@@ -1,12 +1,4 @@
-require 'action_controller/mime_type'
-require 'action_controller/request'
-require 'action_controller/response'
-require 'action_controller/routing'
-require 'action_controller/resources'
-require 'action_controller/url_rewriter'
-require 'action_controller/status_codes'
require 'action_view'
-require 'drb'
require 'set'
module ActionController #:nodoc:
@@ -1332,4 +1324,11 @@ def process_cleanup
close_session
end
end
+
+ Base.class_eval do
+ include Flash, Filters, Layout, Benchmarking, Rescue, MimeResponds, Helpers
+ include Cookies, Caching, Verification, Streaming
+ include SessionManagement, HttpAuthentication::Basic::ControllerMethods
+ include RecordIdentifier, RequestForgeryProtection, Translation
+ end
end
Oops, something went wrong.

0 comments on commit f3f67ce

Please sign in to comment.