From 0bed93be25e6bcae2b1a74cec70413118be66736 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 1 Jun 2010 04:12:04 -0300 Subject: Unforce tzinfo from AS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activesupport/activesupport.gemspec | 1 - activesupport/lib/active_support/values/time_zone.rb | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'activesupport') 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 -- cgit v1.2.3 From 31e1445a8194f1eab70ac8c7d45797f0708c6c8e Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 1 Jun 2010 04:57:34 -0300 Subject: Unforce builder from AS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activesupport/activesupport.gemspec | 1 - activesupport/lib/active_support/builder.rb | 6 ++++++ activesupport/lib/active_support/core_ext/array/conversions.rb | 2 +- activesupport/lib/active_support/core_ext/hash/conversions.rb | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 activesupport/lib/active_support/builder.rb (limited to 'activesupport') diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index 4179bc27b3..f2ee35ce75 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -19,6 +19,5 @@ Gem::Specification.new do |s| s.has_rdoc = true - s.add_dependency('builder', '~> 2.1.2') s.add_dependency('memcache-client', '>= 1.7.5') end 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/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 # # 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 :builder option. The method also accepts # options like :dasherize 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 -- cgit v1.2.3 From 57144388f0b4c31e43ced7cfd1d6efaded88cf5e Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 1 Jun 2010 05:06:17 -0300 Subject: Unforce memcache from AS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activesupport/activesupport.gemspec | 2 -- activesupport/lib/active_support/cache/mem_cache_store.rb | 7 ++++++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'activesupport') diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index f2ee35ce75..8611a1e5fa 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -18,6 +18,4 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.has_rdoc = true - - s.add_dependency('memcache-client', '>= 1.7.5') 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 -- cgit v1.2.3