Module: Fuzz::Fzzr
- Included in:
- Fuzzers::WhitespaceChecker
- Defined in:
- lib/fuzz/fzzr.rb
Overview
Fuzzers are objects having the following readonly attributes:
#fuzz_id : id of fuzzer (Symbol)
#description: (String)
#errormsg : (String)
and having the following methods:
#applies_to?(object) : checks if the test applies to the object passed
(Fuzz::DirObject or Fuzz::FileObject)
#run(object,apply_fix): runs the fzzr test on the object passed
(Fuzz::DirObject or Fuzz::FileObject)
when apply_fix == true Fuzzer is directed to
attempt to fix any problems found (future)
Fuzz::Fzzr is provided as a convenience Mixin for fuzzers
Fuzzers can inspect the options passed to fuzz.rb by referencing Fuzz::OPTIONS
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#errormsg ⇒ Object
readonly
Returns the value of attribute errormsg.
-
#fuzz_id ⇒ Object
readonly
Returns the value of attribute fuzz_id.
Instance Method Summary collapse
- #applies_to?(object) ⇒ Boolean
- #is_excluded?(object) ⇒ Boolean
- #options ⇒ Object
- #run(object, apply_fix) ⇒ Object
- #setup(optparser) ⇒ Object
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
31 32 33 |
# File 'lib/fuzz/fzzr.rb', line 31 def description @description end |
#errormsg ⇒ Object (readonly)
Returns the value of attribute errormsg.
31 32 33 |
# File 'lib/fuzz/fzzr.rb', line 31 def errormsg @errormsg end |
#fuzz_id ⇒ Object (readonly)
Returns the value of attribute fuzz_id.
31 32 33 |
# File 'lib/fuzz/fzzr.rb', line 31 def fuzz_id @fuzz_id end |
Instance Method Details
#applies_to?(object) ⇒ Boolean
33 34 35 |
# File 'lib/fuzz/fzzr.rb', line 33 def applies_to?(object) !is_excluded?(object) end |
#is_excluded?(object) ⇒ Boolean
44 45 46 47 48 49 |
# File 'lib/fuzz/fzzr.rb', line 44 def is_excluded?(object) # force excludes to be parsed _excludes # now examine ((!_is_included?(object)) || _excludes.any? { |excl| (object.fullpath =~ /#{excl}/) }) end |
#options ⇒ Object
51 52 53 |
# File 'lib/fuzz/fzzr.rb', line 51 def Fuzz::OPTIONS[:config][:fzzr_opts][self.fuzz_id] ||= {} end |
#run(object, apply_fix) ⇒ Object
40 41 42 |
# File 'lib/fuzz/fzzr.rb', line 40 def run(object, apply_fix) true end |
#setup(optparser) ⇒ Object
37 38 |
# File 'lib/fuzz/fzzr.rb', line 37 def setup(optparser) end |