Class: Mxrb::Exporter
- Inherits:
-
Object
- Object
- Mxrb::Exporter
- Defined in:
- lib/mxrb/exporter.rb
Overview
Exports an MPR into an editable, layered Ruby source tree.
Constant Summary collapse
- LAYERS =
%w[domain application presentation infrastructure].freeze
- MARKETPLACE_PROVENANCE =
[ ".mxrb/marketplace.lock.json", ".mxrb/marketplace", ".mxrb/marketplace-originals" ].freeze
- EDITABLE_FLOW_OBJECT_TYPES =
%w[ Microflows$StartEvent Microflows$EndEvent Microflows$ActionActivity Microflows$ExclusiveSplit Microflows$InheritanceSplit Microflows$ExclusiveMerge Microflows$LoopedActivity Microflows$ErrorEvent Microflows$ContinueEvent Microflows$Annotation Microflows$MicroflowParameter ].freeze
- EDITABLE_ACTION_TYPES =
%w[ Microflows$CreateObjectAction Microflows$CreateChangeAction Microflows$ChangeObjectAction Microflows$ChangeAction Microflows$RetrieveAction Microflows$CommitObjectsAction Microflows$CommitAction Microflows$DeleteAction Microflows$MicroflowCallAction Microflows$CreateVariableAction Microflows$ChangeVariableAction Microflows$ShowMessageAction Microflows$LogMessageAction Microflows$ShowFormAction Microflows$CloseFormAction Microflows$JavaActionCallAction Microflows$JavaScriptActionCallAction Microflows$NanoflowCallAction Microflows$AppServiceCallAction Microflows$AggregateAction Microflows$RollbackAction Microflows$CastAction Microflows$CreateListAction Microflows$ListOperationsAction Microflows$ChangeListAction Microflows$ValidationFeedbackAction Microflows$RestCallAction ].freeze
Instance Method Summary collapse
- #export!(parallel: true) ⇒ Object
-
#initialize(mpr_path, output_dir) ⇒ Exporter
constructor
A new instance of Exporter.
Constructor Details
#initialize(mpr_path, output_dir) ⇒ Exporter
Returns a new instance of Exporter.
60 61 62 63 |
# File 'lib/mxrb/exporter.rb', line 60 def initialize(mpr_path, output_dir) @mpr_path = File.(mpr_path) @output_dir = File.(output_dir) end |
Instance Method Details
#export!(parallel: true) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/mxrb/exporter.rb', line 65 def export!(parallel: true) FileUtils.mkdir_p(@output_dir) Mxrb.open(@mpr_path) do |project| @architecture = project.architecture_definition export_app_structure export_project_assets export_native_units(project) export_security(project) export_architecture_contracts(project) mods = project.modules if parallel && mods.size > 1 threads = mods.map { |mod| Thread.new { export_module(mod) } } threads.each(&:join) else mods.each { export_module(_1) } end write_project(project) end @output_dir end |