Module: BootstrapViewsGenerator::Helpers

Included in:
Bootstrap::Generators::DeviseGenerator, Bootstrap::Generators::InstallGenerator
Defined in:
lib/bootstrap_views_generator/helpers.rb

Instance Method Summary collapse

Instance Method Details

#app_nameString

Return a cleaned up version of the name of the application being generated

Returns:

  • (String)


7
8
9
10
11
12
13
14
# File 'lib/bootstrap_views_generator/helpers.rb', line 7

def app_name
  # Avoid deprecation errors when pulling the application name when using Rails > 6.0
  @app_name ||= if Rails.version.to_f >= 6.0
                  Rails.app_class.module_parent_name.demodulize.titleize
                else
                  Rails.application.class.parent.to_s.titleize
                end
end