Module: Ripe::DSL
- Defined in:
- lib/ripe/dsl/task_dsl.rb,
lib/ripe/dsl/workflow_dsl.rb
Defined Under Namespace
Classes: TaskDSL, WorkflowDSL
Instance Method Summary collapse
-
#task(handle, &block) ⇒ WorkingBlock?
Create a
WorkingBlockusing a DSL. -
#workflow(handle, &block) ⇒ Object
Create a
Workflowusing a DSL.
Instance Method Details
#task(handle, &block) ⇒ WorkingBlock?
Create a WorkingBlock using a DSL. It is syntactic sugar for
foo = WorkingBlock.new('/path/to/foo', {
param1: 'val1',
param2: 'val2',
})
in the form of:
foo = task 'foo' do
param :param1, 'val1'
param :param2, 'val2'
end
foo = task 'foo' do |t|
t.param :param1, 'val1'
t.param :param2, 'val2'
end
It internally uses Ripe::DSL::TaskDSL to provide the DSL.
35 36 37 38 39 40 41 |
# File 'lib/ripe/dsl/task_dsl.rb', line 35 def task(handle, &block) filename = Library.find(:task, handle) abort "Could not find task #{handle}." if filename == nil params = TaskDSL.new(handle, &block).params Blocks::WorkingBlock.new(filename, params) end |
#workflow(handle, &block) ⇒ Object
Create a Workflow using a DSL. It is syntactic sugar for
workflow 'foobar' do
param :node_count, 1
param :ppn, 8
param :project_name, 'abc-012-ab'
param :queue, 'queue'
param :walltime, '12:00:00'
describe do |sample, params|
# task
end
end
The block given in describe has two mandatory arguments:
- sample: the name of the sample
- params: the parameters defined at the workflow-level
It internally uses Ripe::DSL::WorkflowDSL to provide the DSL.
33 34 35 |
# File 'lib/ripe/dsl/workflow_dsl.rb', line 33 def workflow(handle, &block) $workflow = WorkflowDSL.new(handle, &block) end |