lib/binman/rakefile.rb in binman-3.1.1 vs lib/binman/rakefile.rb in binman-3.2.0

- old
+ new

@@ -1,19 +1,37 @@ require 'rake' -directory path = 'man/man1' -bins = FileList['bin/*'] -mans = bins.pathmap("#{path}/%n.1") +# build man pages before building ruby gem using bundler +%w[build install release].each {|t| task t => :binman } -desc 'Build UNIX manual pages for bin/ scripts.' -task :binman => mans +#----------------------------------------------------------------------------- +desc 'Build manual pages for bin/ scripts.' +task :binman => ['binman:man', 'binman:web'] +#----------------------------------------------------------------------------- -bins.zip(mans).each do |bin, man| - file man => [bin, path] do +directory dir = 'man/man1' +bins = FileList['bin/*'] +mkds = bins.pathmap("#{dir}/%n.1.markdown") + +bins.zip(mkds).each do |src, dst| + file dst => [dir, src] do require 'binman' - roff = BinMan.dump(bin) - File.open(man, 'w') {|f| f << roff } + output = BinMan.load(src) + File.open(dst, 'w') {|f| f << output } end end -# build man pages before building ruby gem using bundler -%w[build install release].each {|t| task t => :binman } +#----------------------------------------------------------------------------- +desc 'Build UNIX manual pages for bin/ scripts.' +task 'binman:man' => mkds do +#----------------------------------------------------------------------------- + require 'md2man/rakefile' + Rake::Task['md2man:man'].invoke +end + +#----------------------------------------------------------------------------- +desc 'Build HTML manual pages for bin/ scripts.' +task 'binman:web' => mkds do +#----------------------------------------------------------------------------- + require 'md2man/rakefile' + Rake::Task['md2man:web'].invoke +end