Class: Rfix::Diff

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/rfix/diff.rb

Constant Summary collapse

OPTIONS =
{
  context_lines: 1,
  ignore_whitespace: true,
  ignore_whitespace_change: true,
  ignore_whitespace_eol: true,
  disable_pathspec_match: false,
  ignore_submodules: true,
  include_ignored: false,
  include_unmodified: false,
  skip_binary_check: true,
  ignore_filemode: true,
  include_untracked_content: false,
  include_typechange: false
}.freeze

Instance Method Summary collapse

Instance Method Details

#deltasObject



34
35
36
# File 'lib/rfix/diff.rb', line 34

def deltas
  diff.deltas.reject(&:deleted?)
end

#filesObject



38
39
40
41
42
# File 'lib/rfix/diff.rb', line 38

def files
  deltas.map(&:new_file).map do |file|
    repository.path.join(file.fetch(:path))
  end
end