Class: Dressmaker::Configuration::FileRule::Pattern
- Inherits:
-
Object
- Object
- Dressmaker::Configuration::FileRule::Pattern
- Defined in:
- lib/dressmaker/configuration/file_rule.rb
Instance Method Summary collapse
-
#initialize(pattern, &action) ⇒ Pattern
constructor
A new instance of Pattern.
- #matches?(base, target) ⇒ Boolean
Constructor Details
#initialize(pattern, &action) ⇒ Pattern
Returns a new instance of Pattern.
23 24 25 26 |
# File 'lib/dressmaker/configuration/file_rule.rb', line 23 def initialize(pattern, &action) @pattern = pattern @action = action end |
Instance Method Details
#matches?(base, target) ⇒ Boolean
28 29 30 |
# File 'lib/dressmaker/configuration/file_rule.rb', line 28 def matches?(base, target) File.file?(File.join(base, target)) and File.fnmatch(pattern, File.join(base, target)) end |