Skip to content

Instantly share code, notes, and snippets.

@weatheredwatcher
Created May 4, 2010 15:18
Show Gist options
  • Save weatheredwatcher/389538 to your computer and use it in GitHub Desktop.
Save weatheredwatcher/389538 to your computer and use it in GitHub Desktop.
#
# Basic Ruby script to create a new project for basic web development
#
# Author: David Duggins
# Email: weatheredwatcher@gmail.com
#
# 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
@weatheredwatcher
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment