diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2010-06-01 04:12:04 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-01 09:16:19 +0200 |
commit | 0bed93be25e6bcae2b1a74cec70413118be66736 (patch) | |
tree | cf572b3c200943538162242cda4c506995bfe728 | |
parent | ea037ff55791a33d24773efd380b734f733c2815 (diff) | |
download | rails-0bed93be25e6bcae2b1a74cec70413118be66736.tar.gz rails-0bed93be25e6bcae2b1a74cec70413118be66736.tar.bz2 rails-0bed93be25e6bcae2b1a74cec70413118be66736.zip |
Unforce tzinfo from AS
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r-- | actionpack/actionpack.gemspec | 1 | ||||
-rw-r--r-- | activerecord/activerecord.gemspec | 1 | ||||
-rw-r--r-- | activesupport/activesupport.gemspec | 1 | ||||
-rw-r--r-- | activesupport/lib/active_support/values/time_zone.rb | 8 |
4 files changed, 9 insertions, 2 deletions
diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec index 040d05f050..f20c964003 100644 --- a/actionpack/actionpack.gemspec +++ b/actionpack/actionpack.gemspec @@ -25,5 +25,6 @@ Gem::Specification.new do |s| s.add_dependency('rack', '~> 1.1.0') s.add_dependency('rack-test', '~> 0.5.4') s.add_dependency('rack-mount', '~> 0.6.3') + s.add_dependency('tzinfo', '~> 0.3.16') s.add_dependency('erubis', '~> 2.6.5') end diff --git a/activerecord/activerecord.gemspec b/activerecord/activerecord.gemspec index 59caa53be0..44c8fb83e1 100644 --- a/activerecord/activerecord.gemspec +++ b/activerecord/activerecord.gemspec @@ -24,4 +24,5 @@ Gem::Specification.new do |s| s.add_dependency('activesupport', version) s.add_dependency('activemodel', version) s.add_dependency('arel', '~> 0.3.3') + s.add_dependency('tzinfo', '~> 0.3.16') end 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 |