activesupport 3.0.5 → 3.0.6.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.
- data/CHANGELOG +15 -0
- data/lib/active_support/buffered_logger.rb +1 -0
- data/lib/active_support/callbacks.rb +1 -0
- data/lib/active_support/core_ext/date/calculations.rb +2 -2
- data/lib/active_support/core_ext/date/zones.rb +3 -3
- data/lib/active_support/core_ext/date_time/calculations.rb +2 -1
- data/lib/active_support/core_ext/module/deprecation.rb +2 -0
- data/lib/active_support/core_ext/time/calculations.rb +2 -2
- data/lib/active_support/version.rb +2 -2
- data/lib/active_support/whiny_nil.rb +1 -1
- metadata +14 -10
data/CHANGELOG
CHANGED
@@ -34,9 +34,9 @@ class Date
|
|
34
34
|
::Date.current.tomorrow
|
35
35
|
end
|
36
36
|
|
37
|
-
# Returns Time.zone.today when config.time_zone
|
37
|
+
# Returns Time.zone.today when <tt>Time.zone</tt> or <tt>config.time_zone</tt> are set, otherwise just returns Date.today.
|
38
38
|
def current
|
39
|
-
::Time.
|
39
|
+
::Time.zone ? ::Time.zone.today : ::Date.today
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -2,10 +2,10 @@ require 'date'
|
|
2
2
|
require 'active_support/core_ext/time/zones'
|
3
3
|
|
4
4
|
class Date
|
5
|
-
# Converts Date to a TimeWithZone in the current zone if Time.
|
6
|
-
# otherwise converts Date to a Time via Date#to_time
|
5
|
+
# Converts Date to a TimeWithZone in the current zone if Time.zone or Time.zone_default
|
6
|
+
# is set, otherwise converts Date to a Time via Date#to_time
|
7
7
|
def to_time_in_current_zone
|
8
|
-
if ::Time.
|
8
|
+
if ::Time.zone
|
9
9
|
::Time.zone.local(year, month, day)
|
10
10
|
else
|
11
11
|
to_time
|
@@ -9,8 +9,9 @@ class DateTime
|
|
9
9
|
::Time.local(2007).utc_offset.to_r / 86400
|
10
10
|
end
|
11
11
|
|
12
|
+
# Returns <tt>Time.zone.now.to_datetime</tt> when <tt>Time.zone</tt> or <tt>config.time_zone</tt> are set, otherwise returns <tt>Time.now.to_datetime</tt>.
|
12
13
|
def current
|
13
|
-
::Time.
|
14
|
+
::Time.zone ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
|
14
15
|
end
|
15
16
|
end
|
16
17
|
|
@@ -41,9 +41,9 @@ class Time
|
|
41
41
|
time_with_datetime_fallback(:local, *args)
|
42
42
|
end
|
43
43
|
|
44
|
-
# Returns <tt>Time.zone.now</tt> when <tt>config.time_zone</tt>
|
44
|
+
# Returns <tt>Time.zone.now</tt> when <tt>Time.zone</tt> or <tt>config.time_zone</tt> are set, otherwise just returns <tt>Time.now</tt>.
|
45
45
|
def current
|
46
|
-
::Time.
|
46
|
+
::Time.zone ? ::Time.zone.now : ::Time.now
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -37,7 +37,7 @@ class NilClass
|
|
37
37
|
|
38
38
|
# Raises a RuntimeError when you attempt to call +id+ on +nil+.
|
39
39
|
def id
|
40
|
-
raise RuntimeError, "Called id for nil, which would mistakenly be
|
40
|
+
raise RuntimeError, "Called id for nil, which would mistakenly be #{object_id} -- if you really wanted the id of nil, use object_id", caller
|
41
41
|
end
|
42
42
|
|
43
43
|
private
|
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: 15424071
|
5
|
+
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
|
9
|
+
- 6
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 3.0.6.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: 2011-
|
20
|
+
date: 2011-03-29 00:00:00 -07:00
|
19
21
|
default_executable:
|
20
22
|
dependencies: []
|
21
23
|
|
@@ -260,16 +262,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
260
262
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
261
263
|
none: false
|
262
264
|
requirements:
|
263
|
-
- - "
|
265
|
+
- - ">"
|
264
266
|
- !ruby/object:Gem::Version
|
265
|
-
hash:
|
267
|
+
hash: 25
|
266
268
|
segments:
|
267
|
-
-
|
268
|
-
|
269
|
+
- 1
|
270
|
+
- 3
|
271
|
+
- 1
|
272
|
+
version: 1.3.1
|
269
273
|
requirements: []
|
270
274
|
|
271
275
|
rubyforge_project: activesupport
|
272
|
-
rubygems_version: 1.
|
276
|
+
rubygems_version: 1.6.1
|
273
277
|
signing_key:
|
274
278
|
specification_version: 3
|
275
279
|
summary: A toolkit of support libraries and Ruby core extensions extracted from the Rails framework.
|