Module: BackupOrganizer

Defined in:
lib/backup_organizer.rb,
lib/backup_organizer/rule.rb,
lib/backup_organizer/setup.rb,
lib/backup_organizer/pattern.rb,
lib/backup_organizer/version.rb,
lib/backup_organizer/file_age.rb,
lib/backup_organizer/file_mover.rb,
lib/backup_organizer/file_utils.rb,
lib/backup_organizer/configuration.rb,
lib/backup_organizer/error/base_error.rb,
lib/backup_organizer/error/setup_error.rb,
lib/backup_organizer/error/invalid_path_error.rb,
lib/backup_organizer/error/configuration_error.rb,
lib/backup_organizer/extensions/file_extensions.rb,
lib/backup_organizer/error/error_with_custom_message.rb

Defined Under Namespace

Modules: Error, Extensions Classes: BasicObject, Configuration, FileAge, FileMover, FileUtils, Pattern, Rule, Setup

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.organize(path) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/backup_organizer.rb', line 14

def self.organize(path)
  pattern = Pattern.new do |files|
    yield files
  end
  configuration = Configuration.new(:path => path, :pattern => pattern)
  Setup.create_structure(configuration)
  configuration.move_all_files
end