summaryrefslogtreecommitdiffstats
path: root/lib/git/path.rb
blob: 9d6ba49be28ab7152c1f5cc1f63f6a3907da08e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module Git
  class Path
    
    attr_accessor :path
    
    def initialize(path)
      if File.exists?(path)
        @path = path
      else
        raise ArgumentError, "path does not exist", path 
      end
    end
    
    def readable?
      File.readable?(@path)
    end

    def writable?
      File.writable?(@path)
    end
    
  end
end