Sha256: 2f74e4b6ed34e378d07a2f6b208794ba8df2735a312fca89fcaf7d9d610010ad

Contents?: true

Size: 947 Bytes

Versions: 3

Compression:

Stored size: 947 Bytes

Contents

require_relative 'workflow/definition'
require_relative 'workflow/util'
require_relative 'workflow/task'
require_relative 'workflow/step'
require_relative 'workflow/documentation'
require_relative 'workflow/usage'

require_relative 'resource'
require_relative 'resource/scout'

module Workflow
  class << self
    attr_accessor :workflows
    def workflows
      @workflows ||= []
    end
  end

  attr_accessor :libdir
  def self.extended(base)
    self.workflows << base
    libdir = Path.caller_lib_dir
    return if libdir.nil?
    base.libdir = Path.setup(libdir).tap{|p| p.resource = base}
  end

  def self.require_workflow(workflow)
    workflow = Path.setup('workflows')[workflow]["workflow.rb"] unless Open.exists?(workflow)
    if Open.exists?(workflow)
      workflow = workflow.find if Path === workflow
      load workflow
    end
    workflows.last
  end

  def job(name, *args)
    task = tasks[name]
    task.job(*args)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
scout-gear-7.1.0 lib/scout/workflow.rb
scout-gear-6.0.0 lib/scout/workflow.rb
scout-gear-5.2.0 lib/scout/workflow.rb