Module: ForemanOpenscapHelper

Defined in:
app/helpers/foreman_openscap_helper.rb

Instance Method Summary collapse

Instance Method Details



4
5
6
7
8
9
10
# File 'app/helpers/foreman_openscap_helper.rb', line 4

def scap_doc_link(section = '', text = _('documentation'))
  link_to(
    text,
    scap_doc_url(section),
    :rel => 'external noopener noreferrer', :target => '_blank'
  )
end

#scap_doc_url(section = '') ⇒ Object



12
13
14
15
16
# File 'app/helpers/foreman_openscap_helper.rb', line 12

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

  documentation_url(section, root_url: scap_root_url)
end

#scap_root_urlObject



18
19
20
21
22
23
# File 'app/helpers/foreman_openscap_helper.rb', line 18

def scap_root_url
  @scap_root_url ||= begin
    version = ForemanOpenscap::VERSION.split('.')[0..-2].join('.')
    "https://theforeman.org/plugins/foreman_openscap/#{version}/index.html"
  end
end