activesupport 3.1.8 → 3.1.9
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +4 -1494
- data/lib/active_support/core_ext/string/output_safety.rb +26 -15
- data/lib/active_support/version.rb +1 -1
- metadata +12 -19
@@ -6,21 +6,32 @@ 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
|
+
if RUBY_VERSION >= '1.9'
|
10
|
+
# A utility method for escaping HTML tag characters.
|
11
|
+
# This method is also aliased as <tt>h</tt>.
|
12
|
+
#
|
13
|
+
# In your ERB templates, use this method to escape any unsafe content. For example:
|
14
|
+
# <%=h @person.name %>
|
15
|
+
#
|
16
|
+
# ==== Example:
|
17
|
+
# puts html_escape("is a > 0 & a < 10?")
|
18
|
+
# # => is a > 0 & a < 10?
|
19
|
+
def html_escape(s)
|
20
|
+
s = s.to_s
|
21
|
+
if s.html_safe?
|
22
|
+
s
|
23
|
+
else
|
24
|
+
s.gsub(/[&"'><]/, HTML_ESCAPE).html_safe
|
25
|
+
end
|
26
|
+
end
|
27
|
+
else
|
28
|
+
def html_escape(s) #:nodoc:
|
29
|
+
s = s.to_s
|
30
|
+
if s.html_safe?
|
31
|
+
s
|
32
|
+
else
|
33
|
+
s.gsub(/[&"'><]/n) { |special| HTML_ESCAPE[special] }.html_safe
|
34
|
+
end
|
24
35
|
end
|
25
36
|
end
|
26
37
|
|
metadata
CHANGED
@@ -1,36 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
5
|
-
prerelease:
|
4
|
+
version: 3.1.9
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- David Heinemeier Hansson
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2012-
|
11
|
+
date: 2012-12-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: multi_json
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '1.0'
|
22
|
-
- - <
|
20
|
+
- - "<"
|
23
21
|
- !ruby/object:Gem::Version
|
24
22
|
version: '1.3'
|
25
23
|
type: :runtime
|
26
24
|
prerelease: false
|
27
25
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
26
|
requirements:
|
30
|
-
- -
|
27
|
+
- - ">="
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: '1.0'
|
33
|
-
- - <
|
30
|
+
- - "<"
|
34
31
|
- !ruby/object:Gem::Version
|
35
32
|
version: '1.3'
|
36
33
|
description: A toolkit of support libraries and Ruby core extensions extracted from
|
@@ -257,32 +254,28 @@ files:
|
|
257
254
|
- lib/active_support.rb
|
258
255
|
homepage: http://www.rubyonrails.org
|
259
256
|
licenses: []
|
257
|
+
metadata: {}
|
260
258
|
post_install_message:
|
261
259
|
rdoc_options:
|
262
|
-
- --encoding
|
260
|
+
- "--encoding"
|
263
261
|
- UTF-8
|
264
262
|
require_paths:
|
265
263
|
- lib
|
266
264
|
required_ruby_version: !ruby/object:Gem::Requirement
|
267
|
-
none: false
|
268
265
|
requirements:
|
269
|
-
- -
|
266
|
+
- - ">="
|
270
267
|
- !ruby/object:Gem::Version
|
271
268
|
version: 1.8.7
|
272
269
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
273
|
-
none: false
|
274
270
|
requirements:
|
275
|
-
- -
|
271
|
+
- - ">="
|
276
272
|
- !ruby/object:Gem::Version
|
277
273
|
version: '0'
|
278
|
-
segments:
|
279
|
-
- 0
|
280
|
-
hash: 1313720041613742728
|
281
274
|
requirements: []
|
282
275
|
rubyforge_project:
|
283
|
-
rubygems_version:
|
276
|
+
rubygems_version: 2.0.0.preview2.1
|
284
277
|
signing_key:
|
285
|
-
specification_version:
|
278
|
+
specification_version: 4
|
286
279
|
summary: A toolkit of support libraries and Ruby core extensions extracted from the
|
287
280
|
Rails framework.
|
288
281
|
test_files: []
|