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-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



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

def self.activate
  new.activate
end

.load_flavorsObject



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

def self.load_flavors
  new.load_flavors
end

Instance Method Details

#activateObject



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

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



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

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