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 +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/didkit/plc_importer.rb +2 -1
- data/lib/didkit/plc_operation.rb +2 -1
- data/lib/didkit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3fae54f7c1e125655363ac9b8585f5622b87afb371b170fbe8d4d6d25091fd38
|
|
4
|
+
data.tar.gz: 9de4a4d69ef03399b9bed045b1647226fc92c547b3f017bb4127fa2cb674f9d5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/didkit/plc_importer.rb
CHANGED
|
@@ -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
|
|
76
|
+
rescue FormatError => e
|
|
76
77
|
@error_handler ? @error_handler.call(e, json) : raise
|
|
77
78
|
nil
|
|
78
79
|
end
|
data/lib/didkit/plc_operation.rb
CHANGED
|
@@ -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')
|
data/lib/didkit/version.rb
CHANGED