Class: Roopap::Organizer

Inherits:
Object
  • Object
show all
Defined in:
lib/roopap/organizer.rb

Instance Method Summary collapse

Constructor Details

#initializeOrganizer

Returns a new instance of Organizer.



8
9
10
# File 'lib/roopap/organizer.rb', line 8

def initialize
  @count = 0
end

Instance Method Details

#organized_file_countObject



22
23
24
# File 'lib/roopap/organizer.rb', line 22

def organized_file_count
  @count
end

#perform(source, dest) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/roopap/organizer.rb', line 12

def perform(source, dest)
  Pathname.new(source).each_child do |c|
    src_file_path =  c.to_s
    next unless jpg_file?(src_file_path)
    target_path = dest_for(src_file_path, dest)
    copy(src_file_path, target_path)
    inc_success_number
  end
end