Just a temporary holder for a set of patterns that are used to construct a relative FileList for pages and resources.
Methods
Attributes
| [RW] | dir | Access the base dir for these patterns |
| [R] | excludes | |
| [R] | includes | Access the pattern arrays |
Public Class methods
[ show source ]
# File lib/rote/rotetasks.rb, line 18
18: def initialize(basedir = '.')
19: @dir = basedir
20: @includes, @excludes = [], []
21: end
Public Instance methods
Specify glob patterns or regexps to exclude
[ show source ]
# File lib/rote/rotetasks.rb, line 38
38: def exclude(*patterns)
39: patterns.each { |it|
40: @excludes << it
41: }
42: end
Specify glob patterns to include
[ show source ]
# File lib/rote/rotetasks.rb, line 31
31: def include(*patterns)
32: patterns.each { |it|
33: @includes << it
34: }
35: end
Create a FileList with these patterns
[ show source ]
# File lib/rote/rotetasks.rb, line 45
45: def to_filelist
46: fl = FileList.new
47: fl.include(*includes.map { |it| "#{dir}/#{it}"} ) unless includes.empty?
48:
49: # excludes may be regexp too
50: fl.exclude(*excludes.map { |it| it.is_a?(String) ? "#{dir}/#{it}" : it } ) unless excludes.empty?
51:
52: # don't allow dir to be changed anymore.
53: freeze
54:
55: fl
56: end