actionpack 4.2.11.3 → 5.0.0.beta1

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 (125) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +379 -462
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +2 -3
  5. data/lib/abstract_controller.rb +0 -2
  6. data/lib/abstract_controller/base.rb +17 -32
  7. data/lib/abstract_controller/callbacks.rb +52 -19
  8. data/lib/abstract_controller/collector.rb +4 -9
  9. data/lib/abstract_controller/helpers.rb +2 -2
  10. data/lib/abstract_controller/railties/routes_helpers.rb +2 -2
  11. data/lib/abstract_controller/rendering.rb +27 -22
  12. data/lib/abstract_controller/translation.rb +8 -7
  13. data/lib/action_controller.rb +4 -3
  14. data/lib/action_controller/api.rb +146 -0
  15. data/lib/action_controller/base.rb +6 -10
  16. data/lib/action_controller/caching.rb +1 -3
  17. data/lib/action_controller/caching/fragments.rb +48 -3
  18. data/lib/action_controller/form_builder.rb +48 -0
  19. data/lib/action_controller/log_subscriber.rb +1 -10
  20. data/lib/action_controller/metal.rb +89 -62
  21. data/lib/action_controller/metal/basic_implicit_render.rb +11 -0
  22. data/lib/action_controller/metal/conditional_get.rb +65 -24
  23. data/lib/action_controller/metal/cookies.rb +0 -2
  24. data/lib/action_controller/metal/data_streaming.rb +2 -22
  25. data/lib/action_controller/metal/etag_with_template_digest.rb +1 -1
  26. data/lib/action_controller/metal/exceptions.rb +11 -6
  27. data/lib/action_controller/metal/force_ssl.rb +6 -6
  28. data/lib/action_controller/metal/head.rb +14 -7
  29. data/lib/action_controller/metal/helpers.rb +9 -5
  30. data/lib/action_controller/metal/http_authentication.rb +37 -38
  31. data/lib/action_controller/metal/implicit_render.rb +23 -6
  32. data/lib/action_controller/metal/instrumentation.rb +0 -1
  33. data/lib/action_controller/metal/live.rb +17 -55
  34. data/lib/action_controller/metal/mime_responds.rb +17 -37
  35. data/lib/action_controller/metal/params_wrapper.rb +8 -8
  36. data/lib/action_controller/metal/redirecting.rb +32 -9
  37. data/lib/action_controller/metal/renderers.rb +10 -8
  38. data/lib/action_controller/metal/rendering.rb +38 -6
  39. data/lib/action_controller/metal/request_forgery_protection.rb +67 -35
  40. data/lib/action_controller/metal/rescue.rb +2 -4
  41. data/lib/action_controller/metal/streaming.rb +4 -4
  42. data/lib/action_controller/metal/strong_parameters.rb +231 -78
  43. data/lib/action_controller/metal/testing.rb +1 -12
  44. data/lib/action_controller/metal/url_for.rb +12 -5
  45. data/lib/action_controller/renderer.rb +111 -0
  46. data/lib/action_controller/template_assertions.rb +9 -0
  47. data/lib/action_controller/test_case.rb +267 -363
  48. data/lib/action_dispatch.rb +2 -1
  49. data/lib/action_dispatch/http/cache.rb +23 -26
  50. data/lib/action_dispatch/http/filter_parameters.rb +6 -8
  51. data/lib/action_dispatch/http/filter_redirect.rb +7 -8
  52. data/lib/action_dispatch/http/headers.rb +28 -11
  53. data/lib/action_dispatch/http/mime_negotiation.rb +40 -26
  54. data/lib/action_dispatch/http/mime_type.rb +92 -61
  55. data/lib/action_dispatch/http/mime_types.rb +1 -4
  56. data/lib/action_dispatch/http/parameter_filter.rb +18 -8
  57. data/lib/action_dispatch/http/parameters.rb +45 -41
  58. data/lib/action_dispatch/http/request.rb +146 -82
  59. data/lib/action_dispatch/http/response.rb +180 -99
  60. data/lib/action_dispatch/http/url.rb +117 -8
  61. data/lib/action_dispatch/journey/formatter.rb +34 -28
  62. data/lib/action_dispatch/journey/gtg/transition_table.rb +1 -1
  63. data/lib/action_dispatch/journey/nfa/dot.rb +0 -2
  64. data/lib/action_dispatch/journey/nfa/transition_table.rb +1 -46
  65. data/lib/action_dispatch/journey/nodes/node.rb +14 -4
  66. data/lib/action_dispatch/journey/parser_extras.rb +4 -0
  67. data/lib/action_dispatch/journey/path/pattern.rb +37 -41
  68. data/lib/action_dispatch/journey/route.rb +71 -17
  69. data/lib/action_dispatch/journey/router.rb +5 -6
  70. data/lib/action_dispatch/journey/router/utils.rb +5 -5
  71. data/lib/action_dispatch/journey/routes.rb +14 -15
  72. data/lib/action_dispatch/journey/visitors.rb +86 -43
  73. data/lib/action_dispatch/middleware/cookies.rb +184 -135
  74. data/lib/action_dispatch/middleware/debug_exceptions.rb +115 -45
  75. data/lib/action_dispatch/middleware/exception_wrapper.rb +21 -20
  76. data/lib/action_dispatch/middleware/flash.rb +61 -45
  77. data/lib/action_dispatch/middleware/load_interlock.rb +21 -0
  78. data/lib/action_dispatch/middleware/params_parser.rb +30 -46
  79. data/lib/action_dispatch/middleware/public_exceptions.rb +2 -2
  80. data/lib/action_dispatch/middleware/reloader.rb +2 -4
  81. data/lib/action_dispatch/middleware/remote_ip.rb +29 -19
  82. data/lib/action_dispatch/middleware/request_id.rb +11 -6
  83. data/lib/action_dispatch/middleware/session/abstract_store.rb +23 -11
  84. data/lib/action_dispatch/middleware/session/cache_store.rb +9 -6
  85. data/lib/action_dispatch/middleware/session/cookie_store.rb +29 -23
  86. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +4 -0
  87. data/lib/action_dispatch/middleware/show_exceptions.rb +11 -9
  88. data/lib/action_dispatch/middleware/ssl.rb +93 -36
  89. data/lib/action_dispatch/middleware/stack.rb +43 -48
  90. data/lib/action_dispatch/middleware/static.rb +52 -40
  91. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +2 -14
  92. data/lib/action_dispatch/middleware/templates/rescues/{_source.erb → _source.html.erb} +0 -0
  93. data/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +8 -0
  94. data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +1 -1
  95. data/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +1 -1
  96. data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +4 -4
  97. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +59 -63
  98. data/lib/action_dispatch/railtie.rb +0 -2
  99. data/lib/action_dispatch/request/session.rb +66 -34
  100. data/lib/action_dispatch/request/utils.rb +51 -19
  101. data/lib/action_dispatch/routing.rb +3 -8
  102. data/lib/action_dispatch/routing/inspector.rb +6 -30
  103. data/lib/action_dispatch/routing/mapper.rb +447 -322
  104. data/lib/action_dispatch/routing/polymorphic_routes.rb +8 -14
  105. data/lib/action_dispatch/routing/redirection.rb +3 -3
  106. data/lib/action_dispatch/routing/route_set.rb +124 -227
  107. data/lib/action_dispatch/routing/url_for.rb +27 -10
  108. data/lib/action_dispatch/testing/assertions.rb +1 -1
  109. data/lib/action_dispatch/testing/assertions/response.rb +27 -9
  110. data/lib/action_dispatch/testing/assertions/routing.rb +9 -9
  111. data/lib/action_dispatch/testing/integration.rb +237 -76
  112. data/lib/action_dispatch/testing/test_process.rb +5 -5
  113. data/lib/action_dispatch/testing/test_request.rb +12 -21
  114. data/lib/action_dispatch/testing/test_response.rb +1 -4
  115. data/lib/action_pack.rb +1 -1
  116. data/lib/action_pack/gem_version.rb +4 -4
  117. metadata +26 -25
  118. data/lib/action_controller/metal/hide_actions.rb +0 -40
  119. data/lib/action_controller/metal/rack_delegation.rb +0 -32
  120. data/lib/action_controller/middleware.rb +0 -39
  121. data/lib/action_controller/model_naming.rb +0 -12
  122. data/lib/action_dispatch/journey/router/strexp.rb +0 -27
  123. data/lib/action_dispatch/testing/assertions/dom.rb +0 -3
  124. data/lib/action_dispatch/testing/assertions/selector.rb +0 -3
  125. data/lib/action_dispatch/testing/assertions/tag.rb +0 -3
@@ -5,9 +5,9 @@ require 'active_support/core_ext/hash/indifferent_access'
5
5
  module ActionDispatch
6
6
  module TestProcess
7
7
  def assigns(key = nil)
8
- assigns = {}.with_indifferent_access
9
- @controller.view_assigns.each { |k, v| assigns.regular_writer(k, v) }
10
- key.nil? ? assigns : assigns[key]
8
+ raise NoMethodError,
9
+ "assigns has been extracted to a gem. To continue using it,
10
+ add `gem 'rails-controller-testing'` to your Gemfile."
11
11
  end
12
12
 
13
13
  def session
@@ -19,14 +19,14 @@ module ActionDispatch
19
19
  end
20
20
 
21
21
  def cookies
22
- @request.cookie_jar
22
+ @cookie_jar ||= Cookies::CookieJar.build(@request, @request.cookies)
23
23
  end
24
24
 
25
25
  def redirect_to_url
26
26
  @response.redirect_url
27
27
  end
28
28
 
29
- # Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionController::TestCase.fixture_path, path), type)</tt>:
29
+ # Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.fixture_path, path), type)</tt>:
30
30
  #
31
31
  # post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png')
32
32
  #
@@ -4,19 +4,22 @@ require 'rack/utils'
4
4
  module ActionDispatch
5
5
  class TestRequest < Request
6
6
  DEFAULT_ENV = Rack::MockRequest.env_for('/',
7
- 'HTTP_HOST' => 'test.host',
8
- 'REMOTE_ADDR' => '0.0.0.0',
9
- 'HTTP_USER_AGENT' => 'Rails Testing'
7
+ 'HTTP_HOST' => 'test.host',
8
+ 'REMOTE_ADDR' => '0.0.0.0',
9
+ 'HTTP_USER_AGENT' => 'Rails Testing',
10
10
  )
11
11
 
12
- def self.new(env = {})
13
- super
12
+ # Create a new test request with default `env` values
13
+ def self.create(env = {})
14
+ env = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application
15
+ env["rack.request.cookie_hash"] ||= {}.with_indifferent_access
16
+ new(default_env.merge(env))
14
17
  end
15
18
 
16
- def initialize(env = {})
17
- env = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application
18
- super(default_env.merge(env))
19
+ def self.default_env
20
+ DEFAULT_ENV
19
21
  end
22
+ private_class_method :default_env
20
23
 
21
24
  def request_method=(method)
22
25
  @env['REQUEST_METHOD'] = method.to_s.upcase
@@ -60,19 +63,7 @@ module ActionDispatch
60
63
 
61
64
  def accept=(mime_types)
62
65
  @env.delete('action_dispatch.request.accepts')
63
- @env['HTTP_ACCEPT'] = Array(mime_types).collect { |mime_type| mime_type.to_s }.join(",")
64
- end
65
-
66
- alias :rack_cookies :cookies
67
-
68
- def cookies
69
- @cookies ||= {}.with_indifferent_access
70
- end
71
-
72
- private
73
-
74
- def default_env
75
- DEFAULT_ENV
66
+ @env['HTTP_ACCEPT'] = Array(mime_types).collect(&:to_s).join(",")
76
67
  end
77
68
  end
78
69
  end
@@ -7,7 +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 response.status, response.headers, response.body, default_headers: nil
10
+ new response.status, response.headers, response.body
11
11
  end
12
12
 
13
13
  # Was the response successful?
@@ -16,9 +16,6 @@ module ActionDispatch
16
16
  # Was the URL not found?
17
17
  alias_method :missing?, :not_found?
18
18
 
19
- # Were we redirected?
20
- alias_method :redirect?, :redirection?
21
-
22
19
  # Was there a server-side error?
23
20
  alias_method :error?, :server_error?
24
21
  end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2004-2014 David Heinemeier Hansson
2
+ # Copyright (c) 2004-2015 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
@@ -5,10 +5,10 @@ module ActionPack
5
5
  end
6
6
 
7
7
  module VERSION
8
- MAJOR = 4
9
- MINOR = 2
10
- TINY = 11
11
- PRE = "3"
8
+ MAJOR = 5
9
+ MINOR = 0
10
+ TINY = 0
11
+ PRE = "beta1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
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.2.11.3
4
+ version: 5.0.0.beta1
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: 2020-05-15 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.11.3
19
+ version: 5.0.0.beta1
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.2.11.3
26
+ version: 5.0.0.beta1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: 2.x
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: '1.6'
40
+ version: 2.x
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rack-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.6.2
47
+ version: 0.6.3
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: 0.6.2
54
+ version: 0.6.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rails-html-sanitizer
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -98,28 +98,28 @@ dependencies:
98
98
  requirements:
99
99
  - - '='
100
100
  - !ruby/object:Gem::Version
101
- version: 4.2.11.3
101
+ version: 5.0.0.beta1
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
106
  - - '='
107
107
  - !ruby/object:Gem::Version
108
- version: 4.2.11.3
108
+ version: 5.0.0.beta1
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: activemodel
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - '='
114
114
  - !ruby/object:Gem::Version
115
- version: 4.2.11.3
115
+ version: 5.0.0.beta1
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - '='
121
121
  - !ruby/object:Gem::Version
122
- version: 4.2.11.3
122
+ version: 5.0.0.beta1
123
123
  description: Web apps on Rails. Simple, battle-tested conventions for building and
124
124
  testing MVC web applications. Works with any Rack-compatible server.
125
125
  email: david@loudthinking.com
@@ -142,11 +142,14 @@ files:
142
142
  - lib/abstract_controller/translation.rb
143
143
  - lib/abstract_controller/url_for.rb
144
144
  - lib/action_controller.rb
145
+ - lib/action_controller/api.rb
145
146
  - lib/action_controller/base.rb
146
147
  - lib/action_controller/caching.rb
147
148
  - lib/action_controller/caching/fragments.rb
149
+ - lib/action_controller/form_builder.rb
148
150
  - lib/action_controller/log_subscriber.rb
149
151
  - lib/action_controller/metal.rb
152
+ - lib/action_controller/metal/basic_implicit_render.rb
150
153
  - lib/action_controller/metal/conditional_get.rb
151
154
  - lib/action_controller/metal/cookies.rb
152
155
  - lib/action_controller/metal/data_streaming.rb
@@ -156,14 +159,12 @@ files:
156
159
  - lib/action_controller/metal/force_ssl.rb
157
160
  - lib/action_controller/metal/head.rb
158
161
  - lib/action_controller/metal/helpers.rb
159
- - lib/action_controller/metal/hide_actions.rb
160
162
  - lib/action_controller/metal/http_authentication.rb
161
163
  - lib/action_controller/metal/implicit_render.rb
162
164
  - lib/action_controller/metal/instrumentation.rb
163
165
  - lib/action_controller/metal/live.rb
164
166
  - lib/action_controller/metal/mime_responds.rb
165
167
  - lib/action_controller/metal/params_wrapper.rb
166
- - lib/action_controller/metal/rack_delegation.rb
167
168
  - lib/action_controller/metal/redirecting.rb
168
169
  - lib/action_controller/metal/renderers.rb
169
170
  - lib/action_controller/metal/rendering.rb
@@ -173,10 +174,10 @@ files:
173
174
  - lib/action_controller/metal/strong_parameters.rb
174
175
  - lib/action_controller/metal/testing.rb
175
176
  - lib/action_controller/metal/url_for.rb
176
- - lib/action_controller/middleware.rb
177
- - lib/action_controller/model_naming.rb
178
177
  - lib/action_controller/railtie.rb
179
178
  - lib/action_controller/railties/helpers.rb
179
+ - lib/action_controller/renderer.rb
180
+ - lib/action_controller/template_assertions.rb
180
181
  - lib/action_controller/test_case.rb
181
182
  - lib/action_dispatch.rb
182
183
  - lib/action_dispatch/http/cache.rb
@@ -210,7 +211,6 @@ files:
210
211
  - lib/action_dispatch/journey/path/pattern.rb
211
212
  - lib/action_dispatch/journey/route.rb
212
213
  - lib/action_dispatch/journey/router.rb
213
- - lib/action_dispatch/journey/router/strexp.rb
214
214
  - lib/action_dispatch/journey/router/utils.rb
215
215
  - lib/action_dispatch/journey/routes.rb
216
216
  - lib/action_dispatch/journey/scanner.rb
@@ -223,6 +223,7 @@ files:
223
223
  - lib/action_dispatch/middleware/debug_exceptions.rb
224
224
  - lib/action_dispatch/middleware/exception_wrapper.rb
225
225
  - lib/action_dispatch/middleware/flash.rb
226
+ - lib/action_dispatch/middleware/load_interlock.rb
226
227
  - lib/action_dispatch/middleware/params_parser.rb
227
228
  - lib/action_dispatch/middleware/public_exceptions.rb
228
229
  - lib/action_dispatch/middleware/reloader.rb
@@ -238,7 +239,8 @@ files:
238
239
  - lib/action_dispatch/middleware/static.rb
239
240
  - lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
240
241
  - lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
241
- - lib/action_dispatch/middleware/templates/rescues/_source.erb
242
+ - lib/action_dispatch/middleware/templates/rescues/_source.html.erb
243
+ - lib/action_dispatch/middleware/templates/rescues/_source.text.erb
242
244
  - lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
243
245
  - lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
244
246
  - lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb
@@ -267,11 +269,8 @@ files:
267
269
  - lib/action_dispatch/routing/routes_proxy.rb
268
270
  - lib/action_dispatch/routing/url_for.rb
269
271
  - lib/action_dispatch/testing/assertions.rb
270
- - lib/action_dispatch/testing/assertions/dom.rb
271
272
  - lib/action_dispatch/testing/assertions/response.rb
272
273
  - lib/action_dispatch/testing/assertions/routing.rb
273
- - lib/action_dispatch/testing/assertions/selector.rb
274
- - lib/action_dispatch/testing/assertions/tag.rb
275
274
  - lib/action_dispatch/testing/integration.rb
276
275
  - lib/action_dispatch/testing/test_process.rb
277
276
  - lib/action_dispatch/testing/test_request.rb
@@ -291,16 +290,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
291
290
  requirements:
292
291
  - - ">="
293
292
  - !ruby/object:Gem::Version
294
- version: 1.9.3
293
+ version: 2.2.2
295
294
  required_rubygems_version: !ruby/object:Gem::Requirement
296
295
  requirements:
297
- - - ">="
296
+ - - ">"
298
297
  - !ruby/object:Gem::Version
299
- version: '0'
298
+ version: 1.3.1
300
299
  requirements:
301
300
  - none
302
- rubygems_version: 3.0.3
301
+ rubyforge_project:
302
+ rubygems_version: 2.5.1
303
303
  signing_key:
304
304
  specification_version: 4
305
305
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
306
306
  test_files: []
307
+ has_rdoc:
@@ -1,40 +0,0 @@
1
-
2
- module ActionController
3
- # Adds the ability to prevent public methods on a controller to be called as actions.
4
- module HideActions
5
- extend ActiveSupport::Concern
6
-
7
- included do
8
- class_attribute :hidden_actions
9
- self.hidden_actions = Set.new.freeze
10
- end
11
-
12
- private
13
-
14
- # Overrides AbstractController::Base#action_method? to return false if the
15
- # action name is in the list of hidden actions.
16
- def method_for_action(action_name)
17
- self.class.visible_action?(action_name) && super
18
- end
19
-
20
- module ClassMethods
21
- # Sets all of the actions passed in as hidden actions.
22
- #
23
- # ==== Parameters
24
- # * <tt>args</tt> - A list of actions
25
- def hide_action(*args)
26
- self.hidden_actions = hidden_actions.dup.merge(args.map(&:to_s)).freeze
27
- end
28
-
29
- def visible_action?(action_name)
30
- not hidden_actions.include?(action_name)
31
- end
32
-
33
- # Overrides AbstractController::Base#action_methods to remove any methods
34
- # that are listed as hidden methods.
35
- def action_methods
36
- @action_methods ||= Set.new(super.reject { |name| hidden_actions.include?(name) }).freeze
37
- end
38
- end
39
- end
40
- end
@@ -1,32 +0,0 @@
1
- require 'action_dispatch/http/request'
2
- require 'action_dispatch/http/response'
3
-
4
- module ActionController
5
- module RackDelegation
6
- extend ActiveSupport::Concern
7
-
8
- delegate :headers, :status=, :location=, :content_type=,
9
- :status, :location, :content_type, :response_code, :to => "@_response"
10
-
11
- def dispatch(action, request)
12
- set_response!(request)
13
- super(action, request)
14
- end
15
-
16
- def response_body=(body)
17
- response.body = body if response
18
- super
19
- end
20
-
21
- def reset_session
22
- @_request.reset_session
23
- end
24
-
25
- private
26
-
27
- def set_response!(request)
28
- @_response = ActionDispatch::Response.new
29
- @_response.request = request
30
- end
31
- end
32
- end
@@ -1,39 +0,0 @@
1
- module ActionController
2
- class Middleware < Metal
3
- class ActionMiddleware
4
- def initialize(controller, app)
5
- @controller, @app = controller, app
6
- end
7
-
8
- def call(env)
9
- request = ActionDispatch::Request.new(env)
10
- @controller.build(@app).dispatch(:index, request)
11
- end
12
- end
13
-
14
- class << self
15
- alias build new
16
-
17
- def new(app)
18
- ActionMiddleware.new(self, app)
19
- end
20
- end
21
-
22
- attr_internal :app
23
-
24
- def process(action)
25
- response = super
26
- self.status, self.headers, self.response_body = response if response.is_a?(Array)
27
- response
28
- end
29
-
30
- def initialize(app)
31
- super()
32
- @_app = app
33
- end
34
-
35
- def index
36
- call(env)
37
- end
38
- end
39
- end
@@ -1,12 +0,0 @@
1
- module ActionController
2
- module ModelNaming
3
- # Converts the given object to an ActiveModel compliant one.
4
- def convert_to_model(object)
5
- object.respond_to?(:to_model) ? object.to_model : object
6
- end
7
-
8
- def model_name_from_record_or_class(record_or_class)
9
- convert_to_model(record_or_class).model_name
10
- end
11
- end
12
- end