Sha256: f879e6b49fec938a1384a5a51e3f86c4871ac98b957718cdb628d154d025c83a

Contents?: true

Size: 509 Bytes

Versions: 13

Compression:

Stored size: 509 Bytes

Contents

require 'itamae'

module Itamae
  module Resource
    class Execute < Base
      define_attribute :action, default: :run
      define_attribute :command, type: String, default_name: true

      def pre_action
        case @current_action
        when :run
          attributes.executed = true
        end
      end

      def set_current_attributes
        current.executed = false
      end

      def action_run(options)
        run_command(attributes.command)
        updated!
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
itamae-1.6.3 lib/itamae/resource/execute.rb
itamae-1.6.2 lib/itamae/resource/execute.rb
itamae-1.6.1 lib/itamae/resource/execute.rb
itamae-1.6.0 lib/itamae/resource/execute.rb
itamae-1.5.2 lib/itamae/resource/execute.rb
itamae-1.5.1 lib/itamae/resource/execute.rb
itamae-1.5.0 lib/itamae/resource/execute.rb
itamae-1.4.5 lib/itamae/resource/execute.rb
itamae-1.4.4 lib/itamae/resource/execute.rb
itamae-1.4.3 lib/itamae/resource/execute.rb
itamae-1.4.2 lib/itamae/resource/execute.rb
itamae-1.4.1 lib/itamae/resource/execute.rb
itamae-1.4.0 lib/itamae/resource/execute.rb