class Detroit::Ronn
RONN Tool
Constants
- DEFAULT_DIRECTORY
Default manpage directoy.
Attributes
date[RW]
Published date in YYYY-MM-DD format (bottom-center).
folder[RW]
Location of ‘.ronn` files, defaults to `man`.
organization[RW]
Publishing group or individual (bottom-left).
title[RW]
Name of the manual (top-center).
Public Instance Methods
assemble(station, options={})
click to toggle source
It’s important to update the manifest before other generators, so this plugs into the :pre_generate phase.
# File lib/detroit-ronn.rb, line 85 def assemble(station, options={}) case station when :generate then generate end end
assemble?(station, options={})
click to toggle source
Assemble on ‘generate` phase.
# File lib/detroit-ronn.rb, line 77 def assemble?(station, options={}) case station when :generate then true end end
date=(date)
click to toggle source
Make sure data is in the YYYY-MM-DD format.
# File lib/detroit-ronn.rb, line 29 def date=(date) @date = Time.parse(date).strftime('%Y-%M-%D') end
generate()
click to toggle source
Generate man pages.
@todo Can we do this in code instead of shelling out?
# File lib/detroit-ronn.rb, line 48 def generate argv = [] argv << %[ronn] argv << %[--date="#{date}"] argv << %[--manual="#{manual}"] argv << %[--organization="#{organiation}"] sh argv.join(' ') # report "" end
Private Instance Methods
initialize_defaults()
click to toggle source
# File lib/detroit-ronn.rb, line 99 def initialize_defaults @date = Time.now.strftime('%Y-%M-%D') @title = project.metadata.title @organization = project.metadata.organization @folder = DEFUALT_DIRECTORY end
initialize_requires()
click to toggle source
# File lib/detroit-ronn.rb, line 94 def initialize_requires require 'ronn' end
options()
click to toggle source
# File lib/detroit-ronn.rb, line 107 def options { :title => title, :date => date, :organization => organization, :folder => folder } end