Sha256: 9f1b37c68ed0f06a78feb77e9ac596a34e3c10c24f1a164b4c61d6b87c07522d
Contents?: true
Size: 802 Bytes
Versions: 11
Compression:
Stored size: 802 Bytes
Contents
module CMSScanner # Controllers Container class Controllers < Array attr_reader :option_parser def initialize(option_parser = OptParseValidator::OptParser.new) @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
11 entries across 11 versions & 1 rubygems