Module: Metanorma
- Defined in:
- lib/metanorma/standoc.rb,
lib/metanorma/standoc/ref.rb,
lib/metanorma/standoc/base.rb,
lib/metanorma/standoc/init.rb,
lib/metanorma/standoc/reqt.rb,
lib/metanorma/standoc/front.rb,
lib/metanorma/standoc/lists.rb,
lib/metanorma/standoc/table.rb,
lib/metanorma/standoc/terms.rb,
lib/metanorma/standoc/utils.rb,
lib/metanorma/standoc/anchor.rb,
lib/metanorma/standoc/blocks.rb,
lib/metanorma/standoc/inline.rb,
lib/metanorma/standoc/macros.rb,
lib/metanorma/standoc/render.rb,
lib/metanorma/standoc/cleanup.rb,
lib/metanorma/standoc/section.rb,
lib/metanorma/standoc/version.rb,
lib/metanorma/standoc/localbib.rb,
lib/metanorma/standoc/ref_sect.rb,
lib/metanorma/standoc/validate.rb,
lib/metanorma/standoc/converter.rb,
lib/metanorma/standoc/processor.rb,
lib/metanorma/standoc/ref_queue.rb,
lib/metanorma/standoc/cleanup_ref.rb,
lib/metanorma/standoc/cleanup_toc.rb,
lib/metanorma/standoc/macros_form.rb,
lib/metanorma/standoc/macros_link.rb,
lib/metanorma/standoc/macros_note.rb,
lib/metanorma/standoc/ref_utility.rb,
lib/metanorma/standoc/blocks_image.rb,
lib/metanorma/standoc/blocks_notes.rb,
lib/metanorma/standoc/cleanup_reqt.rb,
lib/metanorma/standoc/cleanup_text.rb,
lib/metanorma/standoc/cleanup_xref.rb,
lib/metanorma/standoc/macros_embed.rb,
lib/metanorma/standoc/macros_terms.rb,
lib/metanorma/standoc/cleanup_amend.rb,
lib/metanorma/standoc/cleanup_block.rb,
lib/metanorma/standoc/cleanup_image.rb,
lib/metanorma/standoc/cleanup_maths.rb,
lib/metanorma/standoc/cleanup_table.rb,
lib/metanorma/standoc/cleanup_terms.rb,
lib/metanorma/standoc/macros_inline.rb,
lib/metanorma/standoc/validate_term.rb,
lib/metanorma/standoc/cleanup_inline.rb,
lib/metanorma/standoc/merge_bibitems.rb,
lib/metanorma/standoc/validate_table.rb,
lib/metanorma/standoc/cleanup_bibdata.rb,
lib/metanorma/standoc/cleanup_bibitem.rb,
lib/metanorma/standoc/cleanup_section.rb,
lib/metanorma/standoc/cleanup_symbols.rb,
lib/metanorma/standoc/macros_plantuml.rb,
lib/metanorma/standoc/cleanup_asciibib.rb,
lib/metanorma/standoc/spans_to_bibitem.rb,
lib/metanorma/standoc/validate_section.rb,
lib/metanorma/standoc/cleanup_footnotes.rb,
lib/metanorma/standoc/front_contributor.rb,
lib/metanorma/standoc/cleanup_dochistory.rb,
lib/metanorma/standoc/front_organisation.rb,
lib/metanorma/standoc/cleanup_boilerplate.rb,
lib/metanorma/standoc/cleanup_mathvariant.rb,
lib/metanorma/standoc/term_lookup_cleanup.rb,
lib/metanorma/standoc/cleanup_section_names.rb,
lib/metanorma/standoc/cleanup_terms_boilerplate.rb,
lib/metanorma/standoc/cleanup_terms_designations.rb,
lib/metanorma/standoc/datamodel/plantuml_renderer.rb,
lib/metanorma/standoc/datamodel/diagram_preprocessor.rb,
lib/metanorma/standoc/spans_to_bibitem_preprocessing.rb,
lib/metanorma/standoc/datamodel/attributes_table_preprocessor.rb
Defined Under Namespace
Modules: Datamodel, Standoc
Class Method Summary
collapse
Class Method Details
.all_modules(mod) ⇒ Object
9
10
11
12
13
|
# File 'lib/metanorma/standoc/version.rb', line 9
def all_modules(mod)
[mod] + mod.constants.map { |c| mod.const_get(c) }
.select { |c| c.is_a?(Module) && parent_of(c) == mod }
.flat_map { |m| all_modules(m) }
end
|
.parent_of(mod) ⇒ Object
4
5
6
7
|
# File 'lib/metanorma/standoc/version.rb', line 4
def parent_of(mod)
parent_name = mod.name =~ /::[^:]+\Z/ ? $`.freeze : nil
Object.const_get(parent_name) if parent_name
end
|
.versioned(mod, flavour) ⇒ Object
15
16
17
18
|
# File 'lib/metanorma/standoc/version.rb', line 15
def versioned(mod, flavour)
all_modules(mod).select { |c| defined? c::VERSION }
.select { |c| c.name =~ /::#{flavour}$/ }
end
|