actionpack 3.1.12 → 3.2.0.rc1
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.
- data/CHANGELOG.md +5503 -108
- data/README.rdoc +3 -3
- data/lib/abstract_controller/asset_paths.rb +1 -1
- data/lib/abstract_controller/base.rb +1 -1
- data/lib/abstract_controller/callbacks.rb +102 -18
- data/lib/abstract_controller/helpers.rb +1 -1
- data/lib/abstract_controller/layouts.rb +116 -50
- data/lib/abstract_controller/logger.rb +1 -1
- data/lib/abstract_controller/railties/routes_helpers.rb +2 -2
- data/lib/abstract_controller/rendering.rb +1 -6
- data/lib/abstract_controller/view_paths.rb +6 -5
- data/lib/action_controller.rb +0 -15
- data/lib/action_controller/caching.rb +0 -1
- data/lib/action_controller/caching/actions.rb +5 -6
- data/lib/action_controller/caching/fragments.rb +18 -18
- data/lib/action_controller/caching/pages.rb +7 -6
- data/lib/action_controller/caching/sweeping.rb +1 -1
- data/lib/action_controller/log_subscriber.rb +8 -4
- data/lib/action_controller/metal.rb +7 -1
- data/lib/action_controller/metal/conditional_get.rb +49 -4
- data/lib/action_controller/metal/data_streaming.rb +17 -5
- data/lib/action_controller/metal/force_ssl.rb +8 -5
- data/lib/action_controller/metal/helpers.rb +7 -4
- data/lib/action_controller/metal/http_authentication.rb +9 -12
- data/lib/action_controller/metal/instrumentation.rb +9 -4
- data/lib/action_controller/metal/mime_responds.rb +4 -4
- data/lib/action_controller/metal/params_wrapper.rb +12 -8
- data/lib/action_controller/metal/redirecting.rb +7 -6
- data/lib/action_controller/metal/renderers.rb +9 -11
- data/lib/action_controller/metal/request_forgery_protection.rb +2 -1
- data/lib/action_controller/metal/rescue.rb +13 -0
- data/lib/action_controller/metal/responder.rb +11 -23
- data/lib/action_controller/metal/streaming.rb +0 -25
- data/lib/action_controller/railtie.rb +1 -0
- data/lib/action_controller/railties/paths.rb +4 -3
- data/lib/action_controller/record_identifier.rb +4 -4
- data/lib/action_controller/test_case.rb +60 -56
- data/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +6 -6
- data/lib/action_dispatch.rb +5 -1
- data/lib/action_dispatch/http/cache.rb +27 -15
- data/lib/action_dispatch/http/filter_parameters.rb +3 -1
- data/lib/action_dispatch/http/headers.rb +3 -5
- data/lib/action_dispatch/http/mime_negotiation.rb +2 -1
- data/lib/action_dispatch/http/mime_type.rb +7 -3
- data/lib/action_dispatch/http/mime_types.rb +12 -0
- data/lib/action_dispatch/http/parameter_filter.rb +3 -1
- data/lib/action_dispatch/http/parameters.rb +0 -4
- data/lib/action_dispatch/http/request.rb +18 -68
- data/lib/action_dispatch/http/response.rb +11 -32
- data/lib/action_dispatch/http/upload.rb +3 -14
- data/lib/action_dispatch/http/url.rb +1 -1
- data/lib/action_dispatch/middleware/callbacks.rb +1 -2
- data/lib/action_dispatch/middleware/cookies.rb +20 -16
- data/lib/action_dispatch/middleware/debug_exceptions.rb +82 -0
- data/lib/action_dispatch/middleware/exception_wrapper.rb +78 -0
- data/lib/action_dispatch/middleware/flash.rb +6 -9
- data/lib/action_dispatch/middleware/params_parser.rb +6 -11
- data/lib/action_dispatch/middleware/public_exceptions.rb +30 -0
- data/lib/action_dispatch/middleware/reloader.rb +38 -14
- data/lib/action_dispatch/middleware/remote_ip.rb +66 -36
- data/lib/action_dispatch/middleware/request_id.rb +39 -0
- data/lib/action_dispatch/middleware/session/abstract_store.rb +4 -16
- data/lib/action_dispatch/middleware/session/cache_store.rb +50 -0
- data/lib/action_dispatch/middleware/session/cookie_store.rb +1 -1
- data/lib/action_dispatch/middleware/show_exceptions.rb +58 -142
- data/lib/action_dispatch/middleware/static.rb +2 -10
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +1 -0
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.erb +13 -8
- data/lib/action_dispatch/railtie.rb +15 -1
- data/lib/action_dispatch/routing.rb +1 -2
- data/lib/action_dispatch/routing/mapper.rb +108 -107
- data/lib/action_dispatch/routing/redirection.rb +63 -69
- data/lib/action_dispatch/routing/route_set.rb +75 -43
- data/lib/action_dispatch/routing/routes_proxy.rb +0 -4
- data/lib/action_dispatch/routing/url_for.rb +3 -3
- data/lib/action_dispatch/testing/assertions/response.rb +5 -7
- data/lib/action_dispatch/testing/assertions/routing.rb +10 -9
- data/lib/action_dispatch/testing/integration.rb +8 -25
- data/lib/action_dispatch/testing/test_process.rb +3 -2
- data/lib/action_dispatch/testing/test_request.rb +4 -23
- data/lib/action_pack/version.rb +3 -3
- data/lib/action_view.rb +1 -5
- data/lib/action_view/asset_paths.rb +7 -8
- data/lib/action_view/base.rb +7 -5
- data/lib/action_view/helpers/asset_paths.rb +1 -1
- data/lib/action_view/helpers/asset_tag_helper.rb +4 -8
- data/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +3 -0
- data/lib/action_view/helpers/atom_feed_helper.rb +2 -2
- data/lib/action_view/helpers/capture_helper.rb +3 -3
- data/lib/action_view/helpers/controller_helper.rb +1 -1
- data/lib/action_view/helpers/date_helper.rb +26 -18
- data/lib/action_view/helpers/debug_helper.rb +1 -1
- data/lib/action_view/helpers/form_helper.rb +71 -13
- data/lib/action_view/helpers/form_options_helper.rb +65 -34
- data/lib/action_view/helpers/form_tag_helper.rb +24 -18
- data/lib/action_view/helpers/javascript_helper.rb +12 -3
- data/lib/action_view/helpers/number_helper.rb +3 -2
- data/lib/action_view/helpers/record_tag_helper.rb +51 -5
- data/lib/action_view/helpers/rendering_helper.rb +2 -2
- data/lib/action_view/helpers/sanitize_helper.rb +6 -7
- data/lib/action_view/helpers/tag_helper.rb +1 -1
- data/lib/action_view/helpers/text_helper.rb +5 -4
- data/lib/action_view/helpers/url_helper.rb +19 -11
- data/lib/action_view/locale/en.yml +6 -0
- data/lib/action_view/log_subscriber.rb +1 -1
- data/lib/action_view/lookup_context.rb +123 -125
- data/lib/action_view/path_set.rb +60 -13
- data/lib/action_view/renderer/abstract_renderer.rb +16 -11
- data/lib/action_view/renderer/partial_renderer.rb +59 -40
- data/lib/action_view/renderer/template_renderer.rb +29 -17
- data/lib/action_view/template.rb +0 -1
- data/lib/action_view/template/error.rb +6 -5
- data/lib/action_view/template/handlers.rb +0 -6
- data/lib/action_view/template/handlers/builder.rb +10 -1
- data/lib/action_view/template/handlers/erb.rb +2 -2
- data/lib/action_view/template/resolver.rb +20 -31
- data/lib/action_view/test_case.rb +7 -10
- data/lib/sprockets/assets.rake +1 -1
- data/lib/sprockets/bootstrap.rb +3 -31
- data/lib/sprockets/compressors.rb +69 -7
- data/lib/sprockets/helpers/rails_helper.rb +6 -11
- data/lib/sprockets/railtie.rb +1 -0
- data/lib/sprockets/static_compiler.rb +0 -3
- metadata +57 -86
- checksums.yaml +0 -7
- data/lib/action_dispatch/middleware/closed_error.rb +0 -7
- data/lib/action_dispatch/routing/route.rb +0 -67
- data/lib/action_view/template/handler.rb +0 -49
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 2c423d4e0da24d8506d8dfd759d28c201735a2e5
|
4
|
-
data.tar.gz: 44e0ab2d57cbeea6b1b18cd7d313665abfa1bf60
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 77902afcf2aa8a91ba0df275d278f231b5c1b8a77a1535255fbe7683b6d998e4253ead0ee57ec4306008f9a1dfe613d4668c14dcc70e87162e07c6301be6b71d
|
7
|
-
data.tar.gz: ddd9a06ad58e592d40fbd82c3a020ee73521174968f1b27b7c236e5dca14a4eb2ef711aa7aa00f1dd843baf0bac49bc6a13005a60c7abfb30d91c9c4bd2373d1
|
@@ -1,67 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext/module/deprecation'
|
2
|
-
|
3
|
-
module ActionDispatch
|
4
|
-
module Routing
|
5
|
-
class Route #:nodoc:
|
6
|
-
attr_reader :app, :conditions, :defaults, :name
|
7
|
-
attr_reader :path, :requirements, :set
|
8
|
-
|
9
|
-
def initialize(set, app, conditions, requirements, defaults, name, anchor)
|
10
|
-
@set = set
|
11
|
-
@app = app
|
12
|
-
@defaults = defaults
|
13
|
-
@name = name
|
14
|
-
|
15
|
-
# FIXME: we should not be doing this much work in a constructor.
|
16
|
-
|
17
|
-
@requirements = requirements.merge(defaults)
|
18
|
-
@requirements.delete(:controller) if @requirements[:controller].is_a?(Regexp)
|
19
|
-
@requirements.delete_if { |k, v|
|
20
|
-
v == Regexp.compile("[^#{SEPARATORS.join}]+")
|
21
|
-
}
|
22
|
-
|
23
|
-
if path = conditions[:path_info]
|
24
|
-
@path = path
|
25
|
-
conditions[:path_info] = ::Rack::Mount::Strexp.compile(path, requirements, SEPARATORS, anchor)
|
26
|
-
end
|
27
|
-
|
28
|
-
@verbs = conditions[:request_method] || []
|
29
|
-
|
30
|
-
@conditions = conditions.dup
|
31
|
-
|
32
|
-
# Rack-Mount requires that :request_method be a regular expression.
|
33
|
-
# :request_method represents the HTTP verb that matches this route.
|
34
|
-
#
|
35
|
-
# Here we munge values before they get sent on to rack-mount.
|
36
|
-
@conditions[:request_method] = %r[^#{verb}$] unless @verbs.empty?
|
37
|
-
@conditions[:path_info] = Rack::Mount::RegexpWithNamedGroups.new(@conditions[:path_info]) if @conditions[:path_info]
|
38
|
-
@conditions.delete_if{ |k,v| k != :path_info && !valid_condition?(k) }
|
39
|
-
@requirements.delete_if{ |k,v| !valid_condition?(k) }
|
40
|
-
end
|
41
|
-
|
42
|
-
def verb
|
43
|
-
@verbs.join '|'
|
44
|
-
end
|
45
|
-
|
46
|
-
def segment_keys
|
47
|
-
@segment_keys ||= conditions[:path_info].names.compact.map { |key| key.to_sym }
|
48
|
-
end
|
49
|
-
|
50
|
-
def to_a
|
51
|
-
[@app, @conditions, @defaults, @name]
|
52
|
-
end
|
53
|
-
deprecate :to_a
|
54
|
-
|
55
|
-
def to_s
|
56
|
-
@to_s ||= begin
|
57
|
-
"%-6s %-40s %s" % [(verb || :any).to_s.upcase, path, requirements.inspect]
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
private
|
62
|
-
def valid_condition?(method)
|
63
|
-
segment_keys.include?(method) || set.valid_conditions.include?(method)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'action_dispatch/http/mime_type'
|
2
|
-
require 'active_support/core_ext/class/attribute'
|
3
|
-
|
4
|
-
# Legacy TemplateHandler stub
|
5
|
-
module ActionView
|
6
|
-
class Template
|
7
|
-
module Handlers #:nodoc:
|
8
|
-
module Compilable
|
9
|
-
def self.included(base)
|
10
|
-
ActiveSupport::Deprecation.warn "Including Compilable in your template handler is deprecated. " <<
|
11
|
-
"Since Rails 3, all the API your template handler needs to implement is to respond to #call."
|
12
|
-
base.extend(ClassMethods)
|
13
|
-
end
|
14
|
-
|
15
|
-
module ClassMethods
|
16
|
-
def call(template)
|
17
|
-
new.compile(template)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def compile(template)
|
22
|
-
raise "Need to implement #{self.class.name}#compile(template)"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
class Template::Handler
|
28
|
-
class_attribute :default_format
|
29
|
-
self.default_format = Mime::HTML
|
30
|
-
|
31
|
-
def self.inherited(base)
|
32
|
-
ActiveSupport::Deprecation.warn "Inheriting from ActionView::Template::Handler is deprecated. " <<
|
33
|
-
"Since Rails 3, all the API your template handler needs to implement is to respond to #call."
|
34
|
-
super
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.call(template)
|
38
|
-
raise "Need to implement #{self.class.name}#call(template)"
|
39
|
-
end
|
40
|
-
|
41
|
-
def render(template, local_assigns)
|
42
|
-
raise "Need to implement #{self.class.name}#render(template, local_assigns)"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
TemplateHandlers = Template::Handlers
|
48
|
-
TemplateHandler = Template::Handler
|
49
|
-
end
|