Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle :rdoc from ~/.gemrc

  • Loading branch information...
commit 91511b77c2b291f9f44b4a932cf9bf7a1d5c2925 1 parent 37732f2
@drbrain drbrain authored
Showing with 42 additions and 1 deletion.
  1. +8 −1 lib/rubygems/rdoc.rb
  2. +34 −0 test/rubygems/test_gem_rdoc.rb
View
9 lib/rubygems/rdoc.rb
@@ -170,8 +170,15 @@ def generate
options.files.push(*@spec.extra_rdoc_files)
args = @spec.rdoc_options
+
+ case config_args = Gem.configuration[:rdoc]
+ when String then
+ args = args.concat Gem.configuration[:rdoc].split
+ when Array then
+ args = args.concat Gem.configuration[:rdoc]
+ end
+
delete_legacy_args args
- # TODO Gem.configuration[:rdoc]
options.parse args
options.quiet = !Gem.configuration.really_verbose
View
34 test/rubygems/test_gem_rdoc.rb
@@ -69,6 +69,40 @@ def test_generate
assert @rdoc.rdoc_installed?
assert @rdoc.ri_installed?
+
+ rdoc = @rdoc.instance_variable_get :@rdoc
+
+ refute rdoc.options.hyperlink_all
+ end
+
+ def test_generate_configuration_rdoc_array
+ skip 'RDoc 3+ required' unless rdoc_3?
+
+ Gem.configuration[:rdoc] = %w[-A]
+
+ FileUtils.mkdir_p @a.doc_dir
+ FileUtils.mkdir_p File.join(@a.gem_dir, 'lib')
+
+ @rdoc.generate
+
+ rdoc = @rdoc.instance_variable_get :@rdoc
+
+ assert rdoc.options.hyperlink_all
+ end
+
+ def test_generate_configuration_rdoc_string
+ skip 'RDoc 3+ required' unless rdoc_3?
+
+ Gem.configuration[:rdoc] = '-A'
+
+ FileUtils.mkdir_p @a.doc_dir
+ FileUtils.mkdir_p File.join(@a.gem_dir, 'lib')
+
+ @rdoc.generate
+
+ rdoc = @rdoc.instance_variable_get :@rdoc
+
+ assert rdoc.options.hyperlink_all
end
def test_generate_disabled
Please sign in to comment.
Something went wrong with that request. Please try again.