Skip to content

Commit

Permalink
Removes the dependency that AMo has on tzinfo
Browse files Browse the repository at this point in the history
[#4979 state:committed]
  • Loading branch information
spastorino committed Jul 3, 2010
1 parent 201f373 commit f6d7a4d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions activesupport/lib/active_support/values/time_zone.rb
@@ -1,11 +1,5 @@
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/object/try'
begin
require 'tzinfo'
rescue LoadError => e
$stderr.puts "You don't have tzinfo installed in your application. Please add it to your Gemfile and run bundle install"
raise e
end

# The TimeZone class serves as a wrapper around TZInfo::Timezone instances. It allows us to do the following:
#
Expand Down Expand Up @@ -201,6 +195,12 @@ def self.seconds_to_utc_offset(seconds, colon = true)
# (GMT). Seconds were chosen as the offset unit because that is the unit that
# Ruby uses to represent time zone offsets (see Time#utc_offset).
def initialize(name, utc_offset = nil, tzinfo = nil)
begin
require 'tzinfo'
rescue LoadError => e
$stderr.puts "You don't have tzinfo installed in your application. Please add it to your Gemfile and run bundle install"
raise e
end
@name = name
@utc_offset = utc_offset
@tzinfo = tzinfo || TimeZone.find_tzinfo(name)
Expand Down

0 comments on commit f6d7a4d

Please sign in to comment.