summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-11 11:14:36 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-11 11:14:36 +0000
commitcfaddc2a3248dd0ce4a370fdbab44ca88adf5722 (patch)
tree6c004c0c73ea77dc6c77033632241f6ba4f77a58 /lib
parent8e7b572d97f0a19a8467f3a299d72c49ba51a293 (diff)
* ext/json/*, test/json/*, defs/default_gems: Gemify JSON library.
[fix GH-867][Feature #11057] * test/ruby/test_extlibs.rb: removed json gem from existence extentions. * gems/bundled_gems: added json gem into bundled gem. * lib/rdoc/rubygems_hook.rb: ignored no json environment. * lib/rubygems/test_case.rb, test/rubygems/*: ditto. * lib/rdoc/test_case.rb, test/rdoc/*: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/rubygems_hook.rb8
-rw-r--r--lib/rdoc/test_case.rb6
-rw-r--r--lib/rubygems/test_case.rb5
3 files changed, 16 insertions, 3 deletions
diff --git a/lib/rdoc/rubygems_hook.rb b/lib/rdoc/rubygems_hook.rb
index c4eaddbd97..5711aa1abf 100644
--- a/lib/rdoc/rubygems_hook.rb
+++ b/lib/rdoc/rubygems_hook.rb
@@ -3,6 +3,11 @@ require 'rubygems/user_interaction'
require 'fileutils'
require 'rdoc'
+begin
+ require 'json'
+rescue LoadError
+end
+
##
# Gem::RDoc provides methods to generate RDoc and ri data for installed gems
# upon gem installation.
@@ -200,7 +205,7 @@ class RDoc::RubygemsHook
@generate_ri and (@force or not File.exist? @ri_dir)
document 'darkfish', options, @rdoc_dir if
- @generate_rdoc and (@force or not File.exist? @rdoc_dir)
+ defined?(JSON) and @generate_rdoc and (@force or not File.exist? @rdoc_dir)
end
##
@@ -250,4 +255,3 @@ class RDoc::RubygemsHook
end
end
-
diff --git a/lib/rdoc/test_case.rb b/lib/rdoc/test_case.rb
index 4989516b7a..3b2c181201 100644
--- a/lib/rdoc/test_case.rb
+++ b/lib/rdoc/test_case.rb
@@ -6,6 +6,11 @@ rescue NoMethodError, Gem::LoadError
# for ruby tests
end
+begin
+ require 'json'
+rescue LoadError
+end
+
require 'minitest/autorun'
require 'minitest/benchmark' if ENV['BENCHMARK']
@@ -214,4 +219,3 @@ $LOAD_PATH.each do |load_path|
break if load_path[0] == ?/
load_path.replace File.expand_path load_path
end if RUBY_VERSION < '1.9'
-
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb
index 306edcc3f6..b1aabb658d 100644
--- a/lib/rubygems/test_case.rb
+++ b/lib/rubygems/test_case.rb
@@ -24,6 +24,11 @@ unless Gem::Dependency.new('rdoc', '>= 3.10').matching_specs.empty?
gem 'json'
end
+begin
+ require 'json'
+rescue LoadError
+end
+
require 'minitest/autorun'
require 'rubygems/deprecate'