Sha256: 1f4c0face8335e507bdab3cfd339677e51c3f27e3358d6dc637d3fd86b68992a

Contents?: true

Size: 554 Bytes

Versions: 20

Compression:

Stored size: 554 Bytes

Contents

module Vx
  module Builder
    class Script

      Services = Struct.new(:app) do

        include Helper::TraceShCommand

        def call(env)
          env.source.services.each do |srv|
            env.init << trace_sh_command(
              "sudo /usr/bin/env PATH=/sbin:/usr/sbin:$PATH service #{srv} start",
              trace: "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

20 entries across 20 versions & 1 rubygems

Version Path
vx-builder-0.0.22 lib/vx/builder/script/services.rb
vx-builder-0.0.21 lib/vx/builder/script/services.rb
vx-builder-0.0.20 lib/vx/builder/script/services.rb
vx-builder-0.0.19 lib/vx/builder/script/services.rb
vx-builder-0.0.18 lib/vx/builder/script/services.rb
vx-builder-0.0.16 lib/vx/builder/script/services.rb
vx-builder-0.0.15 lib/vx/builder/script/services.rb
vx-builder-0.0.14 lib/vx/builder/script/services.rb
vx-builder-0.0.13 lib/vx/builder/script/services.rb
vx-builder-0.0.12 lib/vx/builder/script/services.rb
vx-builder-0.0.11 lib/vx/builder/script/services.rb
vx-builder-0.0.10 lib/vx/builder/script/services.rb
vx-builder-0.0.9 lib/vx/builder/script/services.rb
vx-builder-0.0.8 lib/vx/builder/script/services.rb
vx-builder-0.0.7 lib/vx/builder/script/services.rb
vx-builder-0.0.6 lib/vx/builder/script/services.rb
vx-builder-0.0.5 lib/vx/builder/script/services.rb
vx-builder-0.0.4 lib/vx/builder/script/services.rb
vx-builder-0.0.3 lib/vx/builder/script/services.rb
vx-builder-0.0.2 lib/vx/builder/script/services.rb