class Git::Path

Attributes

path[RW]

Public Class Methods

new(path, check_path=true) click to toggle source
# File lib/git/path.rb, line 7
def initialize(path, check_path=true)
  path = File.expand_path(path)
  
  if check_path && !File.exist?(path)
    raise ArgumentError, 'path does not exist', [path]
  end
  
  @path = path
end

Public Instance Methods

readable?() click to toggle source
# File lib/git/path.rb, line 17
def readable?
  File.readable?(@path)
end
to_s() click to toggle source
# File lib/git/path.rb, line 25
def to_s
  @path
end
writable?() click to toggle source
# File lib/git/path.rb, line 21
def writable?
  File.writable?(@path)
end