Skip to content

Commit

Permalink
+ Removed use of Gem.bin_wrapper. rdoc is now just rdoc.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/hoe/dev/": change = 13970]
  • Loading branch information
zenspider committed Nov 16, 2023
1 parent e4815cc commit b9a0f95
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 deletions.
4 changes: 0 additions & 4 deletions lib/hoe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
28 changes: 9 additions & 19 deletions lib/hoe/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 1 addition & 10 deletions test/test_hoe_publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,16 @@ 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
lib
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
Expand Down

0 comments on commit b9a0f95

Please sign in to comment.