Skip to content

Commit 31e1445

Browse files
spastorinojosevalim
authored andcommitted
Unforce builder from AS
Signed-off-by: José Valim <[email protected]>
1 parent 0bed93b commit 31e1445

File tree

6 files changed

+10
-3
lines changed

6 files changed

+10
-3
lines changed

actionpack/actionpack.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
2121

2222
s.add_dependency('activesupport', version)
2323
s.add_dependency('activemodel', version)
24+
s.add_dependency('builder', '~> 2.1.2')
2425
s.add_dependency('i18n', '~> 0.4.0')
2526
s.add_dependency('rack', '~> 1.1.0')
2627
s.add_dependency('rack-test', '~> 0.5.4')

activemodel/activemodel.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ Gem::Specification.new do |s|
2020
s.has_rdoc = true
2121

2222
s.add_dependency('activesupport', version)
23+
s.add_dependency('builder', '~> 2.1.2')
2324
s.add_dependency('i18n', '~> 0.4.0')
2425
end

activesupport/activesupport.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ Gem::Specification.new do |s|
1919

2020
s.has_rdoc = true
2121

22-
s.add_dependency('builder', '~> 2.1.2')
2322
s.add_dependency('memcache-client', '>= 1.7.5')
2423
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

activesupport/lib/active_support/core_ext/array/conversions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def to_formatted_s(format = :default)
134134
# </messages>
135135
#
136136
def to_xml(options = {})
137-
require 'builder' unless defined?(Builder)
137+
require 'active_support/builder' unless defined?(Builder)
138138

139139
options = options.dup
140140
options[:indent] ||= 2

activesupport/lib/active_support/core_ext/hash/conversions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Hash
5555
# configure your own builder with the <tt>:builder</tt> option. The method also accepts
5656
# options like <tt>:dasherize</tt> and friends, they are forwarded to the builder.
5757
def to_xml(options = {})
58-
require 'builder' unless defined?(Builder)
58+
require 'active_support/builder' unless defined?(Builder)
5959

6060
options = options.dup
6161
options[:indent] ||= 2

0 commit comments

Comments
 (0)