Class: Moku::Task::Shell

Inherits:
Task
  • Object
show all
Defined in:
lib/moku/task/shell.rb

Overview

A simple shell task, resolved in the context of the artifact.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command:) ⇒ Shell


15
16
17
# File 'lib/moku/task/shell.rb', line 15

def initialize(command:)
  @command = command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command


23
24
25
# File 'lib/moku/task/shell.rb', line 23

def command
  @command
end

Class Method Details

.from_spec(task_spec) ⇒ Object


11
12
13
# File 'lib/moku/task/shell.rb', line 11

def self.from_spec(task_spec)
  new(command: task_spec.command)
end

Instance Method Details

#call(artifact) ⇒ Object


26
27
28
# File 'lib/moku/task/shell.rb', line 26

def call(artifact)
  artifact.run(command)
end

#to_sObject


19
20
21
# File 'lib/moku/task/shell.rb', line 19

def to_s
  "#{self.class}(#{command})"
end