Class: Ea::Spa::Output::Strategy
- Inherits:
-
Object
- Object
- Ea::Spa::Output::Strategy
- Defined in:
- lib/ea/spa/output/strategy.rb
Overview
Abstract output strategy. Concrete subclasses project the same SPA artifacts (skeleton, search index, shards) to disk in different layouts.
Adding a new layout = new subclass + registration in Generator::OUTPUT_STRATEGIES. No edit to Projector or existing strategies.
Direct Known Subclasses
Constant Summary collapse
- SIZE_THRESHOLD_BYTES =
2 MB
2 * 1024 * 1024
- FRONTEND_DIST_DIR =
Path to the pre-built Vue IIFE bundle shipped with the gem. Built from frontend/ via
npm run build; committed so the gem never needs npm at install time. Resolved lazily so a missing bundle raises a clear error pointing at frontend/. File.("../../../../frontend/dist", __dir__)
- FRONTEND_APP_JS =
File.join(FRONTEND_DIST_DIR, "app.iife.js")
- FRONTEND_STYLE_CSS =
File.join(FRONTEND_DIST_DIR, "style.css")
Instance Attribute Summary collapse
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
Instance Method Summary collapse
-
#initialize(output_path) ⇒ Strategy
constructor
A new instance of Strategy.
- #render(_projector) ⇒ Object
Constructor Details
#initialize(output_path) ⇒ Strategy
Returns a new instance of Strategy.
28 29 30 |
# File 'lib/ea/spa/output/strategy.rb', line 28 def initialize(output_path) @output_path = output_path end |
Instance Attribute Details
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
26 27 28 |
# File 'lib/ea/spa/output/strategy.rb', line 26 def output_path @output_path end |
Instance Method Details
#render(_projector) ⇒ Object
32 33 34 35 |
# File 'lib/ea/spa/output/strategy.rb', line 32 def render(_projector) raise NotImplementedError, "#{self.class} must implement #render" end |