module Deis
  module Commands
    class Disable < Struct.new :app
      include Helpers

      def run
        status "Disabling App: #{app}"
        units = shell('foreman check').strip.sub(/.*\((.*)\)/, "\\1").split(', ')
        scale app, units.each_with_object({}) { |k, h| h[k] = 0 }
      end

    end
  end
end
