Class: WhatTheGem::Changes::Parser
- Extended by:
- I::Callable
- Defined in:
- lib/whatthegem/changes/parser.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file) ⇒ Parser
constructor
A new instance of Parser.
Methods included from I::Callable
Constructor Details
#initialize(file) ⇒ Parser
Returns a new instance of Parser.
24 25 26 |
# File 'lib/whatthegem/changes/parser.rb', line 24 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
22 23 24 |
# File 'lib/whatthegem/changes/parser.rb', line 22 def file @file end |
Class Method Details
.call(file) ⇒ Object
7 8 9 |
# File 'lib/whatthegem/changes/parser.rb', line 7 def call(file) parser_for(file).versions end |
.parser_for(file) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/whatthegem/changes/parser.rb', line 11 def parser_for(file) case file.basename when /\.(md|markdown)$/i MarkdownParser.new(file) else # Most of the time in Ruby-land, when no extension it is RDoc or RDoc-alike RDocParser.new(file) end end |