Sha256: 888795dee35b22f0ba53d951558ef697d5b36956b65ff7c11bc9c0ce3d7cdc4d

Contents?: true

Size: 549 Bytes

Versions: 2

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

module BootstrapViewsGenerator
  module Helpers
    # Return a cleaned up version of the name of the application being generated
    # @return [String]
    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bootstrap_views_generator-0.1.16 lib/bootstrap_views_generator/helpers.rb
bootstrap_views_generator-0.1.15 lib/bootstrap_views_generator/helpers.rb