Class: TrelloFs::RepositoryCleaner
- Inherits:
-
Object
- Object
- TrelloFs::RepositoryCleaner
- Defined in:
- lib/trello-fs/repository_cleaner.rb
Instance Method Summary collapse
- #clean ⇒ Object
-
#initialize(repository) ⇒ RepositoryCleaner
constructor
A new instance of RepositoryCleaner.
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
#clean ⇒ Object
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 |