activesupport 3.1.4 → 3.1.5.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activesupport might be problematic. Click here for more details.
@@ -6,21 +6,42 @@ class ERB
|
|
6
6
|
HTML_ESCAPE = { '&' => '&', '>' => '>', '<' => '<', '"' => '"' }
|
7
7
|
JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C' }
|
8
8
|
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
s
|
22
|
-
|
23
|
-
|
9
|
+
# Detect whether 1.9 can transcode with XML escaping.
|
10
|
+
if '"><&""' == ('><&"'.encode('utf-8', :xml => :attr) rescue false)
|
11
|
+
# A utility method for escaping HTML tag characters.
|
12
|
+
# This method is also aliased as <tt>h</tt>.
|
13
|
+
#
|
14
|
+
# In your ERB templates, use this method to escape any unsafe content. For example:
|
15
|
+
# <%=h @person.name %>
|
16
|
+
#
|
17
|
+
# ==== Example:
|
18
|
+
# puts html_escape("is a > 0 & a < 10?")
|
19
|
+
# # => is a > 0 & a < 10?
|
20
|
+
def html_escape(s)
|
21
|
+
s = s.to_s
|
22
|
+
if s.html_safe?
|
23
|
+
s
|
24
|
+
else
|
25
|
+
s.encode(s.encoding, :xml => :attr)[1...-1].html_safe
|
26
|
+
end
|
27
|
+
end
|
28
|
+
else
|
29
|
+
# A utility method for escaping HTML tag characters.
|
30
|
+
# This method is also aliased as <tt>h</tt>.
|
31
|
+
#
|
32
|
+
# In your ERB templates, use this method to escape any unsafe content. For example:
|
33
|
+
# <%=h @person.name %>
|
34
|
+
#
|
35
|
+
# ==== Example:
|
36
|
+
# puts html_escape("is a > 0 & a < 10?")
|
37
|
+
# # => is a > 0 & a < 10?
|
38
|
+
def html_escape(s)
|
39
|
+
s = s.to_s
|
40
|
+
if s.html_safe?
|
41
|
+
s
|
42
|
+
else
|
43
|
+
s.gsub(/[&"><]/n) { |special| HTML_ESCAPE[special] }.html_safe
|
44
|
+
end
|
24
45
|
end
|
25
46
|
end
|
26
47
|
|
@@ -114,9 +135,7 @@ module ActiveSupport #:nodoc:
|
|
114
135
|
end
|
115
136
|
|
116
137
|
def clone_empty
|
117
|
-
|
118
|
-
new_safe_buffer.instance_variable_set(:@dirty, @dirty)
|
119
|
-
new_safe_buffer
|
138
|
+
self[0, 0]
|
120
139
|
end
|
121
140
|
|
122
141
|
def concat(value)
|
@@ -36,7 +36,7 @@ module ActiveSupport
|
|
36
36
|
RubyProf.pause
|
37
37
|
full_profile_options[:runs].to_i.times { run_test(@metric, :profile) }
|
38
38
|
@data = RubyProf.stop
|
39
|
-
@total = @data.threads.
|
39
|
+
@total = @data.threads.sum(0) { |thread| thread.methods.max.total_time }
|
40
40
|
end
|
41
41
|
|
42
42
|
def record
|
@@ -28,7 +28,7 @@ module ActiveSupport
|
|
28
28
|
MAPPING = {
|
29
29
|
"International Date Line West" => "Pacific/Midway",
|
30
30
|
"Midway Island" => "Pacific/Midway",
|
31
|
-
"Samoa"
|
31
|
+
"American Samoa" => "Pacific/Pago_Pago",
|
32
32
|
"Hawaii" => "Pacific/Honolulu",
|
33
33
|
"Alaska" => "America/Juneau",
|
34
34
|
"Pacific Time (US & Canada)" => "America/Los_Angeles",
|
@@ -167,7 +167,9 @@ module ActiveSupport
|
|
167
167
|
"Marshall Is." => "Pacific/Majuro",
|
168
168
|
"Auckland" => "Pacific/Auckland",
|
169
169
|
"Wellington" => "Pacific/Auckland",
|
170
|
-
"Nuku'alofa" => "Pacific/Tongatapu"
|
170
|
+
"Nuku'alofa" => "Pacific/Tongatapu",
|
171
|
+
"Tokelau Is." => "Pacific/Fakaofo",
|
172
|
+
"Samoa" => "Pacific/Apia"
|
171
173
|
}.each { |name, zone| name.freeze; zone.freeze }
|
172
174
|
MAPPING.freeze
|
173
175
|
|
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 660180367
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
|
9
|
+
- 5
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 3.1.5.rc1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- David Heinemeier Hansson
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2012-
|
20
|
+
date: 2012-05-28 00:00:00 Z
|
19
21
|
dependencies:
|
20
22
|
- !ruby/object:Gem::Dependency
|
21
23
|
name: multi_json
|
@@ -23,13 +25,20 @@ dependencies:
|
|
23
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
26
|
none: false
|
25
27
|
requirements:
|
26
|
-
- -
|
28
|
+
- - ">="
|
27
29
|
- !ruby/object:Gem::Version
|
28
30
|
hash: 15
|
29
31
|
segments:
|
30
32
|
- 1
|
31
33
|
- 0
|
32
34
|
version: "1.0"
|
35
|
+
- - <
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
hash: 9
|
38
|
+
segments:
|
39
|
+
- 1
|
40
|
+
- 3
|
41
|
+
version: "1.3"
|
33
42
|
type: :runtime
|
34
43
|
version_requirements: *id001
|
35
44
|
description: A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing.
|
@@ -278,16 +287,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
278
287
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
288
|
none: false
|
280
289
|
requirements:
|
281
|
-
- - "
|
290
|
+
- - ">"
|
282
291
|
- !ruby/object:Gem::Version
|
283
|
-
hash:
|
292
|
+
hash: 25
|
284
293
|
segments:
|
285
|
-
-
|
286
|
-
|
294
|
+
- 1
|
295
|
+
- 3
|
296
|
+
- 1
|
297
|
+
version: 1.3.1
|
287
298
|
requirements: []
|
288
299
|
|
289
300
|
rubyforge_project:
|
290
|
-
rubygems_version: 1.8.
|
301
|
+
rubygems_version: 1.8.22
|
291
302
|
signing_key:
|
292
303
|
specification_version: 3
|
293
304
|
summary: A toolkit of support libraries and Ruby core extensions extracted from the Rails framework.
|