Sha256: f69e8f2045bd98ba5bebcdecb546072d23bc8a089d1bce3f6b98e9573ea61322

Contents?: true

Size: 442 Bytes

Versions: 7

Compression:

Stored size: 442 Bytes

Contents

module Percheron
  module Actions
    class Stop

      include Base

      def initialize(unit)
        @unit = unit
      end

      def execute!
        results = []
        results << stop! if unit.running?
        results.compact.empty? ? nil : unit
      end

      private

        attr_reader :unit

        def stop!
          $logger.info "Stopping '#{unit.name}' unit"
          unit.container.stop!
        end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
percheron-0.7.13 lib/percheron/actions/stop.rb
percheron-0.7.12 lib/percheron/actions/stop.rb
percheron-0.7.11 lib/percheron/actions/stop.rb
percheron-0.7.10 lib/percheron/actions/stop.rb
percheron-0.7.9 lib/percheron/actions/stop.rb
percheron-0.7.8 lib/percheron/actions/stop.rb
percheron-0.7.7 lib/percheron/actions/stop.rb