Sha256: 87e0ec44477c916dbd752b03227f2e847a998636b18f603362c94f1aaa69aa8e

Contents?: true

Size: 410 Bytes

Versions: 4

Compression:

Stored size: 410 Bytes

Contents

module Resource

  class Service < Base

    block_attr :action

    def initialize name, &block
      set_base_defaults
      @name       = name
      @always_run = true
      self.instance_eval(&block)
    end

    def run
      Execution.block "Changing #{@name} service", @action, 'root' do |b|
        b.always_run @always_run
        b.run "/etc/init.d/#{@name} #{@action}"
      end
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
atesta-0.0.4 lib/resource/service.rb
atesta-0.0.3 lib/resource/service.rb
atesta-0.0.2 lib/resource/service.rb
atesta-0.0.1 lib/resource/service.rb