Class: Templater::Actions::Directory

Inherits:
File
  • Object
show all
Defined in:
lib/merb-gen/templater.rb

Instance Method Summary collapse

Methods inherited from File

#invoke!, #revoke!

Instance Method Details

#identical?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/merb-gen/templater.rb', line 4

def identical?
  sanity = ::File.directory?(destination) && exists?
  if sanity
    src  = Dir[::File.join(source, "**", "*")]
    src.map! {|f| f.gsub(/#{source}/, "")}
    dest = Dir[::File.join(destination, "**", "*")]
    dest.map!   {|f| f.gsub(/#{destination}/, "")}
    src == dest
  else
    false
  end
end