Class: WhatTheGem::Changes::MarkdownParser
- Defined in:
- lib/whatthegem/changes/markdown_parser.rb
Instance Attribute Summary
Attributes inherited from Parser
Instance Method Summary collapse
Methods inherited from Parser
Methods included from I::Callable
Constructor Details
This class inherits a constructor from WhatTheGem::Changes::Parser
Instance Method Details
#versions ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/whatthegem/changes/markdown_parser.rb', line 4 def versions nodes = I::Kramdowns.elements(content) level = detect_version_level(nodes) # find level of headers which contain version sections = sections(nodes, level) .select { |title,| title.match?(VERSION_LINE_REGEXP) } .map(&method(:make_version)) .sort_by(&:number) # it is internally converted to Gem::Version, so "1.12" is correctly > "1.2" end |