Class: Lister

Inherits:
Object
  • Object
show all
Defined in:
lib/bvwack/lister.rb

Instance Method Summary collapse

Constructor Details

#initialize(to_clean_list, converted_files_list, not_converted_list) ⇒ Lister

Returns a new instance of Lister.



2
3
4
5
6
# File 'lib/bvwack/lister.rb', line 2

def initialize(to_clean_list, converted_files_list, not_converted_list)
  @to_clean_list            = to_clean_list
  @converted_files_list     = converted_files_list
  @not_converted_list = not_converted_list
end

Instance Method Details

#list_convertedObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/bvwack/lister.rb', line 8

def list_converted
  begin
    while @to_clean_list
      key                = @to_clean_list.pop
      converted_filename = @converted_files_list[key]
      old_filename       = @not_converted_list[key]
      dirname            = File.dirname(@not_converted_list[key])
      puts "\nConverted file:\n"
      puts %Q{In Directory "#{dirname}"}
      p `ls -lh "#{converted_filename}"`
      p `ls -lh "#{old_filename}"`
      puts %Q{To test run:  open "#{converted_filename}"}
      puts "\n"
    end
  rescue
    puts("\nNothing to list")
  end
end