Builds a new Directory
generator<Object> |
The generator |
name<Symbol> |
The name of this directory |
destination<String> |
Full path to the destination of this directory |
options<Hash{Symbol=>Symbol} |
Options, including callbacks. |
# File lib/templater/actions/empty_directory.rb, line 12 def initialize(generator, name, destination, options={}) self.generator = generator self.name = name self.destination = destination self.options = options end
Checks if the destination file already exists.
Boolean |
true if the file exists, false otherwise. |
# File lib/templater/actions/empty_directory.rb, line 31 def exists? ::File.exists?(destination) end
For empty directory this is in fact alias for exists? method.
Boolean |
true if it is identical, false otherwise. |
# File lib/templater/actions/empty_directory.rb, line 39 def identical? exists? end
Renders the template and copies it to the destination.
# File lib/templater/actions/empty_directory.rb, line 44 def invoke! callback(:before) ::FileUtils.mkdir_p(destination) callback(:after) end
Generated with the Darkfish Rdoc Generator 2.