A blog about software by Alexander Yaäkov Garber.

Ruby Project Skeleton Generator on Gist!

Exercise 46 of Learn Ruby the Hard Way gives instructions for manually creating a project skeleton.  So I decided to do what I have done many times before in BASH and Python, and automate this task with a pretty Ruby script.

A few thoughts:
  1. Ruby's handling of files and folders is delightfully straightforward.
  2. Ruby handles strings elegantly.
  3. This was originally written as a straight script, but then I refactored it with object-oriented programming in mind:
    1. One Class (Project)
    2. The main components of the class broken down into methods.
    3. Names of folders and files are stored in an array and a hash.
    4. Blocks of text are stored using Squiggly HEREDOC