Skip to content
This repository
Browse code

Unforce builder from AS

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit 31e1445a8194f1eab70ac8c7d45797f0708c6c8e 1 parent 0bed93b
Santiago Pastorino authored June 01, 2010 josevalim committed June 01, 2010
1  actionpack/actionpack.gemspec
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21 21
 
22 22
   s.add_dependency('activesupport', version)
23 23
   s.add_dependency('activemodel',   version)
  24
+  s.add_dependency('builder',       '~> 2.1.2')
24 25
   s.add_dependency('i18n',          '~> 0.4.0')
25 26
   s.add_dependency('rack',          '~> 1.1.0')
26 27
   s.add_dependency('rack-test',     '~> 0.5.4')
1  activemodel/activemodel.gemspec
@@ -20,5 +20,6 @@ Gem::Specification.new do |s|
20 20
   s.has_rdoc = true
21 21
 
22 22
   s.add_dependency('activesupport', version)
  23
+  s.add_dependency('builder',       '~> 2.1.2')
23 24
   s.add_dependency('i18n',          '~> 0.4.0')
24 25
 end
1  activesupport/activesupport.gemspec
@@ -19,6 +19,5 @@ Gem::Specification.new do |s|
19 19
 
20 20
   s.has_rdoc = true
21 21
 
22  
-  s.add_dependency('builder',         '~> 2.1.2')
23 22
   s.add_dependency('memcache-client', '>= 1.7.5')
24 23
 end
6  activesupport/lib/active_support/builder.rb
... ...
@@ -0,0 +1,6 @@
  1
+begin
  2
+  require 'builder'
  3
+rescue LoadError => e
  4
+  $stderr.puts "You don't have builder installed in your application. Please add it to your Gemfile and run bundle install"
  5
+  raise e
  6
+end
2  activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -134,7 +134,7 @@ def to_formatted_s(format = :default)
134 134
   #   </messages>
135 135
   #
136 136
   def to_xml(options = {})
137  
-    require 'builder' unless defined?(Builder)
  137
+    require 'active_support/builder' unless defined?(Builder)
138 138
 
139 139
     options = options.dup
140 140
     options[:indent]  ||= 2
2  activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -55,7 +55,7 @@ class Hash
55 55
   # configure your own builder with the <tt>:builder</tt> option. The method also accepts
56 56
   # options like <tt>:dasherize</tt> and friends, they are forwarded to the builder.
57 57
   def to_xml(options = {})
58  
-    require 'builder' unless defined?(Builder)
  58
+    require 'active_support/builder' unless defined?(Builder)
59 59
 
60 60
     options = options.dup
61 61
     options[:indent]  ||= 2

0 notes on commit 31e1445

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