ace-demo 0.18.0 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52bcbe78edb6ed9c85b9aa166c0aeb6eddcc7f2c3abf2fc308c6948d11b10e2a
|
|
4
|
+
data.tar.gz: 0ffc6151eabe9b4a7cf758c5e16befd95795e9fccf798ba6314e4db502033ddb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3fbf0d84492ae0e797bfc18fafac44e0c3346c7ed68f73113452aa58cd388de3d0c1079df772bae8172fd81c980fce3a07ce7b03cc1e4fbbfb46742995cbeea3
|
|
7
|
+
data.tar.gz: 9bbebcb303c7fe7a5f46f41dc07c9c624b4461e320e56c67c91999355ceb0d32f29797fb9ccccae2bd2db6d8be1ed82471c46f972f80977b349f19f13d8422f2
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.18.1] - 2026-03-23
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Normalize `settings.env` values to strings and validate the map structure in YAML tape parser.
|
|
14
|
+
|
|
10
15
|
## [0.18.0] - 2026-03-23
|
|
11
16
|
|
|
12
17
|
### Added
|
|
@@ -66,10 +66,19 @@ module Ace
|
|
|
66
66
|
normalized["width"] = integer_or_nil(settings["width"], "settings.width", source_path)
|
|
67
67
|
normalized["height"] = integer_or_nil(settings["height"], "settings.height", source_path)
|
|
68
68
|
normalized["format"] = settings["format"]&.to_s
|
|
69
|
+
normalized["env"] = normalize_env(settings["env"], source_path: source_path) if settings.key?("env")
|
|
69
70
|
normalized
|
|
70
71
|
end
|
|
71
72
|
private_class_method :normalize_settings
|
|
72
73
|
|
|
74
|
+
def normalize_env(env, source_path:)
|
|
75
|
+
return {} if env.nil?
|
|
76
|
+
raise DemoYamlParseError, "settings.env must be a map in #{source_path}" unless env.is_a?(Hash)
|
|
77
|
+
|
|
78
|
+
env.transform_keys(&:to_s).transform_values(&:to_s)
|
|
79
|
+
end
|
|
80
|
+
private_class_method :normalize_env
|
|
81
|
+
|
|
73
82
|
def integer_or_nil(value, field, source_path)
|
|
74
83
|
return nil if value.nil?
|
|
75
84
|
|
|
@@ -16,6 +16,10 @@ module Ace
|
|
|
16
16
|
lines << "Set Width #{settings["width"] || 960}"
|
|
17
17
|
lines << "Set Height #{settings["height"] || 480}"
|
|
18
18
|
|
|
19
|
+
(settings["env"] || {}).each do |key, value|
|
|
20
|
+
lines << "Env #{key} \"#{value}\""
|
|
21
|
+
end
|
|
22
|
+
|
|
19
23
|
spec.fetch("scenes", []).each do |scene|
|
|
20
24
|
scene_name = scene["name"]
|
|
21
25
|
lines << ""
|
|
@@ -66,6 +66,7 @@ module Ace
|
|
|
66
66
|
"#{File.basename(tape_path).sub(/\.ya?ml\z/, "")}.compiled.tape"
|
|
67
67
|
)
|
|
68
68
|
tape_output = "./#{File.basename(output_path)}"
|
|
69
|
+
inject_sandbox_env(spec, sandbox[:path])
|
|
69
70
|
tape_content = @yaml_compiler.compile(spec: spec, output_path: tape_output)
|
|
70
71
|
File.write(compiled_tape_path, tape_content)
|
|
71
72
|
|
|
@@ -81,6 +82,12 @@ module Ace
|
|
|
81
82
|
end
|
|
82
83
|
end
|
|
83
84
|
|
|
85
|
+
def inject_sandbox_env(spec, sandbox_path)
|
|
86
|
+
settings = spec["settings"] ||= {}
|
|
87
|
+
env = settings["env"] ||= {}
|
|
88
|
+
env["PROJECT_ROOT_PATH"] ||= sandbox_path
|
|
89
|
+
end
|
|
90
|
+
|
|
84
91
|
def default_output_path(tape_ref, format)
|
|
85
92
|
basename = File.basename(tape_ref).sub(/\.tape\.ya?ml\z/, "").sub(/\.tape\z/, "").sub(/\.ya?ml\z/, "")
|
|
86
93
|
File.expand_path(File.join(@output_dir, "#{basename}.#{format}"), Dir.pwd)
|
data/lib/ace/demo/version.rb
CHANGED