Class: Downloads::Commands::Status

Inherits:
Base
  • Object
show all
Defined in:
lib/downloads/commands/status.rb

Instance Attribute Summary

Attributes inherited from Base

#configuration, #local, #options, #remote

Instance Method Summary collapse

Methods inherited from Base

command_name, #configure, inherited, #initialize, usage, #usage, #valid?

Constructor Details

This class inherits a constructor from Downloads::Commands::Base

Instance Method Details

#runObject



4
5
6
7
8
9
# File 'lib/downloads/commands/status.rb', line 4

def run
  longest_filename = remote.filenames.max { |a, b| a.length <=> b.length }
  remote.files.each do |file|
    puts "%-#{longest_filename.length}s\t%3s%%\t%5s" % [file[:name], status(file), human_readable(file[:size])]
  end
end