Sha256: 0eed0ed24a063e3f385897490edfdb9dad5f9d6f34a3613e2466dddbfa6b70bf

Contents?: true

Size: 740 Bytes

Versions: 11

Compression:

Stored size: 740 Bytes

Contents

require "vmc/cli/app/base"

module VMC::App
  class Stop < Base
    desc "Stop an application"
    group :apps, :manage
    input :apps, :argument => :splat, :singular => :app,
      :desc => "Applications to start",
      :from_given => by_name("app")
    input :all, :type => :boolean, :default => false,
      :desc => "Stop all applications"
    def stop
      apps = input[:all] ? client.apps : input[:apps]
      fail "No applications given." if apps.empty?

      apps.each do |app|
        with_progress("Stopping #{c(app.name, :name)}") do |s|
          if app.stopped?
            s.skip do
              err "Application is not running."
            end
          end

          app.stop!
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vmc-0.4.7 lib/vmc/cli/app/stop.rb
vmc-0.4.6 lib/vmc/cli/app/stop.rb
vmc-0.4.5 lib/vmc/cli/app/stop.rb
vmc-0.4.4 lib/vmc/cli/app/stop.rb
vmc-0.4.3 lib/vmc/cli/app/stop.rb
vmc-0.4.2 lib/vmc/cli/app/stop.rb
vmc-0.4.1 lib/vmc/cli/app/stop.rb
vmc-0.4.0 lib/vmc/cli/app/stop.rb
vmc-0.4.0.beta.97 vmc-ng/lib/vmc/cli/app/stop.rb
vmc-0.4.0.beta.96 vmc-ng/lib/vmc/cli/app/stop.rb
vmc-0.4.0.beta.94 vmc-ng/lib/vmc/cli/app/stop.rb