Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more cleanup because eric is a jerk... pfft

[git-p4: depot-paths = "//src/hoe/dev/": change = 7180]
  • Loading branch information...
commit 85f512edf2cd2fe8f31400e866f85fd4be0e84b9 1 parent 49e79c9
Ryan Davis zenspider authored
2  lib/hoe.rb
View
@@ -823,5 +823,5 @@ def self.read_utf path
end
def Gem.bin_wrapper name # HACK
- File.join Gem.dir, "bin", Gem.default_exec_format % name
+ File.join Gem.bindir, Gem.default_exec_format % name
end unless Gem.respond_to? :bin_wrapper
20 lib/hoe/publish.rb
View
@@ -96,21 +96,19 @@ def initialize_publish
self.rsync_args ||= '-av --delete'
end
- def make_rdoc_cmd extra_args = nil
+ def make_rdoc_cmd(*extra_args)
title = "#{name}-#{version} Documentation"
title = "#{rubyforge_name}'s #{title}" if rubyforge_name != name
- rdoc = Gem.bin_path "rdoc", "rdoc"
+ rdoc = Gem.bin_wrapper "rdoc"
- cmd = %W[#{rdoc}
- --title #{title}
- -o #{local_rdoc_dir}
- ] +
+ %W[#{rdoc}
+ --title #{title}
+ -o #{local_rdoc_dir}
+ ] +
spec.rdoc_options +
- Array(extra_args) +
+ extra_args +
spec.require_paths +
spec.extra_rdoc_files
-
- cmd
end
##
@@ -124,12 +122,12 @@ def define_publish_tasks
desc "Generate rdoc"
task :docs => [:clobber_docs, :isolate] do
- ruby(*make_rdoc_cmd)
+ sh(*make_rdoc_cmd)
end
desc "Generate rdoc coverage report"
task :dcov => :isolate do
- ruby make_rdoc_cmd '-C'
+ sh(*make_rdoc_cmd('-C'))
end
desc "Remove RDoc files"
8 lib/hoe/rcov.rb
View
@@ -18,7 +18,7 @@ def define_rcov_tasks
task :isolate # ensure it exists
task :rcov => :isolate do
- ruby make_rcov_cmd
+ sh(*make_rcov_cmd)
end
task :clobber_rcov do
@@ -42,7 +42,7 @@ def define_rcov_tasks
end
end
- def make_rcov_cmd extra_args = nil
+ def make_rcov_cmd
rcov = Gem.bin_wrapper "rcov"
tests = test_globs.sort.map { |g| Dir.glob(g) }.flatten.map(&:inspect)
@@ -55,10 +55,10 @@ def make_rcov_cmd extra_args = nil
-x tmp/isolate
--sort coverage
--sort-reverse
- -o "coverage"
+ -o coverage
] + tests
- cmd.join " "
+ cmd
end
end
26 test/test_hoe_publish.rb
View
@@ -1,31 +1,25 @@
+require 'rubygems'
require 'minitest/autorun'
require 'hoe'
-Hoe.load_plugins # make sure Hoe::Test is loaded
-
class TestHoePublish < MiniTest::Unit::TestCase
def setup
- Rake.application.clear
-
@hoe = Hoe.spec 'blah' do
self.version = '1.0'
+
developer 'author', ''
end
-
- @hoe.extend Hoe::Publish
end
def test_make_rdoc_cmd
- expected = []
- expected << Gem.bin_path('rdoc', 'rdoc')
- expected << '--title' << 'blah-1.0 Documentation'
- expected.concat %w[-o doc]
- expected.concat %w[--main README.txt]
- expected << 'lib'
- expected.concat %w[History.txt Manifest.txt README.txt]
-
+ expected = %W[
+ #{Gem.bin_wrapper "rdoc"}
+ --title blah-1.0\ Documentation
+ -o doc
+ --main README.txt
+ lib
+ History.txt Manifest.txt README.txt
+ ]
assert_equal expected, @hoe.make_rdoc_cmd
end
-
end
-
Please sign in to comment.
Something went wrong with that request. Please try again.