Class: CommitFormat::Parser
- Inherits:
-
Object
- Object
- CommitFormat::Parser
- Defined in:
- lib/commit_format/parser.rb
Constant Summary collapse
- SEPARATOR =
"# ------------------------ COMMIT >! ------------------------"
Instance Method Summary collapse
- #commits ⇒ Object
-
#initialize(options) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(options) ⇒ Parser
Returns a new instance of Parser.
7 8 9 |
# File 'lib/commit_format/parser.rb', line 7 def initialize() = end |
Instance Method Details
#commits ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/commit_format/parser.rb', line 11 def commits log_output = `git log --reverse --pretty="#{SEPARATOR}%n%B" #{arguments(@options)}` log_output .split(SEPARATOR) .map(&:strip) .reject { |commit| commit.length.zero? } end |