class Tukune::Git::Diff

Attributes

changed_files[R]

Public Class Methods

name_status(target_paths = []) click to toggle source
# File lib/tukune/git/diff.rb, line 39
def name_status(target_paths = [])
  Diff.new(target_paths)
end
new(target_paths) click to toggle source
# File lib/tukune/git/diff.rb, line 10
def initialize(target_paths)
  @target_paths = target_paths.join(' ')
end

Public Instance Methods

added_files() click to toggle source
# File lib/tukune/git/diff.rb, line 18
def added_files
  `git ls-files --others --exclude-standard #{@target_paths}`.strip.split("\n")
end
deleted_files() click to toggle source
# File lib/tukune/git/diff.rb, line 28
def deleted_files
  changed_files.select { |type, _| type == 'D' }.map { |_, name| name }
end
modified_files() click to toggle source
# File lib/tukune/git/diff.rb, line 23
def modified_files
  changed_files.select { |type, _| type == 'M' }.map { |_, name| name }
end
nothing_to_commit?() click to toggle source
# File lib/tukune/git/diff.rb, line 14
def nothing_to_commit?
  changed_files.empty?
end