Class: TrelloFs::RepositoryCleaner

Inherits:
Object
  • Object
show all
Defined in:
lib/trello-fs/repository_cleaner.rb

Instance Method Summary collapse

Constructor Details

#initialize(repository) ⇒ RepositoryCleaner

Returns a new instance of RepositoryCleaner.



5
6
7
# File 'lib/trello-fs/repository_cleaner.rb', line 5

def initialize(repository)
  @repository = repository
end

Instance Method Details

#cleanObject



9
10
11
12
13
14
15
16
# File 'lib/trello-fs/repository_cleaner.rb', line 9

def clean
  Dir.entries(@repository.path).each do |path|
    next if path.start_with? '.'
    next if path == 'Attachments'

    FileUtils.rm_rf File.join(@repository.path, path)
  end
end