Skip to content

Instantly share code, notes, and snippets.

@julsfelic
Last active January 2, 2016 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save julsfelic/abdd92f98610b25d937b to your computer and use it in GitHub Desktop.
Save julsfelic/abdd92f98610b25d937b to your computer and use it in GitHub Desktop.
Bash Function to Quickly Create Ruby Project Structure
# Copy this function into your .bash_profile found at ~/.bash_profile
# You can rename the function to your preference
function new_ruby_project {
mkdir $1;
cd $1;
mkdir lib/;
touch lib/"$1".rb;
mkdir test/;
touch test/test_helper.rb;
echo "require 'minitest'" >> test/test_helper.rb;
touch test/"$1"_test.rb
echo "require 'test_helper'" >> test/"$1"_test.rb;
}
# You use the bash script as follows
$ new_ruby_project cat
# This creates the following directory structure
.
├── lib
│   └── cat.rb
└── test
├── cat_test.rb
└── test_helper.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment