class Git::DiffPathStatus
Public Class Methods
Source
# File lib/git/diff_path_status.rb, line 8 def initialize(base, from, to, path_limiter = nil) # Eagerly check for invalid arguments [from, to].compact.each do |arg| raise ArgumentError, "Invalid argument: '#{arg}'" if arg.start_with?('-') end @base = base @from = from @to = to @path_limiter = path_limiter @path_status = nil end
@private
Public Instance Methods
Source
# File lib/git/diff_path_status.rb, line 24 def each(&block) fetch_path_status.each(&block) end
Iterates over each file’s status.
@yield [path, status]
Source
# File lib/git/diff_path_status.rb, line 32 def to_h fetch_path_status end
Returns the name-status report as a Hash.
@return [Hash<String, String>] A hash where keys are file paths
and values are their status codes.
Private Instance Methods
Source
# File lib/git/diff_path_status.rb, line 39 def fetch_path_status @path_status ||= @base.lib.diff_path_status( @from, @to, { path: @path_limiter } ) end
Lazily fetches and caches the path status from the git lib.