class Git::Path
A base class that represents and validates a filesystem path
Use for tracking things relevant to a Git repository, such as the working directory or index file.
Public Class Methods
Source
# File lib/git/path.rb, line 18 def initialize(path, must_exist: true) path = File.expand_path(path) raise ArgumentError, 'path does not exist', [path] if must_exist && !File.exist?(path) @path = path end
Public Instance Methods
Source
# File lib/git/path.rb, line 10 def path Git::Deprecation.warn( 'The .path accessor is deprecated and will be removed in v5.0. ' \ 'Use .to_s instead.' ) @path end