summaryrefslogtreecommitdiffstats
path: root/lib/git/path.rb
diff options
context:
space:
mode:
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