Sha256: 7b2caa866f409627caf9563810c259dc9c5faaa7fddcb48144a8dc1962b6145b

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

require 'binman'
require 'rake'

# build man pages before building ruby gem using bundler
if defined? Bundler::GemHelper
  %w[build install release].each {|t| task t => :binman }
end

#-----------------------------------------------------------------------------
desc 'Build manual pages for bin/ scripts.'
task :binman => ['binman:man', 'binman:web']
#-----------------------------------------------------------------------------

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
    output = BinMan.text(src)
    File.open(dst, 'w') {|f| f << output }
  end
end

desc 'Extract manuals embedded in bin/ scripts.'
task 'binman:mkd' => mkds

#-----------------------------------------------------------------------------
desc 'Build UNIX manual pages for bin/ scripts.'
task 'binman:man' => 'binman:mkd' do
#-----------------------------------------------------------------------------
  sh 'md2man-rake', 'man'
end

#-----------------------------------------------------------------------------
desc 'Build HTML manual pages for bin/ scripts.'
task 'binman:web' => 'binman:mkd' do
#-----------------------------------------------------------------------------
  sh 'md2man-rake', 'web'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
binman-5.1.0 lib/binman/rakefile.rb