got clone and init to work - my first writing functions
[rubygit.git] / lib / git / path.rb
blobe429d6f058a135a0f3ae748ba7fc02e486e573cc
1 module Git
2   class Path
3     
4     attr_accessor :path
5     
6     def initialize(path, check_path = true)
7       if !check_path || File.exists?(path)
8         @path = File.expand_path(path)
9       else
10         raise ArgumentError, "path does not exist", File.expand_path(path)
11       end
12     end
13     
14     def readable?
15       File.readable?(@path)
16     end
18     def writable?
19       File.writable?(@path)
20     end
21     
22   end
23 end