Class: MetaCommit::Index::Adapters::GitNotes

Inherits:
Object
  • Object
show all
Defined in:
lib/meta_commit/index/adapters/git_notes.rb

Overview

Adapter class to write repository changes to git notes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(git_folder_path) ⇒ GitNotes

Returns a new instance of GitNotes.

Parameters:

  • git_folder_path (String)


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_pathString

Returns the current value of git_folder_path.

Returns:

  • (String)

    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

Parameters:



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