Class: Defmastership::Modifier::UpdateDefVersion
- Defined in:
- lib/defmastership/modifier/update_def_version.rb
Overview
modify one line after another
Defined Under Namespace
Modules: Helper
Instance Attribute Summary
Attributes inherited from UpdateDef
Attributes included from ModifierCommon
Class Method Summary collapse
-
.default_config ⇒ Hash{Symbol => Object}
The default configuration.
Instance Method Summary collapse
-
#do_modifications(adoc_sources) ⇒ Object
Apply the modifier on all provided asciidoc sources based on modifier’s
self.replacement_methods
list. -
#initialize(config) ⇒ UpdateDefVersion
constructor
A new instance of UpdateDefVersion.
Methods inherited from UpdateDef
reference_regexp, #replace_reference, replacement_methods
Methods included from ModifierCommon
#method_missing, #respond_to_missing?, #setup_modifier_module
Constructor Details
#initialize(config) ⇒ UpdateDefVersion
Returns a new instance of UpdateDefVersion.
24 25 26 27 28 29 30 |
# File 'lib/defmastership/modifier/update_def_version.rb', line 24 def initialize(config) @ref_document = Document.new Helper.normalilize_config!(config) if config.key?(:ref_document) super end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Defmastership::Modifier::ModifierCommon
Class Method Details
.default_config ⇒ Hash{Symbol => Object}
Returns the default configuration.
13 14 15 16 17 18 19 20 21 |
# File 'lib/defmastership/modifier/update_def_version.rb', line 13 def self.default_config { def_type: '', ref_document: [], ref_tag: '', ref_repo: '.', first_version: '' } end |
Instance Method Details
#do_modifications(adoc_sources) ⇒ Object
Apply the modifier on all provided asciidoc sources based on modifier’s self.replacement_methods
list
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/defmastership/modifier/update_def_version.rb', line 38 def do_modifications(adoc_sources) if ref_tag == '' ref_document.each { |ref_doc| @ref_document.parse_file_with_preprocessor(ref_doc) } else Dir.mktmpdir('defmastership') do |tmpdir| parse_ref_files_from_git(adoc_sources, tmpdir) end end super end |