activesupport 3.2.4 → 3.2.5

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.

@@ -3,6 +3,9 @@
3
3
  * Added #beginning_of_hour and #end_of_hour to Time and DateTime core
4
4
  extensions. *Mark J. Titorenko*
5
5
 
6
+ * ActiveSupport::JSON::Variable is deprecated. Define your own #as_json and #encode_json methods
7
+ for custom JSON string literals. *Erich Menge*
8
+
6
9
 
7
10
  ## Rails 3.2.3 (March 30, 2012) ##
8
11
 
@@ -158,18 +158,18 @@ class Struct #:nodoc:
158
158
  end
159
159
 
160
160
  class TrueClass
161
- AS_JSON = ActiveSupport::JSON::Variable.new('true').freeze
162
- def as_json(options = nil) AS_JSON end #:nodoc:
161
+ def as_json(options = nil) self end #:nodoc:
162
+ def encode_json(encoder) to_s end #:nodoc:
163
163
  end
164
164
 
165
165
  class FalseClass
166
- AS_JSON = ActiveSupport::JSON::Variable.new('false').freeze
167
- def as_json(options = nil) AS_JSON end #:nodoc:
166
+ def as_json(options = nil) self end #:nodoc:
167
+ def encode_json(encoder) to_s end #:nodoc:
168
168
  end
169
169
 
170
170
  class NilClass
171
- AS_JSON = ActiveSupport::JSON::Variable.new('null').freeze
172
- def as_json(options = nil) AS_JSON end #:nodoc:
171
+ def as_json(options = nil) self end #:nodoc:
172
+ def encode_json(encoder) 'null' end #:nodoc:
173
173
  end
174
174
 
175
175
  class String
@@ -1,7 +1,15 @@
1
+ require 'active_support/deprecation'
2
+
1
3
  module ActiveSupport
2
4
  module JSON
3
- # A string that returns itself as its JSON-encoded form.
5
+ # Deprecated: A string that returns itself as its JSON-encoded form.
4
6
  class Variable < String
7
+ def initialize(*args)
8
+ ActiveSupport::Deprecation.warn 'ActiveSupport::JSON::Variable is deprecated and will be removed in Rails 4.0. ' \
9
+ 'For your own custom JSON literals, define #as_json and #encode_json yourself.'
10
+ super
11
+ end
12
+
5
13
  def as_json(options = nil) self end #:nodoc:
6
14
  def encode_json(encoder) self end #:nodoc:
7
15
  end
@@ -28,17 +28,22 @@ module ActiveSupport
28
28
  end
29
29
 
30
30
  module ForMiniTest
31
+ PASSTHROUGH_EXCEPTIONS = MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS rescue [NoMemoryError, SignalException, Interrupt, SystemExit]
31
32
  def run(runner)
32
33
  result = '.'
33
34
  begin
34
35
  run_callbacks :setup do
35
36
  result = super
36
37
  end
38
+ rescue *PASSTHROUGH_EXCEPTIONS => e
39
+ raise e
37
40
  rescue Exception => e
38
41
  result = runner.puke(self.class, method_name, e)
39
42
  ensure
40
43
  begin
41
44
  run_callbacks :teardown
45
+ rescue *PASSTHROUGH_EXCEPTIONS => e
46
+ raise e
42
47
  rescue Exception => e
43
48
  result = runner.puke(self.class, method_name, e)
44
49
  end
@@ -2,7 +2,7 @@ module ActiveSupport
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
- TINY = 4
5
+ TINY = 5
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
- - 4
10
- version: 3.2.4
9
+ - 5
10
+ version: 3.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Heinemeier Hansson
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-31 00:00:00 Z
18
+ date: 2012-06-01 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: i18n