spectre_ai 2.1.1 → 2.1.2

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: 83d3a297e011e019679dcb12edb0c00f3bb73c6dc599378923627ef257ff6f1f
4
- data.tar.gz: 79def4a06049ed718bf0c66ffc7f0a29016d8a0831ab0941cc9c02f0b451ab03
3
+ metadata.gz: 255f79b2e70034e8aed955ba0aa42a51521beca4b0ee8bf535da0cecd92775ac
4
+ data.tar.gz: c28e34352b07c35644f69368b0894c270c40a4088646a607dacc1e6f1cc9b254
5
5
  SHA512:
6
- metadata.gz: 18cea546ff80840b1cb6087b35305a6efdf17fd8c6b6bea565157336958b02105822bb5725d7bb8e23a170362105506143992feb52ba6834986ced9fe87ab21d
7
- data.tar.gz: 2397f388fbab927a41b959c92364f2cbbc50e8d6cebe1ed4a0ea33b631fa0d2e635687d349f523d5f20d88f414d176f9b297163337ed3632232cb520f04040f9
6
+ metadata.gz: fd28340546109791de6abb7d257b52978b4793a67e2d22c6e915f7bf583a9ae5013203b8427043e611e584f806923b539d0cb75b0ffe29d63a27136496b48a9a
7
+ data.tar.gz: 7a4c2ee7d0da4fc4e6e554f97a18d5e7e770bdfacef0abd500800bf162f5978627f367c0acf729d479de6a7b51034a4e79ef662852f4cad4ec42d5080a0bab40
data/CHANGELOG.md CHANGED
@@ -423,3 +423,12 @@ Docs: https://openrouter.ai/docs/guides/features/plugins/overview
423
423
  Spectre::Openrouter::Embeddings.create('some text', model: 'text-embedding-3-small')
424
424
  ```
425
425
 
426
+
427
+ # Changelog for Version 2.1.2
428
+
429
+ **Release Date:** [5th Nov 2026]
430
+
431
+ ### Fix: Control characters in prompt locals
432
+
433
+ - `Spectre::Prompt.render` now drops control characters (e.g. `\u0000`, `\u0081`) from string locals before rendering. YAML rejects them, so a single bad character in a local used to fail the whole render with `YAML Syntax Error ... control characters are not allowed`.
434
+ - Newlines and tabs are kept, as before.
@@ -116,12 +116,16 @@ module Spectre
116
116
  end
117
117
  end
118
118
 
119
+ # Control characters YAML rejects; newlines and tabs are escaped below instead.
120
+ CONTROL_CHARS = /[^\P{Cc}\n\r\t]/
121
+
119
122
  # Escape special characters in strings to avoid YAML parsing issues
120
123
  #
121
124
  # @param value [String] The string to process
122
125
  # @return [String] The processed string with special characters escaped
123
126
  def escape_special_chars(value)
124
- value.gsub('&', '&')
127
+ value.gsub(CONTROL_CHARS, '')
128
+ .gsub('&', '&')
125
129
  .gsub('<', '&lt;')
126
130
  .gsub('>', '&gt;')
127
131
  .gsub('"', '&quot;')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spectre # :nodoc:all
4
- VERSION = "2.1.1"
4
+ VERSION = "2.1.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spectre_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Klapatok
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-12-15 00:00:00.000000000 Z
12
+ date: 2026-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec-rails