Class: Avm::Git::Runners::Base::DirtyFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/git/runners/base/dirty_files.rb

Constant Summary collapse

DEFAULT_FORMAT =
'%p'
FIELDS =
{
  i: :index, w: :worktree, p: :path, a: :absolute_path
}.transform_keys { |k| "%#{k}" }

Instance Method Summary collapse

Instance Method Details

#help_extra_textObject



21
22
23
# File 'lib/avm/git/runners/base/dirty_files.rb', line 21

def help_extra_text
  "Format fields:\n" + FIELDS.map { |k, v| "  #{k} => #{v}" }.join("\n") # rubocop:disable Style/StringConcatenation
end

#runObject



25
26
27
28
29
# File 'lib/avm/git/runners/base/dirty_files.rb', line 25

def run
  runner_context.call(:git).dirty_files.each do |file|
    out("#{format_file(file)}\n")
  end
end