Sha256: e19856138dbb92a43cbb8902dbc08c654b4db2b493c9826c285103d5af9fa19b

Contents?: true

Size: 712 Bytes

Versions: 54

Compression:

Stored size: 712 Bytes

Contents

require "vmc/cli/app/base"

module VMC::App
  class Stop < Base
    desc "Stop an application"
    group :apps, :manage
    input :apps, :desc => "Applications to start", :argument => :splat,
          :singular => :app, :from_given => by_name(:app)
    input :all, :desc => "Stop all applications", :default => false
    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

54 entries across 54 versions & 4 rubygems

Version Path
cloulu-1.0.0 lib/vmc/cli/app/stop.rb
cloulu-0.7.0 lib/vmc/cli/app/stop.rb
cloulu-0.6.6 lib/vmc/cli/app/stop.rb
cloulu-0.6.5 lib/vmc/cli/app/stop.rb
cloulu-0.6.1 lib/vmc/cli/app/stop.rb
cloulu-0.6.0 lib/vmc/cli/app/stop.rb
cloulu-0.5.1 lib/vmc/cli/app/stop.rb
cloulu-0.5.0 lib/vmc/cli/app/stop.rb
cloulu-0.3.0 lib/vmc/cli/app/stop.rb
cloulu-0.2.6 lib/vmc/cli/app/stop.rb
cloulu-0.2.5 lib/vmc/cli/app/stop.rb
cloulu-0.2.4 lib/vmc/cli/app/stop.rb
cloulu-0.2.3 lib/vmc/cli/app/stop.rb
cloulu-0.2.1 lib/vmc/cli/app/stop.rb
cloulu-0.2.0 lib/vmc/cli/app/stop.rb
cloulu-0.1.6 lib/vmc/cli/app/stop.rb
cloulu-0.1.5 lib/vmc/cli/app/stop.rb
cloulu-0.1.2 lib/vmc/cli/app/stop.rb
cloulu-0.1.1 lib/vmc/cli/app/stop.rb
vmc-0.5.1 lib/vmc/cli/app/stop.rb