aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-06-01 04:57:34 -0300
committerJosé Valim <jose.valim@gmail.com>2010-06-01 10:45:51 +0200
commit31e1445a8194f1eab70ac8c7d45797f0708c6c8e (patch)
tree44794aced84e799dfd09e209b14abb04d085c3e0
parent0bed93be25e6bcae2b1a74cec70413118be66736 (diff)
downloadrails-31e1445a8194f1eab70ac8c7d45797f0708c6c8e.tar.gz
rails-31e1445a8194f1eab70ac8c7d45797f0708c6c8e.tar.bz2
rails-31e1445a8194f1eab70ac8c7d45797f0708c6c8e.zip
Unforce builder from AS
Signed-off-by: José Valim <jose.valim@gmail.com>
-rw-r--r--actionpack/actionpack.gemspec1
-rw-r--r--activemodel/activemodel.gemspec1
-rw-r--r--activesupport/activesupport.gemspec1
-rw-r--r--activesupport/lib/active_support/builder.rb6
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb2
6 files changed, 10 insertions, 3 deletions
diff --git a/actionpack/actionpack.gemspec b/actionpack/actionpack.gemspec
index f20c964003..0f45cb5a4a 100644
--- a/actionpack/actionpack.gemspec
+++ b/actionpack/actionpack.gemspec
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
s.add_dependency('activesupport', version)
s.add_dependency('activemodel', version)
+ s.add_dependency('builder', '~> 2.1.2')
s.add_dependency('i18n', '~> 0.4.0')
s.add_dependency('rack', '~> 1.1.0')
s.add_dependency('rack-test', '~> 0.5.4')
diff --git a/activemodel/activemodel.gemspec b/activemodel/activemodel.gemspec
index f06761ceb9..678007c0ef 100644
--- a/activemodel/activemodel.gemspec
+++ b/activemodel/activemodel.gemspec
@@ -20,5 +20,6 @@ Gem::Specification.new do |s|
s.has_rdoc = true
s.add_dependency('activesupport', version)
+ s.add_dependency('builder', '~> 2.1.2')
s.add_dependency('i18n', '~> 0.4.0')
end
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
# </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