Class: EMDirWatcher::PathGlobMatcher
- Inherits:
-
Object
- Object
- EMDirWatcher::PathGlobMatcher
- Defined in:
- lib/em-dir-watcher/tree.rb
Instance Method Summary collapse
-
#initialize(glob) ⇒ PathGlobMatcher
constructor
A new instance of PathGlobMatcher.
- #matches?(relative_path) ⇒ Boolean
Constructor Details
#initialize(glob) ⇒ PathGlobMatcher
Returns a new instance of PathGlobMatcher.
123 124 125 |
# File 'lib/em-dir-watcher/tree.rb', line 123 def initialize glob @glob = glob.gsub(%r-^/+-, '') end |
Instance Method Details
#matches?(relative_path) ⇒ Boolean
126 127 128 |
# File 'lib/em-dir-watcher/tree.rb', line 126 def matches? relative_path File.fnmatch?(@glob, relative_path) end |