Class: GitReleaseNotes::GitAdapter
- Inherits:
-
Object
- Object
- GitReleaseNotes::GitAdapter
- Defined in:
- lib/git_release_notes/git_adapter.rb
Instance Method Summary collapse
-
#initialize(dir = Dir.pwd) ⇒ GitAdapter
constructor
A new instance of GitAdapter.
- #logs_messages_between_sha(commit) ⇒ Object
- #messages_for_pattern(commit, regexp) ⇒ Object
Constructor Details
#initialize(dir = Dir.pwd) ⇒ GitAdapter
Returns a new instance of GitAdapter.
5 6 7 |
# File 'lib/git_release_notes/git_adapter.rb', line 5 def initialize(dir=Dir.pwd) @dir = dir end |
Instance Method Details
#logs_messages_between_sha(commit) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/git_release_notes/git_adapter.rb', line 16 def (commit) logs = client.log.between(commit, 'HEAD') logs.map do |c| c. end end |
#messages_for_pattern(commit, regexp) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/git_release_notes/git_adapter.rb', line 9 def (commit, regexp) logs = (commit); logs .select { |l| l[regexp] } .map { |l| { key: l[regexp], git_message: l } } end |