class Thor::Actions::Directory

:nodoc:

def execute!

def execute!
  lookup = config[:recursive] ? File.join(source, '**') : source
  lookup = File.join(lookup, '{*,.[a-z]*}')
  Dir[lookup].each do |file_source|
    next if File.directory?(file_source)
    file_destination = File.join(given_destination, file_source.gsub(source, '.'))
    case file_source
      when /\.empty_directory$/
        dirname = File.dirname(file_destination).gsub(/\/\.$/, '')
        next if dirname == given_destination
        base.empty_directory(dirname, config)
      when /\.tt$/
        base.template(file_source, file_destination[0..-4], config)
      else
        base.copy_file(file_source, file_destination, config)
    end
  end
end

def initialize(base, source, destination=nil, config={})

def initialize(base, source, destination=nil, config={})
  @source = File.expand_path(base.find_in_source_paths(source.to_s))
  super(base, destination, { :recursive => true }.merge(config))
end

def invoke!

def invoke!
  base.empty_directory given_destination, config
  execute!
end

def revoke!

def revoke!
  execute!
end