Class: Metanorma::Flavor

Inherits:
Object
  • Object
show all
Defined in:
lib/metanorma/flavor.rb

Constant Summary collapse

SUPPORTED_GEMS =
[
  "metanorma-iso",
  "metanorma-iec",
  "metanorma-ieee",
  "metanorma-ietf",
  "metanorma-bipm",
  "metanorma-cc",
  "metanorma-csa",
  "metanorma-iho",
  "metanorma-jis",
  # "metanorma-m3aawg", 
  "metanorma-generic",
  "metanorma-standoc",
  "metanorma-un",
  "metanorma-ogc",
  "metanorma-itu",
].freeze
PRIVATE_SUPPORTED_GEMS =
[
  "metanorma-ribose",
  # "metanorma-mpfa",
  "metanorma-nist",
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.activateObject



31
32
33
# File 'lib/metanorma/flavor.rb', line 31

def self.activate
  new.activate
end

.load_flavorsObject



35
36
37
# File 'lib/metanorma/flavor.rb', line 35

def self.load_flavors
  new.load_flavors
end

Instance Method Details

#activateObject



39
40
41
42
43
44
45
# File 'lib/metanorma/flavor.rb', line 39

def activate
  flavors.each do |flavor_name|
    gem(flavor_name)
  rescue LoadError, MissingSpecError => _e
    Metanorma::Cli::UI.debug("#{flavor_name} is not present!")
  end
end

#load_flavorsObject



47
48
49
50
51
52
53
# File 'lib/metanorma/flavor.rb', line 47

def load_flavors
  flavors.each do |flavor_name|
    require(flavor_name)
  rescue LoadError => _e
    gem_loading_error(flavor_name)
  end
end