Class: Metanorma::Flavor

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

Constant Summary collapse

SUPPORTED_GEMS =
[
  "metanorma-iso",
  "metanorma-iec",
  "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



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

def self.activate
  new.activate
end

.load_flavorsObject



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

def self.load_flavors
  new.load_flavors
end

Instance Method Details

#activateObject



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

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

#load_flavorsObject



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

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