Class: IsoDoc::Acme::Metadata

Inherits:
Metadata
  • Object
show all
Defined in:
lib/isodoc/acme/metadata.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lang, script, labels) ⇒ Metadata

Returns a new instance of Metadata.



7
8
9
10
11
12
# File 'lib/isodoc/acme/metadata.rb', line 7

def initialize(lang, script, labels)
  super
  here = File.dirname(__FILE__)
  default_logo_path = File.expand_path(File.join(here, "html", "logo.jpg"))
  set(:logo, baselocation(configuration.logo_path) || default_logo_path)
end

Class Attribute Details

._fileObject

Returns the value of attribute _file.



15
16
17
# File 'lib/isodoc/acme/metadata.rb', line 15

def _file
  @_file
end

Class Method Details

.inherited(k) ⇒ Object



18
19
20
# File 'lib/isodoc/acme/metadata.rb', line 18

def self.inherited( k )
  k._file = caller_locations.first.absolute_path
end

Instance Method Details

#author(isoxml, _out) ⇒ Object



31
32
33
34
35
# File 'lib/isodoc/acme/metadata.rb', line 31

def author(isoxml, _out)
  super
  tc = isoxml.at(ns("//bibdata/ext/editorialgroup/committee"))
  set(:tc, tc.text) if tc
end

#baselocation(loc) ⇒ Object



22
23
24
25
# File 'lib/isodoc/acme/metadata.rb', line 22

def baselocation(loc)
  return nil if loc.nil?
  File.expand_path(File.join(File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
end

#configurationObject



27
28
29
# File 'lib/isodoc/acme/metadata.rb', line 27

def configuration
  Metanorma::Acme.configuration
end

#stage_abbr(status) ⇒ Object



37
38
39
40
# File 'lib/isodoc/acme/metadata.rb', line 37

def stage_abbr(status)
  return super unless configuration.stage_abbreviations
  Hash(configuration.stage_abbreviations).dig(status)
end

#unpublished(status) ⇒ Object



42
43
44
45
# File 'lib/isodoc/acme/metadata.rb', line 42

def unpublished(status)
  stages = configuration&.published_stages || ["published"]
  !(Array(stages).map { |m| m.downcase }.include? status.downcase)
end