Created
May 4, 2010 15:18
-
-
Save weatheredwatcher/389538 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Basic Ruby script to create a new project for basic web development | |
# | |
# Author: David Duggins | |
# Email: [email protected] | |
# | |
# Created: 5/4/2010 | |
# License: GPL2 | |
# | |
require 'fileutils' | |
#OPTIONS | |
# Here you can define the directory structure that you want on the base level | |
dir_structure = ['stylesheets','javascript','images','db'] | |
# This makes sure that a variable has been passed | |
if ARGV.length == 0 | |
puts "Please enter the name of your Project" | |
exit 0 | |
end | |
# Sets the project name | |
project = ARGV[0] | |
FileUtils.mkdir_p project | |
puts "#{project}:CREATED" | |
FileUtils.cd project | |
# Runs through the array defined in options to create the Directory Structure. | |
dir_structure.each do |i| | |
FileUtils.mkdir_p i | |
puts "#{i}:CREATED" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a little bit of code I created to help me throw up some basic structure. I use TextMate for my coding and this is just a simple and expandable script that I can use to get a project started.