Class: Zencoder::CLI::Command::Output

Inherits:
Base
  • Object
show all
Defined in:
lib/zencoder-cli/commands/outputs.rb

Class Method Summary collapse

Methods inherited from Base

extract_id, provides

Methods included from Helpers

#ask, #confirm, #display, #error, #format_date, #home_directory, #running_on_a_mac?, #running_on_windows?, #truncate

Class Method Details

.progress(args, global_options, command_options) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/zencoder-cli/commands/outputs.rb', line 8

def progress(args, global_options, command_options)
  output = Zencoder::Output.progress(args.shift, :base_url => Zencoder.base_url(global_options[:environment])).process_for_cli.body
  rows = []
  rows << ["State", output["state"].titleize]
  if output["state"] == "processing"
    rows << ["Event", output["current_event"].titleize]
    rows << ["Progress", output["progress"]]
  elsif output["state"] == "finished"
    rows << ["Progress", "100%"]
  end
  puts table([{ :value => "Output", :colspan => 2 }], *rows)
end