Skip to content

Commit

Permalink
clean action and clean option to create
Browse files Browse the repository at this point in the history
  • Loading branch information
lachie committed Apr 8, 2011
1 parent ccfabd8 commit 3ba3c75
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions targets/dir.rb
@@ -1,4 +1,5 @@
require 'common_mob'
require 'fileutils'

class DirTarget < AngryMob::Target
nickname 'dir'
Expand All @@ -12,12 +13,20 @@ def create
rescue Errno::EEXIST
# *ulp*
end

clean if args.clean?
end

def delete
FileUtils.rm_rf(default_object) if exist?
end

def clean
Pathname.glob(default_object + '*').each {|path|
FileUtils.rm_rf(path)
}
end

protected

def state
Expand Down

0 comments on commit 3ba3c75

Please sign in to comment.