Class: SproutCore::FileRule
- Defined in:
- lib/buildtasks/helpers/file_rule.rb
Instance Method Summary collapse
-
#include?(file) ⇒ Boolean
Decides whether or not a file should be included.
-
#initialize(exp, mode) ⇒ FileRule
constructor
A new instance of FileRule.
Constructor Details
#initialize(exp, mode) ⇒ FileRule
Returns a new instance of FileRule.
4 5 6 7 |
# File 'lib/buildtasks/helpers/file_rule.rb', line 4 def initialize(exp, mode) @mode = mode @expression = Regexp.new(exp) end |
Instance Method Details
#include?(file) ⇒ Boolean
Decides whether or not a file should be included. Returns either true, false, or nil (for not a match at all)
11 12 13 14 15 16 17 18 19 |
# File 'lib/buildtasks/helpers/file_rule.rb', line 11 def include?(file) ret = (@mode == :deny) ? false : true if file =~ @expression return ret else return nil end end |