Class: Lutaml::Xsd::Spa::Strategies::VueInlinedStrategy
- Inherits:
-
OutputStrategy
- Object
- OutputStrategy
- Lutaml::Xsd::Spa::Strategies::VueInlinedStrategy
- Defined in:
- lib/lutaml/xsd/spa/strategies/vue_inlined_strategy.rb
Overview
VueInlinedStrategy - Generates a single HTML file with Vue app inlined
This is the DEFAULT strategy that generates a self-contained HTML file with all CSS and JavaScript embedded directly. This works reliably on all browsers including when opened via file:// protocol.
Instance Attribute Summary collapse
-
#config_loader ⇒ Object
readonly
Returns the value of attribute config_loader.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
Attributes inherited from OutputStrategy
Instance Method Summary collapse
-
#generate(data, _renderer) ⇒ Array<String>
Generate single HTML file with Vue app inlined.
-
#initialize(output_path, config_loader, verbose: false) ⇒ VueInlinedStrategy
constructor
Initialize Vue inlined strategy.
Methods inherited from OutputStrategy
Constructor Details
#initialize(output_path, config_loader, verbose: false) ⇒ VueInlinedStrategy
Initialize Vue inlined strategy
31 32 33 34 35 |
# File 'lib/lutaml/xsd/spa/strategies/vue_inlined_strategy.rb', line 31 def initialize(output_path, config_loader, verbose: false) super(verbose: verbose) @output_path = output_path @config_loader = config_loader end |
Instance Attribute Details
#config_loader ⇒ Object (readonly)
Returns the value of attribute config_loader.
24 25 26 |
# File 'lib/lutaml/xsd/spa/strategies/vue_inlined_strategy.rb', line 24 def config_loader @config_loader end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
24 25 26 |
# File 'lib/lutaml/xsd/spa/strategies/vue_inlined_strategy.rb', line 24 def output_path @output_path end |
Instance Method Details
#generate(data, _renderer) ⇒ Array<String>
Generate single HTML file with Vue app inlined
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/lutaml/xsd/spa/strategies/vue_inlined_strategy.rb', line 42 def generate(data, _renderer) log "Generating Vue inlined SPA (single HTML with all assets embedded)..." # Read pre-built assets app_js = read_frontend_asset("app.iife.js") app_css = read_frontend_asset("style.css") # Build complete HTML document html = build_html_document(data, app_js, app_css) # Write to file prepare_output files = [write_file(output_path, html)] log "✓ Vue inlined SPA generated: #{output_path}" files end |