Search code examples
rubyrubygemscommand-line-interfacemanpage

How to create man page for ruby gem executable?


I'm developing a ruby gem, and part of it is a CLI which is installed on the user's system. Is there a way to create a man page for this executable and package it with the gem to be installed?


Solution

  • You would write a manpage for a Ruby executable the same way that you would write a manpage for any other program: write it in some markup language and translate to ROFF or just write it directly in ROFF. There is no way to install manpages from RubyGems (what would it do with that on Windows, for example?) but if you want to ship a manpage, you are presumably on some Unix system anyway, pretty much all of which have package management systems that can take care of that for you. So, for Debian or Debian-derived systems, you would distribute it as a .deb, for RedHat, SuSE or derivatives thereof, you would use an .rpm and so on.