actionview 5.0.0.1 → 5.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionview might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +55 -1
- data/README.rdoc +1 -1
- data/lib/action_view/digestor.rb +7 -2
- data/lib/action_view/gem_version.rb +2 -2
- data/lib/action_view/helpers/tag_helper.rb +2 -2
- data/lib/action_view/helpers/text_helper.rb +1 -8
- data/lib/action_view/helpers/url_helper.rb +13 -0
- data/lib/action_view/railtie.rb +1 -1
- data/lib/action_view/renderer/partial_renderer.rb +1 -1
- data/lib/action_view/template.rb +10 -4
- data/lib/action_view/test_case.rb +1 -0
- metadata +11 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72d354dd1600d2bd3a6b748947dc6e5178c930e0
|
4
|
+
data.tar.gz: 86768dbfffe647ce3b7161bb6fec7f4e8aaae67d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a966cb46db779ce5bcffc2f83d7770036ed6752dbfe0dbf497bdc971e0fcf70c91abcdc0e554bf6fc5c0166bb4e2f29b3363785dd88bdb17568ec559bbf15fa3
|
7
|
+
data.tar.gz: 540ba24650be60525c4bf012418a925cc3c0b37a759c0a634d403d7eb096643a7f1518a3ba452a19f9759b3dd42dd094c12d6745d06b19df980c2313aabbf893
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,59 @@
|
|
1
|
+
## Rails 5.0.1.rc1 (December 01, 2016) ##
|
2
|
+
|
3
|
+
* Fix support to `ActionController::Parameters` in `button_to`.
|
4
|
+
|
5
|
+
*Jon Moss*
|
6
|
+
|
7
|
+
* Render now accepts any keys for locals, including reserved words
|
8
|
+
|
9
|
+
Only locals with valid variable names get set directly. Others
|
10
|
+
will still be available in local_assigns.
|
11
|
+
|
12
|
+
Example of render with reserved words:
|
13
|
+
|
14
|
+
```erb
|
15
|
+
<%= render "example", class: "text-center", message: "Hello world!" %>
|
16
|
+
|
17
|
+
<!-- _example.html.erb: -->
|
18
|
+
<%= tag.div class: local_assigns[:class] do %>
|
19
|
+
<p><%= message %></p>
|
20
|
+
<% end %>
|
21
|
+
```
|
22
|
+
|
23
|
+
*Peter Schilling*, *Matthew Draper*
|
24
|
+
|
25
|
+
* Changed partial rendering with a collection to allow collections which
|
26
|
+
implement `to_a`.
|
27
|
+
|
28
|
+
Extracting the collection option had an optimization to avoid unnecessary
|
29
|
+
queries of ActiveRecord Relations by calling `#to_ary` on the given
|
30
|
+
collection. Instances of `Enumerator` or `Enumerable` are valid
|
31
|
+
collections, but they do not implement `#to_ary`. By changing this to
|
32
|
+
`#to_a`, they will now be extracted and rendered as expected.
|
33
|
+
|
34
|
+
*Steven Harman*
|
35
|
+
|
36
|
+
* Fix `ActionView::Helpers#current_page?` to work properly even with
|
37
|
+
a trailing slash.
|
38
|
+
|
39
|
+
Fixes #19472.
|
40
|
+
|
41
|
+
*Stan Lo*
|
42
|
+
|
43
|
+
|
1
44
|
## Rails 5.0.0 (June 30, 2016) ##
|
2
45
|
|
46
|
+
* Changed partial rendering with a collection to allow collections which
|
47
|
+
implement `to_a`.
|
48
|
+
|
49
|
+
Extracting the collection option had an optimization to avoid unnecessary
|
50
|
+
queries of ActiveRecord Relations by calling `#to_ary` on the given
|
51
|
+
collection. Instances of `Enumerator` or `Enumerable` are valid
|
52
|
+
collections, but they do not implement `#to_ary`. By changing this to
|
53
|
+
`#to_a`, they will now be extracted and rendered as expected.
|
54
|
+
|
55
|
+
*Steven Harman*
|
56
|
+
|
3
57
|
* Change `datetime_field` and `datetime_field_tag` to generate `datetime-local` fields.
|
4
58
|
|
5
59
|
As a new specification of the HTML 5 the text field type `datetime` will no longer exist
|
@@ -292,7 +346,7 @@
|
|
292
346
|
|
293
347
|
*Todd Bealmear*
|
294
348
|
|
295
|
-
* Allow to pass
|
349
|
+
* Allow to pass an integer value to `size` option in `image_tag` and `video_tag`.
|
296
350
|
|
297
351
|
This makes the behavior more consistent with `width` or `height` options.
|
298
352
|
|
data/README.rdoc
CHANGED
@@ -13,7 +13,7 @@ The latest version of Action View can be installed with RubyGems:
|
|
13
13
|
|
14
14
|
Source code can be downloaded as part of the Rails project on GitHub
|
15
15
|
|
16
|
-
* https://github.com/rails/rails/tree/
|
16
|
+
* https://github.com/rails/rails/tree/5-0-stable/actionview
|
17
17
|
|
18
18
|
|
19
19
|
== License
|
data/lib/action_view/digestor.rb
CHANGED
@@ -6,6 +6,12 @@ module ActionView
|
|
6
6
|
class Digestor
|
7
7
|
@@digest_mutex = Mutex.new
|
8
8
|
|
9
|
+
module PerExecutionDigestCacheExpiry
|
10
|
+
def self.before(target)
|
11
|
+
ActionView::LookupContext::DetailsKey.clear
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
9
15
|
class << self
|
10
16
|
# Supported options:
|
11
17
|
#
|
@@ -42,8 +48,7 @@ module ActionView
|
|
42
48
|
options = {}
|
43
49
|
options[:formats] = [finder.rendered_format] if finder.rendered_format
|
44
50
|
|
45
|
-
if finder.disable_cache { finder.
|
46
|
-
template = finder.disable_cache { finder.find(logical_name, [], partial, [], options) }
|
51
|
+
if template = finder.disable_cache { finder.find_all(logical_name, [], partial, [], options).first }
|
47
52
|
finder.rendered_format ||= template.formats.first
|
48
53
|
|
49
54
|
if node = seen[template.identifier] # handle cycles in the tree
|
@@ -187,9 +187,9 @@ module ActionView
|
|
187
187
|
if value.is_a?(Array)
|
188
188
|
value = escape ? safe_join(value, " ".freeze) : value.join(" ".freeze)
|
189
189
|
else
|
190
|
-
value = escape ? ERB::Util.unwrapped_html_escape(value) : value
|
190
|
+
value = escape ? ERB::Util.unwrapped_html_escape(value) : value.to_s
|
191
191
|
end
|
192
|
-
%(#{key}="#{value.gsub(
|
192
|
+
%(#{key}="#{value.gsub('"'.freeze, '"'.freeze)}")
|
193
193
|
end
|
194
194
|
end
|
195
195
|
end
|
@@ -225,14 +225,7 @@ module ActionView
|
|
225
225
|
#
|
226
226
|
# pluralize(2, 'Person', locale: :de)
|
227
227
|
# # => 2 Personen
|
228
|
-
def pluralize(count, singular,
|
229
|
-
if deprecated_plural
|
230
|
-
ActiveSupport::Deprecation.warn("Passing plural as a positional argument " \
|
231
|
-
"is deprecated and will be removed in Rails 5.1. Use e.g. " \
|
232
|
-
"pluralize(1, 'person', plural: 'people') instead.")
|
233
|
-
plural ||= deprecated_plural
|
234
|
-
end
|
235
|
-
|
228
|
+
def pluralize(count, singular, plural_arg = nil, plural: plural_arg, locale: I18n.locale)
|
236
229
|
word = if (count == 1 || count =~ /^1(\.0+)?$/)
|
237
230
|
singular
|
238
231
|
else
|
@@ -548,6 +548,8 @@ module ActionView
|
|
548
548
|
request_uri = url_string.index("?") ? request.fullpath : request.path
|
549
549
|
request_uri = URI.parser.unescape(request_uri).force_encoding(Encoding::BINARY)
|
550
550
|
|
551
|
+
url_string.chomp!("/") if url_string.start_with?("/") && url_string != "/"
|
552
|
+
|
551
553
|
if url_string =~ /^\w+:\/\//
|
552
554
|
url_string == "#{request.protocol}#{request.host_with_port}#{request_uri}"
|
553
555
|
else
|
@@ -614,6 +616,17 @@ module ActionView
|
|
614
616
|
# to_form_params({ name: 'Denmark' }, 'country')
|
615
617
|
# # => [{name: 'country[name]', value: 'Denmark'}]
|
616
618
|
def to_form_params(attribute, namespace = nil) # :nodoc:
|
619
|
+
attribute = if attribute.respond_to?(:permitted?)
|
620
|
+
unless attribute.permitted?
|
621
|
+
raise ArgumentError, "Attempting to generate a buttom from non-sanitized request parameters!" \
|
622
|
+
" Whitelist and sanitize passed parameters to be secure."
|
623
|
+
end
|
624
|
+
|
625
|
+
attribute.to_h
|
626
|
+
else
|
627
|
+
attribute
|
628
|
+
end
|
629
|
+
|
617
630
|
params = []
|
618
631
|
case attribute
|
619
632
|
when Hash
|
data/lib/action_view/railtie.rb
CHANGED
@@ -40,7 +40,7 @@ module ActionView
|
|
40
40
|
initializer "action_view.per_request_digest_cache" do |app|
|
41
41
|
ActiveSupport.on_load(:action_view) do
|
42
42
|
if app.config.consider_all_requests_local
|
43
|
-
app.executor.to_run
|
43
|
+
app.executor.to_run ActionView::Digestor::PerExecutionDigestCacheExpiry
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
data/lib/action_view/template.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "active_support/core_ext/object/try"
|
2
|
+
require "active_support/core_ext/kernel/singleton_class"
|
3
|
+
require "active_support/core_ext/module/delegation"
|
4
|
+
require "thread"
|
4
5
|
|
5
6
|
module ActionView
|
6
7
|
# = Action View Template
|
@@ -325,8 +326,13 @@ module ActionView
|
|
325
326
|
end
|
326
327
|
|
327
328
|
def locals_code #:nodoc:
|
329
|
+
# Only locals with valid variable names get set directly. Others will
|
330
|
+
# still be available in local_assigns.
|
331
|
+
locals = @locals.to_set - Module::DELEGATION_RESERVED_METHOD_NAMES
|
332
|
+
locals = locals.grep(/\A(?![A-Z0-9])(?:[[:alnum:]_]|[^\0-\177])+\z/)
|
333
|
+
|
328
334
|
# Double assign to suppress the dreaded 'assigned but unused variable' warning
|
329
|
-
|
335
|
+
locals.each_with_object("") { |key, code| code << "#{key} = #{key} = local_assigns[:#{key}];" }
|
330
336
|
end
|
331
337
|
|
332
338
|
def method_name #:nodoc:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1.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: 2016-
|
11
|
+
date: 2016-11-30 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: 5.0.
|
19
|
+
version: 5.0.1.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: 5.0.
|
26
|
+
version: 5.0.1.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,28 +92,28 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - '='
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 5.0.
|
95
|
+
version: 5.0.1.rc1
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - '='
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 5.0.
|
102
|
+
version: 5.0.1.rc1
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: activemodel
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - '='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 5.0.
|
109
|
+
version: 5.0.1.rc1
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - '='
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: 5.0.
|
116
|
+
version: 5.0.1.rc1
|
117
117
|
description: Simple, battle-tested conventions and helpers for building web pages.
|
118
118
|
email: david@loudthinking.com
|
119
119
|
executables: []
|
@@ -238,15 +238,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
238
238
|
version: 2.2.2
|
239
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
240
|
requirements:
|
241
|
-
- - "
|
241
|
+
- - ">"
|
242
242
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
243
|
+
version: 1.3.1
|
244
244
|
requirements:
|
245
245
|
- none
|
246
246
|
rubyforge_project:
|
247
|
-
rubygems_version: 2.
|
247
|
+
rubygems_version: 2.5.2
|
248
248
|
signing_key:
|
249
249
|
specification_version: 4
|
250
250
|
summary: Rendering framework putting the V in MVC (part of Rails).
|
251
251
|
test_files: []
|
252
|
-
has_rdoc:
|