Class: Lutaml::Xsd::Spa::SingleFileMode
- Inherits:
-
Object
- Object
- Lutaml::Xsd::Spa::SingleFileMode
- Defined in:
- lib/lutaml/xsd/spa/output_mode.rb
Overview
Single-file output mode
Instance Attribute Summary collapse
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(output_path, verbose = false) ⇒ SingleFileMode
constructor
A new instance of SingleFileMode.
-
#write(html_content, _schema_data) ⇒ Array<String>
Write single HTML file with embedded resources.
Constructor Details
#initialize(output_path, verbose = false) ⇒ SingleFileMode
Returns a new instance of SingleFileMode.
37 38 39 40 |
# File 'lib/lutaml/xsd/spa/output_mode.rb', line 37 def initialize(output_path, verbose = false) @output_path = output_path @verbose = verbose end |
Instance Attribute Details
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
35 36 37 |
# File 'lib/lutaml/xsd/spa/output_mode.rb', line 35 def output_path @output_path end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
35 36 37 |
# File 'lib/lutaml/xsd/spa/output_mode.rb', line 35 def verbose @verbose end |
Instance Method Details
#write(html_content, _schema_data) ⇒ Array<String>
Write single HTML file with embedded resources
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/lutaml/xsd/spa/output_mode.rb', line 47 def write(html_content, _schema_data) # Ensure output directory exists output_dir = File.dirname(output_path) FileUtils.mkdir_p(output_dir) # Write HTML file File.write(output_path, html_content) log "✓ Wrote: #{output_path}" [output_path] end |