Class Webby::Apps::Generator
In: lib/webby/apps/generator.rb
Parent: Object

webby gen template site => creates the tmplate webby gen -h / —help webby gen => same as —help

Methods

abort   cp   create_site   force_file_collision?   gets   identical?   mkdir   new   parse   pretend?   print   puts   run   run   site_files   templates  

Attributes

options  [R] 
site  [RW] 
template  [RW] 

Public Class methods

Initialize a new generator object.

Create a new Generator instance and run the webby application given the command line args.

Public Instance methods

Prints an abort message to the screen and then exits the Ruby interpreter. A non-zero return code is used to indicate an error.

Copy a file from the template location to the user specified site location. A message will be displayed to the screen indicating tha the file is being created.

Create the site from the template specified by the user.

Ask the user what to do about the file collision.

Reads a line text frim the input source.

Returns true if the source file is identical to the destination file. Returns false if this is not the case.

Make a directory in the user specified site location. A message will be displayed to the screen indicating tha the directory is being created.

Parse out the command line options found in the args array.

Returns true if we are only going to pretend to do something. All the output messages will be written, but no changes will be made on the disc.

Writes the given objects to the output destination.

Writes the given objects to the output destination. Each object is followed by a newline unless the object is a string with a newline already at the end.

Run the generator executing the commands specified by the user on the command line.

Iterates over all the files in the template directory and stores them in a hash.

Returns an array of available site templates.

[Validate]