actionpack 4.2.11.3 → 5.0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +890 -384
- data/MIT-LICENSE +1 -1
- data/README.rdoc +2 -3
- data/lib/abstract_controller/base.rb +28 -38
- data/lib/{action_controller → abstract_controller}/caching/fragments.rb +51 -11
- data/lib/abstract_controller/caching.rb +62 -0
- data/lib/abstract_controller/callbacks.rb +54 -19
- data/lib/abstract_controller/collector.rb +4 -9
- data/lib/abstract_controller/error.rb +4 -0
- data/lib/abstract_controller/helpers.rb +4 -3
- data/lib/abstract_controller/railties/routes_helpers.rb +2 -2
- data/lib/abstract_controller/rendering.rb +28 -18
- data/lib/abstract_controller/translation.rb +8 -7
- data/lib/abstract_controller.rb +6 -2
- data/lib/action_controller/api/api_rendering.rb +14 -0
- data/lib/action_controller/api.rb +147 -0
- data/lib/action_controller/base.rb +14 -11
- data/lib/action_controller/caching.rb +13 -58
- data/lib/action_controller/form_builder.rb +48 -0
- data/lib/action_controller/log_subscriber.rb +3 -10
- data/lib/action_controller/metal/basic_implicit_render.rb +11 -0
- data/lib/action_controller/metal/conditional_get.rb +106 -34
- data/lib/action_controller/metal/cookies.rb +1 -3
- data/lib/action_controller/metal/data_streaming.rb +14 -34
- data/lib/action_controller/metal/etag_with_template_digest.rb +8 -2
- data/lib/action_controller/metal/exceptions.rb +11 -6
- data/lib/action_controller/metal/force_ssl.rb +11 -11
- data/lib/action_controller/metal/head.rb +14 -8
- data/lib/action_controller/metal/helpers.rb +15 -6
- data/lib/action_controller/metal/http_authentication.rb +44 -35
- data/lib/action_controller/metal/implicit_render.rb +61 -6
- data/lib/action_controller/metal/instrumentation.rb +5 -5
- data/lib/action_controller/metal/live.rb +71 -88
- data/lib/action_controller/metal/mime_responds.rb +27 -42
- data/lib/action_controller/metal/params_wrapper.rb +9 -9
- data/lib/action_controller/metal/redirecting.rb +32 -9
- data/lib/action_controller/metal/renderers.rb +83 -40
- data/lib/action_controller/metal/rendering.rb +38 -6
- data/lib/action_controller/metal/request_forgery_protection.rb +126 -48
- data/lib/action_controller/metal/rescue.rb +3 -12
- data/lib/action_controller/metal/streaming.rb +4 -4
- data/lib/action_controller/metal/strong_parameters.rb +527 -134
- data/lib/action_controller/metal/testing.rb +1 -12
- data/lib/action_controller/metal/url_for.rb +12 -5
- data/lib/action_controller/metal.rb +88 -63
- data/lib/action_controller/railtie.rb +11 -7
- data/lib/action_controller/renderer.rb +113 -0
- data/lib/action_controller/template_assertions.rb +9 -0
- data/lib/action_controller/test_case.rb +311 -374
- data/lib/action_controller.rb +12 -9
- data/lib/action_dispatch/http/cache.rb +73 -34
- data/lib/action_dispatch/http/filter_parameters.rb +16 -12
- data/lib/action_dispatch/http/filter_redirect.rb +7 -8
- data/lib/action_dispatch/http/headers.rb +45 -14
- data/lib/action_dispatch/http/mime_negotiation.rb +42 -23
- data/lib/action_dispatch/http/mime_type.rb +126 -90
- data/lib/action_dispatch/http/mime_types.rb +3 -4
- data/lib/action_dispatch/http/parameter_filter.rb +19 -9
- data/lib/action_dispatch/http/parameters.rb +70 -40
- data/lib/action_dispatch/http/request.rb +144 -89
- data/lib/action_dispatch/http/response.rb +215 -102
- data/lib/action_dispatch/http/upload.rb +6 -2
- data/lib/action_dispatch/http/url.rb +117 -8
- data/lib/action_dispatch/journey/formatter.rb +47 -30
- data/lib/action_dispatch/journey/gtg/transition_table.rb +1 -1
- data/lib/action_dispatch/journey/nfa/dot.rb +0 -2
- data/lib/action_dispatch/journey/nfa/transition_table.rb +1 -46
- data/lib/action_dispatch/journey/nodes/node.rb +14 -4
- data/lib/action_dispatch/journey/parser.rb +2 -0
- data/lib/action_dispatch/journey/parser_extras.rb +8 -2
- data/lib/action_dispatch/journey/path/pattern.rb +38 -42
- data/lib/action_dispatch/journey/route.rb +88 -26
- data/lib/action_dispatch/journey/router/utils.rb +5 -5
- data/lib/action_dispatch/journey/router.rb +8 -10
- data/lib/action_dispatch/journey/routes.rb +14 -15
- data/lib/action_dispatch/journey/visitors.rb +89 -44
- data/lib/action_dispatch/middleware/callbacks.rb +10 -1
- data/lib/action_dispatch/middleware/cookies.rb +188 -134
- data/lib/action_dispatch/middleware/debug_exceptions.rb +128 -49
- data/lib/action_dispatch/middleware/debug_locks.rb +122 -0
- data/lib/action_dispatch/middleware/exception_wrapper.rb +21 -21
- data/lib/action_dispatch/middleware/executor.rb +19 -0
- data/lib/action_dispatch/middleware/flash.rb +66 -45
- data/lib/action_dispatch/middleware/params_parser.rb +32 -46
- data/lib/action_dispatch/middleware/public_exceptions.rb +2 -2
- data/lib/action_dispatch/middleware/reloader.rb +14 -58
- data/lib/action_dispatch/middleware/remote_ip.rb +29 -19
- data/lib/action_dispatch/middleware/request_id.rb +11 -6
- data/lib/action_dispatch/middleware/session/abstract_store.rb +23 -11
- data/lib/action_dispatch/middleware/session/cache_store.rb +9 -6
- data/lib/action_dispatch/middleware/session/cookie_store.rb +30 -24
- data/lib/action_dispatch/middleware/session/mem_cache_store.rb +4 -0
- data/lib/action_dispatch/middleware/show_exceptions.rb +11 -9
- data/lib/action_dispatch/middleware/ssl.rb +124 -36
- data/lib/action_dispatch/middleware/stack.rb +44 -40
- data/lib/action_dispatch/middleware/static.rb +51 -35
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +2 -14
- data/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +8 -0
- data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +4 -4
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +59 -63
- data/lib/action_dispatch/railtie.rb +2 -2
- data/lib/action_dispatch/request/session.rb +69 -33
- data/lib/action_dispatch/request/utils.rb +51 -19
- data/lib/action_dispatch/routing/inspector.rb +32 -43
- data/lib/action_dispatch/routing/mapper.rb +515 -348
- data/lib/action_dispatch/routing/polymorphic_routes.rb +8 -14
- data/lib/action_dispatch/routing/redirection.rb +5 -4
- data/lib/action_dispatch/routing/route_set.rb +148 -240
- data/lib/action_dispatch/routing/url_for.rb +27 -10
- data/lib/action_dispatch/routing.rb +17 -13
- data/lib/action_dispatch/testing/assertion_response.rb +45 -0
- data/lib/action_dispatch/testing/assertions/response.rb +38 -20
- data/lib/action_dispatch/testing/assertions/routing.rb +16 -12
- data/lib/action_dispatch/testing/assertions.rb +1 -1
- data/lib/action_dispatch/testing/integration.rb +377 -149
- data/lib/action_dispatch/testing/request_encoder.rb +53 -0
- data/lib/action_dispatch/testing/test_process.rb +24 -20
- data/lib/action_dispatch/testing/test_request.rb +22 -31
- data/lib/action_dispatch/testing/test_response.rb +12 -4
- data/lib/action_dispatch.rb +4 -1
- data/lib/action_pack/gem_version.rb +4 -4
- data/lib/action_pack.rb +1 -1
- metadata +32 -34
- data/lib/action_controller/metal/hide_actions.rb +0 -40
- data/lib/action_controller/metal/rack_delegation.rb +0 -32
- data/lib/action_controller/middleware.rb +0 -39
- data/lib/action_controller/model_naming.rb +0 -12
- data/lib/action_dispatch/journey/backwards.rb +0 -5
- data/lib/action_dispatch/journey/router/strexp.rb +0 -27
- data/lib/action_dispatch/testing/assertions/dom.rb +0 -3
- data/lib/action_dispatch/testing/assertions/selector.rb +0 -3
- data/lib/action_dispatch/testing/assertions/tag.rb +0 -3
- /data/lib/action_dispatch/middleware/templates/rescues/{_source.erb → _source.html.erb} +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
module ActionDispatch
|
|
2
|
+
class RequestEncoder # :nodoc:
|
|
3
|
+
class IdentityEncoder
|
|
4
|
+
def content_type; end
|
|
5
|
+
def accept_header; end
|
|
6
|
+
def encode_params(params); params; end
|
|
7
|
+
def response_parser; -> body { body }; end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
@encoders = { identity: IdentityEncoder.new }
|
|
11
|
+
|
|
12
|
+
attr_reader :response_parser
|
|
13
|
+
|
|
14
|
+
def initialize(mime_name, param_encoder, response_parser)
|
|
15
|
+
@mime = Mime[mime_name]
|
|
16
|
+
|
|
17
|
+
unless @mime
|
|
18
|
+
raise ArgumentError, "Can't register a request encoder for " \
|
|
19
|
+
"unregistered MIME Type: #{mime_name}. See `Mime::Type.register`."
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
@response_parser = response_parser || -> body { body }
|
|
23
|
+
@param_encoder = param_encoder || :"to_#{@mime.symbol}".to_proc
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def content_type
|
|
27
|
+
@mime.to_s
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def accept_header
|
|
31
|
+
@mime.to_s
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def encode_params(params)
|
|
35
|
+
@param_encoder.call(params)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def self.parser(content_type)
|
|
39
|
+
mime = Mime::Type.lookup(content_type)
|
|
40
|
+
encoder(mime ? mime.ref : nil).response_parser
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def self.encoder(name)
|
|
44
|
+
@encoders[name] || @encoders[:identity]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def self.register_encoder(mime_name, param_encoder: nil, response_parser: nil)
|
|
48
|
+
@encoders[mime_name] = new(mime_name, param_encoder, response_parser)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
register_encoder :json, response_parser: -> body { JSON.parse(body) }
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
require 'action_dispatch/middleware/cookies'
|
|
2
2
|
require 'action_dispatch/middleware/flash'
|
|
3
|
-
require 'active_support/core_ext/hash/indifferent_access'
|
|
4
3
|
|
|
5
4
|
module ActionDispatch
|
|
6
5
|
module TestProcess
|
|
6
|
+
module FixtureFile
|
|
7
|
+
# Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.fixture_path, path), type)</tt>:
|
|
8
|
+
#
|
|
9
|
+
# post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png')
|
|
10
|
+
#
|
|
11
|
+
# To upload binary files on Windows, pass <tt>:binary</tt> as the last parameter.
|
|
12
|
+
# This will not affect other platforms:
|
|
13
|
+
#
|
|
14
|
+
# post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png', :binary)
|
|
15
|
+
def fixture_file_upload(path, mime_type = nil, binary = false)
|
|
16
|
+
if self.class.respond_to?(:fixture_path) && self.class.fixture_path &&
|
|
17
|
+
!File.exist?(path)
|
|
18
|
+
path = File.join(self.class.fixture_path, path)
|
|
19
|
+
end
|
|
20
|
+
Rack::Test::UploadedFile.new(path, mime_type, binary)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
include FixtureFile
|
|
25
|
+
|
|
7
26
|
def assigns(key = nil)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
27
|
+
raise NoMethodError,
|
|
28
|
+
"assigns has been extracted to a gem. To continue using it,
|
|
29
|
+
add `gem 'rails-controller-testing'` to your Gemfile."
|
|
11
30
|
end
|
|
12
31
|
|
|
13
32
|
def session
|
|
@@ -19,26 +38,11 @@ module ActionDispatch
|
|
|
19
38
|
end
|
|
20
39
|
|
|
21
40
|
def cookies
|
|
22
|
-
@request.
|
|
41
|
+
@cookie_jar ||= Cookies::CookieJar.build(@request, @request.cookies)
|
|
23
42
|
end
|
|
24
43
|
|
|
25
44
|
def redirect_to_url
|
|
26
45
|
@response.redirect_url
|
|
27
46
|
end
|
|
28
|
-
|
|
29
|
-
# Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionController::TestCase.fixture_path, path), type)</tt>:
|
|
30
|
-
#
|
|
31
|
-
# post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png')
|
|
32
|
-
#
|
|
33
|
-
# To upload binary files on Windows, pass <tt>:binary</tt> as the last parameter.
|
|
34
|
-
# This will not affect other platforms:
|
|
35
|
-
#
|
|
36
|
-
# post :change_avatar, avatar: fixture_file_upload('files/spongebob.png', 'image/png', :binary)
|
|
37
|
-
def fixture_file_upload(path, mime_type = nil, binary = false)
|
|
38
|
-
if self.class.respond_to?(:fixture_path) && self.class.fixture_path
|
|
39
|
-
path = File.join(self.class.fixture_path, path)
|
|
40
|
-
end
|
|
41
|
-
Rack::Test::UploadedFile.new(path, mime_type, binary)
|
|
42
|
-
end
|
|
43
47
|
end
|
|
44
48
|
end
|
|
@@ -4,38 +4,41 @@ require 'rack/utils'
|
|
|
4
4
|
module ActionDispatch
|
|
5
5
|
class TestRequest < Request
|
|
6
6
|
DEFAULT_ENV = Rack::MockRequest.env_for('/',
|
|
7
|
-
'HTTP_HOST'
|
|
8
|
-
'REMOTE_ADDR'
|
|
9
|
-
'HTTP_USER_AGENT'
|
|
7
|
+
'HTTP_HOST' => 'test.host',
|
|
8
|
+
'REMOTE_ADDR' => '0.0.0.0',
|
|
9
|
+
'HTTP_USER_AGENT' => 'Rails Testing',
|
|
10
10
|
)
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
17
|
-
|
|
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
|
+
super(method.to_s.upcase)
|
|
23
26
|
end
|
|
24
27
|
|
|
25
28
|
def host=(host)
|
|
26
|
-
|
|
29
|
+
set_header('HTTP_HOST', host)
|
|
27
30
|
end
|
|
28
31
|
|
|
29
32
|
def port=(number)
|
|
30
|
-
|
|
33
|
+
set_header('SERVER_PORT', number.to_i)
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
def request_uri=(uri)
|
|
34
|
-
|
|
37
|
+
set_header('REQUEST_URI', uri)
|
|
35
38
|
end
|
|
36
39
|
|
|
37
40
|
def path=(path)
|
|
38
|
-
|
|
41
|
+
set_header('PATH_INFO', path)
|
|
39
42
|
end
|
|
40
43
|
|
|
41
44
|
def action=(action_name)
|
|
@@ -43,36 +46,24 @@ module ActionDispatch
|
|
|
43
46
|
end
|
|
44
47
|
|
|
45
48
|
def if_modified_since=(last_modified)
|
|
46
|
-
|
|
49
|
+
set_header('HTTP_IF_MODIFIED_SINCE', last_modified)
|
|
47
50
|
end
|
|
48
51
|
|
|
49
52
|
def if_none_match=(etag)
|
|
50
|
-
|
|
53
|
+
set_header('HTTP_IF_NONE_MATCH', etag)
|
|
51
54
|
end
|
|
52
55
|
|
|
53
56
|
def remote_addr=(addr)
|
|
54
|
-
|
|
57
|
+
set_header('REMOTE_ADDR', addr)
|
|
55
58
|
end
|
|
56
59
|
|
|
57
60
|
def user_agent=(user_agent)
|
|
58
|
-
|
|
61
|
+
set_header('HTTP_USER_AGENT', user_agent)
|
|
59
62
|
end
|
|
60
63
|
|
|
61
64
|
def accept=(mime_types)
|
|
62
|
-
|
|
63
|
-
|
|
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
|
|
65
|
+
delete_header('action_dispatch.request.accepts')
|
|
66
|
+
set_header('HTTP_ACCEPT', Array(mime_types).collect(&:to_s).join(","))
|
|
76
67
|
end
|
|
77
68
|
end
|
|
78
69
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'action_dispatch/testing/request_encoder'
|
|
2
|
+
|
|
1
3
|
module ActionDispatch
|
|
2
4
|
# Integration test methods such as ActionDispatch::Integration::Session#get
|
|
3
5
|
# and ActionDispatch::Integration::Session#post return objects of class
|
|
@@ -7,7 +9,12 @@ module ActionDispatch
|
|
|
7
9
|
# See Response for more information on controller response objects.
|
|
8
10
|
class TestResponse < Response
|
|
9
11
|
def self.from_response(response)
|
|
10
|
-
new response.status, response.headers, response.body
|
|
12
|
+
new response.status, response.headers, response.body
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def initialize(*) # :nodoc:
|
|
16
|
+
super
|
|
17
|
+
@response_parser = RequestEncoder.parser(content_type)
|
|
11
18
|
end
|
|
12
19
|
|
|
13
20
|
# Was the response successful?
|
|
@@ -16,10 +23,11 @@ module ActionDispatch
|
|
|
16
23
|
# Was the URL not found?
|
|
17
24
|
alias_method :missing?, :not_found?
|
|
18
25
|
|
|
19
|
-
# Were we redirected?
|
|
20
|
-
alias_method :redirect?, :redirection?
|
|
21
|
-
|
|
22
26
|
# Was there a server-side error?
|
|
23
27
|
alias_method :error?, :server_error?
|
|
28
|
+
|
|
29
|
+
def parsed_body
|
|
30
|
+
@parsed_body ||= @response_parser.call(body)
|
|
31
|
+
end
|
|
24
32
|
end
|
|
25
33
|
end
|
data/lib/action_dispatch.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#--
|
|
2
|
-
# Copyright (c) 2004-
|
|
2
|
+
# Copyright (c) 2004-2016 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
|
|
@@ -50,7 +50,9 @@ module ActionDispatch
|
|
|
50
50
|
autoload :Callbacks
|
|
51
51
|
autoload :Cookies
|
|
52
52
|
autoload :DebugExceptions
|
|
53
|
+
autoload :DebugLocks
|
|
53
54
|
autoload :ExceptionWrapper
|
|
55
|
+
autoload :Executor
|
|
54
56
|
autoload :Flash
|
|
55
57
|
autoload :ParamsParser
|
|
56
58
|
autoload :PublicExceptions
|
|
@@ -94,6 +96,7 @@ module ActionDispatch
|
|
|
94
96
|
autoload :TestProcess
|
|
95
97
|
autoload :TestRequest
|
|
96
98
|
autoload :TestResponse
|
|
99
|
+
autoload :AssertionResponse
|
|
97
100
|
end
|
|
98
101
|
end
|
|
99
102
|
|
data/lib/action_pack.rb
CHANGED
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
|
+
version: 5.0.7.2
|
|
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:
|
|
11
|
+
date: 2019-03-13 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:
|
|
19
|
+
version: 5.0.7.2
|
|
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:
|
|
26
|
+
version: 5.0.7.2
|
|
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: '
|
|
33
|
+
version: '2.0'
|
|
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: '
|
|
40
|
+
version: '2.0'
|
|
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.
|
|
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.
|
|
54
|
+
version: 0.6.3
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: rails-html-sanitizer
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -78,48 +78,42 @@ dependencies:
|
|
|
78
78
|
requirements:
|
|
79
79
|
- - "~>"
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '
|
|
82
|
-
- - ">="
|
|
83
|
-
- !ruby/object:Gem::Version
|
|
84
|
-
version: 1.0.5
|
|
81
|
+
version: '2.0'
|
|
85
82
|
type: :runtime
|
|
86
83
|
prerelease: false
|
|
87
84
|
version_requirements: !ruby/object:Gem::Requirement
|
|
88
85
|
requirements:
|
|
89
86
|
- - "~>"
|
|
90
87
|
- !ruby/object:Gem::Version
|
|
91
|
-
version: '
|
|
92
|
-
- - ">="
|
|
93
|
-
- !ruby/object:Gem::Version
|
|
94
|
-
version: 1.0.5
|
|
88
|
+
version: '2.0'
|
|
95
89
|
- !ruby/object:Gem::Dependency
|
|
96
90
|
name: actionview
|
|
97
91
|
requirement: !ruby/object:Gem::Requirement
|
|
98
92
|
requirements:
|
|
99
93
|
- - '='
|
|
100
94
|
- !ruby/object:Gem::Version
|
|
101
|
-
version:
|
|
95
|
+
version: 5.0.7.2
|
|
102
96
|
type: :runtime
|
|
103
97
|
prerelease: false
|
|
104
98
|
version_requirements: !ruby/object:Gem::Requirement
|
|
105
99
|
requirements:
|
|
106
100
|
- - '='
|
|
107
101
|
- !ruby/object:Gem::Version
|
|
108
|
-
version:
|
|
102
|
+
version: 5.0.7.2
|
|
109
103
|
- !ruby/object:Gem::Dependency
|
|
110
104
|
name: activemodel
|
|
111
105
|
requirement: !ruby/object:Gem::Requirement
|
|
112
106
|
requirements:
|
|
113
107
|
- - '='
|
|
114
108
|
- !ruby/object:Gem::Version
|
|
115
|
-
version:
|
|
109
|
+
version: 5.0.7.2
|
|
116
110
|
type: :development
|
|
117
111
|
prerelease: false
|
|
118
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
119
113
|
requirements:
|
|
120
114
|
- - '='
|
|
121
115
|
- !ruby/object:Gem::Version
|
|
122
|
-
version:
|
|
116
|
+
version: 5.0.7.2
|
|
123
117
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
|
124
118
|
testing MVC web applications. Works with any Rack-compatible server.
|
|
125
119
|
email: david@loudthinking.com
|
|
@@ -133,8 +127,11 @@ files:
|
|
|
133
127
|
- lib/abstract_controller.rb
|
|
134
128
|
- lib/abstract_controller/asset_paths.rb
|
|
135
129
|
- lib/abstract_controller/base.rb
|
|
130
|
+
- lib/abstract_controller/caching.rb
|
|
131
|
+
- lib/abstract_controller/caching/fragments.rb
|
|
136
132
|
- lib/abstract_controller/callbacks.rb
|
|
137
133
|
- lib/abstract_controller/collector.rb
|
|
134
|
+
- lib/abstract_controller/error.rb
|
|
138
135
|
- lib/abstract_controller/helpers.rb
|
|
139
136
|
- lib/abstract_controller/logger.rb
|
|
140
137
|
- lib/abstract_controller/railties/routes_helpers.rb
|
|
@@ -142,11 +139,14 @@ files:
|
|
|
142
139
|
- lib/abstract_controller/translation.rb
|
|
143
140
|
- lib/abstract_controller/url_for.rb
|
|
144
141
|
- lib/action_controller.rb
|
|
142
|
+
- lib/action_controller/api.rb
|
|
143
|
+
- lib/action_controller/api/api_rendering.rb
|
|
145
144
|
- lib/action_controller/base.rb
|
|
146
145
|
- lib/action_controller/caching.rb
|
|
147
|
-
- lib/action_controller/
|
|
146
|
+
- lib/action_controller/form_builder.rb
|
|
148
147
|
- lib/action_controller/log_subscriber.rb
|
|
149
148
|
- lib/action_controller/metal.rb
|
|
149
|
+
- lib/action_controller/metal/basic_implicit_render.rb
|
|
150
150
|
- lib/action_controller/metal/conditional_get.rb
|
|
151
151
|
- lib/action_controller/metal/cookies.rb
|
|
152
152
|
- lib/action_controller/metal/data_streaming.rb
|
|
@@ -156,14 +156,12 @@ files:
|
|
|
156
156
|
- lib/action_controller/metal/force_ssl.rb
|
|
157
157
|
- lib/action_controller/metal/head.rb
|
|
158
158
|
- lib/action_controller/metal/helpers.rb
|
|
159
|
-
- lib/action_controller/metal/hide_actions.rb
|
|
160
159
|
- lib/action_controller/metal/http_authentication.rb
|
|
161
160
|
- lib/action_controller/metal/implicit_render.rb
|
|
162
161
|
- lib/action_controller/metal/instrumentation.rb
|
|
163
162
|
- lib/action_controller/metal/live.rb
|
|
164
163
|
- lib/action_controller/metal/mime_responds.rb
|
|
165
164
|
- lib/action_controller/metal/params_wrapper.rb
|
|
166
|
-
- lib/action_controller/metal/rack_delegation.rb
|
|
167
165
|
- lib/action_controller/metal/redirecting.rb
|
|
168
166
|
- lib/action_controller/metal/renderers.rb
|
|
169
167
|
- lib/action_controller/metal/rendering.rb
|
|
@@ -173,10 +171,10 @@ files:
|
|
|
173
171
|
- lib/action_controller/metal/strong_parameters.rb
|
|
174
172
|
- lib/action_controller/metal/testing.rb
|
|
175
173
|
- lib/action_controller/metal/url_for.rb
|
|
176
|
-
- lib/action_controller/middleware.rb
|
|
177
|
-
- lib/action_controller/model_naming.rb
|
|
178
174
|
- lib/action_controller/railtie.rb
|
|
179
175
|
- lib/action_controller/railties/helpers.rb
|
|
176
|
+
- lib/action_controller/renderer.rb
|
|
177
|
+
- lib/action_controller/template_assertions.rb
|
|
180
178
|
- lib/action_controller/test_case.rb
|
|
181
179
|
- lib/action_dispatch.rb
|
|
182
180
|
- lib/action_dispatch/http/cache.rb
|
|
@@ -194,7 +192,6 @@ files:
|
|
|
194
192
|
- lib/action_dispatch/http/upload.rb
|
|
195
193
|
- lib/action_dispatch/http/url.rb
|
|
196
194
|
- lib/action_dispatch/journey.rb
|
|
197
|
-
- lib/action_dispatch/journey/backwards.rb
|
|
198
195
|
- lib/action_dispatch/journey/formatter.rb
|
|
199
196
|
- lib/action_dispatch/journey/gtg/builder.rb
|
|
200
197
|
- lib/action_dispatch/journey/gtg/simulator.rb
|
|
@@ -210,7 +207,6 @@ files:
|
|
|
210
207
|
- lib/action_dispatch/journey/path/pattern.rb
|
|
211
208
|
- lib/action_dispatch/journey/route.rb
|
|
212
209
|
- lib/action_dispatch/journey/router.rb
|
|
213
|
-
- lib/action_dispatch/journey/router/strexp.rb
|
|
214
210
|
- lib/action_dispatch/journey/router/utils.rb
|
|
215
211
|
- lib/action_dispatch/journey/routes.rb
|
|
216
212
|
- lib/action_dispatch/journey/scanner.rb
|
|
@@ -221,7 +217,9 @@ files:
|
|
|
221
217
|
- lib/action_dispatch/middleware/callbacks.rb
|
|
222
218
|
- lib/action_dispatch/middleware/cookies.rb
|
|
223
219
|
- lib/action_dispatch/middleware/debug_exceptions.rb
|
|
220
|
+
- lib/action_dispatch/middleware/debug_locks.rb
|
|
224
221
|
- lib/action_dispatch/middleware/exception_wrapper.rb
|
|
222
|
+
- lib/action_dispatch/middleware/executor.rb
|
|
225
223
|
- lib/action_dispatch/middleware/flash.rb
|
|
226
224
|
- lib/action_dispatch/middleware/params_parser.rb
|
|
227
225
|
- lib/action_dispatch/middleware/public_exceptions.rb
|
|
@@ -238,7 +236,8 @@ files:
|
|
|
238
236
|
- lib/action_dispatch/middleware/static.rb
|
|
239
237
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
|
|
240
238
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
|
|
241
|
-
- lib/action_dispatch/middleware/templates/rescues/_source.erb
|
|
239
|
+
- lib/action_dispatch/middleware/templates/rescues/_source.html.erb
|
|
240
|
+
- lib/action_dispatch/middleware/templates/rescues/_source.text.erb
|
|
242
241
|
- lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
|
|
243
242
|
- lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
|
|
244
243
|
- lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb
|
|
@@ -266,20 +265,19 @@ files:
|
|
|
266
265
|
- lib/action_dispatch/routing/route_set.rb
|
|
267
266
|
- lib/action_dispatch/routing/routes_proxy.rb
|
|
268
267
|
- lib/action_dispatch/routing/url_for.rb
|
|
268
|
+
- lib/action_dispatch/testing/assertion_response.rb
|
|
269
269
|
- lib/action_dispatch/testing/assertions.rb
|
|
270
|
-
- lib/action_dispatch/testing/assertions/dom.rb
|
|
271
270
|
- lib/action_dispatch/testing/assertions/response.rb
|
|
272
271
|
- lib/action_dispatch/testing/assertions/routing.rb
|
|
273
|
-
- lib/action_dispatch/testing/assertions/selector.rb
|
|
274
|
-
- lib/action_dispatch/testing/assertions/tag.rb
|
|
275
272
|
- lib/action_dispatch/testing/integration.rb
|
|
273
|
+
- lib/action_dispatch/testing/request_encoder.rb
|
|
276
274
|
- lib/action_dispatch/testing/test_process.rb
|
|
277
275
|
- lib/action_dispatch/testing/test_request.rb
|
|
278
276
|
- lib/action_dispatch/testing/test_response.rb
|
|
279
277
|
- lib/action_pack.rb
|
|
280
278
|
- lib/action_pack/gem_version.rb
|
|
281
279
|
- lib/action_pack/version.rb
|
|
282
|
-
homepage: http://
|
|
280
|
+
homepage: http://rubyonrails.org
|
|
283
281
|
licenses:
|
|
284
282
|
- MIT
|
|
285
283
|
metadata: {}
|
|
@@ -291,7 +289,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
291
289
|
requirements:
|
|
292
290
|
- - ">="
|
|
293
291
|
- !ruby/object:Gem::Version
|
|
294
|
-
version:
|
|
292
|
+
version: 2.2.2
|
|
295
293
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
296
294
|
requirements:
|
|
297
295
|
- - ">="
|
|
@@ -299,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
299
297
|
version: '0'
|
|
300
298
|
requirements:
|
|
301
299
|
- none
|
|
302
|
-
rubygems_version: 3.0.
|
|
300
|
+
rubygems_version: 3.0.1
|
|
303
301
|
signing_key:
|
|
304
302
|
specification_version: 4
|
|
305
303
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|
|
@@ -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
|