Last active
August 29, 2015 14:14
-
-
Save sohamkamani/8b72bda2ef3c4ec6fdd8 to your computer and use it in GitHub Desktop.
Shell script to create a new ruby project structure
This file contains 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
echo "Enter the project name" | |
read -e NAME | |
echo "Enter name of dummy directory" | |
read -e DUMMY | |
mkdir $NAME | |
cd $NAME | |
mkdir lib | |
cd lib | |
mkdir $DUMMY | |
touch $DUMMY.rb | |
cd .. | |
mkdir spec | |
cd spec | |
touch spec_helper.rb | |
echo "require 'simplecov'" >> spec_helper.rb | |
echo "SimpleCov.start do" >> spec_helper.rb | |
echo "end" >> spec_helper.rb | |
echo "require '$DUMMY'" >> spec_helper.rb | |
mkdir $DUMMY | |
cd .. | |
touch Rakefile | |
touch Gemfile | |
echo "require 'rspec/core/rake_task'" >> Rakefile | |
echo " " >> Rakefile | |
echo "RSpec::Core::RakeTask.new(:spec)" >> Rakefile | |
echo "task :default => :spec" >> Rakefile | |
echo 'source "http://rubygems.org"' >> Gemfile | |
echo "" >> Gemfile | |
echo "gem 'rake'" >> Gemfile | |
echo "gem 'rspec'" >> Gemfile | |
echo "gem 'simplecov'" >> Gemfile | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment