Class: Rabbit::READMEParser
- Inherits:
-
Object
- Object
- Rabbit::READMEParser
- Includes:
- GetText, PathManipulatable
- Defined in:
- lib/rabbit/readme-parser.rb
Constant Summary
Constants included from GetText
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(logger = nil) ⇒ READMEParser
constructor
A new instance of READMEParser.
- #parse(path = nil) ⇒ Object
Methods included from GetText
Constructor Details
#initialize(logger = nil) ⇒ READMEParser
Returns a new instance of READMEParser.
27 28 29 30 31 |
# File 'lib/rabbit/readme-parser.rb', line 27 def initialize(logger=nil) @logger = logger || Logger.default @title = nil @description = nil end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
26 27 28 |
# File 'lib/rabbit/readme-parser.rb', line 26 def description @description end |
#logger ⇒ Object
Returns the value of attribute logger.
25 26 27 |
# File 'lib/rabbit/readme-parser.rb', line 25 def logger @logger end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
26 27 28 |
# File 'lib/rabbit/readme-parser.rb', line 26 def title @title end |
Instance Method Details
#parse(path = nil) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/rabbit/readme-parser.rb', line 33 def parse(path=nil) path ||= remove_backup_paths(Dir.glob("README*"))[0] raise _("No README found") if path.nil? parse_content(File.read(path), File.extname(path)) end |