Sha256: 80f18e88acaa00f807b024bca73867f09f613bd64e125ec37c8006d426d6512d

Contents?: true

Size: 630 Bytes

Versions: 1

Compression:

Stored size: 630 Bytes

Contents

module Omnitest
  class Psychic
    class Workflow
      attr_reader :commands, :psychic

      def initialize(psychic, name = 'workflow', options = {}, &block)
        @psychic = psychic
        @name = name
        @options = options
        @commands = []
        instance_eval &block if block_given?
      end

      def task(name, *args)
        @commands << psychic.task(name, *args)
      end

      def command
        @commands.map(&:command).join("\n") + "\n"
      end

      def execute(_params = {}, shell_opts = {}, *extra_args)
        @psychic.execute(command, shell_opts, *extra_args)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omnitest-psychic-0.0.9 lib/omnitest/psychic/workflow.rb