Class: Lutaml::Xsd::InteractiveBuilder
- Inherits:
-
Object
- Object
- Lutaml::Xsd::InteractiveBuilder
- Defined in:
- lib/lutaml/xsd/interactive_builder.rb
Overview
Interactive package builder for creating schema repository configurations Discovers dependencies, resolves ambiguities, and generates YAML config
Constant Summary collapse
- SESSION_FILE =
".lutaml-xsd-session.yml"- CACHE_DIR =
File.("~/.lutaml-xsd/cache")
Instance Attribute Summary collapse
-
#entry_points ⇒ Object
readonly
Returns the value of attribute entry_points.
-
#namespace_mappings ⇒ Object
readonly
Returns the value of attribute namespace_mappings.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#pattern_mappings ⇒ Object
readonly
Returns the value of attribute pattern_mappings.
-
#pending_schemas ⇒ Object
readonly
Returns the value of attribute pending_schemas.
-
#processed_schemas ⇒ Object
readonly
Returns the value of attribute processed_schemas.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
-
#resolved_mappings ⇒ Object
readonly
Returns the value of attribute resolved_mappings.
Instance Method Summary collapse
-
#initialize(entry_points, options = {}) ⇒ InteractiveBuilder
constructor
A new instance of InteractiveBuilder.
-
#run ⇒ Boolean
Run the interactive builder session.
Constructor Details
#initialize(entry_points, options = {}) ⇒ InteractiveBuilder
Returns a new instance of InteractiveBuilder.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 21 def initialize(entry_points, = {}) @entry_points = entry_points @options = @prompt = TTY::Prompt.new @resolved_mappings = [] @namespace_mappings = [] @pattern_mappings = [] @pending_schemas = [] @processed_schemas = [] @dependency_count = 0 end |
Instance Attribute Details
#entry_points ⇒ Object (readonly)
Returns the value of attribute entry_points.
15 16 17 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 15 def entry_points @entry_points end |
#namespace_mappings ⇒ Object (readonly)
Returns the value of attribute namespace_mappings.
15 16 17 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 15 def namespace_mappings @namespace_mappings end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
15 16 17 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 15 def @options end |
#pattern_mappings ⇒ Object (readonly)
Returns the value of attribute pattern_mappings.
15 16 17 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 15 def pattern_mappings @pattern_mappings end |
#pending_schemas ⇒ Object (readonly)
Returns the value of attribute pending_schemas.
15 16 17 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 15 def pending_schemas @pending_schemas end |
#processed_schemas ⇒ Object (readonly)
Returns the value of attribute processed_schemas.
15 16 17 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 15 def processed_schemas @processed_schemas end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
15 16 17 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 15 def prompt @prompt end |
#resolved_mappings ⇒ Object (readonly)
Returns the value of attribute resolved_mappings.
15 16 17 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 15 def resolved_mappings @resolved_mappings end |
Instance Method Details
#run ⇒ Boolean
Run the interactive builder session
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/lutaml/xsd/interactive_builder.rb', line 35 def run display_welcome if [:resume] && session_exists? load_session else initialize_session end process_all_schemas save_configuration cleanup_session display_summary true rescue StandardError => e error("Interactive builder failed: #{e.}") save_session if @dependency_count.positive? false end |