Sha256: af33877164b50a9258bc01ebba635bc6b64df97b5debeb21bd6838651141a4a7

Contents?: true

Size: 568 Bytes

Versions: 8

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: true

module EacRailsBase0
  module AppVersionHelper
    def base0_app_version
      base0_app_version_by_environment_variable ||
        base0_app_version_by_version_file ||
        ::I18n.t('eac_rails_base0.app_version.unsetted')
    end

    def base0_app_version_by_environment_variable
      ENV['APP_VERSION'].to_s.strip.presence
    end

    def base0_app_version_by_version_file
      ::Rails.root.children.find { |file| file.basename.to_path.downcase == 'version' }
        .if_present { |file| file.read.presence }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
eac_rails_base0-0.69.0 app/helpers/eac_rails_base0/app_version_helper.rb
eac_rails_base0-0.68.7 app/helpers/eac_rails_base0/app_version_helper.rb
eac_rails_base0-0.68.6 app/helpers/eac_rails_base0/app_version_helper.rb
eac_rails_base0-0.68.5 app/helpers/eac_rails_base0/app_version_helper.rb
eac_rails_base0-0.68.4 app/helpers/eac_rails_base0/app_version_helper.rb
eac_rails_base0-0.68.3 app/helpers/eac_rails_base0/app_version_helper.rb
eac_rails_base0-0.68.2 app/helpers/eac_rails_base0/app_version_helper.rb
eac_rails_base0-0.68.1 app/helpers/eac_rails_base0/app_version_helper.rb