diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-01 16:39:05 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2010-06-01 16:39:05 -0500 |
commit | cae25199008bc26d215e7af5558cfcdfdc6ec264 (patch) | |
tree | 9b1cd9bf1a2a770af31406652362001460816e5b /activesupport/lib | |
parent | d57397c4b62b6474ff8eb55bfd763f5e6dcdcd40 (diff) | |
parent | a0bb1dda119a7488b8a4d61b354a64e619b0d1b3 (diff) | |
download | rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.tar.gz rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.tar.bz2 rails-cae25199008bc26d215e7af5558cfcdfdc6ec264.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activesupport/lib')
5 files changed, 21 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/builder.rb b/activesupport/lib/active_support/builder.rb new file mode 100644 index 0000000000..321e462acd --- /dev/null +++ b/activesupport/lib/active_support/builder.rb @@ -0,0 +1,6 @@ +begin + require 'builder' +rescue LoadError => e + $stderr.puts "You don't have builder installed in your application. Please add it to your Gemfile and run bundle install" + raise e +end diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb index d8377a208f..e3a2688e2f 100644 --- a/activesupport/lib/active_support/cache/mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/mem_cache_store.rb @@ -1,4 +1,9 @@ -require 'memcache' +begin + require 'memcache' +rescue LoadError => e + $stderr.puts "You don't have memcache installed in your application. Please add it to your Gemfile and run bundle install" + raise e +end require 'digest/md5' module ActiveSupport diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb index 7e4d30f5e8..79e3828817 100644 --- a/activesupport/lib/active_support/core_ext/array/conversions.rb +++ b/activesupport/lib/active_support/core_ext/array/conversions.rb @@ -134,7 +134,7 @@ class Array # </messages> # def to_xml(options = {}) - require 'builder' unless defined?(Builder) + require 'active_support/builder' unless defined?(Builder) options = options.dup options[:indent] ||= 2 diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb index 14e5d2f8ac..565c9af7fb 100644 --- a/activesupport/lib/active_support/core_ext/hash/conversions.rb +++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb @@ -55,7 +55,7 @@ class Hash # configure your own builder with the <tt>:builder</tt> option. The method also accepts # options like <tt>:dasherize</tt> and friends, they are forwarded to the builder. def to_xml(options = {}) - require 'builder' unless defined?(Builder) + require 'active_support/builder' unless defined?(Builder) options = options.dup options[:indent] ||= 2 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 |