Class: DangerPackwerk::Private::GitFilesystem
- Inherits:
-
T::Struct
- Object
- T::Struct
- DangerPackwerk::Private::GitFilesystem
- Extended by:
- T::Sig
- Defined in:
- lib/danger-packwerk/private/git.rb
Instance Method Summary collapse
- #added_files ⇒ Object
- #convert_to_filesystem(path) ⇒ Object
- #deleted_files ⇒ Object
- #diff(filename_on_disk) ⇒ Object
- #modified_files ⇒ Object
- #renamed_files ⇒ Object
Instance Method Details
#added_files ⇒ Object
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_files ⇒ Object
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_files ⇒ Object
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_files ⇒ Object
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 |