diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-06-01 04:12:04 -0300 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-06-03 23:32:11 +1000 |
commit | c8e2ec07a2fb1a441b693efe4855b5dae355f926 (patch) | |
tree | 50bfe8e150cf232636ab744cc8f267fc4b8b7f1c /activesupport | |
parent | bd7a27ac6b64c2ec46a90176c7d6d7477b030a82 (diff) | |
download | rails-c8e2ec07a2fb1a441b693efe4855b5dae355f926.tar.gz rails-c8e2ec07a2fb1a441b693efe4855b5dae355f926.tar.bz2 rails-c8e2ec07a2fb1a441b693efe4855b5dae355f926.zip |
Unforce tzinfo from AS
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/activesupport.gemspec | 1 | ||||
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index b07e74c5d4..4179bc27b3 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -19,7 +19,6 @@ Gem::Specification.new do |s| s.has_rdoc = true - s.add_dependency('tzinfo', '~> 0.3.16') s.add_dependency('builder', '~> 2.1.2') s.add_dependency('memcache-client', '>= 1.7.5') end diff --git a/activesupport/lib/active_support/values/time_zone.rb b/activesupport/lib/active_support/values/time_zone.rb index 2ac5134911..67b37785f5 100644 --- a/activesupport/lib/active_support/values/time_zone.rb +++ b/activesupport/lib/active_support/values/time_zone.rb @@ -1,5 +1,11 @@ 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: # @@ -313,7 +319,7 @@ module ActiveSupport # TODO: Preload instead of lazy load for thread safety def self.find_tzinfo(name) - require 'tzinfo' unless defined?(::TZInfo) + require 'active_support/tzinfo' unless defined?(::TZInfo) ::TZInfo::TimezoneProxy.new(MAPPING[name] || name) end |