Sha256: 6029d389204252f53dd893a6d23f1a3f2e7c8acfd38756857c321237c86e3aa7

Contents?: true

Size: 525 Bytes

Versions: 90

Compression:

Stored size: 525 Bytes

Contents

require 'itamae-mitsurin'

module ItamaeMitsurin
  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

90 entries across 47 versions & 1 rubygems

Version Path
itamae-mitsurin-1.0.3 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-1.0.2 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-1.0.1 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-1.0.0 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.50 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.50 test/test_itamae-mitsurin/resource/test_execute.rb
itamae-mitsurin-0.49 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.49 test/test_itamae-mitsurin/resource/test_execute.rb
itamae-mitsurin-0.48 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.48 test/test_itamae-mitsurin/resource/test_execute.rb
itamae-mitsurin-0.47 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.47 test/test_itamae-mitsurin/resource/test_execute.rb
itamae-mitsurin-0.46 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.46 test/test_itamae-mitsurin/resource/test_execute.rb
itamae-mitsurin-0.45 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.45 test/test_itamae-mitsurin/resource/test_execute.rb
itamae-mitsurin-0.44 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.44 test/test_itamae-mitsurin/resource/test_execute.rb
itamae-mitsurin-0.43 lib/itamae-mitsurin/resource/execute.rb
itamae-mitsurin-0.43 test/test_itamae-mitsurin/resource/test_execute.rb