Class: Holistics::Transforms
Class Method Summary
collapse
Instance Method Summary
collapse
banner, subcommand_prefix
Constructor Details
#initialize(*args) ⇒ Transforms
Returns a new instance of Transforms.
Class Method Details
.help(*args) ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/holistics/transforms.rb', line 7
def self.help(*args)
super
puts <<-INSTRUCTION
Examples:
holistics transforms list # List all data transformations
INSTRUCTION
end
|
Instance Method Details
#execute(id) ⇒ Object
37
38
39
40
41
42
|
# File 'lib/holistics/transforms.rb', line 37
def execute(id)
puts "`transforms execute #{id}` called with options: #{options}" if Holistics.debug?
result = @this.execute(id)
puts 'Job ID: ' + result['job_id'].to_s.yellow + " Submit: " + Holistics::Utils.colorize(result['status'])
invoke 'holistics:jobs:logs', [result['job_id']], { follow: true }
end
|
#info(id) ⇒ Object
31
32
33
34
|
# File 'lib/holistics/transforms.rb', line 31
def info(id)
puts "`transform info #{id}` called with options: #{options}" if Holistics.debug?
tp(@this.find(id))
end
|
#list(ds_id = nil) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/holistics/transforms.rb', line 17
def list(ds_id = nil)
puts "`transforms list` called with options: #{options}" if Holistics.debug?
tp(
@this.all.map do |item|
item.slice(*%w{id title owner_name}).merge({
mode: item['settings']['mode'],
created_at: item['created_at'] ? DateTime.parse(item['created_at']).to_formatted_s(:short) : nil,
last_run: item['last_run'] ? DateTime.parse(item['last_run']).to_formatted_s(:short) : nil
})
end
)
end
|