Class: LSync::Directory
- Inherits:
-
Object
- Object
- LSync::Directory
- Includes:
- EventHandler
- Defined in:
- lib/lsync/directory.rb
Overview
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.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#exclude(pattern) ⇒ Object
Exclude a specific shell glob pattern.
-
#initialize(path) ⇒ Directory
constructor
A new instance of Directory.
-
#to_s ⇒ Object
A string representation of the path for logging.
Methods included from EventHandler
Constructor Details
#initialize(path) ⇒ Directory
Returns a new instance of Directory.
44 45 46 47 |
# File 'lib/lsync/directory.rb', line 44 def initialize(path) @path = Pathname.new(path).cleanpath.normalize_trailing_slash = {:arguments => []} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
50 51 52 |
# File 'lib/lsync/directory.rb', line 50 def end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
49 50 51 |
# File 'lib/lsync/directory.rb', line 49 def path @path end |
Instance Method Details
#exclude(pattern) ⇒ Object
Exclude a specific shell glob pattern.
53 54 55 56 |
# File 'lib/lsync/directory.rb', line 53 def exclude(pattern) # RSync specific... need to figure out if there is a good way to do this generally. [:arguments] += ["--exclude", pattern] end |
#to_s ⇒ Object
A string representation of the path for logging.
59 60 61 |
# File 'lib/lsync/directory.rb', line 59 def to_s @path.to_s end |