Class: MetaCommit::Index::Adapters::GitNotes
- Inherits:
-
Object
- Object
- MetaCommit::Index::Adapters::GitNotes
- Defined in:
- lib/meta_commit/index/adapters/git_notes.rb
Overview
Adapter class to write repository changes to git notes
Instance Attribute Summary collapse
-
#git_folder_path ⇒ String
The current value of git_folder_path.
Instance Method Summary collapse
-
#initialize(git_folder_path) ⇒ GitNotes
constructor
A new instance of GitNotes.
- #write_repository_change_chunk(repo, repository_changes) ⇒ Object
Constructor Details
#initialize(git_folder_path) ⇒ GitNotes
Returns a new instance of GitNotes.
9 10 11 |
# File 'lib/meta_commit/index/adapters/git_notes.rb', line 9 def initialize(git_folder_path) @git_folder_path = git_folder_path end |
Instance Attribute Details
#git_folder_path ⇒ String
Returns the current value of git_folder_path.
5 6 7 |
# File 'lib/meta_commit/index/adapters/git_notes.rb', line 5 def git_folder_path @git_folder_path end |
Instance Method Details
#write_repository_change_chunk(repo, repository_changes) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/meta_commit/index/adapters/git_notes.rb', line 15 def write_repository_change_chunk(repo, repository_changes) repository_changes.each do |commit_changes| diffs=[] commit_changes.file_changes.uniq.each do |change| diffs.push(" - #{change.string_representation}") end write_to_notes(commit_changes.new_commit_id, diffs.uniq.join("\n")) end end |