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.

@@ -17,6 +17,7 @@ class File
17
17
  require 'fileutils' unless defined?(FileUtils)
18
18
 
19
19
  temp_file = Tempfile.new(basename(file_name), temp_dir)
20
+ temp_file.binmode
20
21
  yield temp_file
21
22
  temp_file.close
22
23
 
@@ -6,21 +6,42 @@ class ERB
6
6
  HTML_ESCAPE = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;' }
7
7
  JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C' }
8
8
 
9
- # A utility method for escaping HTML tag characters.
10
- # This method is also aliased as <tt>h</tt>.
11
- #
12
- # In your ERB templates, use this method to escape any unsafe content. For example:
13
- # <%=h @person.name %>
14
- #
15
- # ==== Example:
16
- # puts html_escape("is a > 0 & a < 10?")
17
- # # => is a &gt; 0 &amp; a &lt; 10?
18
- def html_escape(s)
19
- s = s.to_s
20
- if s.html_safe?
21
- s
22
- else
23
- s.gsub(/[&"><]/n) { |special| HTML_ESCAPE[special] }.html_safe
9
+ # Detect whether 1.9 can transcode with XML escaping.
10
+ if '"&gt;&lt;&amp;&quot;"' == ('><&"'.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 &gt; 0 &amp; a &lt; 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 &gt; 0 &amp; a &lt; 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
- new_safe_buffer = self[0, 0]
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.values.sum(0) { |method_infos| method_infos.max.total_time }
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" => "Pacific/Pago_Pago",
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
 
@@ -2,8 +2,8 @@ module ActiveSupport
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
- TINY = 4
6
- PRE = nil
5
+ TINY = 5
6
+ PRE = "rc1"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
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: 11
5
- prerelease:
4
+ hash: 660180367
5
+ prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
- - 4
10
- version: 3.1.4
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-03-01 00:00:00 Z
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: 3
292
+ hash: 25
284
293
  segments:
285
- - 0
286
- version: "0"
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.16
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.