Class: Plushie::Configuration
- Inherits:
-
Object
- Object
- Plushie::Configuration
- Defined in:
- lib/plushie.rb
Overview
Global configuration for the Plushie SDK.
Instance Attribute Summary collapse
-
#artifacts ⇒ Array<Symbol>
Which artifacts to install with download/build tasks.
-
#bin_file ⇒ String?
Override destination path for the native binary.
-
#binary_path ⇒ String?
Explicit path to the plushie binary.
-
#build_name ⇒ String
Custom binary name for native widget builds.
-
#source_path ⇒ String?
Path to the plushie Rust source checkout.
-
#test_backend ⇒ Symbol?
Test backend (:mock, :headless, :windowed).
-
#validate_props ⇒ Boolean
Enable renderer-side prop validation.
-
#wasm_dir ⇒ String?
Override output directory for WASM renderer files.
-
#widget_config ⇒ Hash
Runtime configuration map passed to native widgets via the Settings wire message.
-
#widgets ⇒ Array<Class>
Widget classes to include in custom builds.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/plushie.rb', line 216 def initialize @binary_path = nil @source_path = nil @build_name = "plushie-custom" @widgets = [] @widget_config = {} @test_backend = nil @artifacts = [:bin] @bin_file = nil @wasm_dir = nil @validate_props = false end |
Instance Attribute Details
#artifacts ⇒ Array<Symbol>
Which artifacts to install with download/build tasks. Default: +[:bin]+. Set to +[:bin, :wasm]+ for projects that need both the native binary and the WASM renderer.
197 198 199 |
# File 'lib/plushie.rb', line 197 def artifacts @artifacts end |
#bin_file ⇒ String?
Override destination path for the native binary. Used by +rake plushie:download+ and +rake plushie:build+. Env var +PLUSHIE_BIN_FILE+ takes precedence.
203 204 205 |
# File 'lib/plushie.rb', line 203 def bin_file @bin_file end |
#binary_path ⇒ String?
Explicit path to the plushie binary. Overrides all resolution. Equivalent to PLUSHIE_BINARY_PATH env var.
166 167 168 |
# File 'lib/plushie.rb', line 166 def binary_path @binary_path end |
#build_name ⇒ String
Custom binary name for native widget builds. Defaults to "plushie-custom". Used as the Cargo binary target name and the installed filename.
177 178 179 |
# File 'lib/plushie.rb', line 177 def build_name @build_name end |
#source_path ⇒ String?
Path to the plushie Rust source checkout. Used by rake plushie:build.
Equivalent to PLUSHIE_RUST_SOURCE_PATH env var.
171 172 173 |
# File 'lib/plushie.rb', line 171 def source_path @source_path end |
#test_backend ⇒ Symbol?
Test backend (:mock, :headless, :windowed). Equivalent to PLUSHIE_TEST_BACKEND env var.
191 192 193 |
# File 'lib/plushie.rb', line 191 def test_backend @test_backend end |
#validate_props ⇒ Boolean
Enable renderer-side prop validation. When true, the renderer emits diagnostic events for unknown or invalid props.
214 215 216 |
# File 'lib/plushie.rb', line 214 def validate_props @validate_props end |
#wasm_dir ⇒ String?
Override output directory for WASM renderer files. Used by +rake plushie:download+. Env var +PLUSHIE_WASM_DIR+ takes precedence.
209 210 211 |
# File 'lib/plushie.rb', line 209 def wasm_dir @wasm_dir end |
#widget_config ⇒ Hash
Runtime configuration map passed to native widgets via the Settings wire message. Keyed by widget type.
186 187 188 |
# File 'lib/plushie.rb', line 186 def @widget_config end |
#widgets ⇒ Array<Class>
Widget classes to include in custom builds.
181 182 183 |
# File 'lib/plushie.rb', line 181 def @widgets end |