Class: LatexFlow::CLI::Archives

Inherits:
Generic
  • Object
show all
Defined in:
lib/latex-flow/cli/archives.rb

Instance Method Summary collapse

Methods inherited from Generic

#initialize

Constructor Details

This class inherits a constructor from LatexFlow::CLI::Generic

Instance Method Details

#runObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/latex-flow/cli/archives.rb', line 6

def run
  Dir.glob(File.join('archives', '*.zip')).map{ |archive|
    basename = File.basename(archive)
    time = basename.scan(/\A.+\-(\d+)\..+\Z/).first.first.to_i
    [time, archive]
  }.sort_by{ |time, archive|
    time
  }.each do |time, archive|
    puts "#{Time.at(time.to_i)}\t#{archive}"
  end
end