Class: Mantra::Commands::Transform
Instance Attribute Summary collapse
#options
Instance Method Summary
collapse
description, full_description, #initialize, option, option_descriptors, #parse_options, #run, usage
included
Instance Attribute Details
#manifest ⇒ Object
Returns the value of attribute manifest.
13
14
15
|
# File 'lib/mantra/commands/transform.rb', line 13
def manifest
@manifest
end
|
Instance Method Details
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/mantra/commands/transform.rb', line 32
def perform
transforms.each do |t|
t.run
end
unless transforms.last.nil?
puts transforms.last.result.to_ruby_object.to_yaml
else
puts {}.to_yaml
end
end
|
#result ⇒ Object
28
29
30
|
# File 'lib/mantra/commands/transform.rb', line 28
def result
@manifest ||= Manifest.new(self.manifest_path).root
end
|
15
16
17
|
# File 'lib/mantra/commands/transform.rb', line 15
def transform_config
@transform_config ||= YAML.load_file(transform_config_path)
end
|
19
20
21
22
23
24
25
26
|
# File 'lib/mantra/commands/transform.rb', line 19
def transforms
return @transforms unless @transforms.nil?
previous_transform = self
@transforms = transform_config["transforms"].map do |options|
options.merge!(previous_transform: previous_transform)
previous_transform = Mantra::Transform.create(options)
end
end
|