Sha256: 4c4b8df0c95351484296a78a1d25eec17d4fc069699397d0ad226dff58d458b1

Contents?: true

Size: 602 Bytes

Versions: 7

Compression:

Stored size: 602 Bytes

Contents

module Percheron
  module Actions
    class Restart

      include Base

      def initialize(container)
        @container = container
      end

      def execute!
        results = []
        results << stop!
        results << start!
        results.compact.empty? ? nil : container
      end

      private

        attr_reader :container

        def stop!
          Stop.new(container).execute!
        end

        def start!
          opts = { dependant_containers: container.startable_dependant_containers.values }
          Start.new(container, opts).execute!
        end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
percheron-0.7.6 lib/percheron/actions/restart.rb
percheron-0.7.5 lib/percheron/actions/restart.rb
percheron-0.7.4 lib/percheron/actions/restart.rb
percheron-0.7.3 lib/percheron/actions/restart.rb
percheron-0.7.2 lib/percheron/actions/restart.rb
percheron-0.7.1 lib/percheron/actions/restart.rb
percheron-0.7.0 lib/percheron/actions/restart.rb