Is there an easy way to test if the current directory is inside a rails project? Clearly Rails itself tests this in order to use the rails subcommands (generate, scaffold, etc.), so presumably there’s a straight-forward way to test this.
I’m looking for something similar to how you would test if you’re inside a Git repo.
Upon further investigation, I was able to dig into the
railscommand itself and based a solution on part of therailtiesgem (<railties>/lib/rails/script_rails_loader.rb):