|
|
@@ -12,7 +12,6 @@ module Fotos
|
|
|
end
|
|
|
|
|
|
attr_reader :zip_file_path, :destination_path
|
|
|
- attr_accessor :extracted_paths, :copied_paths
|
|
|
|
|
|
def call
|
|
|
extract
|
|
|
@@ -30,7 +29,7 @@ module Fotos
|
|
|
file_name = entry.name.split('/').last
|
|
|
dest_path = File.join(tmp_dir_path, file_name)
|
|
|
#puts "extracting #{entry.name}"
|
|
|
- extracted_paths << dest_path
|
|
|
+ @extracted_paths << dest_path
|
|
|
entry.extract(dest_path)
|
|
|
rescue Zip::DestinationFileExistsError
|
|
|
next
|
|
|
@@ -40,7 +39,7 @@ module Fotos
|
|
|
|
|
|
def copy
|
|
|
date_format = '%d-%m-%Y'
|
|
|
- copied_paths = extracted_paths.map do |fp|
|
|
|
+ @copied_paths = @extracted_paths.map do |fp|
|
|
|
file_name = File.basename(fp)
|
|
|
puts "looking at #{file_name}"
|
|
|
exif = EXIFR::JPEG.new(fp)
|
|
|
@@ -61,7 +60,7 @@ module Fotos
|
|
|
end
|
|
|
|
|
|
def generate_thumbnails
|
|
|
- copied_paths.map do |fp|
|
|
|
+ @copied_paths.map do |fp|
|
|
|
Thumbnail.new(fp).create
|
|
|
end
|
|
|
end
|