Sha256: 45891f00c59abc5d26b17b9164d6b4c8611cd879457589dc3016078d0db09c85

Contents?: true

Size: 560 Bytes

Versions: 16

Compression:

Stored size: 560 Bytes

Contents

module Vx
  module Builder
    class Script

      Services = Struct.new(:app) do

        ALIASES = {
          'rabbitmq' => 'rabbitmq-server'
        }

        include Helper::TraceShCommand

        def call(env)
          env.source.services.each do |srv|
            srv = ALIASES[srv] || srv
            env.init << trace_sh_command("sudo service #{srv} start")
          end
          unless env.source.services.empty?
            env.init << trace_sh_command("sleep 3")
          end

          app.call(env)
        end

      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
vx-builder-0.1.8 lib/vx/builder/script/services.rb
vx-builder-0.1.7 lib/vx/builder/script/services.rb
vx-builder-0.1.6 lib/vx/builder/script/services.rb
vx-builder-0.1.5 lib/vx/builder/script/services.rb
vx-builder-0.1.4 lib/vx/builder/script/services.rb
vx-builder-0.1.3 lib/vx/builder/script/services.rb
vx-builder-0.1.2 lib/vx/builder/script/services.rb
vx-builder-0.1.1 lib/vx/builder/script/services.rb
vx-builder-0.1.0 lib/vx/builder/script/services.rb
vx-builder-0.0.29 lib/vx/builder/script/services.rb
vx-builder-0.0.28 lib/vx/builder/script/services.rb
vx-builder-0.0.27 lib/vx/builder/script/services.rb
vx-builder-0.0.26 lib/vx/builder/script/services.rb
vx-builder-0.0.25 lib/vx/builder/script/services.rb
vx-builder-0.0.24 lib/vx/builder/script/services.rb
vx-builder-0.0.23 lib/vx/builder/script/services.rb