actionview 4.2.2 → 4.2.3.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 +34 -2
- data/lib/action_view/digestor.rb +2 -1
- data/lib/action_view/gem_version.rb +2 -2
- data/lib/action_view/helpers/asset_tag_helper.rb +1 -1
- data/lib/action_view/helpers/cache_helper.rb +1 -1
- data/lib/action_view/helpers/capture_helper.rb +3 -1
- data/lib/action_view/helpers/form_helper.rb +2 -1
- data/lib/action_view/helpers/form_options_helper.rb +1 -1
- data/lib/action_view/helpers/sanitize_helper.rb +1 -1
- data/lib/action_view/helpers/translation_helper.rb +6 -6
- data/lib/action_view/tasks/dependencies.rake +9 -7
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 702bbde5eea6889e4e2b0a94d6b09e4eaa0fff84
|
4
|
+
data.tar.gz: c065b94bb01eeb032ae30095e88f5b9968c09eb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a158f5c925ef19f76469cfd4f0a59295902b05b61ea4b4d6713742723412da30c9cfa946ae0a2d5b1264f555fa45489702cc8a56fdc5e46def8d70b9dd0aa6e7
|
7
|
+
data.tar.gz: 622dbb9d71968b0d7a7c41b4d00b35d402151be970234e7c2ba511358826aec3c15c705ed8021167b4fd94c9c3f331794f90661e99d3664e10abfad3db6cc0f8
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,43 @@
|
|
1
|
+
## Rails 4.2.3 (June 22, 2015) ##
|
2
|
+
|
3
|
+
* `translate` should handle `raise` flag correctly in case of both main and default
|
4
|
+
translation is missing.
|
5
|
+
|
6
|
+
Fixes #19967
|
7
|
+
|
8
|
+
*Bernard Potocki*
|
9
|
+
|
10
|
+
* `translate` allows `default: [[]]` again for a default value of `[]`.
|
11
|
+
|
12
|
+
Fixes #19640.
|
13
|
+
|
14
|
+
*Adam Prescott*
|
15
|
+
|
16
|
+
* `translate` should accept nils as members of the `:default`
|
17
|
+
parameter without raising a translation missing error. Fixes a
|
18
|
+
regression introduced 362557e.
|
19
|
+
|
20
|
+
Fixes #19419
|
21
|
+
|
22
|
+
*Justin Coyne*
|
23
|
+
|
24
|
+
|
25
|
+
* `number_to_percentage` does not crash with `Float::NAN` or `Float::INFINITY`
|
26
|
+
as input when `precision: 0` is used.
|
27
|
+
|
28
|
+
Fixes #19227.
|
29
|
+
|
30
|
+
*Yves Senn*
|
31
|
+
|
32
|
+
|
1
33
|
## Rails 4.2.2 (June 16, 2015) ##
|
2
34
|
|
3
35
|
* No Changes *
|
4
36
|
|
5
37
|
|
6
|
-
## Rails 4.2.1 (March 19,
|
38
|
+
## Rails 4.2.1 (March 19, 2015) ##
|
7
39
|
|
8
|
-
* Default translations that have a lower
|
40
|
+
* Default translations that have a lower precedence than an html safe default,
|
9
41
|
but are not themselves safe, should not be marked as html_safe.
|
10
42
|
|
11
43
|
*Justin Coyne*
|
data/lib/action_view/digestor.rb
CHANGED
@@ -70,7 +70,8 @@ module ActionView
|
|
70
70
|
def dependencies
|
71
71
|
DependencyTracker.find_dependencies(name, template)
|
72
72
|
rescue ActionView::MissingTemplate
|
73
|
-
|
73
|
+
logger.try :error, " '#{name}' file doesn't exist, so no dependencies"
|
74
|
+
[]
|
74
75
|
end
|
75
76
|
|
76
77
|
def nested_dependencies
|
@@ -127,7 +127,7 @@ module ActionView
|
|
127
127
|
# auto_discovery_link_tag(:rss, {controller: "news", action: "feed"})
|
128
128
|
# # => <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.currenthost.com/news/feed" />
|
129
129
|
# auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", {title: "Example RSS"})
|
130
|
-
# # => <link rel="alternate" type="application/rss+xml" title="Example RSS" href="http://www.example.com/feed" />
|
130
|
+
# # => <link rel="alternate" type="application/rss+xml" title="Example RSS" href="http://www.example.com/feed.rss" />
|
131
131
|
def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
|
132
132
|
if !(type == :rss || type == :atom) && tag_options[:type].blank?
|
133
133
|
raise ArgumentError.new("You should pass :type tag_option key explicitly, because you have passed #{type} type other than :rss or :atom.")
|
@@ -111,7 +111,7 @@ module ActionView
|
|
111
111
|
#
|
112
112
|
# Now all you'll have to do is change that timestamp when the helper method changes.
|
113
113
|
def cache(name = {}, options = nil, &block)
|
114
|
-
if controller.perform_caching
|
114
|
+
if controller.respond_to?(:perform_caching) && controller.perform_caching
|
115
115
|
safe_concat(fragment_for(cache_fragment_name(name, options), options, &block))
|
116
116
|
else
|
117
117
|
yield
|
@@ -194,7 +194,9 @@ module ActionView
|
|
194
194
|
def with_output_buffer(buf = nil) #:nodoc:
|
195
195
|
unless buf
|
196
196
|
buf = ActionView::OutputBuffer.new
|
197
|
-
|
197
|
+
if output_buffer && output_buffer.respond_to?(:encoding)
|
198
|
+
buf.force_encoding(output_buffer.encoding)
|
199
|
+
end
|
198
200
|
end
|
199
201
|
self.output_buffer, old_buffer = buf, output_buffer
|
200
202
|
yield
|
@@ -1226,7 +1226,7 @@ module ActionView
|
|
1226
1226
|
# Admin: <%= person_form.check_box :admin %>
|
1227
1227
|
# <% end %>
|
1228
1228
|
#
|
1229
|
-
# In the above block,
|
1229
|
+
# In the above block, a +FormBuilder+ object is yielded as the
|
1230
1230
|
# +person_form+ variable. This allows you to generate the +text_field+
|
1231
1231
|
# and +check_box+ fields by specifying their eponymous methods, which
|
1232
1232
|
# modify the underlying template and associates the +@person+ model object
|
@@ -1247,6 +1247,7 @@ module ActionView
|
|
1247
1247
|
# )
|
1248
1248
|
# )
|
1249
1249
|
# end
|
1250
|
+
# end
|
1250
1251
|
#
|
1251
1252
|
# The above code creates a new method +div_radio_button+ which wraps a div
|
1252
1253
|
# around the new radio button. Note that when options are passed in, you
|
@@ -410,7 +410,7 @@ module ActionView
|
|
410
410
|
# * +collection+ - An array of objects representing the <tt><optgroup></tt> tags.
|
411
411
|
# * +group_method+ - The name of a method which, when called on a member of +collection+, returns an
|
412
412
|
# array of child objects representing the <tt><option></tt> tags.
|
413
|
-
# * group_label_method+ - The name of a method which, when called on a member of +collection+, returns a
|
413
|
+
# * +group_label_method+ - The name of a method which, when called on a member of +collection+, returns a
|
414
414
|
# string to be used as the +label+ attribute for its <tt><optgroup></tt> tag.
|
415
415
|
# * +option_key_method+ - The name of a method which, when called on a child object of a member of
|
416
416
|
# +collection+, returns a value to be used as the +value+ attribute for its <tt><option></tt> tag.
|
@@ -100,7 +100,7 @@ module ActionView
|
|
100
100
|
# strip_tags("<div id='top-bar'>Welcome to my website!</div>")
|
101
101
|
# # => Welcome to my website!
|
102
102
|
def strip_tags(html)
|
103
|
-
self.class.full_sanitizer.sanitize(html)
|
103
|
+
self.class.full_sanitizer.sanitize(html, encode_special_chars: false)
|
104
104
|
end
|
105
105
|
|
106
106
|
# Strips all link tags from +html+ leaving just the link text.
|
@@ -38,10 +38,10 @@ module ActionView
|
|
38
38
|
def translate(key, options = {})
|
39
39
|
options = options.dup
|
40
40
|
has_default = options.has_key?(:default)
|
41
|
-
remaining_defaults = Array(options.delete(:default))
|
41
|
+
remaining_defaults = Array(options.delete(:default)).compact
|
42
42
|
|
43
43
|
if has_default && !remaining_defaults.first.kind_of?(Symbol)
|
44
|
-
options[:default] = remaining_defaults
|
44
|
+
options[:default] = remaining_defaults
|
45
45
|
end
|
46
46
|
|
47
47
|
# If the user has explicitly decided to NOT raise errors, pass that option to I18n.
|
@@ -49,10 +49,10 @@ module ActionView
|
|
49
49
|
# Note: `raise_error` refers to us re-raising the error in this method. I18n is forced to raise by default.
|
50
50
|
if options[:raise] == false || (options.key?(:rescue_format) && options[:rescue_format].nil?)
|
51
51
|
raise_error = false
|
52
|
-
|
52
|
+
i18n_raise = false
|
53
53
|
else
|
54
54
|
raise_error = options[:raise] || options[:rescue_format] || ActionView::Base.raise_on_missing_translations
|
55
|
-
|
55
|
+
i18n_raise = true
|
56
56
|
end
|
57
57
|
|
58
58
|
if html_safe_translation_key?(key)
|
@@ -62,11 +62,11 @@ module ActionView
|
|
62
62
|
html_safe_options[name] = ERB::Util.html_escape(value.to_s)
|
63
63
|
end
|
64
64
|
end
|
65
|
-
translation = I18n.translate(scope_key_by_partial(key), html_safe_options)
|
65
|
+
translation = I18n.translate(scope_key_by_partial(key), html_safe_options.merge(raise: i18n_raise))
|
66
66
|
|
67
67
|
translation.respond_to?(:html_safe) ? translation.html_safe : translation
|
68
68
|
else
|
69
|
-
I18n.translate(scope_key_by_partial(key), options)
|
69
|
+
I18n.translate(scope_key_by_partial(key), options.merge(raise: i18n_raise))
|
70
70
|
end
|
71
71
|
rescue I18n::MissingTranslationData => e
|
72
72
|
if remaining_defaults.present?
|
@@ -2,20 +2,22 @@ namespace :cache_digests do
|
|
2
2
|
desc 'Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)'
|
3
3
|
task :nested_dependencies => :environment do
|
4
4
|
abort 'You must provide TEMPLATE for the task to run' unless ENV['TEMPLATE'].present?
|
5
|
-
puts JSON.pretty_generate ActionView::Digestor.new(name: template_name, finder: finder).nested_dependencies
|
5
|
+
puts JSON.pretty_generate ActionView::Digestor.new(name: CacheDigests.template_name, finder: CacheDigests.finder).nested_dependencies
|
6
6
|
end
|
7
7
|
|
8
8
|
desc 'Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)'
|
9
9
|
task :dependencies => :environment do
|
10
10
|
abort 'You must provide TEMPLATE for the task to run' unless ENV['TEMPLATE'].present?
|
11
|
-
puts JSON.pretty_generate ActionView::Digestor.new(name: template_name, finder: finder).dependencies
|
11
|
+
puts JSON.pretty_generate ActionView::Digestor.new(name: CacheDigests.template_name, finder: CacheDigests.finder).dependencies
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
class CacheDigests
|
15
|
+
def self.template_name
|
16
|
+
ENV['TEMPLATE'].split('.', 2).first
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
def self.finder
|
20
|
+
ApplicationController.new.lookup_context
|
21
|
+
end
|
20
22
|
end
|
21
23
|
end
|
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: 4.2.
|
4
|
+
version: 4.2.3.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: 2015-06-
|
11
|
+
date: 2015-06-22 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.2.
|
19
|
+
version: 4.2.3.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.2.
|
26
|
+
version: 4.2.3.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,7 +61,7 @@ dependencies:
|
|
61
61
|
version: '1.0'
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 1.0.
|
64
|
+
version: 1.0.2
|
65
65
|
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -71,7 +71,7 @@ dependencies:
|
|
71
71
|
version: '1.0'
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.0.
|
74
|
+
version: 1.0.2
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rails-dom-testing
|
77
77
|
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.
|
101
|
+
version: 4.2.3.rc1
|
102
102
|
type: :development
|
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.
|
108
|
+
version: 4.2.3.rc1
|
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.
|
115
|
+
version: 4.2.3.rc1
|
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.
|
122
|
+
version: 4.2.3.rc1
|
123
123
|
description: Simple, battle-tested conventions and helpers for building web pages.
|
124
124
|
email: david@loudthinking.com
|
125
125
|
executables: []
|
@@ -242,9 +242,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
242
242
|
version: 1.9.3
|
243
243
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
244
244
|
requirements:
|
245
|
-
- - "
|
245
|
+
- - ">"
|
246
246
|
- !ruby/object:Gem::Version
|
247
|
-
version:
|
247
|
+
version: 1.3.1
|
248
248
|
requirements:
|
249
249
|
- none
|
250
250
|
rubyforge_project:
|