Class: Git::Path
- Inherits:
-
Object
show all
- Defined in:
- lib/git/path.rb
Instance Attribute Summary collapse
-
#path
Returns the value of attribute path.
Instance Method Summary
collapse
Constructor Details
#initialize(path, check_path = true) ⇒ Path
9
10
11
12
13
14
15
16
17
|
# File 'lib/git/path.rb', line 9
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
|
Instance Attribute Details
#path
Returns the value of attribute path.
7
8
9
|
# File 'lib/git/path.rb', line 7
def path
@path
end
|
Instance Method Details
#readable? ⇒ Boolean
19
20
21
|
# File 'lib/git/path.rb', line 19
def readable?
File.readable?(@path)
end
|
#to_s
27
28
29
|
# File 'lib/git/path.rb', line 27
def to_s
@path
end
|
#writable? ⇒ Boolean
23
24
25
|
# File 'lib/git/path.rb', line 23
def writable?
File.writable?(@path)
end
|