actionpack 3.0.0.rc → 3.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionpack might be problematic. Click here for more details.

Files changed (57) hide show
  1. data/CHANGELOG +11 -2
  2. data/README.rdoc +3 -3
  3. data/lib/abstract_controller/base.rb +13 -1
  4. data/lib/action_controller.rb +2 -1
  5. data/lib/action_controller/base.rb +1 -1
  6. data/lib/action_controller/deprecated/base.rb +11 -1
  7. data/lib/action_controller/deprecated/url_writer.rb +14 -0
  8. data/lib/action_controller/metal/http_authentication.rb +3 -3
  9. data/lib/action_controller/metal/responder.rb +2 -8
  10. data/lib/action_controller/middleware.rb +1 -1
  11. data/lib/action_controller/test_case.rb +1 -1
  12. data/lib/action_controller/vendor/html-scanner/html/document.rb +2 -2
  13. data/lib/action_controller/vendor/html-scanner/html/node.rb +29 -29
  14. data/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +25 -25
  15. data/lib/action_controller/vendor/html-scanner/html/selector.rb +1 -1
  16. data/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +8 -8
  17. data/lib/action_dispatch.rb +1 -0
  18. data/lib/action_dispatch/http/cache.rb +2 -2
  19. data/lib/action_dispatch/http/mime_type.rb +10 -10
  20. data/lib/action_dispatch/http/parameters.rb +2 -2
  21. data/lib/action_dispatch/http/request.rb +7 -0
  22. data/lib/action_dispatch/http/url.rb +10 -0
  23. data/lib/action_dispatch/middleware/best_standards_support.rb +22 -0
  24. data/lib/action_dispatch/middleware/cookies.rb +18 -8
  25. data/lib/action_dispatch/middleware/session/abstract_store.rb +2 -5
  26. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +1 -0
  27. data/lib/action_dispatch/middleware/show_exceptions.rb +2 -9
  28. data/lib/action_dispatch/middleware/stack.rb +1 -1
  29. data/lib/action_dispatch/railtie.rb +2 -1
  30. data/lib/action_dispatch/routing.rb +4 -4
  31. data/lib/action_dispatch/routing/deprecated_mapper.rb +1 -0
  32. data/lib/action_dispatch/routing/mapper.rb +34 -21
  33. data/lib/action_dispatch/routing/route_set.rb +8 -5
  34. data/lib/action_dispatch/routing/url_for.rb +1 -1
  35. data/lib/action_dispatch/testing/assertions/routing.rb +37 -14
  36. data/lib/action_dispatch/testing/integration.rb +1 -0
  37. data/lib/action_pack/version.rb +1 -1
  38. data/lib/action_view/base.rb +1 -0
  39. data/lib/action_view/helpers/asset_tag_helper.rb +12 -0
  40. data/lib/action_view/helpers/debug_helper.rb +1 -1
  41. data/lib/action_view/helpers/form_helper.rb +7 -6
  42. data/lib/action_view/helpers/form_options_helper.rb +21 -18
  43. data/lib/action_view/helpers/form_tag_helper.rb +9 -9
  44. data/lib/action_view/helpers/number_helper.rb +1 -1
  45. data/lib/action_view/helpers/raw_output_helper.rb +1 -1
  46. data/lib/action_view/helpers/sanitize_helper.rb +4 -2
  47. data/lib/action_view/helpers/text_helper.rb +5 -2
  48. data/lib/action_view/helpers/translation_helper.rb +9 -9
  49. data/lib/action_view/log_subscriber.rb +1 -1
  50. data/lib/action_view/render/layouts.rb +8 -4
  51. data/lib/action_view/render/partials.rb +1 -1
  52. data/lib/action_view/template/handler.rb +1 -1
  53. data/lib/action_view/template/handlers.rb +1 -1
  54. data/lib/action_view/template/resolver.rb +15 -0
  55. data/lib/action_view/test_case.rb +1 -1
  56. data/lib/action_view/testing/resolvers.rb +1 -1
  57. metadata +18 -16
@@ -7,7 +7,7 @@ module ActionView
7
7
  message = "Rendered #{from_rails_root(event.payload[:identifier])}"
8
8
  message << " within #{from_rails_root(event.payload[:layout])}" if event.payload[:layout]
9
9
  message << (" (%.1fms)" % event.duration)
10
- info(message)
10
+ info(message)
11
11
  end
12
12
  alias :render_partial :render_template
13
13
  alias :render_collection :render_template
@@ -47,11 +47,15 @@ module ActionView
47
47
  # Hello David
48
48
  # </html>
49
49
  #
50
- def _layout_for(name = nil, &block) #:nodoc:
51
- if !block || name
52
- @_content_for[name || :layout].html_safe
50
+ def _layout_for(*args, &block) #:nodoc:
51
+ name = args.first
52
+
53
+ if name.is_a?(Symbol)
54
+ @_content_for[name].html_safe
55
+ elsif block
56
+ capture(*args, &block)
53
57
  else
54
- capture(&block)
58
+ @_content_for[:layout].html_safe
55
59
  end
56
60
  end
57
61
 
@@ -56,7 +56,7 @@ module ActionView
56
56
  # you're following its conventions for RecordIdentifier#partial_path. Examples:
57
57
  #
58
58
  # # @account is an Account instance, so it uses the RecordIdentifier to replace
59
- # # <%= render :partial => "accounts/account", :locals => { :account => @buyer } %>
59
+ # # <%= render :partial => "accounts/account", :locals => { :account => @account} %>
60
60
  # <%= render :partial => @account %>
61
61
  #
62
62
  # # @posts is an array of Post instances, so it uses the RecordIdentifier to replace
@@ -35,7 +35,7 @@ module ActionView
35
35
  end
36
36
  end
37
37
  end
38
-
38
+
39
39
  TemplateHandlers = Template::Handlers
40
40
  TemplateHandler = Template::Handler
41
41
  end
@@ -18,7 +18,7 @@ module ActionView #:nodoc:
18
18
 
19
19
  @@template_handlers = {}
20
20
  @@default_template_handlers = nil
21
-
21
+
22
22
  def self.extensions
23
23
  @@template_extensions ||= @@template_handlers.keys
24
24
  end
@@ -69,6 +69,9 @@ module ActionView
69
69
  query << '{' << ext.map {|e| e && ".#{e}" }.join(',') << ',}'
70
70
  end
71
71
 
72
+ query.gsub!(/\{\.html,/, "{.html,.text.html,")
73
+ query.gsub!(/\{\.text,/, "{.text,.text.plain,")
74
+
72
75
  Dir[query].reject { |p| File.directory?(p) }.map do |p|
73
76
  handler, format = extract_handler_and_format(p, formats)
74
77
 
@@ -87,6 +90,18 @@ module ActionView
87
90
  pieces.shift
88
91
 
89
92
  handler = Template.handler_class_for_extension(pieces.pop)
93
+
94
+ if pieces.last == "html" && pieces[-2] == "text"
95
+ correct_path = path.gsub(/\.text\.html/, ".html")
96
+ ActiveSupport::Deprecation.warn "The file `#{path}` uses the deprecated format `text.html`. Please rename it to #{correct_path}", caller
97
+ end
98
+
99
+ if pieces.last == "plain" && pieces[-2] == "text"
100
+ correct_path = path.gsub(/\.text\.plain/, ".text")
101
+ pieces.pop
102
+ ActiveSupport::Deprecation.warn "The file `#{path}` uses the deprecated format `text.plain`. Please rename it to #{correct_path}", caller
103
+ end
104
+
90
105
  format = pieces.last && Mime[pieces.last] && pieces.pop.to_sym
91
106
  format ||= handler.default_format if handler.respond_to?(:default_format)
92
107
  format ||= default_formats
@@ -44,7 +44,7 @@ module ActionView
44
44
  include ActionView::Helpers
45
45
 
46
46
  attr_accessor :controller, :output_buffer, :rendered
47
-
47
+
48
48
  module ClassMethods
49
49
  def tests(helper_class)
50
50
  self.helper_class = helper_class
@@ -38,6 +38,6 @@ module ActionView #:nodoc:
38
38
  [ActionView::Template.new("Template generated by Null Resolver", path, handler, :virtual_path => path, :format => format)]
39
39
  end
40
40
  end
41
-
41
+
42
42
  end
43
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7712042
4
+ hash: 977940607
5
5
  prerelease: true
6
6
  segments:
7
7
  - 3
8
8
  - 0
9
9
  - 0
10
- - rc
11
- version: 3.0.0.rc
10
+ - rc2
11
+ version: 3.0.0.rc2
12
12
  platform: ruby
13
13
  authors:
14
14
  - David Heinemeier Hansson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-07-26 00:00:00 -05:00
19
+ date: 2010-08-23 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -27,13 +27,13 @@ dependencies:
27
27
  requirements:
28
28
  - - "="
29
29
  - !ruby/object:Gem::Version
30
- hash: 7712042
30
+ hash: 977940607
31
31
  segments:
32
32
  - 3
33
33
  - 0
34
34
  - 0
35
- - rc
36
- version: 3.0.0.rc
35
+ - rc2
36
+ version: 3.0.0.rc2
37
37
  type: :runtime
38
38
  version_requirements: *id001
39
39
  - !ruby/object:Gem::Dependency
@@ -44,13 +44,13 @@ dependencies:
44
44
  requirements:
45
45
  - - "="
46
46
  - !ruby/object:Gem::Version
47
- hash: 7712042
47
+ hash: 977940607
48
48
  segments:
49
49
  - 3
50
50
  - 0
51
51
  - 0
52
- - rc
53
- version: 3.0.0.rc
52
+ - rc2
53
+ version: 3.0.0.rc2
54
54
  type: :runtime
55
55
  version_requirements: *id002
56
56
  - !ruby/object:Gem::Dependency
@@ -125,12 +125,12 @@ dependencies:
125
125
  requirements:
126
126
  - - ~>
127
127
  - !ruby/object:Gem::Version
128
- hash: 21
128
+ hash: 31
129
129
  segments:
130
130
  - 0
131
131
  - 6
132
- - 9
133
- version: 0.6.9
132
+ - 12
133
+ version: 0.6.12
134
134
  type: :runtime
135
135
  version_requirements: *id007
136
136
  - !ruby/object:Gem::Dependency
@@ -141,12 +141,12 @@ dependencies:
141
141
  requirements:
142
142
  - - ~>
143
143
  - !ruby/object:Gem::Version
144
- hash: 63
144
+ hash: 61
145
145
  segments:
146
146
  - 0
147
147
  - 3
148
- - 22
149
- version: 0.3.22
148
+ - 23
149
+ version: 0.3.23
150
150
  type: :runtime
151
151
  version_requirements: *id008
152
152
  - !ruby/object:Gem::Dependency
@@ -198,6 +198,7 @@ files:
198
198
  - lib/action_controller/deprecated/dispatcher.rb
199
199
  - lib/action_controller/deprecated/integration_test.rb
200
200
  - lib/action_controller/deprecated/performance_test.rb
201
+ - lib/action_controller/deprecated/url_writer.rb
201
202
  - lib/action_controller/deprecated.rb
202
203
  - lib/action_controller/log_subscriber.rb
203
204
  - lib/action_controller/metal/compatibility.rb
@@ -248,6 +249,7 @@ files:
248
249
  - lib/action_dispatch/http/response.rb
249
250
  - lib/action_dispatch/http/upload.rb
250
251
  - lib/action_dispatch/http/url.rb
252
+ - lib/action_dispatch/middleware/best_standards_support.rb
251
253
  - lib/action_dispatch/middleware/callbacks.rb
252
254
  - lib/action_dispatch/middleware/cookies.rb
253
255
  - lib/action_dispatch/middleware/flash.rb