Builds a new Directory
generator | The generator |
name | The name of this directory |
destination | Full path to the destination of this directory |
options | Options, including callbacks. |
# File lib/templater/actions/empty_directory.rb, line 12 12: def initialize(generator, name, destination, options={}) 13: self.generator = generator 14: self.name = name 15: self.destination = destination 16: self.options = options 17: 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 31: def exists? 32: ::File.exists?(destination) 33: 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 39: def identical? 40: exists? 41: end
Renders the template and copies it to the destination.
# File lib/templater/actions/empty_directory.rb, line 44 44: def invoke! 45: callback(:before) 46: ::FileUtils.mkdir_p(destination) 47: callback(:after) 48: end
Returns an empty String: there’s nothing to read from.
String | The source file. |
# File lib/templater/actions/empty_directory.rb, line 23 23: def render 24: '' 25: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.