Class: Detroit::Ronn

Inherits:
Tool
  • Object
show all
Defined in:
lib/detroit-ronn.rb

Overview

RONN Tool

Constant Summary collapse

DEFAULT_DIRECTORY =

Default manpage directoy.

'man'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dateObject

Published date in YYYY-MM-DD format (bottom-center).



26
27
28
# File 'lib/detroit-ronn.rb', line 26

def date
  @date
end

#folderObject

Location of ‘.ronn` files, defaults to `man`.



40
41
42
# File 'lib/detroit-ronn.rb', line 40

def folder
  @folder
end

#organizationObject

Publishing group or individual (bottom-left).



34
35
36
# File 'lib/detroit-ronn.rb', line 34

def organization
  @organization
end

#titleObject

Name of the manual (top-center).



23
24
25
# File 'lib/detroit-ronn.rb', line 23

def title
  @title
end

Instance Method Details

#assemble(station, options = {}) ⇒ Object

It’s important to update the manifest before other generators, so this plugs into the :pre_generate phase.



85
86
87
88
89
# File 'lib/detroit-ronn.rb', line 85

def assemble(station, options={})
  case station
  when :generate then generate
  end
end

#assemble?(station, options = {}) ⇒ Boolean

Assemble on ‘generate` phase.

Returns:

  • (Boolean)


77
78
79
80
81
# File 'lib/detroit-ronn.rb', line 77

def assemble?(station, options={})
  case station
  when :generate then true
  end
end

#generateObject

TODO:

Can we do this in code instead of shelling out?

Generate man pages.



48
49
50
51
52
53
54
55
56
57
58
# 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