Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Unforce tzinfo from AS

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit c8e2ec07a2fb1a441b693efe4855b5dae355f926 1 parent bd7a27a
@spastorino spastorino authored mikel committed
View
1  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
View
1  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
View
1  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
View
8 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 @@ def period_for_local(time, dst=true)
# 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

0 comments on commit c8e2ec0

Please sign in to comment.
Something went wrong with that request. Please try again.