didkit 0.3.2 → 0.3.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: d7a4ebcd65dd0bb01a1dfd790dafaa6db2780e704558b8da171eae1db45053d5
4
- data.tar.gz: 27bd5afc5f6bec8207f07b152092337c028abfee26cf0684f5c04d1352241b03
3
+ metadata.gz: 3fae54f7c1e125655363ac9b8585f5622b87afb371b170fbe8d4d6d25091fd38
4
+ data.tar.gz: 9de4a4d69ef03399b9bed045b1647226fc92c547b3f017bb4127fa2cb674f9d5
5
5
  SHA512:
6
- metadata.gz: 5cfcbe474eb92088fef122b10df8776b99589a5aa8f1725c5303305cc5ece4696d291f82931e691c92d7b3eb16b0f874efc0fb8bfbfc01f4267defa4e3cc28e4
7
- data.tar.gz: 984039e433ef24d7499c70c5bcd336c4f826195b59b3143a03ca131741146c18fdae3b9088a201b3556169871b8ddd93062e7dfcc7292db4294fb45e464b9e17
6
+ metadata.gz: a52a90e39e7fea15530a9a4e53e006fdbfde90cf919cad0f46552e3740e7a881ace83d1eaba8ca09ffd13fc57f60c20b018ce5779b4b8adf1d8a478d68fc58cf
7
+ data.tar.gz: fbfb3f01d8b56bc6dfe2f975995c6dc4da75901c43d177e85d0834b920b55036c53ccfc59f1b16e2f4f8f9e0c30b21f719fbecd2a1d28d893556a81f137f52f6
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
+ ## [0.3.3] - 2026-02-22
2
+
3
+ - fixed old `FormatError` classes mentioned in `PLCImporter`
4
+
1
5
  ## [0.3.2] - 2026-02-15
2
6
 
3
- - added YARD API documentation
7
+ - added [YARD API documentation](https://rubydoc.info/gems/didkit/)
4
8
  - marked some helper methods in `requests.rb`, `at_handles.rb` and `DIDKit::Resolver` as private
5
9
  - merged all "FormatErrors" into one `DIDKit::FormatError`
6
10
  - added `frozen_string_literal` directive everywhere to minimize garbage collection
@@ -4,6 +4,7 @@ require 'json'
4
4
  require 'time'
5
5
  require 'uri'
6
6
 
7
+ require_relative 'errors'
7
8
  require_relative 'plc_operation'
8
9
  require_relative 'requests'
9
10
 
@@ -72,7 +73,7 @@ module DIDKit
72
73
  operations = rows.filter_map { |json|
73
74
  begin
74
75
  PLCOperation.new(json)
75
- rescue PLCOperation::FormatError, AtHandles::FormatError, ServiceRecord::FormatError => e
76
+ rescue FormatError => e
76
77
  @error_handler ? @error_handler.call(e, json) : raise
77
78
  nil
78
79
  end
@@ -81,13 +81,14 @@ module DIDKit
81
81
 
82
82
  type = operation['type']
83
83
  raise FormatError, "Missing operation type: #{json}" if type.nil?
84
+ raise FormatError, "Invalid operation type: #{type.inspect}" unless type.is_a?(String)
84
85
 
85
86
  @type = type.to_sym
86
87
  return unless @type == :plc_operation
87
88
 
88
89
  services = operation['services']
89
90
  raise FormatError, "Missing services key: #{json}" if services.nil?
90
- raise FormatError, "Invalid services data: #{services}" unless services.is_a?(Hash)
91
+ raise FormatError, "Invalid services data: #{services.inspect}" unless services.is_a?(Hash)
91
92
 
92
93
  @services = services.map { |k, x|
93
94
  type, endpoint = x.values_at('type', 'endpoint')
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DIDKit
4
- VERSION = "0.3.2"
4
+ VERSION = "0.3.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: didkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kuba Suder