Class: Suma::Processor
- Inherits:
-
Object
- Object
- Suma::Processor
- Defined in:
- lib/suma/processor.rb
Instance Attribute Summary collapse
-
#compile_flag ⇒ Object
readonly
Returns the value of attribute compile_flag.
-
#metanorma_yaml_path ⇒ Object
readonly
Returns the value of attribute metanorma_yaml_path.
-
#output_directory ⇒ Object
readonly
Returns the value of attribute output_directory.
-
#schemas_all_path ⇒ Object
readonly
Returns the value of attribute schemas_all_path.
Instance Method Summary collapse
-
#initialize(metanorma_yaml_path:, schemas_all_path:, compile: true, output_directory: "_site") ⇒ Processor
constructor
A new instance of Processor.
- #run ⇒ Object
Constructor Details
#initialize(metanorma_yaml_path:, schemas_all_path:, compile: true, output_directory: "_site") ⇒ Processor
Returns a new instance of Processor.
14 15 16 17 18 19 20 |
# File 'lib/suma/processor.rb', line 14 def initialize(metanorma_yaml_path:, schemas_all_path:, compile: true, output_directory: "_site") @metanorma_yaml_path = @schemas_all_path = schemas_all_path @compile_flag = compile @output_directory = output_directory end |
Instance Attribute Details
#compile_flag ⇒ Object (readonly)
Returns the value of attribute compile_flag.
11 12 13 |
# File 'lib/suma/processor.rb', line 11 def compile_flag @compile_flag end |
#metanorma_yaml_path ⇒ Object (readonly)
Returns the value of attribute metanorma_yaml_path.
11 12 13 |
# File 'lib/suma/processor.rb', line 11 def @metanorma_yaml_path end |
#output_directory ⇒ Object (readonly)
Returns the value of attribute output_directory.
11 12 13 |
# File 'lib/suma/processor.rb', line 11 def output_directory @output_directory end |
#schemas_all_path ⇒ Object (readonly)
Returns the value of attribute schemas_all_path.
11 12 13 |
# File 'lib/suma/processor.rb', line 11 def schemas_all_path @schemas_all_path end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/suma/processor.rb', line 22 def run Utils.log "Current directory: #{Dir.getwd}, writing #{schemas_all_path}..." collection_config = export_schema_config return nil unless @compile_flag Utils.log "Compiling schema collection..." compile_schema(schemas_all_path, collection_config) Utils.log "Compiling complete collection..." compile_collection(collection_config, output_directory) end |