Changeset 9041
- Timestamp:
- 03/17/08 02:54:23 (4 months ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/time_with_zone.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/time_with_zone_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r9040 r9041 1 1 *SVN* 2 3 * TimeWithZone responds to Ruby 1.9 weekday-named query methods [Geoff Buesing] 2 4 3 5 * TimeWithZone caches TZInfo::TimezonePeriod used for time conversion so that it can be reused, and enforces DST rules correctly when instance is created from a local time [Geoff Buesing] trunk/activesupport/lib/active_support/time_with_zone.rb
r9040 r9041 154 154 alias_method :month, :mon 155 155 156 %w(sunday? monday? tuesday? wednesday? thursday? friday? saturday?).each do |name| 157 define_method(name) do 158 time.__send__(name) 159 end 160 end unless RUBY_VERSION < '1.9' 161 156 162 def to_a 157 163 time.to_a[0, 8].push(dst?, zone) trunk/activesupport/test/core_ext/time_with_zone_test.rb
r9040 r9041 281 281 assert_equal true, twz.dst? 282 282 assert_equal 'EDT', twz.zone 283 end 284 285 def test_ruby_19_weekday_name_query_methods 286 ruby_19_or_greater = RUBY_VERSION >= '1.9' 287 %w(sunday? monday? tuesday? wednesday? thursday? friday? saturday?).each do |name| 288 assert_equal ruby_19_or_greater, @twz.respond_to?(name) 289 end 283 290 end 284 291 end