spectre_ai 2.1.1 → 2.1.3

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: 2e9ddd202014a2b8f7f5abf81aa3f4eb7045c639717c3362f744e911816eac39
4
+ data.tar.gz: 6551cd0908636fdcac346152eba8a6d73b4245cb974f355a16f9d4b554a5597d
5
5
  SHA512:
6
- metadata.gz: 18cea546ff80840b1cb6087b35305a6efdf17fd8c6b6bea565157336958b02105822bb5725d7bb8e23a170362105506143992feb52ba6834986ced9fe87ab21d
7
- data.tar.gz: 2397f388fbab927a41b959c92364f2cbbc50e8d6cebe1ed4a0ea33b631fa0d2e635687d349f523d5f20d88f414d176f9b297163337ed3632232cb520f04040f9
6
+ metadata.gz: 3265217fb6eaf0c783fc3de46204d2e9af423051b3b871d655bc4598d37fd4d537c161112f3cd23282f72f3b46b64ff80f7a0645cfa1fc1653ea4d04b1251aa1
7
+ data.tar.gz: f3eeeec25fe03a1b576c928333b91a21778b374cbb99f34a9208432165f9a2628e4835fd8b28968073b23397b725f331036c7143e5735db7dd364a97fee5e797
data/CHANGELOG.md CHANGED
@@ -423,3 +423,22 @@ 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.
435
+
436
+ # Changelog for Version 2.1.3
437
+
438
+ **Release Date:** [5th Nov 2026]
439
+
440
+ ### Ruby 4 support
441
+
442
+ - Spectre now works on Ruby 4.0. Development and CI use Ruby 4.0.9.
443
+ - `logger` is now a runtime dependency. Ruby 4.0 no longer ships it as a default gem, and Spectre requires it for logging.
444
+ - `required_ruby_version` is unchanged (`>= 3`).
@@ -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.3"
5
5
  end
metadata CHANGED
@@ -1,16 +1,29 @@
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Klapatok
8
8
  - Matthew Black
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2025-12-15 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
14
27
  - !ruby/object:Gem::Dependency
15
28
  name: rspec-rails
16
29
  requirement: !ruby/object:Gem::Requirement
@@ -77,7 +90,6 @@ homepage: https://github.com/hiremav/spectre
77
90
  licenses:
78
91
  - MIT
79
92
  metadata: {}
80
- post_install_message:
81
93
  rdoc_options: []
82
94
  require_paths:
83
95
  - lib
@@ -92,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
104
  - !ruby/object:Gem::Version
93
105
  version: '0'
94
106
  requirements: []
95
- rubygems_version: 3.5.11
96
- signing_key:
107
+ rubygems_version: 4.0.20
97
108
  specification_version: 4
98
109
  summary: Spectre
99
110
  test_files: []