Class: Target

Inherits:
Object
  • Object
show all
Defined in:
lib/reggae.rb

Overview

A build target

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(outputs, command = '', dependencies = [], implicits = []) ⇒ Target

Returns a new instance of Target.



34
35
36
37
38
39
# File 'lib/reggae.rb', line 34

def initialize(outputs, command = '', dependencies = [], implicits = [])
  @outputs = arrayify(outputs)
  @command = jsonifiable(command, ShellCommand)
  @dependencies = dependify(dependencies, FixedDependencies)
  @implicits = dependify(implicits, FixedDependencies)
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



32
33
34
# File 'lib/reggae.rb', line 32

def command
  @command
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



32
33
34
# File 'lib/reggae.rb', line 32

def dependencies
  @dependencies
end

#implicitsObject (readonly)

Returns the value of attribute implicits.



32
33
34
# File 'lib/reggae.rb', line 32

def implicits
  @implicits
end

#outputsObject (readonly)

Returns the value of attribute outputs.



32
33
34
# File 'lib/reggae.rb', line 32

def outputs
  @outputs
end

Instance Method Details

#jsonifyObject



45
46
47
48
49
50
51
52
# File 'lib/reggae.rb', line 45

def jsonify
  { type: 'fixed',
    command: @command.jsonify,
    outputs: @outputs,
    dependencies: @dependencies.jsonify,
    implicits: @implicits.jsonify
  }
end

#to_jsonObject



41
42
43
# File 'lib/reggae.rb', line 41

def to_json
  jsonify.to_json
end