Class: ManBook::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/manbook/formatter.rb

Direct Known Subclasses

HtmlFormatter

Instance Method Summary collapse

Constructor Details

#initialize(man_page) ⇒ Formatter

Returns a new instance of Formatter.



3
4
5
6
7
8
9
10
11
12
# File 'lib/manbook/formatter.rb', line 3

def initialize(man_page)
  @man_page = man_page
  begin
    @man_page_file = execute("man -w #{man_page}").chomp!
  rescue ManBook::CommandFailedError => e
    raise ManBook::ManPageNotFoundError.new(e.msg)
  end

  ManBook.logger.debug("Located man page at #{@man_page_file}")
end