Class: Six::Repositories::Rsync::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/six/rsync/path.rb

Direct Known Subclasses

Repository, WorkingDirectory

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, check_path = true) ⇒ Path

Returns a new instance of Path.



10
11
12
13
14
15
16
# File 'lib/six/rsync/path.rb', line 10

def initialize(path, check_path = true)
  if !check_path || File.exists?(path)
    @path = File.expand_path(path)
  else
    raise ArgumentError, "path does not exist", File.expand_path(path)
  end
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



8
9
10
# File 'lib/six/rsync/path.rb', line 8

def path
  @path
end

Instance Method Details

#readable?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/six/rsync/path.rb', line 18

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

#to_sObject



26
27
28
# File 'lib/six/rsync/path.rb', line 26

def to_s
  @path
end

#writable?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/six/rsync/path.rb', line 22

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