From b9a0f954098cf34fde3e2c7150a3fc9808e37988 Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Thu, 16 Nov 2023 12:56:52 -0800 Subject: [PATCH] + Removed use of Gem.bin_wrapper. rdoc is now just rdoc. [git-p4: depot-paths = "//src/hoe/dev/": change = 13970] --- lib/hoe.rb | 4 ---- lib/hoe/publish.rb | 28 +++++++++------------------- test/test_hoe_publish.rb | 11 +---------- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/lib/hoe.rb b/lib/hoe.rb index 45bc4e9..787cb22 100644 --- a/lib/hoe.rb +++ b/lib/hoe.rb @@ -961,7 +961,3 @@ def self.read_utf path end end end - -def Gem.bin_wrapper name # :nodoc: HACK - File.join Gem.bindir, Gem.default_exec_format % name -end unless Gem.respond_to? :bin_wrapper diff --git a/lib/hoe/publish.rb b/lib/hoe/publish.rb index cc2fe4b..e50407c 100644 --- a/lib/hoe/publish.rb +++ b/lib/hoe/publish.rb @@ -204,26 +204,16 @@ def post_blog_task # :nodoc: def make_rdoc_cmd(*extra_args) # :nodoc: title = "#{name}-#{version} Documentation" title = "#{group_name}'s #{title}" if group_name != name - rdoc = Gem.bin_wrapper "rdoc" - extra = nil - - unless File.exist? rdoc then - warn "Can't find #{rdoc}. Falling back." - rdoc = "rdoc" - extra = "-S" - end - - ( # I don't understand this bug... but removing empties definitely fixes it. - %W[#{Gem.ruby} #{extra} - #{rdoc} - --title #{title} - -o #{local_rdoc_dir} - ] + - spec.rdoc_options + - extra_args + - spec.require_paths + - spec.extra_rdoc_files + ( + %W[#{Gem.ruby} -S rdoc + --title #{title} + -o #{local_rdoc_dir} + ] + + spec.rdoc_options + + extra_args + + spec.require_paths + + spec.extra_rdoc_files ).reject(&:empty?) end diff --git a/test/test_hoe_publish.rb b/test/test_hoe_publish.rb index 9e86540..131e3df 100644 --- a/test/test_hoe_publish.rb +++ b/test/test_hoe_publish.rb @@ -18,16 +18,9 @@ def linux? platform = RUBY_PLATFORM # TODO: push up to minitest? end def test_make_rdoc_cmd - rdoc = Gem.bin_wrapper "rdoc" - - unless File.exist? rdoc then - extra = "-S" - rdoc = "rdoc" - end - expected = %W[ #{Gem.ruby} - #{rdoc} + -S rdoc --title blah-1.0\ Documentation -o doc --main README.rdoc @@ -35,8 +28,6 @@ def test_make_rdoc_cmd History.rdoc Manifest.txt README.rdoc ] - expected[1, 0] = extra if extra - # skip if linux? capture_io do assert_equal expected, @hoe.make_rdoc_cmd