Class: DangerPackwerk::Private::GitFilesystem

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/danger-packwerk/private/git.rb

Instance Method Summary collapse

Instance Method Details

#added_filesObject



38
39
40
# File 'lib/danger-packwerk/private/git.rb', line 38

def added_files
  convert_from_filesystem(@git.added_files.to_a)
end

#convert_to_filesystem(path) ⇒ Object



48
49
50
# File 'lib/danger-packwerk/private/git.rb', line 48

def convert_to_filesystem(path)
  Pathname(@root).join(path).to_s
end

#deleted_filesObject



33
34
35
# File 'lib/danger-packwerk/private/git.rb', line 33

def deleted_files
  convert_from_filesystem(@git.deleted_files.to_a)
end

#diff(filename_on_disk) ⇒ Object



43
44
45
# File 'lib/danger-packwerk/private/git.rb', line 43

def diff(filename_on_disk)
  @git.diff[filename_on_disk]
end

#modified_filesObject



28
29
30
# File 'lib/danger-packwerk/private/git.rb', line 28

def modified_files
  convert_from_filesystem(@git.modified_files.to_a)
end

#renamed_filesObject



18
19
20
21
22
23
24
25
# File 'lib/danger-packwerk/private/git.rb', line 18

def renamed_files
  @git.renamed_files.map do |f|
    {
      after: convert_file_from_filesystem(f[:after]),
      before: convert_file_from_filesystem(f[:before])
    }
  end
end