Class: OptionParser

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbit/console/roff.rb

Defined Under Namespace

Classes: Category, List, Switch

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.roff_escape(str) ⇒ Object



80
81
82
83
# File 'lib/rabbit/console/roff.rb', line 80

def self.roff_escape(str)
  str.gsub(/[-\\]/, '\\\\\\&').gsub(/^[.']/, '\\&') # '
  # TODO: taken over from rd2man-lib.rb, necessary to be confirmed
end

Instance Method Details

#category(str) ⇒ Object



76
77
78
# File 'lib/rabbit/console/roff.rb', line 76

def category(str)
  top.append(Category.new(str), nil, nil)
end

#roffObject



68
69
70
71
72
73
74
# File 'lib/rabbit/console/roff.rb', line 68

def roff
  to = [%[.TH #{self.class.roff_escape(program_name.upcase)} "1"]]
  visit(:summarize_as_roff) do |l|
    to << l + $/
  end
  to
end