Class: PhotoHelper::Screensaver

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/photo-helper/screensaver.rb

Instance Method Summary collapse

Instance Method Details

#moveObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/photo-helper/screensaver.rb', line 10

def move
  files = Dir["#{BEST_OF_ROOT}/**/*"]

  files.each do |file|
    next unless FileHelper.is_jpeg?(file)
    dest = File.join(SCREENSAVER_ROOT, File.basename(file))
    next if File.exist?(dest)
    puts file
    FileUtils.copy(file, dest)
  end

  puts 'Compressing'

  compress = PhotoHelper::Compress.new
  compress.options = { overwrite: true }
  compress.images(SCREENSAVER_ROOT)
end