lib/abak-flow/commands/checkup.rb in abak-flow-1.0.10 vs lib/abak-flow/commands/checkup.rb in abak-flow-1.1.0

- old
+ new

@@ -1,27 +1,24 @@ # coding: utf-8 -require "ansi/code" - module Abak::Flow module Commands class Checkup + include ANSI::Code - def initialize - manager = Manager.instance - - @configuration = manager.configuration - @repository = manager.repository - end - def run(args, options) process(args, options) - say ANSI.green { I18n.t("commands.checkup.success") } + + say green { Manager.locale.success(self) } end def process(args, options) - Visitor.new(@configuration, @repository, - command: "checkup", call: :ready?, inspect: :errors) - .on_fail(exit: 1) + inspector = Inspector.new(call_method: :valid?, collect_attribute: :errors) + inspector.examine(Manager.configuration, Manager.repository).on_fail do |insp| + say red { Manager.locale.error(self) } + say yellow { insp.output } + + exit 100 + end end end # class Checkup end # module Commands -end # module Abak::Flow \ No newline at end of file +end # module Abak::Flow