summaryrefslogtreecommitdiffstats
path: root/lib/git/path.rb
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-07 16:24:15 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-07 16:24:15 -0800
commitb5d6b907b080992c2d0220eceb66f4ffa85207cd (patch)
tree6a9b2829ac3087b237a88ffe90528905f90c6e34 /lib/git/path.rb
parentf5baa11a1c82dc42ade5c291e9f061c13b66bc2f (diff)
downloadthird_party-ruby-git-b5d6b907b080992c2d0220eceb66f4ffa85207cd.tar.gz
third_party-ruby-git-b5d6b907b080992c2d0220eceb66f4ffa85207cd.tar.xz
third_party-ruby-git-b5d6b907b080992c2d0220eceb66f4ffa85207cd.zip
got the first round working
Diffstat (limited to 'lib/git/path.rb')
-rw-r--r--lib/git/path.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/git/path.rb b/lib/git/path.rb
new file mode 100644
index 0000000..9d6ba49
--- /dev/null
+++ b/lib/git/path.rb
@@ -0,0 +1,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 \ No newline at end of file