actionpack 4.0.0.beta1 → 4.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +195 -11
- data/lib/abstract_controller/base.rb +1 -1
- data/lib/abstract_controller/helpers.rb +2 -2
- data/lib/abstract_controller/layouts.rb +10 -5
- data/lib/abstract_controller/rendering.rb +11 -3
- data/lib/abstract_controller/translation.rb +1 -1
- data/lib/action_controller/log_subscriber.rb +5 -0
- data/lib/action_controller/metal.rb +2 -3
- data/lib/action_controller/metal/force_ssl.rb +52 -17
- data/lib/action_controller/metal/helpers.rb +0 -1
- data/lib/action_controller/metal/hide_actions.rb +1 -1
- data/lib/action_controller/metal/http_authentication.rb +3 -2
- data/lib/action_controller/metal/live.rb +34 -0
- data/lib/action_controller/metal/rendering.rb +1 -1
- data/lib/action_controller/metal/strong_parameters.rb +7 -3
- data/lib/action_controller/test_case.rb +45 -11
- data/lib/action_dispatch.rb +4 -6
- data/lib/action_dispatch/http/cache.rb +2 -2
- data/lib/action_dispatch/http/headers.rb +39 -15
- data/lib/action_dispatch/http/mime_negotiation.rb +1 -1
- data/lib/action_dispatch/http/mime_type.rb +11 -3
- data/lib/action_dispatch/http/parameters.rb +17 -24
- data/lib/action_dispatch/http/request.rb +17 -2
- data/lib/action_dispatch/http/response.rb +2 -1
- data/lib/action_dispatch/http/upload.rb +5 -5
- data/lib/action_dispatch/http/url.rb +53 -12
- data/lib/action_dispatch/journey/formatter.rb +1 -1
- data/lib/action_dispatch/journey/path/pattern.rb +1 -1
- data/lib/action_dispatch/journey/route.rb +8 -0
- data/lib/action_dispatch/journey/router.rb +3 -1
- data/lib/action_dispatch/journey/visitors.rb +8 -0
- data/lib/action_dispatch/middleware/cookies.rb +169 -135
- data/lib/action_dispatch/middleware/exception_wrapper.rb +1 -0
- data/lib/action_dispatch/middleware/remote_ip.rb +2 -2
- data/lib/action_dispatch/middleware/request_id.rb +1 -1
- data/lib/action_dispatch/middleware/session/cookie_store.rb +38 -58
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/_trace.erb +4 -6
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/template_error.erb +1 -1
- data/lib/action_dispatch/routing.rb +28 -64
- data/lib/action_dispatch/routing/mapper.rb +61 -48
- data/lib/action_dispatch/routing/route_set.rb +17 -14
- data/lib/action_dispatch/testing/assertions/routing.rb +2 -2
- data/lib/action_dispatch/testing/assertions/selector.rb +2 -2
- data/lib/action_dispatch/testing/integration.rb +36 -35
- data/lib/action_dispatch/testing/test_process.rb +1 -1
- data/lib/action_pack/version.rb +7 -6
- data/lib/action_view/buffers.rb +6 -0
- data/lib/action_view/dependency_tracker.rb +3 -1
- data/lib/action_view/helpers/asset_tag_helper.rb +13 -8
- data/lib/action_view/helpers/capture_helper.rb +2 -2
- data/lib/action_view/helpers/date_helper.rb +1 -1
- data/lib/action_view/helpers/form_helper.rb +56 -19
- data/lib/action_view/helpers/form_options_helper.rb +3 -3
- data/lib/action_view/helpers/form_tag_helper.rb +1 -1
- data/lib/action_view/helpers/javascript_helper.rb +2 -2
- data/lib/action_view/helpers/number_helper.rb +25 -0
- data/lib/action_view/helpers/tags/base.rb +9 -10
- data/lib/action_view/helpers/tags/check_box.rb +1 -1
- data/lib/action_view/helpers/tags/checkable.rb +2 -2
- data/lib/action_view/helpers/tags/collection_check_boxes.rb +3 -3
- data/lib/action_view/helpers/tags/collection_helpers.rb +3 -3
- data/lib/action_view/helpers/tags/collection_radio_buttons.rb +3 -3
- data/lib/action_view/helpers/tags/collection_select.rb +1 -1
- data/lib/action_view/helpers/tags/color_field.rb +2 -2
- data/lib/action_view/helpers/tags/date_field.rb +2 -2
- data/lib/action_view/helpers/tags/date_select.rb +2 -2
- data/lib/action_view/helpers/tags/datetime_field.rb +2 -2
- data/lib/action_view/helpers/tags/datetime_local_field.rb +2 -2
- data/lib/action_view/helpers/tags/datetime_select.rb +2 -2
- data/lib/action_view/helpers/tags/email_field.rb +2 -2
- data/lib/action_view/helpers/tags/file_field.rb +2 -2
- data/lib/action_view/helpers/tags/grouped_collection_select.rb +2 -2
- data/lib/action_view/helpers/tags/hidden_field.rb +2 -2
- data/lib/action_view/helpers/tags/label.rb +2 -2
- data/lib/action_view/helpers/tags/month_field.rb +2 -2
- data/lib/action_view/helpers/tags/number_field.rb +2 -2
- data/lib/action_view/helpers/tags/password_field.rb +2 -2
- data/lib/action_view/helpers/tags/radio_button.rb +2 -2
- data/lib/action_view/helpers/tags/range_field.rb +2 -2
- data/lib/action_view/helpers/tags/search_field.rb +2 -2
- data/lib/action_view/helpers/tags/select.rb +2 -3
- data/lib/action_view/helpers/tags/tel_field.rb +2 -2
- data/lib/action_view/helpers/tags/text_area.rb +2 -2
- data/lib/action_view/helpers/tags/text_field.rb +2 -2
- data/lib/action_view/helpers/tags/time_field.rb +2 -2
- data/lib/action_view/helpers/tags/time_select.rb +2 -2
- data/lib/action_view/helpers/tags/time_zone_select.rb +2 -2
- data/lib/action_view/helpers/tags/url_field.rb +2 -2
- data/lib/action_view/helpers/tags/week_field.rb +2 -2
- data/lib/action_view/helpers/text_helper.rb +8 -5
- data/lib/action_view/helpers/url_helper.rb +18 -6
- data/lib/action_view/lookup_context.rb +7 -1
- data/lib/action_view/path_set.rb +6 -0
- data/lib/action_view/renderer/abstract_renderer.rb +15 -0
- data/lib/action_view/renderer/partial_renderer.rb +14 -0
- data/lib/action_view/renderer/renderer.rb +6 -0
- data/lib/action_view/template.rb +3 -2
- data/lib/action_view/template/handlers/erb.rb +29 -3
- data/lib/action_view/template/resolver.rb +3 -3
- data/lib/action_view/test_case.rb +1 -0
- data/lib/action_view/vendor/html-scanner/html/sanitizer.rb +5 -5
- data/lib/action_view/vendor/html-scanner/html/selector.rb +8 -8
- metadata +8 -8
@@ -47,7 +47,7 @@ module ActionView
|
|
47
47
|
NAME_BLOCK = lambda {|cache, name| cache[name] = SmallCache.new(&PREFIX_BLOCK)}
|
48
48
|
KEY_BLOCK = lambda {|cache, key| cache[key] = SmallCache.new(&NAME_BLOCK)}
|
49
49
|
|
50
|
-
# usually a majority of template look ups return nothing, use this canonical preallocated array to
|
50
|
+
# usually a majority of template look ups return nothing, use this canonical preallocated array to save memory
|
51
51
|
NO_TEMPLATES = [].freeze
|
52
52
|
|
53
53
|
def initialize
|
@@ -109,7 +109,7 @@ module ActionView
|
|
109
109
|
@cache.clear
|
110
110
|
end
|
111
111
|
|
112
|
-
# Normalizes the arguments and passes it on to
|
112
|
+
# Normalizes the arguments and passes it on to find_templates.
|
113
113
|
def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
|
114
114
|
cached(key, [name, prefix, partial], details, locals) do
|
115
115
|
find_templates(name, prefix, partial, details)
|
@@ -255,7 +255,7 @@ module ActionView
|
|
255
255
|
#
|
256
256
|
# FileSystemResolver.new("/path/to/views", ":prefix/:action{.:locale,}{.:formats,}{.:handlers,}")
|
257
257
|
#
|
258
|
-
# This one allows you to keep files with different formats in
|
258
|
+
# This one allows you to keep files with different formats in separate subdirectories,
|
259
259
|
# eg. `users/new.html` will be loaded from `users/html/new.erb` or `users/new.html.erb`,
|
260
260
|
# `users/new.js` from `users/js/new.erb` or `users/new.js.erb`, etc.
|
261
261
|
#
|
@@ -77,7 +77,7 @@ module HTML
|
|
77
77
|
|
78
78
|
# A regular expression of the valid characters used to separate protocols like
|
79
79
|
# the ':' in 'http://foo.com'
|
80
|
-
self.protocol_separator = /:|(�*58)|(p)|(%|%)3A/
|
80
|
+
self.protocol_separator = /:|(�*58)|(p)|(�*3a)|(%|%)3A/i
|
81
81
|
|
82
82
|
# Specifies a Set of HTML attributes that can have URIs.
|
83
83
|
self.uri_attributes = Set.new(%w(href src cite action longdesc xlink:href lowsrc))
|
@@ -121,8 +121,8 @@ module HTML
|
|
121
121
|
style = style.to_s.gsub(/url\s*\(\s*[^\s)]+?\s*\)\s*/, ' ')
|
122
122
|
|
123
123
|
# gauntlet
|
124
|
-
if style !~
|
125
|
-
style !~
|
124
|
+
if style !~ /\A([:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*\z/ ||
|
125
|
+
style !~ /\A(\s*[-\w]+\s*:\s*[^:;]*(;|$)\s*)*\z/
|
126
126
|
return ''
|
127
127
|
end
|
128
128
|
|
@@ -133,7 +133,7 @@ module HTML
|
|
133
133
|
elsif shorthand_css_properties.include?(prop.split('-')[0].downcase)
|
134
134
|
unless val.split().any? do |keyword|
|
135
135
|
!allowed_css_keywords.include?(keyword) &&
|
136
|
-
keyword !~
|
136
|
+
keyword !~ /\A(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)\z/
|
137
137
|
end
|
138
138
|
clean << prop + ': ' + val + ';'
|
139
139
|
end
|
@@ -182,7 +182,7 @@ module HTML
|
|
182
182
|
|
183
183
|
def contains_bad_protocols?(attr_name, value)
|
184
184
|
uri_attributes.include?(attr_name) &&
|
185
|
-
(value =~ /(^[^\/:]*):|(�*58)|(p)|(%|%)3A/ && !allowed_protocols.include?(value.split(protocol_separator).first.downcase.strip))
|
185
|
+
(value =~ /(^[^\/:]*):|(�*58)|(p)|(�*3a)|(%|%)3A/i && !allowed_protocols.include?(value.split(protocol_separator).first.downcase.strip))
|
186
186
|
end
|
187
187
|
end
|
188
188
|
end
|
@@ -537,7 +537,7 @@ module HTML
|
|
537
537
|
# Get identifier, class, attribute name, pseudo or negation.
|
538
538
|
while true
|
539
539
|
# Element identifier.
|
540
|
-
next if statement.sub!(/^#(\?|[\w\-]+)/) do
|
540
|
+
next if statement.sub!(/^#(\?|[\w\-]+)/) do
|
541
541
|
id = $1
|
542
542
|
if id == "?"
|
543
543
|
id = values.shift
|
@@ -549,7 +549,7 @@ module HTML
|
|
549
549
|
end
|
550
550
|
|
551
551
|
# Class name.
|
552
|
-
next if statement.sub!(/^\.([\w\-]+)/) do
|
552
|
+
next if statement.sub!(/^\.([\w\-]+)/) do
|
553
553
|
class_name = $1
|
554
554
|
@source << ".#{class_name}"
|
555
555
|
class_name = Regexp.new("(^|\s)#{Regexp.escape(class_name)}($|\s)") unless class_name.is_a?(Regexp)
|
@@ -558,7 +558,7 @@ module HTML
|
|
558
558
|
end
|
559
559
|
|
560
560
|
# Attribute value.
|
561
|
-
next if statement.sub!(/^\[\s*([[:alpha:]][\w\-:]*)\s*((?:[~|^$*])?=)?\s*('[^']*'|"[^*]"|[^\]]*)\s*\]/) do
|
561
|
+
next if statement.sub!(/^\[\s*([[:alpha:]][\w\-:]*)\s*((?:[~|^$*])?=)?\s*('[^']*'|"[^*]"|[^\]]*)\s*\]/) do
|
562
562
|
name, equality, value = $1, $2, $3
|
563
563
|
if value == "?"
|
564
564
|
value = values.shift
|
@@ -575,7 +575,7 @@ module HTML
|
|
575
575
|
end
|
576
576
|
|
577
577
|
# Root element only.
|
578
|
-
next if statement.sub!(/^:root/) do
|
578
|
+
next if statement.sub!(/^:root/) do
|
579
579
|
pseudo << lambda do |element|
|
580
580
|
element.parent.nil? || !element.parent.tag?
|
581
581
|
end
|
@@ -611,7 +611,7 @@ module HTML
|
|
611
611
|
"" # Remove
|
612
612
|
end
|
613
613
|
# First/last child (of type).
|
614
|
-
next if statement.sub!(/^:(first|last)-(child|of-type)/) do
|
614
|
+
next if statement.sub!(/^:(first|last)-(child|of-type)/) do
|
615
615
|
reverse = $1 == "last"
|
616
616
|
of_type = $2 == "of-type"
|
617
617
|
pseudo << nth_child(0, 1, of_type, reverse)
|
@@ -619,7 +619,7 @@ module HTML
|
|
619
619
|
"" # Remove
|
620
620
|
end
|
621
621
|
# Only child (of type).
|
622
|
-
next if statement.sub!(/^:only-(child|of-type)/) do
|
622
|
+
next if statement.sub!(/^:only-(child|of-type)/) do
|
623
623
|
of_type = $1 == "of-type"
|
624
624
|
pseudo << only_child(of_type)
|
625
625
|
@source << ":only-#{$1}"
|
@@ -628,7 +628,7 @@ module HTML
|
|
628
628
|
|
629
629
|
# Empty: no child elements or meaningful content (whitespaces
|
630
630
|
# are ignored).
|
631
|
-
next if statement.sub!(/^:empty/) do
|
631
|
+
next if statement.sub!(/^:empty/) do
|
632
632
|
pseudo << lambda do |element|
|
633
633
|
empty = true
|
634
634
|
for child in element.children
|
@@ -644,7 +644,7 @@ module HTML
|
|
644
644
|
end
|
645
645
|
# Content: match the text content of the element, stripping
|
646
646
|
# leading and trailing spaces.
|
647
|
-
next if statement.sub!(/^:content\(\s*(\?|'[^']*'|"[^"]*"|[^)]*)\s*\)/) do
|
647
|
+
next if statement.sub!(/^:content\(\s*(\?|'[^']*'|"[^"]*"|[^)]*)\s*\)/) do
|
648
648
|
content = $1
|
649
649
|
if content == "?"
|
650
650
|
content = values.shift
|
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.0.
|
4
|
+
version: 4.0.0.rc1
|
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
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0.0.
|
19
|
+
version: 4.0.0.rc1
|
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.0.
|
26
|
+
version: 4.0.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,28 +86,28 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 4.0.0.
|
89
|
+
version: 4.0.0.rc1
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 4.0.0.
|
96
|
+
version: 4.0.0.rc1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: tzinfo
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.3.
|
103
|
+
version: 0.3.37
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.3.
|
110
|
+
version: 0.3.37
|
111
111
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
112
112
|
testing MVC web applications. Works with any Rack-compatible server.
|
113
113
|
email: david@loudthinking.com
|