Skip to content

Commit

Permalink
Merge branch 'master' into streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Jul 4, 2010
2 parents f22b4b5 + 5bf3294 commit d307853
Show file tree
Hide file tree
Showing 111 changed files with 1,424 additions and 869 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
*.gem
pkg
.bundle
Gemfile.lock
debug.log
doc/rdoc
activemodel/doc
Expand Down
8 changes: 5 additions & 3 deletions actionmailer/lib/action_mailer/base.rb
Expand Up @@ -540,7 +540,9 @@ def attachments
# :reply_to => 'bounces@test.lindsaar.net'
# end
#
# If you need other headers not listed above, use the <tt>headers['name'] = value</tt> method.
# If you need other headers not listed above, you can either pass them in
# as part of the headers hash or use the <tt>headers['name'] = value</tt>
# method.
#
# When a <tt>:return_path</tt> is specified as header, that value will be used as the 'envelope from'
# address for the Mail message. Setting this is useful when you want delivery notifications
Expand Down Expand Up @@ -746,13 +748,13 @@ def deprecated_url_options
raise "You can no longer call ActionMailer::Base.default_url_options " \
"directly. You need to set config.action_mailer.default_url_options. " \
"If you are using ActionMailer standalone, you need to include the " \
"url_helpers of a router directly."
"routing url_helpers directly."
end
end

# This module will complain if the user tries to set default_url_options
# directly instead of through the config object. In Action Mailer's Railtie,
# we include the url_helpers of the router, which will override this module
# we include the router's url_helpers, which will override this module.
extend DeprecatedUrlOptions

ActiveSupport.run_load_hooks(:action_mailer, self)
Expand Down
1 change: 1 addition & 0 deletions actionmailer/test/base_test.rb
@@ -1,5 +1,6 @@
# encoding: utf-8
require 'abstract_unit'
require 'active_support/time'

class BaseTest < ActiveSupport::TestCase
# TODO Add some tests for implicity layout render and url helpers
Expand Down
12 changes: 7 additions & 5 deletions actionmailer/test/old_base/url_test.rb
Expand Up @@ -28,7 +28,7 @@ def signed_up_with_url(recipient)
end
end

class ActionMailerUrlTest < Test::Unit::TestCase
class ActionMailerUrlTest < ActionMailer::TestCase

def encode( text, charset="UTF-8" )
quoted_printable( text, charset )
Expand Down Expand Up @@ -57,10 +57,12 @@ def teardown

def test_signed_up_with_url
UrlTestMailer.delivery_method = :test

AppRoutes.draw do |map|
map.connect ':controller/:action/:id'
map.welcome 'welcome', :controller=>"foo", :action=>"bar"

assert_deprecated do
AppRoutes.draw do |map|
map.connect ':controller/:action/:id'
map.welcome 'welcome', :controller=>"foo", :action=>"bar"
end
end

expected = new_mail
Expand Down
7 changes: 7 additions & 0 deletions actionpack/CHANGELOG
@@ -1,5 +1,12 @@
*Rails 3.0.0 [Release Candidate] (unreleased)*

* link_to, button_to, and tag/tag_options now rely on html_escape instead of escape_once. [fxn]

* url_for returns always unescaped strings, and the :escape option is gone. [fxn]

* Added accept-charset parameter and _snowman hidden field to force the contents
of Rails POSTed forms to be in UTF-8 [Yehuda Katz]

* Upgrade to Rack 1.2.1 [Jeremy Kemper]

* Allow :path to be given to match/get/post/put/delete instead of :path_names in the new router [Carlos Antônio da Silva]
Expand Down
2 changes: 1 addition & 1 deletion actionpack/actionpack.gemspec
Expand Up @@ -27,5 +27,5 @@ Gem::Specification.new do |s|
s.add_dependency('rack-test', '~> 0.5.4')
#s.add_dependency('rack-mount', '~> 0.6.6')
s.add_dependency('tzinfo', '~> 0.3.16')
s.add_dependency('erubis', '~> 2.6.5')
s.add_dependency('erubis', '~> 2.6.6')
end
4 changes: 2 additions & 2 deletions actionpack/lib/abstract_controller/rendering.rb
Expand Up @@ -50,8 +50,8 @@ def view_context_class
if controller.respond_to?(:_helpers)
include controller._helpers

if controller.respond_to?(:_router)
include controller._router.url_helpers
if controller.respond_to?(:_routes)
include controller._routes.url_helpers
end

# TODO: Fix RJS to not require this
Expand Down
10 changes: 5 additions & 5 deletions actionpack/lib/action_controller/metal/url_for.rb
Expand Up @@ -12,17 +12,17 @@ def url_options
).merge(:script_name => request.script_name)
end

def _router
raise "In order to use #url_for, you must include the helpers of a particular " \
"router. For instance, `include Rails.application.routes.url_helpers"
def _routes
raise "In order to use #url_for, you must include routing helpers explicitly. " \
"For instance, `include Rails.application.routes.url_helpers"
end

module ClassMethods
def action_methods
@action_methods ||= begin
super - _router.named_routes.helper_names
super - _routes.named_routes.helper_names
end
end
end
end
end
end
Expand Up @@ -64,6 +64,11 @@ def []=(key, value)
super(key.to_s, value)
end

def clear
load_for_write!
super
end

def to_hash
load_for_read!
h = {}.replace(self)
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/routing.rb
Expand Up @@ -167,7 +167,7 @@ module ActionDispatch
#
# You can reload routes if you feel you must:
#
# Rails::Application.reload_routes!
# Rails.application.reload_routes!
#
# This will clear all named routes and reload routes.rb if the file has been modified from
# last load. To absolutely force reloading, use <tt>reload!</tt>.
Expand Down
Expand Up @@ -31,7 +31,7 @@ def in_memory_controller_namespaces
class DeprecatedMapper #:nodoc:
def initialize(set) #:nodoc:
ActiveSupport::Deprecation.warn "You are using the old router DSL which will be removed in Rails 3.1. " <<
"Please check how to update your router file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/"
"Please check how to update your routes file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/"
@set = set
end

Expand Down

0 comments on commit d307853

Please sign in to comment.