actionpack 4.0.1 → 4.2.11.1

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 (241) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +402 -1173
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +7 -7
  5. data/lib/abstract_controller/base.rb +39 -7
  6. data/lib/abstract_controller/callbacks.rb +32 -53
  7. data/lib/abstract_controller/collector.rb +11 -1
  8. data/lib/abstract_controller/helpers.rb +26 -16
  9. data/lib/abstract_controller/railties/routes_helpers.rb +3 -3
  10. data/lib/abstract_controller/rendering.rb +57 -127
  11. data/lib/abstract_controller/url_for.rb +1 -1
  12. data/lib/abstract_controller.rb +1 -2
  13. data/lib/action_controller/base.rb +19 -10
  14. data/lib/action_controller/caching/fragments.rb +7 -1
  15. data/lib/action_controller/caching.rb +2 -12
  16. data/lib/action_controller/log_subscriber.rb +29 -20
  17. data/lib/action_controller/metal/conditional_get.rb +37 -12
  18. data/lib/action_controller/metal/data_streaming.rb +1 -1
  19. data/lib/action_controller/metal/etag_with_template_digest.rb +50 -0
  20. data/lib/action_controller/metal/exceptions.rb +1 -1
  21. data/lib/action_controller/metal/flash.rb +17 -0
  22. data/lib/action_controller/metal/force_ssl.rb +2 -2
  23. data/lib/action_controller/metal/head.rb +8 -6
  24. data/lib/action_controller/metal/helpers.rb +6 -2
  25. data/lib/action_controller/metal/http_authentication.rb +45 -23
  26. data/lib/action_controller/metal/instrumentation.rb +9 -6
  27. data/lib/action_controller/metal/live.rb +173 -20
  28. data/lib/action_controller/metal/mime_responds.rb +127 -232
  29. data/lib/action_controller/metal/params_wrapper.rb +16 -9
  30. data/lib/action_controller/metal/rack_delegation.rb +1 -1
  31. data/lib/action_controller/metal/redirecting.rb +34 -26
  32. data/lib/action_controller/metal/renderers.rb +39 -12
  33. data/lib/action_controller/metal/rendering.rb +41 -14
  34. data/lib/action_controller/metal/request_forgery_protection.rb +147 -19
  35. data/lib/action_controller/metal/streaming.rb +19 -21
  36. data/lib/action_controller/metal/strong_parameters.rb +166 -22
  37. data/lib/action_controller/metal/testing.rb +0 -1
  38. data/lib/action_controller/metal/url_for.rb +11 -12
  39. data/lib/action_controller/metal.rb +14 -8
  40. data/lib/action_controller/model_naming.rb +1 -1
  41. data/lib/action_controller/railtie.rb +5 -1
  42. data/lib/action_controller/test_case.rb +160 -94
  43. data/lib/action_controller.rb +2 -18
  44. data/lib/action_dispatch/http/cache.rb +5 -4
  45. data/lib/action_dispatch/http/filter_parameters.rb +2 -2
  46. data/lib/action_dispatch/http/filter_redirect.rb +5 -4
  47. data/lib/action_dispatch/http/headers.rb +46 -10
  48. data/lib/action_dispatch/http/mime_negotiation.rb +31 -4
  49. data/lib/action_dispatch/http/mime_type.rb +25 -26
  50. data/lib/action_dispatch/http/mime_types.rb +1 -0
  51. data/lib/action_dispatch/http/parameter_filter.rb +1 -1
  52. data/lib/action_dispatch/http/parameters.rb +25 -41
  53. data/lib/action_dispatch/http/request.rb +49 -32
  54. data/lib/action_dispatch/http/response.rb +127 -25
  55. data/lib/action_dispatch/http/upload.rb +9 -21
  56. data/lib/action_dispatch/http/url.rb +97 -70
  57. data/lib/action_dispatch/journey/formatter.rb +35 -19
  58. data/lib/action_dispatch/journey/gtg/builder.rb +3 -3
  59. data/lib/action_dispatch/journey/gtg/simulator.rb +10 -7
  60. data/lib/action_dispatch/journey/gtg/transition_table.rb +23 -33
  61. data/lib/action_dispatch/journey/nfa/dot.rb +2 -2
  62. data/lib/action_dispatch/journey/nfa/simulator.rb +1 -1
  63. data/lib/action_dispatch/journey/nfa/transition_table.rb +5 -5
  64. data/lib/action_dispatch/journey/nodes/node.rb +4 -0
  65. data/lib/action_dispatch/journey/parser.rb +51 -59
  66. data/lib/action_dispatch/journey/parser.y +12 -10
  67. data/lib/action_dispatch/journey/path/pattern.rb +16 -19
  68. data/lib/action_dispatch/journey/route.rb +8 -19
  69. data/lib/action_dispatch/journey/router/strexp.rb +9 -6
  70. data/lib/action_dispatch/journey/router/utils.rb +54 -18
  71. data/lib/action_dispatch/journey/router.rb +53 -75
  72. data/lib/action_dispatch/journey/routes.rb +4 -0
  73. data/lib/action_dispatch/journey/scanner.rb +5 -5
  74. data/lib/action_dispatch/journey/visitors.rb +81 -60
  75. data/lib/action_dispatch/journey/visualizer/fsm.css +0 -4
  76. data/lib/action_dispatch/journey/visualizer/index.html.erb +2 -2
  77. data/lib/action_dispatch/middleware/callbacks.rb +7 -7
  78. data/lib/action_dispatch/middleware/cookies.rb +119 -43
  79. data/lib/action_dispatch/middleware/debug_exceptions.rb +32 -13
  80. data/lib/action_dispatch/middleware/exception_wrapper.rb +60 -20
  81. data/lib/action_dispatch/middleware/flash.rb +37 -24
  82. data/lib/action_dispatch/middleware/params_parser.rb +2 -2
  83. data/lib/action_dispatch/middleware/public_exceptions.rb +12 -3
  84. data/lib/action_dispatch/middleware/reloader.rb +11 -2
  85. data/lib/action_dispatch/middleware/remote_ip.rb +40 -54
  86. data/lib/action_dispatch/middleware/request_id.rb +1 -1
  87. data/lib/action_dispatch/middleware/session/cache_store.rb +3 -3
  88. data/lib/action_dispatch/middleware/session/cookie_store.rb +8 -7
  89. data/lib/action_dispatch/middleware/show_exceptions.rb +6 -2
  90. data/lib/action_dispatch/middleware/ssl.rb +10 -7
  91. data/lib/action_dispatch/middleware/static.rb +79 -23
  92. data/lib/action_dispatch/middleware/templates/rescues/{_request_and_response.erb → _request_and_response.html.erb} +0 -0
  93. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +23 -0
  94. data/lib/action_dispatch/middleware/templates/rescues/_source.erb +21 -19
  95. data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +52 -0
  96. data/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb +9 -0
  97. data/lib/action_dispatch/middleware/templates/rescues/{diagnostics.erb → diagnostics.html.erb} +1 -1
  98. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +9 -0
  99. data/lib/action_dispatch/middleware/templates/rescues/layout.erb +6 -0
  100. data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +11 -0
  101. data/lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb +3 -0
  102. data/lib/action_dispatch/middleware/templates/rescues/{routing_error.erb → routing_error.html.erb} +3 -1
  103. data/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb +11 -0
  104. data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +20 -0
  105. data/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +7 -0
  106. data/lib/action_dispatch/middleware/templates/rescues/{unknown_action.erb → unknown_action.html.erb} +1 -1
  107. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +3 -0
  108. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +120 -64
  109. data/lib/action_dispatch/railtie.rb +5 -2
  110. data/lib/action_dispatch/request/session.rb +12 -0
  111. data/lib/action_dispatch/request/utils.rb +35 -0
  112. data/lib/action_dispatch/routing/endpoint.rb +10 -0
  113. data/lib/action_dispatch/routing/inspector.rb +11 -17
  114. data/lib/action_dispatch/routing/mapper.rb +519 -312
  115. data/lib/action_dispatch/routing/polymorphic_routes.rb +204 -79
  116. data/lib/action_dispatch/routing/redirection.rb +51 -26
  117. data/lib/action_dispatch/routing/route_set.rb +331 -206
  118. data/lib/action_dispatch/routing/routes_proxy.rb +5 -4
  119. data/lib/action_dispatch/routing/url_for.rb +19 -5
  120. data/lib/action_dispatch/routing.rb +9 -6
  121. data/lib/action_dispatch/testing/assertions/dom.rb +2 -26
  122. data/lib/action_dispatch/testing/assertions/response.rb +9 -15
  123. data/lib/action_dispatch/testing/assertions/routing.rb +22 -22
  124. data/lib/action_dispatch/testing/assertions/selector.rb +2 -429
  125. data/lib/action_dispatch/testing/assertions/tag.rb +2 -134
  126. data/lib/action_dispatch/testing/assertions.rb +11 -7
  127. data/lib/action_dispatch/testing/integration.rb +31 -29
  128. data/lib/action_dispatch/testing/test_request.rb +1 -1
  129. data/lib/action_dispatch/testing/test_response.rb +1 -5
  130. data/lib/action_dispatch.rb +5 -8
  131. data/lib/action_pack/gem_version.rb +15 -0
  132. data/lib/action_pack/version.rb +4 -7
  133. data/lib/action_pack.rb +1 -1
  134. metadata +77 -159
  135. data/lib/abstract_controller/layouts.rb +0 -423
  136. data/lib/abstract_controller/view_paths.rb +0 -96
  137. data/lib/action_controller/deprecated/integration_test.rb +0 -5
  138. data/lib/action_controller/deprecated.rb +0 -7
  139. data/lib/action_controller/metal/responder.rb +0 -287
  140. data/lib/action_controller/record_identifier.rb +0 -31
  141. data/lib/action_controller/vendor/html-scanner.rb +0 -5
  142. data/lib/action_dispatch/middleware/templates/rescues/_trace.erb +0 -24
  143. data/lib/action_dispatch/middleware/templates/rescues/missing_template.erb +0 -7
  144. data/lib/action_dispatch/middleware/templates/rescues/template_error.erb +0 -43
  145. data/lib/action_view/base.rb +0 -201
  146. data/lib/action_view/buffers.rb +0 -49
  147. data/lib/action_view/context.rb +0 -36
  148. data/lib/action_view/dependency_tracker.rb +0 -93
  149. data/lib/action_view/digestor.rb +0 -113
  150. data/lib/action_view/flows.rb +0 -76
  151. data/lib/action_view/helpers/active_model_helper.rb +0 -49
  152. data/lib/action_view/helpers/asset_tag_helper.rb +0 -320
  153. data/lib/action_view/helpers/asset_url_helper.rb +0 -355
  154. data/lib/action_view/helpers/atom_feed_helper.rb +0 -203
  155. data/lib/action_view/helpers/cache_helper.rb +0 -196
  156. data/lib/action_view/helpers/capture_helper.rb +0 -216
  157. data/lib/action_view/helpers/controller_helper.rb +0 -25
  158. data/lib/action_view/helpers/csrf_helper.rb +0 -30
  159. data/lib/action_view/helpers/date_helper.rb +0 -1083
  160. data/lib/action_view/helpers/debug_helper.rb +0 -39
  161. data/lib/action_view/helpers/form_helper.rb +0 -1880
  162. data/lib/action_view/helpers/form_options_helper.rb +0 -838
  163. data/lib/action_view/helpers/form_tag_helper.rb +0 -785
  164. data/lib/action_view/helpers/javascript_helper.rb +0 -117
  165. data/lib/action_view/helpers/number_helper.rb +0 -441
  166. data/lib/action_view/helpers/output_safety_helper.rb +0 -38
  167. data/lib/action_view/helpers/record_tag_helper.rb +0 -106
  168. data/lib/action_view/helpers/rendering_helper.rb +0 -90
  169. data/lib/action_view/helpers/sanitize_helper.rb +0 -256
  170. data/lib/action_view/helpers/tag_helper.rb +0 -173
  171. data/lib/action_view/helpers/tags/base.rb +0 -148
  172. data/lib/action_view/helpers/tags/check_box.rb +0 -64
  173. data/lib/action_view/helpers/tags/checkable.rb +0 -16
  174. data/lib/action_view/helpers/tags/collection_check_boxes.rb +0 -44
  175. data/lib/action_view/helpers/tags/collection_helpers.rb +0 -84
  176. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +0 -36
  177. data/lib/action_view/helpers/tags/collection_select.rb +0 -28
  178. data/lib/action_view/helpers/tags/color_field.rb +0 -25
  179. data/lib/action_view/helpers/tags/date_field.rb +0 -13
  180. data/lib/action_view/helpers/tags/date_select.rb +0 -72
  181. data/lib/action_view/helpers/tags/datetime_field.rb +0 -22
  182. data/lib/action_view/helpers/tags/datetime_local_field.rb +0 -19
  183. data/lib/action_view/helpers/tags/datetime_select.rb +0 -8
  184. data/lib/action_view/helpers/tags/email_field.rb +0 -8
  185. data/lib/action_view/helpers/tags/file_field.rb +0 -8
  186. data/lib/action_view/helpers/tags/grouped_collection_select.rb +0 -29
  187. data/lib/action_view/helpers/tags/hidden_field.rb +0 -8
  188. data/lib/action_view/helpers/tags/label.rb +0 -66
  189. data/lib/action_view/helpers/tags/month_field.rb +0 -13
  190. data/lib/action_view/helpers/tags/number_field.rb +0 -18
  191. data/lib/action_view/helpers/tags/password_field.rb +0 -12
  192. data/lib/action_view/helpers/tags/radio_button.rb +0 -31
  193. data/lib/action_view/helpers/tags/range_field.rb +0 -8
  194. data/lib/action_view/helpers/tags/search_field.rb +0 -24
  195. data/lib/action_view/helpers/tags/select.rb +0 -40
  196. data/lib/action_view/helpers/tags/tel_field.rb +0 -8
  197. data/lib/action_view/helpers/tags/text_area.rb +0 -18
  198. data/lib/action_view/helpers/tags/text_field.rb +0 -29
  199. data/lib/action_view/helpers/tags/time_field.rb +0 -13
  200. data/lib/action_view/helpers/tags/time_select.rb +0 -8
  201. data/lib/action_view/helpers/tags/time_zone_select.rb +0 -20
  202. data/lib/action_view/helpers/tags/url_field.rb +0 -8
  203. data/lib/action_view/helpers/tags/week_field.rb +0 -13
  204. data/lib/action_view/helpers/tags.rb +0 -39
  205. data/lib/action_view/helpers/text_helper.rb +0 -443
  206. data/lib/action_view/helpers/translation_helper.rb +0 -107
  207. data/lib/action_view/helpers/url_helper.rb +0 -635
  208. data/lib/action_view/helpers.rb +0 -58
  209. data/lib/action_view/locale/en.yml +0 -56
  210. data/lib/action_view/log_subscriber.rb +0 -30
  211. data/lib/action_view/lookup_context.rb +0 -241
  212. data/lib/action_view/model_naming.rb +0 -12
  213. data/lib/action_view/path_set.rb +0 -77
  214. data/lib/action_view/railtie.rb +0 -43
  215. data/lib/action_view/record_identifier.rb +0 -84
  216. data/lib/action_view/renderer/abstract_renderer.rb +0 -47
  217. data/lib/action_view/renderer/partial_renderer.rb +0 -492
  218. data/lib/action_view/renderer/renderer.rb +0 -50
  219. data/lib/action_view/renderer/streaming_template_renderer.rb +0 -103
  220. data/lib/action_view/renderer/template_renderer.rb +0 -96
  221. data/lib/action_view/routing_url_for.rb +0 -107
  222. data/lib/action_view/tasks/dependencies.rake +0 -17
  223. data/lib/action_view/template/error.rb +0 -138
  224. data/lib/action_view/template/handlers/builder.rb +0 -26
  225. data/lib/action_view/template/handlers/erb.rb +0 -146
  226. data/lib/action_view/template/handlers/raw.rb +0 -11
  227. data/lib/action_view/template/handlers.rb +0 -53
  228. data/lib/action_view/template/resolver.rb +0 -326
  229. data/lib/action_view/template/text.rb +0 -34
  230. data/lib/action_view/template/types.rb +0 -57
  231. data/lib/action_view/template.rb +0 -339
  232. data/lib/action_view/test_case.rb +0 -270
  233. data/lib/action_view/testing/resolvers.rb +0 -50
  234. data/lib/action_view/vendor/html-scanner/html/document.rb +0 -68
  235. data/lib/action_view/vendor/html-scanner/html/node.rb +0 -532
  236. data/lib/action_view/vendor/html-scanner/html/sanitizer.rb +0 -188
  237. data/lib/action_view/vendor/html-scanner/html/selector.rb +0 -830
  238. data/lib/action_view/vendor/html-scanner/html/tokenizer.rb +0 -107
  239. data/lib/action_view/vendor/html-scanner/html/version.rb +0 -11
  240. data/lib/action_view/vendor/html-scanner.rb +0 -20
  241. data/lib/action_view.rb +0 -93
@@ -3,7 +3,7 @@ require 'uri'
3
3
  require 'active_support/core_ext/kernel/singleton_class'
4
4
  require 'active_support/core_ext/object/try'
5
5
  require 'rack/test'
6
- require 'minitest/unit'
6
+ require 'minitest'
7
7
 
8
8
  module ActionDispatch
9
9
  module Integration #:nodoc:
@@ -137,7 +137,7 @@ module ActionDispatch
137
137
  class Session
138
138
  DEFAULT_HOST = "www.example.com"
139
139
 
140
- include MiniTest::Assertions
140
+ include Minitest::Assertions
141
141
  include TestProcess, RequestHelpers, Assertions
142
142
 
143
143
  %w( status status_message headers body redirect? ).each do |method|
@@ -189,8 +189,8 @@ module ActionDispatch
189
189
  # This makes app.url_for and app.foo_path available in the console
190
190
  if app.respond_to?(:routes)
191
191
  singleton_class.class_eval do
192
- include app.routes.url_helpers if app.routes.respond_to?(:url_helpers)
193
- include app.routes.mounted_helpers if app.routes.respond_to?(:mounted_helpers)
192
+ include app.routes.url_helpers
193
+ include app.routes.mounted_helpers
194
194
  end
195
195
  end
196
196
 
@@ -201,7 +201,7 @@ module ActionDispatch
201
201
  @url_options ||= default_url_options.dup.tap do |url_options|
202
202
  url_options.reverse_merge!(controller.url_options) if controller
203
203
 
204
- if @app.respond_to?(:routes) && @app.routes.respond_to?(:default_url_options)
204
+ if @app.respond_to?(:routes)
205
205
  url_options.reverse_merge!(@app.routes.default_url_options)
206
206
  end
207
207
 
@@ -242,7 +242,7 @@ module ActionDispatch
242
242
  @https = flag
243
243
  end
244
244
 
245
- # Return +true+ if the session is mimicking a secure HTTPS request.
245
+ # Returns +true+ if the session is mimicking a secure HTTPS request.
246
246
  #
247
247
  # if session.https?
248
248
  # ...
@@ -270,12 +270,6 @@ module ActionDispatch
270
270
  path = location.query ? "#{location.path}?#{location.query}" : location.path
271
271
  end
272
272
 
273
- unless ActionController::Base < ActionController::Testing
274
- ActionController::Base.class_eval do
275
- include ActionController::Testing
276
- end
277
- end
278
-
279
273
  hostname, port = host.split(':')
280
274
 
281
275
  env = {
@@ -298,29 +292,26 @@ module ActionDispatch
298
292
 
299
293
  session = Rack::Test::Session.new(_mock_session)
300
294
 
301
- env.merge!(env)
302
-
303
295
  # NOTE: rack-test v0.5 doesn't build a default uri correctly
304
296
  # Make sure requested path is always a full uri
305
- uri = URI.parse('/')
306
- uri.scheme ||= env['rack.url_scheme']
307
- uri.host ||= env['SERVER_NAME']
308
- uri.port ||= env['SERVER_PORT'].try(:to_i)
309
- uri += path
310
-
311
- session.request(uri.to_s, env)
297
+ session.request(build_full_uri(path, env), env)
312
298
 
313
299
  @request_count += 1
314
300
  @request = ActionDispatch::Request.new(session.last_request.env)
315
301
  response = _mock_session.last_response
316
- @response = ActionDispatch::TestResponse.new(response.status, response.headers, response.body)
302
+ @response = ActionDispatch::TestResponse.from_response(response)
317
303
  @html_document = nil
304
+ @html_scanner_document = nil
318
305
  @url_options = nil
319
306
 
320
307
  @controller = session.last_request.env['action_controller.instance']
321
308
 
322
309
  return response.status
323
310
  end
311
+
312
+ def build_full_uri(path, env)
313
+ "#{env['rack.url_scheme']}://#{env['SERVER_NAME']}:#{env['SERVER_PORT']}#{path}"
314
+ end
324
315
  end
325
316
 
326
317
  module Runner
@@ -336,12 +327,22 @@ module ActionDispatch
336
327
  @integration_session = Integration::Session.new(app)
337
328
  end
338
329
 
330
+ def remove! # :nodoc:
331
+ @integration_session = nil
332
+ end
333
+
339
334
  %w(get post patch put head delete cookies assigns
340
335
  xml_http_request xhr get_via_redirect post_via_redirect).each do |method|
341
336
  define_method(method) do |*args|
342
337
  reset! unless integration_session
343
- # reset the html_document variable, but only for new get/post calls
344
- @html_document = nil unless method == 'cookies' || method == 'assigns'
338
+
339
+ # reset the html_document variable, except for cookies/assigns calls
340
+ unless method == 'cookies' || method == 'assigns'
341
+ @html_document = nil
342
+ @html_scanner_document = nil
343
+ reset_template_assertion
344
+ end
345
+
345
346
  integration_session.__send__(method, *args).tap do
346
347
  copy_session_variables!
347
348
  end
@@ -358,8 +359,9 @@ module ActionDispatch
358
359
  # By default, a single session is automatically created for you, but you
359
360
  # can use this method to open multiple sessions that ought to be tested
360
361
  # simultaneously.
361
- def open_session(app = nil)
362
+ def open_session
362
363
  dup.tap do |session|
364
+ session.reset!
363
365
  yield session if block_given?
364
366
  end
365
367
  end
@@ -489,10 +491,6 @@ module ActionDispatch
489
491
  @@app = nil
490
492
 
491
493
  def self.app
492
- if !@@app && !ActionDispatch.test_app
493
- ActiveSupport::Deprecation.warn "Rails application fallback is deprecated and no longer works, please set ActionDispatch.test_app"
494
- end
495
-
496
494
  @@app || ActionDispatch.test_app
497
495
  end
498
496
 
@@ -508,5 +506,9 @@ module ActionDispatch
508
506
  reset! unless integration_session
509
507
  integration_session.url_options
510
508
  end
509
+
510
+ def document_root_element
511
+ html_document.root
512
+ end
511
513
  end
512
514
  end
@@ -39,7 +39,7 @@ module ActionDispatch
39
39
  end
40
40
 
41
41
  def action=(action_name)
42
- path_parameters["action"] = action_name.to_s
42
+ path_parameters[:action] = action_name.to_s
43
43
  end
44
44
 
45
45
  def if_modified_since=(last_modified)
@@ -7,11 +7,7 @@ module ActionDispatch
7
7
  # See Response for more information on controller response objects.
8
8
  class TestResponse < Response
9
9
  def self.from_response(response)
10
- new.tap do |resp|
11
- resp.status = response.status
12
- resp.headers = response.headers
13
- resp.body = response.body
14
- end
10
+ new response.status, response.headers, response.body, default_headers: nil
15
11
  end
16
12
 
17
13
  # Was the response successful?
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2004-2013 David Heinemeier Hansson
2
+ # Copyright (c) 2004-2014 David Heinemeier Hansson
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
@@ -52,7 +52,6 @@ module ActionDispatch
52
52
  autoload :DebugExceptions
53
53
  autoload :ExceptionWrapper
54
54
  autoload :Flash
55
- autoload :Head
56
55
  autoload :ParamsParser
57
56
  autoload :PublicExceptions
58
57
  autoload :Reloader
@@ -74,18 +73,16 @@ module ActionDispatch
74
73
  autoload :MimeNegotiation
75
74
  autoload :Parameters
76
75
  autoload :ParameterFilter
77
- autoload :FilterParameters
78
- autoload :FilterRedirect
79
76
  autoload :Upload
80
77
  autoload :UploadedFile, 'action_dispatch/http/upload'
81
78
  autoload :URL
82
79
  end
83
80
 
84
81
  module Session
85
- autoload :AbstractStore, 'action_dispatch/middleware/session/abstract_store'
86
- autoload :CookieStore, 'action_dispatch/middleware/session/cookie_store'
87
- autoload :MemCacheStore, 'action_dispatch/middleware/session/mem_cache_store'
88
- autoload :CacheStore, 'action_dispatch/middleware/session/cache_store'
82
+ autoload :AbstractStore, 'action_dispatch/middleware/session/abstract_store'
83
+ autoload :CookieStore, 'action_dispatch/middleware/session/cookie_store'
84
+ autoload :MemCacheStore, 'action_dispatch/middleware/session/mem_cache_store'
85
+ autoload :CacheStore, 'action_dispatch/middleware/session/cache_store'
89
86
  end
90
87
 
91
88
  mattr_accessor :test_app
@@ -0,0 +1,15 @@
1
+ module ActionPack
2
+ # Returns the version of the currently loaded Action Pack as a <tt>Gem::Version</tt>
3
+ def self.gem_version
4
+ Gem::Version.new VERSION::STRING
5
+ end
6
+
7
+ module VERSION
8
+ MAJOR = 4
9
+ MINOR = 2
10
+ TINY = 11
11
+ PRE = "1"
12
+
13
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
+ end
15
+ end
@@ -1,11 +1,8 @@
1
+ require_relative 'gem_version'
2
+
1
3
  module ActionPack
2
- # Returns the version of the currently loaded ActionPack as a Gem::Version
4
+ # Returns the version of the currently loaded ActionPack as a <tt>Gem::Version</tt>
3
5
  def self.version
4
- Gem::Version.new "4.0.1"
5
- end
6
-
7
- module VERSION #:nodoc:
8
- MAJOR, MINOR, TINY, PRE = ActionPack.version.segments
9
- STRING = ActionPack.version.to_s
6
+ gem_version
10
7
  end
11
8
  end
data/lib/action_pack.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2004-2013 David Heinemeier Hansson
2
+ # Copyright (c) 2004-2014 David Heinemeier Hansson
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining
5
5
  # a copy of this software and associated documentation files (the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.2.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-01 00:00:00.000000000 Z
11
+ date: 2019-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,98 +16,110 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.1
19
+ version: 4.2.11.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.1
26
+ version: 4.2.11.1
27
27
  - !ruby/object:Gem::Dependency
28
- name: builder
28
+ name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.0
33
+ version: '1.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.0
40
+ version: '1.6'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rack
42
+ name: rack-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.5.2
47
+ version: 0.6.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.5.2
54
+ version: 0.6.2
55
55
  - !ruby/object:Gem::Dependency
56
- name: rack-test
56
+ name: rails-html-sanitizer
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.6.2
61
+ version: '1.0'
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 1.0.2
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
- - - ~>
69
+ - - "~>"
67
70
  - !ruby/object:Gem::Version
68
- version: 0.6.2
71
+ version: '1.0'
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 1.0.2
69
75
  - !ruby/object:Gem::Dependency
70
- name: erubis
76
+ name: rails-dom-testing
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
- - - ~>
79
+ - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: 2.7.0
81
+ version: '1.0'
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 1.0.5
76
85
  type: :runtime
77
86
  prerelease: false
78
87
  version_requirements: !ruby/object:Gem::Requirement
79
88
  requirements:
80
- - - ~>
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '1.0'
92
+ - - ">="
81
93
  - !ruby/object:Gem::Version
82
- version: 2.7.0
94
+ version: 1.0.5
83
95
  - !ruby/object:Gem::Dependency
84
- name: activemodel
96
+ name: actionview
85
97
  requirement: !ruby/object:Gem::Requirement
86
98
  requirements:
87
99
  - - '='
88
100
  - !ruby/object:Gem::Version
89
- version: 4.0.1
90
- type: :development
101
+ version: 4.2.11.1
102
+ type: :runtime
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
93
105
  requirements:
94
106
  - - '='
95
107
  - !ruby/object:Gem::Version
96
- version: 4.0.1
108
+ version: 4.2.11.1
97
109
  - !ruby/object:Gem::Dependency
98
- name: tzinfo
110
+ name: activemodel
99
111
  requirement: !ruby/object:Gem::Requirement
100
112
  requirements:
101
- - - ~>
113
+ - - '='
102
114
  - !ruby/object:Gem::Version
103
- version: 0.3.37
115
+ version: 4.2.11.1
104
116
  type: :development
105
117
  prerelease: false
106
118
  version_requirements: !ruby/object:Gem::Requirement
107
119
  requirements:
108
- - - ~>
120
+ - - '='
109
121
  - !ruby/object:Gem::Version
110
- version: 0.3.37
122
+ version: 4.2.11.1
111
123
  description: Web apps on Rails. Simple, battle-tested conventions for building and
112
124
  testing MVC web applications. Works with any Rack-compatible server.
113
125
  email: david@loudthinking.com
@@ -116,30 +128,29 @@ extensions: []
116
128
  extra_rdoc_files: []
117
129
  files:
118
130
  - CHANGELOG.md
119
- - README.rdoc
120
131
  - MIT-LICENSE
132
+ - README.rdoc
133
+ - lib/abstract_controller.rb
121
134
  - lib/abstract_controller/asset_paths.rb
122
135
  - lib/abstract_controller/base.rb
123
136
  - lib/abstract_controller/callbacks.rb
124
137
  - lib/abstract_controller/collector.rb
125
138
  - lib/abstract_controller/helpers.rb
126
- - lib/abstract_controller/layouts.rb
127
139
  - lib/abstract_controller/logger.rb
128
140
  - lib/abstract_controller/railties/routes_helpers.rb
129
141
  - lib/abstract_controller/rendering.rb
130
142
  - lib/abstract_controller/translation.rb
131
143
  - lib/abstract_controller/url_for.rb
132
- - lib/abstract_controller/view_paths.rb
133
- - lib/abstract_controller.rb
144
+ - lib/action_controller.rb
134
145
  - lib/action_controller/base.rb
135
- - lib/action_controller/caching/fragments.rb
136
146
  - lib/action_controller/caching.rb
137
- - lib/action_controller/deprecated/integration_test.rb
138
- - lib/action_controller/deprecated.rb
147
+ - lib/action_controller/caching/fragments.rb
139
148
  - lib/action_controller/log_subscriber.rb
149
+ - lib/action_controller/metal.rb
140
150
  - lib/action_controller/metal/conditional_get.rb
141
151
  - lib/action_controller/metal/cookies.rb
142
152
  - lib/action_controller/metal/data_streaming.rb
153
+ - lib/action_controller/metal/etag_with_template_digest.rb
143
154
  - lib/action_controller/metal/exceptions.rb
144
155
  - lib/action_controller/metal/flash.rb
145
156
  - lib/action_controller/metal/force_ssl.rb
@@ -158,20 +169,16 @@ files:
158
169
  - lib/action_controller/metal/rendering.rb
159
170
  - lib/action_controller/metal/request_forgery_protection.rb
160
171
  - lib/action_controller/metal/rescue.rb
161
- - lib/action_controller/metal/responder.rb
162
172
  - lib/action_controller/metal/streaming.rb
163
173
  - lib/action_controller/metal/strong_parameters.rb
164
174
  - lib/action_controller/metal/testing.rb
165
175
  - lib/action_controller/metal/url_for.rb
166
- - lib/action_controller/metal.rb
167
176
  - lib/action_controller/middleware.rb
168
177
  - lib/action_controller/model_naming.rb
169
178
  - lib/action_controller/railtie.rb
170
179
  - lib/action_controller/railties/helpers.rb
171
- - lib/action_controller/record_identifier.rb
172
180
  - lib/action_controller/test_case.rb
173
- - lib/action_controller/vendor/html-scanner.rb
174
- - lib/action_controller.rb
181
+ - lib/action_dispatch.rb
175
182
  - lib/action_dispatch/http/cache.rb
176
183
  - lib/action_dispatch/http/filter_parameters.rb
177
184
  - lib/action_dispatch/http/filter_redirect.rb
@@ -186,6 +193,7 @@ files:
186
193
  - lib/action_dispatch/http/response.rb
187
194
  - lib/action_dispatch/http/upload.rb
188
195
  - lib/action_dispatch/http/url.rb
196
+ - lib/action_dispatch/journey.rb
189
197
  - lib/action_dispatch/journey/backwards.rb
190
198
  - lib/action_dispatch/journey/formatter.rb
191
199
  - lib/action_dispatch/journey/gtg/builder.rb
@@ -201,16 +209,15 @@ files:
201
209
  - lib/action_dispatch/journey/parser_extras.rb
202
210
  - lib/action_dispatch/journey/path/pattern.rb
203
211
  - lib/action_dispatch/journey/route.rb
212
+ - lib/action_dispatch/journey/router.rb
204
213
  - lib/action_dispatch/journey/router/strexp.rb
205
214
  - lib/action_dispatch/journey/router/utils.rb
206
- - lib/action_dispatch/journey/router.rb
207
215
  - lib/action_dispatch/journey/routes.rb
208
216
  - lib/action_dispatch/journey/scanner.rb
209
217
  - lib/action_dispatch/journey/visitors.rb
210
218
  - lib/action_dispatch/journey/visualizer/fsm.css
211
219
  - lib/action_dispatch/journey/visualizer/fsm.js
212
220
  - lib/action_dispatch/journey/visualizer/index.html.erb
213
- - lib/action_dispatch/journey.rb
214
221
  - lib/action_dispatch/middleware/callbacks.rb
215
222
  - lib/action_dispatch/middleware/cookies.rb
216
223
  - lib/action_dispatch/middleware/debug_exceptions.rb
@@ -229,19 +236,29 @@ files:
229
236
  - lib/action_dispatch/middleware/ssl.rb
230
237
  - lib/action_dispatch/middleware/stack.rb
231
238
  - lib/action_dispatch/middleware/static.rb
232
- - lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
239
+ - lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
240
+ - lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
233
241
  - lib/action_dispatch/middleware/templates/rescues/_source.erb
234
- - lib/action_dispatch/middleware/templates/rescues/_trace.erb
235
- - lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
242
+ - lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
243
+ - lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
244
+ - lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb
245
+ - lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb
236
246
  - lib/action_dispatch/middleware/templates/rescues/layout.erb
237
- - lib/action_dispatch/middleware/templates/rescues/missing_template.erb
238
- - lib/action_dispatch/middleware/templates/rescues/routing_error.erb
239
- - lib/action_dispatch/middleware/templates/rescues/template_error.erb
240
- - lib/action_dispatch/middleware/templates/rescues/unknown_action.erb
247
+ - lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb
248
+ - lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb
249
+ - lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb
250
+ - lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb
251
+ - lib/action_dispatch/middleware/templates/rescues/template_error.html.erb
252
+ - lib/action_dispatch/middleware/templates/rescues/template_error.text.erb
253
+ - lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb
254
+ - lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb
241
255
  - lib/action_dispatch/middleware/templates/routes/_route.html.erb
242
256
  - lib/action_dispatch/middleware/templates/routes/_table.html.erb
243
257
  - lib/action_dispatch/railtie.rb
244
258
  - lib/action_dispatch/request/session.rb
259
+ - lib/action_dispatch/request/utils.rb
260
+ - lib/action_dispatch/routing.rb
261
+ - lib/action_dispatch/routing/endpoint.rb
245
262
  - lib/action_dispatch/routing/inspector.rb
246
263
  - lib/action_dispatch/routing/mapper.rb
247
264
  - lib/action_dispatch/routing/polymorphic_routes.rb
@@ -249,117 +266,19 @@ files:
249
266
  - lib/action_dispatch/routing/route_set.rb
250
267
  - lib/action_dispatch/routing/routes_proxy.rb
251
268
  - lib/action_dispatch/routing/url_for.rb
252
- - lib/action_dispatch/routing.rb
269
+ - lib/action_dispatch/testing/assertions.rb
253
270
  - lib/action_dispatch/testing/assertions/dom.rb
254
271
  - lib/action_dispatch/testing/assertions/response.rb
255
272
  - lib/action_dispatch/testing/assertions/routing.rb
256
273
  - lib/action_dispatch/testing/assertions/selector.rb
257
274
  - lib/action_dispatch/testing/assertions/tag.rb
258
- - lib/action_dispatch/testing/assertions.rb
259
275
  - lib/action_dispatch/testing/integration.rb
260
276
  - lib/action_dispatch/testing/test_process.rb
261
277
  - lib/action_dispatch/testing/test_request.rb
262
278
  - lib/action_dispatch/testing/test_response.rb
263
- - lib/action_dispatch.rb
264
- - lib/action_pack/version.rb
265
279
  - lib/action_pack.rb
266
- - lib/action_view/base.rb
267
- - lib/action_view/buffers.rb
268
- - lib/action_view/context.rb
269
- - lib/action_view/dependency_tracker.rb
270
- - lib/action_view/digestor.rb
271
- - lib/action_view/flows.rb
272
- - lib/action_view/helpers/active_model_helper.rb
273
- - lib/action_view/helpers/asset_tag_helper.rb
274
- - lib/action_view/helpers/asset_url_helper.rb
275
- - lib/action_view/helpers/atom_feed_helper.rb
276
- - lib/action_view/helpers/cache_helper.rb
277
- - lib/action_view/helpers/capture_helper.rb
278
- - lib/action_view/helpers/controller_helper.rb
279
- - lib/action_view/helpers/csrf_helper.rb
280
- - lib/action_view/helpers/date_helper.rb
281
- - lib/action_view/helpers/debug_helper.rb
282
- - lib/action_view/helpers/form_helper.rb
283
- - lib/action_view/helpers/form_options_helper.rb
284
- - lib/action_view/helpers/form_tag_helper.rb
285
- - lib/action_view/helpers/javascript_helper.rb
286
- - lib/action_view/helpers/number_helper.rb
287
- - lib/action_view/helpers/output_safety_helper.rb
288
- - lib/action_view/helpers/record_tag_helper.rb
289
- - lib/action_view/helpers/rendering_helper.rb
290
- - lib/action_view/helpers/sanitize_helper.rb
291
- - lib/action_view/helpers/tag_helper.rb
292
- - lib/action_view/helpers/tags/base.rb
293
- - lib/action_view/helpers/tags/check_box.rb
294
- - lib/action_view/helpers/tags/checkable.rb
295
- - lib/action_view/helpers/tags/collection_check_boxes.rb
296
- - lib/action_view/helpers/tags/collection_helpers.rb
297
- - lib/action_view/helpers/tags/collection_radio_buttons.rb
298
- - lib/action_view/helpers/tags/collection_select.rb
299
- - lib/action_view/helpers/tags/color_field.rb
300
- - lib/action_view/helpers/tags/date_field.rb
301
- - lib/action_view/helpers/tags/date_select.rb
302
- - lib/action_view/helpers/tags/datetime_field.rb
303
- - lib/action_view/helpers/tags/datetime_local_field.rb
304
- - lib/action_view/helpers/tags/datetime_select.rb
305
- - lib/action_view/helpers/tags/email_field.rb
306
- - lib/action_view/helpers/tags/file_field.rb
307
- - lib/action_view/helpers/tags/grouped_collection_select.rb
308
- - lib/action_view/helpers/tags/hidden_field.rb
309
- - lib/action_view/helpers/tags/label.rb
310
- - lib/action_view/helpers/tags/month_field.rb
311
- - lib/action_view/helpers/tags/number_field.rb
312
- - lib/action_view/helpers/tags/password_field.rb
313
- - lib/action_view/helpers/tags/radio_button.rb
314
- - lib/action_view/helpers/tags/range_field.rb
315
- - lib/action_view/helpers/tags/search_field.rb
316
- - lib/action_view/helpers/tags/select.rb
317
- - lib/action_view/helpers/tags/tel_field.rb
318
- - lib/action_view/helpers/tags/text_area.rb
319
- - lib/action_view/helpers/tags/text_field.rb
320
- - lib/action_view/helpers/tags/time_field.rb
321
- - lib/action_view/helpers/tags/time_select.rb
322
- - lib/action_view/helpers/tags/time_zone_select.rb
323
- - lib/action_view/helpers/tags/url_field.rb
324
- - lib/action_view/helpers/tags/week_field.rb
325
- - lib/action_view/helpers/tags.rb
326
- - lib/action_view/helpers/text_helper.rb
327
- - lib/action_view/helpers/translation_helper.rb
328
- - lib/action_view/helpers/url_helper.rb
329
- - lib/action_view/helpers.rb
330
- - lib/action_view/locale/en.yml
331
- - lib/action_view/log_subscriber.rb
332
- - lib/action_view/lookup_context.rb
333
- - lib/action_view/model_naming.rb
334
- - lib/action_view/path_set.rb
335
- - lib/action_view/railtie.rb
336
- - lib/action_view/record_identifier.rb
337
- - lib/action_view/renderer/abstract_renderer.rb
338
- - lib/action_view/renderer/partial_renderer.rb
339
- - lib/action_view/renderer/renderer.rb
340
- - lib/action_view/renderer/streaming_template_renderer.rb
341
- - lib/action_view/renderer/template_renderer.rb
342
- - lib/action_view/routing_url_for.rb
343
- - lib/action_view/tasks/dependencies.rake
344
- - lib/action_view/template/error.rb
345
- - lib/action_view/template/handlers/builder.rb
346
- - lib/action_view/template/handlers/erb.rb
347
- - lib/action_view/template/handlers/raw.rb
348
- - lib/action_view/template/handlers.rb
349
- - lib/action_view/template/resolver.rb
350
- - lib/action_view/template/text.rb
351
- - lib/action_view/template/types.rb
352
- - lib/action_view/template.rb
353
- - lib/action_view/test_case.rb
354
- - lib/action_view/testing/resolvers.rb
355
- - lib/action_view/vendor/html-scanner/html/document.rb
356
- - lib/action_view/vendor/html-scanner/html/node.rb
357
- - lib/action_view/vendor/html-scanner/html/sanitizer.rb
358
- - lib/action_view/vendor/html-scanner/html/selector.rb
359
- - lib/action_view/vendor/html-scanner/html/tokenizer.rb
360
- - lib/action_view/vendor/html-scanner/html/version.rb
361
- - lib/action_view/vendor/html-scanner.rb
362
- - lib/action_view.rb
280
+ - lib/action_pack/gem_version.rb
281
+ - lib/action_pack/version.rb
363
282
  homepage: http://www.rubyonrails.org
364
283
  licenses:
365
284
  - MIT
@@ -370,18 +289,17 @@ require_paths:
370
289
  - lib
371
290
  required_ruby_version: !ruby/object:Gem::Requirement
372
291
  requirements:
373
- - - '>='
292
+ - - ">="
374
293
  - !ruby/object:Gem::Version
375
294
  version: 1.9.3
376
295
  required_rubygems_version: !ruby/object:Gem::Requirement
377
296
  requirements:
378
- - - '>='
297
+ - - ">="
379
298
  - !ruby/object:Gem::Version
380
299
  version: '0'
381
300
  requirements:
382
301
  - none
383
- rubyforge_project:
384
- rubygems_version: 2.0.3
302
+ rubygems_version: 3.0.1
385
303
  signing_key:
386
304
  specification_version: 4
387
305
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).