Class: CMSScanner::Controllers
- Inherits:
-
Array
- Object
- Array
- CMSScanner::Controllers
- Defined in:
- lib/cms_scanner/controllers.rb
Overview
Controllers Container
Instance Attribute Summary collapse
-
#option_parser ⇒ Object
readonly
Returns the value of attribute option_parser.
Instance Method Summary collapse
- #<<(controller) ⇒ Object
-
#initialize(option_parser = OptParseValidator::OptParser.new(nil, 40)) ⇒ Controllers
constructor
A new instance of Controllers.
- #run ⇒ Object
Constructor Details
#initialize(option_parser = OptParseValidator::OptParser.new(nil, 40)) ⇒ Controllers
Returns a new instance of Controllers.
6 7 8 |
# File 'lib/cms_scanner/controllers.rb', line 6 def initialize(option_parser = OptParseValidator::OptParser.new(nil, 40)) @option_parser = option_parser end |
Instance Attribute Details
#option_parser ⇒ Object (readonly)
Returns the value of attribute option_parser.
4 5 6 |
# File 'lib/cms_scanner/controllers.rb', line 4 def option_parser @option_parser end |
Instance Method Details
#<<(controller) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/cms_scanner/controllers.rb', line 13 def <<(controller) = controller. unless include?(controller) option_parser.add(*) if super(controller) end self end |
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/cms_scanner/controllers.rb', line 23 def run = option_parser.results first.class. = redirect_output_to_file([:output]) if [:output] each(&:before_scan) each(&:run) reverse.each(&:after_scan) end |