class Synco::Directory
A specific directory which is relative to the root of a given server. Specific configuration details such as excludes and other options may be specified.
Attributes
arguments[R]
path[R]
Public Class Methods
depth(path)
click to toggle source
# File lib/synco/directory.rb, line 56 def self.depth(path) path.count('/') end
new(path, arguments: [])
click to toggle source
Calls superclass method
Synco::Controller::new
# File lib/synco/directory.rb, line 30 def initialize(path, arguments: []) if path.start_with?('/') raise AbsolutePathError.new("#{path} must be relative!") end super() @arguments = arguments @path = self.class.normalize(path) end
normalize(path)
click to toggle source
# File lib/synco/directory.rb, line 52 def self.normalize(path) path.end_with?('/') ? path : path + '/' end
Public Instance Methods
depth()
click to toggle source
# File lib/synco/directory.rb, line 44 def depth self.class.depth(@path) end
to_s()
click to toggle source
# File lib/synco/directory.rb, line 48 def to_s @path end