Reputation: 652
When a Rails template is used: rails new todo -m ~/template.rb
, how can I get the real template path from inside it?
Dir.pwd
does not work because when the template is used, its commands are run under the new app scope, so the result is the new application path not the template's path itself.
Upvotes: 0
Views: 242
Reputation: 7627
To get the directory of the currently running file:
File.dirname(__FILE__)
Upvotes: 1