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: 05dccf36768772abb152a0b5494c5248f7c2ace0a1109618d1e66394d48d5a19
4
- data.tar.gz: 5f78333a34958fbfec8e7694016e7511ec2b1bafe55f8a75cfb2d809b23e5e18
3
+ metadata.gz: 52bcbe78edb6ed9c85b9aa166c0aeb6eddcc7f2c3abf2fc308c6948d11b10e2a
4
+ data.tar.gz: 0ffc6151eabe9b4a7cf758c5e16befd95795e9fccf798ba6314e4db502033ddb
5
5
  SHA512:
6
- metadata.gz: 0deee155122d67606f4fdfbdab863b639a31c191cbd0ef6d0cee352c36f32abf17404ed2deebdd1a8923619a5cc66e442a7b572c97dabb920cbe3d66f193b74f
7
- data.tar.gz: 74725ee58385d06c0ca31cdafe9c4d42effde8c6eea50ca4f7d67c0a226fc0e20deb0ec86e23cae5ddba0295f24d727f07f76880d517d9385fe864cbdd0848cc
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ace
4
4
  module Demo
5
- VERSION = "0.18.0"
5
+ VERSION = "0.18.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-demo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz