binman - UNIX man pages for Ruby bin/ scripts
Here is an example bin/ script to help get you started!
Includes both a Ruby library and a command-line client.
Individual extraction, conversion, and display commands.
Implemented in roughly 100 lines of pure Ruby code! :-)
- Ruby 1.9.2 or newer. It might work with 1.8.7 but I haven't tried. :-P
As a Ruby gem (without markdown to roff converter):
gem install binman
As a Ruby gem (with extra cheese and everything please):
gem install binman --development
As a Git clone:
git clone git://github.com/sunaku/binman cd binman bundle install
If installed as a Ruby gem:
If installed as a Git clone:
bundle exec ruby -Ilib bin/binman
--help to see its man page.
In your bin/ scripts
Add the following lines to your bin/ script and you've got
require 'binman' BinMan.help # show man page and exit if ARGV has -h or --help
Or, if you're on a diet:
require 'binman' BinMan.show # just show the man page; no fancy extras, please!
See the API documentation for more delicious recipes.
In your Rakefile
Add the following line to your
Rakefile and you've got a
It will pre-build UNIX man page files for your
bin/ scripts into a
directory so that your end-users do not need the markdown to roff converter
installed in order to view your man pages! Just remember to add the
directory's contents to your gemspec or release package:
Gem::Specification.new do |s| # ... your stuff ... s.files += Dir['man/**/*'] end
Released under the ISC license. See the LICENSE file for details.