actionview 4.2.0 → 4.2.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 +13 -0
- data/lib/action_view/gem_version.rb +2 -2
- data/lib/action_view/helpers/cache_helper.rb +2 -2
- data/lib/action_view/helpers/form_helper.rb +2 -2
- data/lib/action_view/helpers/form_tag_helper.rb +1 -2
- data/lib/action_view/helpers/sanitize_helper.rb +51 -76
- data/lib/action_view/helpers/tags.rb +1 -0
- data/lib/action_view/helpers/tags/base.rb +9 -2
- data/lib/action_view/helpers/tags/label.rb +3 -13
- data/lib/action_view/helpers/tags/placeholderable.rb +3 -15
- data/lib/action_view/helpers/tags/search_field.rb +9 -11
- data/lib/action_view/helpers/tags/text_field.rb +1 -0
- data/lib/action_view/helpers/tags/translator.rb +40 -0
- data/lib/action_view/helpers/translation_helper.rb +17 -25
- data/lib/action_view/renderer/partial_renderer.rb +10 -2
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e4bb093df93d79e327de2207d98acdf3c5deaff
|
4
|
+
data.tar.gz: 5dab0ceaec0500f33bfab92d370f263276b147e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c820990800d373b967614367b586645b377ee22184421cbbd9b1dfdc4a3e424192eccc5d89bc3d8b0fe163990ba29ece731c6a5a1340eb7021190d418c37a5b1
|
7
|
+
data.tar.gz: 1b2f323028acb15ca997d7050fc1d41df8ba05f926fee0c56345153ae1733ed1aa4d8706bb6614379d10e7e507c54ae51678ada2defef3b9c61f4e95ee2719e3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
* Default translations that have a lower precidence than an html safe default,
|
2
|
+
but are not themselves safe, should not be marked as html_safe.
|
3
|
+
|
4
|
+
*Justin Coyne*
|
5
|
+
|
6
|
+
* Added an explicit error message, in `ActionView::PartialRenderer`
|
7
|
+
for partial `rendering`, when the value of option `as` has invalid characters.
|
8
|
+
|
9
|
+
*Angelo Capilleri*
|
10
|
+
|
11
|
+
|
12
|
+
## Rails 4.2.0 (December 20, 2014) ##
|
13
|
+
|
1
14
|
* Local variable in a partial is now available even if a falsy value is
|
2
15
|
passed to `:object` when rendering a partial.
|
3
16
|
|
@@ -122,7 +122,7 @@ module ActionView
|
|
122
122
|
|
123
123
|
# Cache fragments of a view if +condition+ is true
|
124
124
|
#
|
125
|
-
#
|
125
|
+
# <% cache_if admin?, project do %>
|
126
126
|
# <b>All the topics on this project</b>
|
127
127
|
# <%= render project.topics %>
|
128
128
|
# <% end %>
|
@@ -138,7 +138,7 @@ module ActionView
|
|
138
138
|
|
139
139
|
# Cache fragments of a view unless +condition+ is true
|
140
140
|
#
|
141
|
-
#
|
141
|
+
# <% cache_unless admin?, project do %>
|
142
142
|
# <b>All the topics on this project</b>
|
143
143
|
# <%= render project.topics %>
|
144
144
|
# <% end %>
|
@@ -1206,11 +1206,11 @@ module ActionView
|
|
1206
1206
|
object_name = model_name_from_record_or_class(object).param_key
|
1207
1207
|
end
|
1208
1208
|
|
1209
|
-
builder = options[:builder] ||
|
1209
|
+
builder = options[:builder] || default_form_builder_class
|
1210
1210
|
builder.new(object_name, object, self, options)
|
1211
1211
|
end
|
1212
1212
|
|
1213
|
-
def
|
1213
|
+
def default_form_builder_class
|
1214
1214
|
builder = ActionView::Base.default_form_builder
|
1215
1215
|
builder.respond_to?(:constantize) ? builder.constantize : builder
|
1216
1216
|
end
|
@@ -84,14 +84,13 @@ module ActionView
|
|
84
84
|
# * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
|
85
85
|
# * <tt>:include_blank</tt> - If set to true, an empty option will be created. If set to a string, the string will be used as the option's content and the value will be empty.
|
86
86
|
# * <tt>:prompt</tt> - Create a prompt option with blank value and the text asking user to select something.
|
87
|
-
# * <tt>:selected</tt> - Provide a default selected value. It should be of the exact type as the provided options.
|
88
87
|
# * Any other key creates standard HTML attributes for the tag.
|
89
88
|
#
|
90
89
|
# ==== Examples
|
91
90
|
# select_tag "people", options_from_collection_for_select(@people, "id", "name")
|
92
91
|
# # <select id="people" name="people"><option value="1">David</option></select>
|
93
92
|
#
|
94
|
-
# select_tag "people", options_from_collection_for_select(@people, "id", "name"
|
93
|
+
# select_tag "people", options_from_collection_for_select(@people, "id", "name", "1")
|
95
94
|
# # <select id="people" name="people"><option value="1" selected="selected">David</option></select>
|
96
95
|
#
|
97
96
|
# select_tag "people", "<option>David</option>".html_safe
|
@@ -9,76 +9,77 @@ module ActionView
|
|
9
9
|
# These helper methods extend Action View making them callable within your template files.
|
10
10
|
module SanitizeHelper
|
11
11
|
extend ActiveSupport::Concern
|
12
|
-
#
|
13
|
-
# aren't specifically allowed.
|
12
|
+
# Sanitizes HTML input, stripping all tags and attributes that aren't whitelisted.
|
14
13
|
#
|
15
|
-
# It also strips href/src
|
16
|
-
#
|
17
|
-
#
|
18
|
-
# the extensive test suite.
|
14
|
+
# It also strips href/src attributes with unsafe protocols like
|
15
|
+
# <tt>javascript:</tt>, while also protecting against attempts to use Unicode,
|
16
|
+
# ASCII, and hex character references to work around these protocol filters.
|
19
17
|
#
|
20
|
-
#
|
18
|
+
# The default sanitizer is Rails::Html::WhiteListSanitizer. See {Rails HTML
|
19
|
+
# Sanitizers}[https://github.com/rails/rails-html-sanitizer] for more information.
|
21
20
|
#
|
22
|
-
#
|
23
|
-
# See ActionView::Base for full docs on the available options. You can add
|
24
|
-
# tags/attributes for single uses of +sanitize+ by passing either the
|
25
|
-
# <tt>:attributes</tt> or <tt>:tags</tt> options:
|
21
|
+
# Custom sanitization rules can also be provided.
|
26
22
|
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
23
|
+
# Please note that sanitizing user-provided text does not guarantee that the
|
24
|
+
# resulting markup is valid or even well-formed. For example, the output may still
|
25
|
+
# contain unescaped characters like <tt><</tt>, <tt>></tt>, or <tt>&</tt>.
|
30
26
|
#
|
31
|
-
#
|
32
|
-
# (supply a Loofah::Scrubber that does the sanitization)
|
27
|
+
# ==== Options
|
33
28
|
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
29
|
+
# * <tt>:tags</tt> - An array of allowed tags.
|
30
|
+
# * <tt>:attributes</tt> - An array of allowed attributes.
|
31
|
+
# * <tt>:scrubber</tt> - A {Rails::Html scrubber}[https://github.com/rails/rails-html-sanitizer]
|
32
|
+
# or {Loofah::Scrubber}[https://github.com/flavorjones/loofah] object that
|
33
|
+
# defines custom sanitization rules. A custom scrubber takes precedence over
|
34
|
+
# custom tags and attributes.
|
38
35
|
#
|
39
|
-
#
|
40
|
-
# class KittyApocalypse < Loofah::Scrubber
|
41
|
-
# def scrub(node)
|
42
|
-
# node.text = "dawn of cats"
|
43
|
-
# end
|
44
|
-
# end
|
45
|
-
# scrubber = KittyApocalypse.new
|
36
|
+
# ==== Examples
|
46
37
|
#
|
47
|
-
#
|
38
|
+
# Normal use:
|
48
39
|
#
|
49
|
-
#
|
50
|
-
# Learn more about scrubbers here: https://github.com/flavorjones/loofah
|
40
|
+
# <%= sanitize @comment.body %>
|
51
41
|
#
|
52
|
-
#
|
53
|
-
# (only the mentioned tags and attributes are allowed, nothing else)
|
42
|
+
# Providing custom whitelisted tags and attributes:
|
54
43
|
#
|
55
|
-
# <%= sanitize @
|
44
|
+
# <%= sanitize @comment.body, tags: %w(strong em a), attributes: %w(href) %>
|
56
45
|
#
|
57
|
-
#
|
46
|
+
# Providing a custom Rails::Html scrubber:
|
58
47
|
#
|
59
|
-
# class
|
60
|
-
#
|
61
|
-
#
|
48
|
+
# class CommentScrubber < Rails::Html::PermitScrubber
|
49
|
+
# def allowed_node?(node)
|
50
|
+
# !%w(form script comment blockquote).include?(node.name)
|
51
|
+
# end
|
62
52
|
#
|
63
|
-
#
|
53
|
+
# def skip_node?(node)
|
54
|
+
# node.text?
|
55
|
+
# end
|
64
56
|
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
# ActionView::Base.sanitized_allowed_tags.delete 'div'
|
57
|
+
# def scrub_attribute?(name)
|
58
|
+
# name == 'style'
|
68
59
|
# end
|
69
60
|
# end
|
70
61
|
#
|
71
|
-
#
|
62
|
+
# <%= sanitize @comment.body, scrubber: CommentScrubber.new %>
|
63
|
+
#
|
64
|
+
# See {Rails HTML Sanitizer}[https://github.com/rails/rails-html-sanitizer] for
|
65
|
+
# documentation about Rails::Html scrubbers.
|
72
66
|
#
|
73
|
-
#
|
74
|
-
#
|
67
|
+
# Providing a custom Loofah::Scrubber:
|
68
|
+
#
|
69
|
+
# scrubber = Loofah::Scrubber.new do |node|
|
70
|
+
# node.remove if node.name == 'script'
|
75
71
|
# end
|
76
72
|
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
73
|
+
# <%= sanitize @comment.body, scrubber: scrubber %>
|
74
|
+
#
|
75
|
+
# See {Loofah's documentation}[https://github.com/flavorjones/loofah] for more
|
76
|
+
# information about defining custom Loofah::Scrubber objects.
|
81
77
|
#
|
78
|
+
# To set the default allowed tags or attributes across your application:
|
79
|
+
#
|
80
|
+
# # In config/application.rb
|
81
|
+
# config.action_view.sanitized_allowed_tags = ['strong', 'em', 'a']
|
82
|
+
# config.action_view.sanitized_allowed_attributes = ['href', 'title']
|
82
83
|
def sanitize(html, options = {})
|
83
84
|
self.class.white_list_sanitizer.sanitize(html, options).try(:html_safe)
|
84
85
|
end
|
@@ -88,9 +89,7 @@ module ActionView
|
|
88
89
|
self.class.white_list_sanitizer.sanitize_css(style)
|
89
90
|
end
|
90
91
|
|
91
|
-
# Strips all HTML tags from
|
92
|
-
# Nokogiri for tokenization (via Loofah) and so its HTML parsing ability
|
93
|
-
# is limited by that of Nokogiri.
|
92
|
+
# Strips all HTML tags from +html+, including comments.
|
94
93
|
#
|
95
94
|
# strip_tags("Strip <i>these</i> tags!")
|
96
95
|
# # => Strip these tags!
|
@@ -104,7 +103,7 @@ module ActionView
|
|
104
103
|
self.class.full_sanitizer.sanitize(html)
|
105
104
|
end
|
106
105
|
|
107
|
-
# Strips all link tags from +
|
106
|
+
# Strips all link tags from +html+ leaving just the link text.
|
108
107
|
#
|
109
108
|
# strip_links('<a href="http://www.rubyonrails.org">Ruby on Rails</a>')
|
110
109
|
# # => Ruby on Rails
|
@@ -167,30 +166,6 @@ module ActionView
|
|
167
166
|
def white_list_sanitizer
|
168
167
|
@white_list_sanitizer ||= sanitizer_vendor.white_list_sanitizer.new
|
169
168
|
end
|
170
|
-
|
171
|
-
##
|
172
|
-
# :method: sanitized_allowed_tags=
|
173
|
-
#
|
174
|
-
# :call-seq: sanitized_allowed_tags=(tags)
|
175
|
-
#
|
176
|
-
# Replaces the allowed tags for the +sanitize+ helper.
|
177
|
-
#
|
178
|
-
# class Application < Rails::Application
|
179
|
-
# config.action_view.sanitized_allowed_tags = ['table', 'tr', 'td']
|
180
|
-
# end
|
181
|
-
#
|
182
|
-
|
183
|
-
##
|
184
|
-
# :method: sanitized_allowed_attributes=
|
185
|
-
#
|
186
|
-
# :call-seq: sanitized_allowed_attributes=(attributes)
|
187
|
-
#
|
188
|
-
# Replaces the allowed HTML attributes for the +sanitize+ helper.
|
189
|
-
#
|
190
|
-
# class Application < Rails::Application
|
191
|
-
# config.action_view.sanitized_allowed_attributes = ['onclick', 'longdesc']
|
192
|
-
# end
|
193
|
-
#
|
194
169
|
end
|
195
170
|
end
|
196
171
|
end
|
@@ -32,12 +32,19 @@ module ActionView
|
|
32
32
|
unless object.nil?
|
33
33
|
method_before_type_cast = @method_name + "_before_type_cast"
|
34
34
|
|
35
|
-
object.respond_to?(method_before_type_cast)
|
36
|
-
object.
|
35
|
+
if value_came_from_user?(object) && object.respond_to?(method_before_type_cast)
|
36
|
+
object.public_send(method_before_type_cast)
|
37
|
+
else
|
37
38
|
value(object)
|
39
|
+
end
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
43
|
+
def value_came_from_user?(object)
|
44
|
+
method_name = "#{@method_name}_came_from_user?"
|
45
|
+
!object.respond_to?(method_name) || object.public_send(method_name)
|
46
|
+
end
|
47
|
+
|
41
48
|
def retrieve_object(object)
|
42
49
|
if object
|
43
50
|
object
|
@@ -15,20 +15,10 @@ module ActionView
|
|
15
15
|
|
16
16
|
def translation
|
17
17
|
method_and_value = @tag_value.present? ? "#{@method_name}.#{@tag_value}" : @method_name
|
18
|
-
@object_name.gsub!(/\[(.*)_attributes\]\[\d+\]/, '.\1')
|
19
|
-
|
20
|
-
if object.respond_to?(:to_model)
|
21
|
-
key = object.model_name.i18n_key
|
22
|
-
i18n_default = ["#{key}.#{method_and_value}".to_sym, ""]
|
23
|
-
end
|
24
|
-
|
25
|
-
i18n_default ||= ""
|
26
|
-
content = I18n.t("#{@object_name}.#{method_and_value}", :default => i18n_default, :scope => "helpers.label").presence
|
27
|
-
|
28
|
-
content ||= if object && object.class.respond_to?(:human_attribute_name)
|
29
|
-
object.class.human_attribute_name(method_and_value)
|
30
|
-
end
|
31
18
|
|
19
|
+
content ||= Translator
|
20
|
+
.new(object, @object_name, method_and_value, "helpers.label")
|
21
|
+
.translate
|
32
22
|
content ||= @method_name.humanize
|
33
23
|
|
34
24
|
content
|
@@ -7,24 +7,12 @@ module ActionView
|
|
7
7
|
|
8
8
|
if tag_value = @options[:placeholder]
|
9
9
|
placeholder = tag_value if tag_value.is_a?(String)
|
10
|
-
|
11
|
-
object_name = @object_name.gsub(/\[(.*)_attributes\]\[\d+\]/, '.\1')
|
12
10
|
method_and_value = tag_value.is_a?(TrueClass) ? @method_name : "#{@method_name}.#{tag_value}"
|
13
11
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
end
|
18
|
-
|
19
|
-
i18n_default ||= ""
|
20
|
-
placeholder ||= I18n.t("#{object_name}.#{method_and_value}", :default => i18n_default, :scope => "helpers.placeholder").presence
|
21
|
-
|
22
|
-
placeholder ||= if object && object.class.respond_to?(:human_attribute_name)
|
23
|
-
object.class.human_attribute_name(method_and_value)
|
24
|
-
end
|
25
|
-
|
12
|
+
placeholder ||= Tags::Translator
|
13
|
+
.new(object, @object_name, method_and_value, "helpers.placeholder")
|
14
|
+
.translate
|
26
15
|
placeholder ||= @method_name.humanize
|
27
|
-
|
28
16
|
@options[:placeholder] = placeholder
|
29
17
|
end
|
30
18
|
end
|
@@ -3,20 +3,18 @@ module ActionView
|
|
3
3
|
module Tags # :nodoc:
|
4
4
|
class SearchField < TextField # :nodoc:
|
5
5
|
def render
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
super do |options|
|
7
|
+
if options["autosave"]
|
8
|
+
if options["autosave"] == true
|
9
|
+
options["autosave"] = request.host.split(".").reverse.join(".")
|
10
|
+
end
|
11
|
+
options["results"] ||= 10
|
11
12
|
end
|
12
|
-
options["results"] ||= 10
|
13
|
-
end
|
14
13
|
|
15
|
-
|
16
|
-
|
14
|
+
if options["onsearch"]
|
15
|
+
options["incremental"] = true unless options.has_key?("incremental")
|
16
|
+
end
|
17
17
|
end
|
18
|
-
|
19
|
-
super
|
20
18
|
end
|
21
19
|
end
|
22
20
|
end
|
@@ -11,6 +11,7 @@ module ActionView
|
|
11
11
|
options["size"] = options["maxlength"] unless options.key?("size")
|
12
12
|
options["type"] ||= field_type
|
13
13
|
options["value"] = options.fetch("value") { value_before_type_cast(object) } unless field_type == "file"
|
14
|
+
yield options if block_given?
|
14
15
|
add_default_name_and_id(options)
|
15
16
|
tag("input", options)
|
16
17
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module ActionView
|
2
|
+
module Helpers
|
3
|
+
module Tags # :nodoc:
|
4
|
+
class Translator # :nodoc:
|
5
|
+
def initialize(object, object_name, method_and_value, scope)
|
6
|
+
@object_name = object_name.gsub(/\[(.*)_attributes\]\[\d+\]/, '.\1')
|
7
|
+
@method_and_value = method_and_value
|
8
|
+
@scope = scope
|
9
|
+
@model = object.respond_to?(:to_model) ? object.to_model : nil
|
10
|
+
end
|
11
|
+
|
12
|
+
def translate
|
13
|
+
translated_attribute = I18n.t("#{object_name}.#{method_and_value}", default: i18n_default, scope: scope).presence
|
14
|
+
translated_attribute || human_attribute_name
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
attr_reader :object_name, :method_and_value, :scope, :model
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def i18n_default
|
24
|
+
if model
|
25
|
+
key = model.model_name.i18n_key
|
26
|
+
["#{key}.#{method_and_value}".to_sym, ""]
|
27
|
+
else
|
28
|
+
""
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def human_attribute_name
|
33
|
+
if model && model.class.respond_to?(:human_attribute_name)
|
34
|
+
model.class.human_attribute_name(method_and_value)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -37,14 +37,17 @@ module ActionView
|
|
37
37
|
# you know what kind of output to expect when you call translate in a template.
|
38
38
|
def translate(key, options = {})
|
39
39
|
options = options.dup
|
40
|
-
|
40
|
+
remaining_defaults = Array(options.delete(:default))
|
41
|
+
options[:default] = remaining_defaults.shift if remaining_defaults.first.kind_of? String
|
41
42
|
|
42
|
-
# If the user has
|
43
|
-
# raise
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
# If the user has explicitly decided to NOT raise errors, pass that option to I18n.
|
44
|
+
# Otherwise, tell I18n to raise an exception, which we rescue further in this method.
|
45
|
+
# Note: `raise_error` refers to us re-raising the error in this method. I18n is forced to raise by default.
|
46
|
+
if options[:raise] == false || (options.key?(:rescue_format) && options[:rescue_format].nil?)
|
47
|
+
raise_error = false
|
48
|
+
options[:raise] = false
|
49
|
+
else
|
50
|
+
raise_error = options[:raise] || options[:rescue_format] || ActionView::Base.raise_on_missing_translations
|
48
51
|
options[:raise] = true
|
49
52
|
end
|
50
53
|
|
@@ -62,10 +65,14 @@ module ActionView
|
|
62
65
|
I18n.translate(scope_key_by_partial(key), options)
|
63
66
|
end
|
64
67
|
rescue I18n::MissingTranslationData => e
|
65
|
-
|
68
|
+
if remaining_defaults.present?
|
69
|
+
translate remaining_defaults.shift, options.merge(default: remaining_defaults)
|
70
|
+
else
|
71
|
+
raise e if raise_error
|
66
72
|
|
67
|
-
|
68
|
-
|
73
|
+
keys = I18n.normalize_keys(e.locale, e.key, e.options[:scope])
|
74
|
+
content_tag('span', keys.last.to_s.titleize, :class => 'translation_missing', :title => "translation missing: #{keys.join('.')}")
|
75
|
+
end
|
69
76
|
end
|
70
77
|
alias :t :translate
|
71
78
|
|
@@ -94,21 +101,6 @@ module ActionView
|
|
94
101
|
def html_safe_translation_key?(key)
|
95
102
|
key.to_s =~ /(\b|_|\.)html$/
|
96
103
|
end
|
97
|
-
|
98
|
-
def wrap_translate_defaults(defaults)
|
99
|
-
new_defaults = []
|
100
|
-
defaults = Array(defaults)
|
101
|
-
while key = defaults.shift
|
102
|
-
if key.is_a?(Symbol)
|
103
|
-
new_defaults << lambda { |_, options| translate key, options.merge(:default => defaults) }
|
104
|
-
break
|
105
|
-
else
|
106
|
-
new_defaults << key
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
new_defaults
|
111
|
-
end
|
112
104
|
end
|
113
105
|
end
|
114
106
|
end
|
@@ -384,7 +384,7 @@ module ActionView
|
|
384
384
|
end
|
385
385
|
|
386
386
|
if as = options[:as]
|
387
|
-
|
387
|
+
raise_invalid_option_as(as) unless as.to_s =~ /\A[a-z_]\w*\z/
|
388
388
|
as = as.to_sym
|
389
389
|
end
|
390
390
|
|
@@ -530,11 +530,19 @@ module ActionView
|
|
530
530
|
end
|
531
531
|
|
532
532
|
IDENTIFIER_ERROR_MESSAGE = "The partial name (%s) is not a valid Ruby identifier; " +
|
533
|
-
"make sure your partial name starts with
|
533
|
+
"make sure your partial name starts with underscore, " +
|
534
|
+
"and is followed by any combination of letters, numbers and underscores."
|
535
|
+
|
536
|
+
OPTION_AS_ERROR_MESSAGE = "The value (%s) of the option `as` is not a valid Ruby identifier; " +
|
537
|
+
"make sure it starts with lowercase letter, " +
|
534
538
|
"and is followed by any combination of letters, numbers and underscores."
|
535
539
|
|
536
540
|
def raise_invalid_identifier(path)
|
537
541
|
raise ArgumentError.new(IDENTIFIER_ERROR_MESSAGE % (path))
|
538
542
|
end
|
543
|
+
|
544
|
+
def raise_invalid_option_as(as)
|
545
|
+
raise ArgumentError.new(OPTION_AS_ERROR_MESSAGE % (as))
|
546
|
+
end
|
539
547
|
end
|
540
548
|
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.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:
|
11
|
+
date: 2015-02-20 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.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: 4.2.
|
26
|
+
version: 4.2.1.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
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.1.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.1.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.1.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.1.rc1
|
123
123
|
description: Simple, battle-tested conventions and helpers for building web pages.
|
124
124
|
email: david@loudthinking.com
|
125
125
|
executables: []
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- lib/action_view/helpers/tags/time_field.rb
|
192
192
|
- lib/action_view/helpers/tags/time_select.rb
|
193
193
|
- lib/action_view/helpers/tags/time_zone_select.rb
|
194
|
+
- lib/action_view/helpers/tags/translator.rb
|
194
195
|
- lib/action_view/helpers/tags/url_field.rb
|
195
196
|
- lib/action_view/helpers/tags/week_field.rb
|
196
197
|
- lib/action_view/helpers/text_helper.rb
|
@@ -241,13 +242,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
241
242
|
version: 1.9.3
|
242
243
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
243
244
|
requirements:
|
244
|
-
- - "
|
245
|
+
- - ">"
|
245
246
|
- !ruby/object:Gem::Version
|
246
|
-
version:
|
247
|
+
version: 1.3.1
|
247
248
|
requirements:
|
248
249
|
- none
|
249
250
|
rubyforge_project:
|
250
|
-
rubygems_version: 2.
|
251
|
+
rubygems_version: 2.4.5
|
251
252
|
signing_key:
|
252
253
|
specification_version: 4
|
253
254
|
summary: Rendering framework putting the V in MVC (part of Rails).
|