Permalink
Browse files

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

  • Loading branch information...
heavysixer
heavysixer committed Oct 25, 2008
2 parents 35f29f7 + 650aa01 commit 14f05140e53f4f58bc86ee08b9a4ba836c14f9be
Showing with 890 additions and 126 deletions.
  1. +3 −0 actionmailer/CHANGELOG
  2. +3 −3 actionmailer/Rakefile
  3. +3 −1 actionpack/CHANGELOG
  4. +3 −3 actionpack/Rakefile
  5. +9 −2 actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
  6. +15 −0 actionpack/test/controller/html-scanner/cdata_node_test.rb
  7. +21 −0 actionpack/test/controller/html-scanner/node_test.rb
  8. +10 −0 actionpack/test/controller/html-scanner/sanitizer_test.rb
  9. +3 −1 activerecord/CHANGELOG
  10. +3 −3 activerecord/Rakefile
  11. +1 −1 activerecord/lib/active_record/associations.rb
  12. +7 −0 activerecord/test/cases/associations/has_many_associations_test.rb
  13. +1 −1 activeresource/CHANGELOG
  14. +3 −3 activeresource/Rakefile
  15. +1 −1 activeresource/lib/active_resource/version.rb
  16. +1 −1 activesupport/CHANGELOG
  17. +2 −2 activesupport/Rakefile
  18. +1 −1 railties/CHANGELOG
  19. +8 −8 railties/Rakefile
  20. +79 −29 railties/doc/guides/html/2_2_release_notes.html
  21. +1 −1 railties/doc/guides/html/actioncontroller_basics.html
  22. +154 −12 railties/doc/guides/html/getting_started_with_rails.html
  23. +140 −8 railties/doc/guides/html/layouts_and_rendering.html
  24. +54 −2 railties/doc/guides/html/security.html
  25. +50 −29 railties/doc/guides/source/2_2_release_notes.txt
  26. +1 −1 railties/doc/guides/source/actioncontroller_basics/methods.txt
  27. +128 −3 railties/doc/guides/source/getting_started_with_rails.txt
  28. +124 −8 railties/doc/guides/source/layouts_and_rendering.txt
  29. +61 −2 railties/doc/guides/source/security.txt
View
@@ -1,8 +1,11 @@
+*2.2.0 [RC1] (October 24th, 2008)*
+
* Add layout functionality to mailers [Pratik]
Mailer layouts behaves just like controller layouts, except layout names need to
have '_mailer' postfix for them to be automatically picked up.
+
*2.1.0 (May 31st, 2008)*
* Fixed that a return-path header would be ignored #7572 [joost]
View
@@ -55,7 +55,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.2.0' + PKG_BUILD)
s.has_rdoc = true
s.requirements << 'none'
@@ -76,8 +76,8 @@ end
desc "Publish the API documentation"
task :pgem => [:package] do
- Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh wrath.rubyonrails.org './gemupdate.sh'`
+ Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
desc "Publish the API documentation"
View
@@ -1,4 +1,6 @@
-*Edge*
+*2.2.0 [RC1] (October 24th, 2008)*
+
+* Fix incorrect closing CDATA delimiter and that HTML::Node.parse would blow up on unclosed CDATA sections [packagethief]
* Added stale? and fresh_when methods to provide a layer of abstraction above request.fresh? and friends [DHH]. Example:
View
@@ -80,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.2.0' + PKG_BUILD)
s.require_path = 'lib'
s.autorequire = 'action_controller'
@@ -136,8 +136,8 @@ task :update_js => [ :update_scriptaculous ]
desc "Publish the API documentation"
task :pgem => [:package] do
- Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh wrath.rubyonrails.org './gemupdate.sh'`
+ Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
desc "Publish the API documentation"
@@ -150,7 +150,14 @@ def parse(parent, line, pos, content, strict=true)
end
if scanner.skip(/!\[CDATA\[/)
- scanner.scan_until(/\]\]>/)
+ unless scanner.skip_until(/\]\]>/)
+ if strict
+ raise "expected ]]> (got #{scanner.rest.inspect} for #{content})"
+ else
+ scanner.skip_until(/\Z/)
+ end
+ end
+
return CDATA.new(parent, line, pos, scanner.pre_match.gsub(/<!\[CDATA\[/, ''))
end
@@ -265,7 +272,7 @@ def ==(node)
# itself.
class CDATA < Text #:nodoc:
def to_s
- "<![CDATA[#{super}]>"
+ "<![CDATA[#{super}]]>"
end
end
@@ -0,0 +1,15 @@
+require 'abstract_unit'
+
+class CDATANodeTest < Test::Unit::TestCase
+ def setup
+ @node = HTML::CDATA.new(nil, 0, 0, "<p>howdy</p>")
+ end
+
+ def test_to_s
+ assert_equal "<![CDATA[<p>howdy</p>]]>", @node.to_s
+ end
+
+ def test_content
+ assert_equal "<p>howdy</p>", @node.content
+ end
+end
@@ -65,4 +65,25 @@ def test_parse_with_unclosed_tag
assert_nothing_raised { node = HTML::Node.parse(nil,0,0,s,false) }
assert node.attributes.has_key?("onmouseover")
end
+
+ def test_parse_with_valid_cdata_section
+ s = "<![CDATA[<span>contents</span>]]>"
+ node = nil
+ assert_nothing_raised { node = HTML::Node.parse(nil,0,0,s,false) }
+ assert_kind_of HTML::CDATA, node
+ assert_equal '<span>contents</span>', node.content
+ end
+
+ def test_parse_strict_with_unterminated_cdata_section
+ s = "<![CDATA[neverending..."
+ assert_raise(RuntimeError) { HTML::Node.parse(nil,0,0,s) }
+ end
+
+ def test_parse_relaxed_with_unterminated_cdata_section
+ s = "<![CDATA[neverending..."
+ node = nil
+ assert_nothing_raised { node = HTML::Node.parse(nil,0,0,s,false) }
+ assert_kind_of HTML::CDATA, node
+ assert_equal 'neverending...', node.content
+ end
end
@@ -17,6 +17,8 @@ def test_strip_tags
%{This is a test.\n\n\nIt no longer contains any HTML.\n}, sanitizer.sanitize(
%{<title>This is <b>a <a href="" target="_blank">test</a></b>.</title>\n\n<!-- it has a comment -->\n\n<p>It no <b>longer <strong>contains <em>any <strike>HTML</strike></em>.</strong></b></p>\n}))
assert_equal "This has a here.", sanitizer.sanitize("This has a <!-- comment --> here.")
+ assert_equal "This has a here.", sanitizer.sanitize("This has a <![CDATA[<section>]]> here.")
+ assert_equal "This has an unclosed ", sanitizer.sanitize("This has an unclosed <![CDATA[<section>]] here...")
[nil, '', ' '].each { |blank| assert_equal blank, sanitizer.sanitize(blank) }
end
@@ -243,6 +245,14 @@ def test_should_sanitize_img_vbscript
assert_sanitized %(<img src='vbscript:msgbox("XSS")' />), '<img />'
end
+ def test_should_sanitize_cdata_section
+ assert_sanitized "<![CDATA[<span>section</span>]]>", "&lt;![CDATA[&lt;span>section&lt;/span>]]>"
+ end
+
+ def test_should_sanitize_unterminated_cdata_section
+ assert_sanitized "<![CDATA[<span>neverending...", "&lt;![CDATA[&lt;span>neverending...]]>"
+ end
+
protected
def assert_sanitized(input, expected = nil)
@sanitizer ||= HTML::WhiteListSanitizer.new
View
@@ -1,4 +1,6 @@
-*Edge*
+*2.2.0 [RC1] (October 24th, 2008)*
+
+* Skip collection ids reader optimization if using :finder_sql [Jeremy Kemper]
* Add Model#delete instance method, similar to Model.delete class method. #1086 [Hongli Lai]
View
@@ -171,7 +171,7 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
- s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.2.0' + PKG_BUILD)
s.files.delete FIXTURES_ROOT + "/fixture_database.sqlite"
s.files.delete FIXTURES_ROOT + "/fixture_database_2.sqlite"
@@ -225,8 +225,8 @@ end
desc "Publish the beta gem"
task :pgem => [:package] do
- Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh wrath.rubyonrails.org './gemupdate.sh'`
+ Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
desc "Publish the API documentation"
@@ -1296,7 +1296,7 @@ def collection_reader_method(reflection, association_proxy_class)
end
define_method("#{reflection.name.to_s.singularize}_ids") do
- if send(reflection.name).loaded?
+ if send(reflection.name).loaded? || reflection.options[:finder_sql]
send(reflection.name).map(&:id)
else
send(reflection.name).all(:select => "#{reflection.quoted_table_name}.#{reflection.klass.primary_key}").map(&:id)
@@ -853,6 +853,13 @@ def test_get_ids_for_unloaded_associations_does_not_load_them
assert !company.clients.loaded?
end
+ def test_get_ids_for_unloaded_finder_sql_associations_loads_them
+ company = companies(:first_firm)
+ assert !company.clients_using_sql.loaded?
+ assert_equal [companies(:second_client).id], company.clients_using_sql_ids
+ assert company.clients_using_sql.loaded?
+ end
+
def test_assign_ids
firm = Firm.new("name" => "Apple")
firm.client_ids = [companies(:first_client).id, companies(:second_client).id]
View
@@ -1,4 +1,4 @@
-*Edge*
+*2.2.0 [RC1] (October 24th, 2008)*
* Add ActiveResource::Base#to_xml and ActiveResource::Base#to_json. #1011 [Rasik Pandey, Cody Fauser]
View
@@ -65,7 +65,7 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "#{dir}/**/*" ).delete_if { |item| item.include?( "\.svn" ) }
end
- s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.2.0' + PKG_BUILD)
s.require_path = 'lib'
s.autorequire = 'active_resource'
@@ -115,8 +115,8 @@ end
desc "Publish the beta gem"
task :pgem => [:package] do
- Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh wrath.rubyonrails.org './gemupdate.sh'`
+ Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
desc "Publish the API documentation"
@@ -1,7 +1,7 @@
module ActiveResource
module VERSION #:nodoc:
MAJOR = 2
- MINOR = 1
+ MINOR = 2
TINY = 0
STRING = [MAJOR, MINOR, TINY].join('.')
View
@@ -1,4 +1,4 @@
-*Edge*
+*2.2.0 [RC1] (October 24th, 2008)*
* TimeWithZone#freeze: preload instance variables so that we can actually freeze [Geoff Buesing]
View
@@ -65,8 +65,8 @@ end
desc "Publish the beta gem"
task :pgem => [:package] do
- Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh wrath.rubyonrails.org './gemupdate.sh'`
+ Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
desc "Publish the API documentation"
View
@@ -1,4 +1,4 @@
-*Edge*
+*2.2.0 [RC1] (October 24th, 2008)*
* Fixed that sqlite would report "db/development.sqlite3 already exists" whether true or not on db:create #614 [Antonio Cangiano]
View
@@ -348,12 +348,12 @@ spec = Gem::Specification.new do |s|
on top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates.
EOF
- s.add_dependency('rake', '>= 0.8.1')
- s.add_dependency('activesupport', '= 2.1.0' + PKG_BUILD)
- s.add_dependency('activerecord', '= 2.1.0' + PKG_BUILD)
- s.add_dependency('actionpack', '= 2.1.0' + PKG_BUILD)
- s.add_dependency('actionmailer', '= 2.1.0' + PKG_BUILD)
- s.add_dependency('activeresource', '= 2.1.0' + PKG_BUILD)
+ s.add_dependency('rake', '>= 0.8.3')
+ s.add_dependency('activesupport', '= 2.2.0' + PKG_BUILD)
+ s.add_dependency('activerecord', '= 2.2.0' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.2.0' + PKG_BUILD)
+ s.add_dependency('actionmailer', '= 2.2.0' + PKG_BUILD)
+ s.add_dependency('activeresource', '= 2.2.0' + PKG_BUILD)
s.rdoc_options << '--exclude' << '.'
s.has_rdoc = false
@@ -378,8 +378,8 @@ end
# Publishing -------------------------------------------------------
desc "Publish the rails gem"
task :pgem => [:gem] do
- Rake::SshFilePublisher.new("wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
- `ssh wrath.rubyonrails.org './gemupdate.sh'`
+ Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
+ `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
end
desc "Publish the API documentation"
Oops, something went wrong.

0 comments on commit 14f0514

Please sign in to comment.