structify 0.3.3 → 0.3.4

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: ec4cd0600f6463b2d9f48bbfd1f66f2fe12a967f4367a5b0c085d7fca54659e6
4
- data.tar.gz: 6a3fc64c0ba961a6fad1b18ae42b16962450b62dd24503483195907fdb17a4e1
3
+ metadata.gz: b7adef1550b7b34f172ceeea0509d60cc709a211732a12a5dd48c402be9dfa9f
4
+ data.tar.gz: 56198ac66113f0f857e7a79dc13addea1e4a01efd8a62330c0067899a731a48d
5
5
  SHA512:
6
- metadata.gz: 32ecd814b5a520fb58315a1dd0ad1c89b86352b6a6f38c36a22a1c8d80949c5e48ef69c6329b44f6b4fa4eb4e350cd2600bf4140c264ea7482347fdcfdaf57c4
7
- data.tar.gz: 2be8522750ef8c90243411467fd36114b2a380019d7e8fbddffa438fddab0f3a2b2bb2d0508c104e51c495247b33cb20978c62be85ce365c1b0557b1ab2ac7b4
6
+ metadata.gz: d9f5f3cf3d39d1d3b837ac0ed0118d7accfd2ac4d21f9b3385d9c7179fbb24771801387f545754205abb8418a6cb4a9d20141689d8d5f9f2d7669d061cc07fd2
7
+ data.tar.gz: 9b75d78dcb6a1202952ce3253690ca9e8290c7970759258290a7a13f1f1e2cf625086969b40fbc5f138f4021efa0c55dbce02544457b5571b756e46034e8d428
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.3.4] - 2025-03-19
6
+
7
+ ### Changed
8
+
9
+ - Renamed schema `title` to `name` to align with JSON Schema standards
10
+ - Added validation for schema name to ensure it matches the pattern `^[a-zA-Z0-9_-]+$`
11
+
5
12
  ## [0.3.3] - 2025-03-19
6
13
 
7
14
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- structify (0.3.2)
4
+ structify (0.3.4)
5
5
  activesupport (>= 7.0, < 9.0)
6
6
  attr_json (~> 2.1)
7
7
 
data/README.md CHANGED
@@ -94,7 +94,7 @@ class Article < ApplicationRecord
94
94
 
95
95
  schema_definition do
96
96
  version 1
97
- title "Article Extraction"
97
+ name "ArticleExtraction"
98
98
 
99
99
  field :title, :string, required: true
100
100
  field :summary, :text
@@ -111,11 +111,11 @@ module Structify
111
111
  class SchemaBuilder
112
112
  # @return [Class] The model class
113
113
  # @return [Array<Hash>] The field definitions
114
- # @return [String] The schema title
114
+ # @return [String] The schema name
115
115
  # @return [String] The schema description
116
116
  # @return [Integer] The schema version
117
117
  # @return [Boolean] Whether thinking mode is enabled
118
- attr_reader :model, :fields, :title_str, :description_str, :version_number, :thinking_enabled
118
+ attr_reader :model, :fields, :name_str, :description_str, :version_number, :thinking_enabled
119
119
 
120
120
  # Initialize a new SchemaBuilder
121
121
  #
@@ -136,12 +136,16 @@ module Structify
136
136
  @thinking_enabled = enabled
137
137
  end
138
138
 
139
- # Set the schema title
139
+ # Set the schema name
140
140
  #
141
- # @param name [String] The title
141
+ # @param value [String] The name
142
142
  # @return [void]
143
- def title(name)
144
- @title_str = name
143
+ def name(value)
144
+ # Validate the name pattern (must match ^[a-zA-Z0-9_-]+$)
145
+ unless value =~ /^[a-zA-Z0-9_-]+$/
146
+ raise ArgumentError, "Schema name must only contain alphanumeric characters, underscores, and hyphens"
147
+ end
148
+ @name_str = value
145
149
  end
146
150
 
147
151
  # Set the schema description
@@ -131,7 +131,7 @@ module Structify
131
131
  end
132
132
 
133
133
  {
134
- name: schema_builder.title_str,
134
+ name: schema_builder.name_str,
135
135
  description: schema_builder.description_str,
136
136
  parameters: {
137
137
  type: "object",
@@ -1,3 +1,3 @@
1
1
  module Structify
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kieran Klaassen