Class: Glark::DirCriteriaOpts
- Inherits:
-
CriteriaOpts
- Object
- Criteria
- CriteriaOpts
- Glark::DirCriteriaOpts
- Includes:
- OptionUtil
- Defined in:
- lib/glark/input/filter/dir_criteria_opts.rb
Constant Summary
Constants included from OptionUtil
Instance Attribute Summary collapse
-
#skip_all ⇒ Object
Returns the value of attribute skip_all.
Instance Method Summary collapse
-
#initialize(skip_all) ⇒ DirCriteriaOpts
constructor
A new instance of DirCriteriaOpts.
- #opt_classes ⇒ Object
- #skipped?(pn, depth) ⇒ Boolean
Methods included from OptionUtil
#add_opt, #add_opt_arg, #add_opt_blk, #add_opt_false, #add_opt_int, #add_opt_str, #add_opt_true, #colorize, #set, #set_var, #to_boolean
Methods inherited from CriteriaOpts
#add_as_options, #config_fields, #dump_fields, #update_fields
Methods inherited from Criteria
#add, #find_by_class, #get, #match?
Constructor Details
#initialize(skip_all) ⇒ DirCriteriaOpts
Returns a new instance of DirCriteriaOpts.
15 16 17 18 19 20 21 |
# File 'lib/glark/input/filter/dir_criteria_opts.rb', line 15 def initialize skip_all super() @skip_all = skip_all add :name, :negative, BaseNameFilter.new('.svn') add :name, :negative, BaseNameFilter.new('.git') end |
Instance Attribute Details
#skip_all ⇒ Object
Returns the value of attribute skip_all.
13 14 15 |
# File 'lib/glark/input/filter/dir_criteria_opts.rb', line 13 def skip_all @skip_all end |
Instance Method Details
#opt_classes ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/glark/input/filter/dir_criteria_opts.rb', line 28 def opt_classes [ MatchDirNameOption, SkipDirNameOption, MatchDirPathOption, SkipDirPathOption, ] end |
#skipped?(pn, depth) ⇒ Boolean
23 24 25 26 |
# File 'lib/glark/input/filter/dir_criteria_opts.rb', line 23 def skipped? pn, depth return true if @skip_all || !depth.nonzero? super pn end |