Created
March 9, 2013 11:22
-
-
Save johndel/5123892 to your computer and use it in GitHub Desktop.
Check if a project is a rails project.
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
def check_if_rails_project | |
abort = 0 | |
unless File.exists?("Gemfile") | |
say "Missing Gemfile! Is this a rails project? If yes, something went really wrong, create your Gemfile and retry", :red | |
abort = 1 | |
end | |
unless File.exists?(Rails.root.join("config/routes.rb")) | |
say "Missing routes.rb! Is this a rails project? If yes, something went really wrong, create your routes.rb and retry", :red | |
abort = 1 | |
end | |
abort("Exit...") if abort == 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment