Sha256: a32698ad522d1d3edcc750c759abfd857bdd2f91d10efef26c8b8e166cfa0d64

Contents?: true

Size: 670 Bytes

Versions: 8

Compression:

Stored size: 670 Bytes

Contents

require 'foreman_openscap/version'

module ForemanOpenscapHelper
  def scap_doc_button(section)
    documentation_button(section, root_url: scap_doc_url)
  end

  def scap_doc_url(section = '')
    return scap_root_url if section.empty?

    documentation_url(section, root_url: scap_root_url)
  end

  private

  def doc_flavor
    ForemanOpenscap.with_katello? ? 'katello' : 'foreman-el'
  end

  def scap_root_url
    @scap_root_url ||= begin
      version = SETTINGS[:version]
      version = version.tag == 'develop' ? 'nightly' : version.short
      "https://docs.theforeman.org/#{version}/Managing_Security_Compliance/index-#{doc_flavor}.html#"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman_openscap-9.0.4 app/helpers/foreman_openscap_helper.rb
foreman_openscap-9.0.3 app/helpers/foreman_openscap_helper.rb
foreman_openscap-9.0.2 app/helpers/foreman_openscap_helper.rb
foreman_openscap-9.0.1 app/helpers/foreman_openscap_helper.rb
foreman_openscap-9.0.0 app/helpers/foreman_openscap_helper.rb
foreman_openscap-8.0.0 app/helpers/foreman_openscap_helper.rb
foreman_openscap-7.1.1 app/helpers/foreman_openscap_helper.rb
foreman_openscap-7.1.0 app/helpers/foreman_openscap_helper.rb