Sha256: ca064a97dc124194ab6a211c84c453c0c693a63f98fd6eafaca09cfe18fac2da

Contents?: true

Size: 578 Bytes

Versions: 4

Compression:

Stored size: 578 Bytes

Contents

module Resource

  class Execute < Base

    block_attr :owner, :title, :path

    def initialize title, &block
      set_base_defaults
      @path = nil
      @commands = []
      @title = title
      self.instance_eval(&block)
    end

    def command string
      @commands << { :command => string, :path => @path }
    end

    def run
      Execution.block 'Execution', @title, @owner do |b|
        b.always_run @always_run
        @commands.each do |command_hash|
          b.run "#{command_hash[:command]}", command_hash[:path]
        end
      end
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

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