activesupport 3.2.2.rc1 → 3.2.2

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.

@@ -98,29 +98,41 @@ module ActiveSupport #:nodoc:
98
98
  end
99
99
  end
100
100
 
101
- def[](*args)
102
- new_safe_buffer = super
103
- new_safe_buffer.instance_eval { @dirty = false }
104
- new_safe_buffer
101
+ def [](*args)
102
+ return super if args.size < 2
103
+
104
+ if html_safe?
105
+ new_safe_buffer = super
106
+ new_safe_buffer.instance_eval { @html_safe = true }
107
+ new_safe_buffer
108
+ else
109
+ to_str[*args]
110
+ end
105
111
  end
106
112
 
107
113
  def safe_concat(value)
108
- raise SafeConcatError if dirty?
114
+ raise SafeConcatError unless html_safe?
109
115
  original_concat(value)
110
116
  end
111
117
 
112
118
  def initialize(*)
113
- @dirty = false
119
+ @html_safe = true
114
120
  super
115
121
  end
116
122
 
117
123
  def initialize_copy(other)
118
124
  super
119
- @dirty = other.dirty?
125
+ @html_safe = other.html_safe?
126
+ end
127
+
128
+ def clone_empty
129
+ new_safe_buffer = self[0, 0]
130
+ new_safe_buffer.instance_variable_set(:@dirty, @dirty)
131
+ new_safe_buffer
120
132
  end
121
133
 
122
134
  def concat(value)
123
- if dirty? || value.html_safe?
135
+ if !html_safe? || value.html_safe?
124
136
  super(value)
125
137
  else
126
138
  super(ERB::Util.h(value))
@@ -133,7 +145,7 @@ module ActiveSupport #:nodoc:
133
145
  end
134
146
 
135
147
  def html_safe?
136
- !dirty?
148
+ defined?(@html_safe) && @html_safe
137
149
  end
138
150
 
139
151
  def to_s
@@ -161,18 +173,12 @@ module ActiveSupport #:nodoc:
161
173
  end # end
162
174
 
163
175
  def #{unsafe_method}!(*args) # def capitalize!(*args)
164
- @dirty = true # @dirty = true
176
+ @html_safe = false # @html_safe = false
165
177
  super # super
166
178
  end # end
167
179
  EOT
168
180
  end
169
181
  end
170
-
171
- protected
172
-
173
- def dirty?
174
- @dirty
175
- end
176
182
  end
177
183
  end
178
184
 
@@ -3,7 +3,7 @@ module ActiveSupport
3
3
  MAJOR = 3
4
4
  MINOR = 2
5
5
  TINY = 2
6
- PRE = "rc1"
6
+ PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424071
5
- prerelease: 6
4
+ hash: 11
5
+ prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
9
  - 2
10
- - rc
11
- - 1
12
- version: 3.2.2.rc1
10
+ version: 3.2.2
13
11
  platform: ruby
14
12
  authors:
15
13
  - David Heinemeier Hansson
@@ -17,7 +15,7 @@ autorequire:
17
15
  bindir: bin
18
16
  cert_chain: []
19
17
 
20
- date: 2012-02-22 00:00:00 Z
18
+ date: 2012-03-01 00:00:00 Z
21
19
  dependencies:
22
20
  - !ruby/object:Gem::Dependency
23
21
  name: i18n
@@ -294,14 +292,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
292
  required_rubygems_version: !ruby/object:Gem::Requirement
295
293
  none: false
296
294
  requirements:
297
- - - ">"
295
+ - - ">="
298
296
  - !ruby/object:Gem::Version
299
- hash: 25
297
+ hash: 3
300
298
  segments:
301
- - 1
302
- - 3
303
- - 1
304
- version: 1.3.1
299
+ - 0
300
+ version: "0"
305
301
  requirements: []
306
302
 
307
303
  rubyforge_project: