Sha256: 14512a09cee6805b8922221bd31b334a6956151bf1705e18267bc714a855bf42

Contents?: true

Size: 552 Bytes

Versions: 10

Compression:

Stored size: 552 Bytes

Contents

module Percheron
  module Actions
    class Restart

      include Base

      def initialize(unit)
        @unit = unit
      end

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

      private

        attr_reader :unit

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

        def start!
          opts = { dependant_units: unit.startable_dependant_units.values }
          Start.new(unit, opts).execute!
        end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
percheron-0.7.16 lib/percheron/actions/restart.rb
percheron-0.7.15 lib/percheron/actions/restart.rb
percheron-0.7.14 lib/percheron/actions/restart.rb
percheron-0.7.13 lib/percheron/actions/restart.rb
percheron-0.7.12 lib/percheron/actions/restart.rb
percheron-0.7.11 lib/percheron/actions/restart.rb
percheron-0.7.10 lib/percheron/actions/restart.rb
percheron-0.7.9 lib/percheron/actions/restart.rb
percheron-0.7.8 lib/percheron/actions/restart.rb
percheron-0.7.7 lib/percheron/actions/restart.rb