Sha256: c474dddf5f438aefe54f470c2c71a4346146928665ccc5d37106cab2fc53868a
Contents?: true
Size: 811 Bytes
Versions: 10
Compression:
Stored size: 811 Bytes
Contents
module CMSScanner # Controllers Container class Controllers < Array attr_reader :option_parser def initialize(option_parser = OptParseValidator::OptParser.new(nil, 40)) @option_parser = option_parser end # @param [ Controller::Base ] controller # # @retun [ Controllers ] self def <<(controller) options = controller.cli_options unless include?(controller) option_parser.add(*options) if options super(controller) end self end def run parsed_options = option_parser.results first.class.parsed_options = parsed_options redirect_output_to_file(parsed_options[:output]) if parsed_options[:output] each(&:before_scan) each(&:run) reverse_each(&:after_scan) end end end
Version data entries
10 entries across 10 versions & 1 rubygems