Get the name of the Rails3 application in the template that creates the rails application?

I have a template that creates a rails application. The problem is that in my template script I am replacing some files, such as environment.rb, which must know the name of the rails application to run things like AppName::Application.initialize!. I could get the application name from the command line arguments, but this is not always possible, since the user can do this: rails new ./and the application name will be the name of the current dir, but I would not get anything from the argument list.

So, I would like to know a specific way to get the name of a Rails application in a template script.

+3
source share

Source: https://habr.com/ru/post/1753158/


All Articles