Module: Metanorma::Cli

Defined in:
lib/metanorma/cli.rb,
lib/metanorma/cli/version.rb

Constant Summary collapse

SUPPORTED_GEMS =
[
  "metanorma-iso",
  "metanorma-ietf",
  "metanorma-gb",
  "metanorma-csd",
  "metanorma-csand",
  "metanorma-m3d",
  "metanorma-rsd",
  "metanorma-acme",
  "metanorma-standoc",
  "metanorma-unece",
  "metanorma-mpfd",
  "metanorma-nist",
  "metanorma-ogc"
]
VERSION =
"1.1.6"

Class Method Summary collapse

Class Method Details

.load_all_flavorsObject


35
36
37
38
39
40
41
# File 'lib/metanorma/cli.rb', line 35

def self.load_all_flavors
  flavor_names = Gem::Specification.find_all do |g|
    g.name =~ /\Ametanorma-.*\Z/
  end.map(&:name)

  load_flavors(flavor_names)
end

.load_flavors(flavor_names = SUPPORTED_GEMS) ⇒ Object


23
24
25
26
27
28
29
30
31
32
33
# File 'lib/metanorma/cli.rb', line 23

def self.load_flavors(flavor_names = SUPPORTED_GEMS)
  # puts "[metanorma] detecting flavors:"
  flavor_names.each do |flavor|
    begin
      # puts flavor
      require flavor
    rescue LoadError
      $stderr.puts "[metanorma] Error: flavor gem #{flavor} not present"
    end
  end
end