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",
  "metanorma-plateau",
].freeze
PRIVATE_SUPPORTED_GEMS =
[
  "metanorma-ribose",
  # "metanorma-mpfa",
  "metanorma-nist",
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.activateObject



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

def self.activate
  new.activate
end

.load_flavorsObject



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

def self.load_flavors
  new.load_flavors
end

Instance Method Details

#activateObject



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

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



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

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