dapr 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/.version.txt +1 -1
- data/CHANGELOG.md +7 -0
- data/Readme.adoc +25 -1
- data/coverage/coverage.json +1 -1
- data/lib/dapr/client/state.rb +4 -1
- data/lib/dapr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 724a4181910c345d6d4b86b0a2ba19f746b9929c8fda03ad5e6b63f98b14b0ba
|
4
|
+
data.tar.gz: 5398c729f64961d9b3ea88546e5724584dd68c819642d1ebe084d5203ec6b848
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f3258854fdfe62627b8038f699b81c968a09972f59814f01cc357097e17a2777c7d78df7449d97158ec1032ff2c782daf5316f9229fcce65583b189375d1665
|
7
|
+
data.tar.gz: 9fba6543b90f3174d1ef00fd5ffc26791c61ae39d1b62da224c7228adc624da233c32e38e1476bce27f478a5f022810ab23485ad8b8df2ce72182857605f1eae
|
data/.version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.4.1](https://github.com/rubyists/dapr-ruby-client/compare/v0.4.0...v0.4.1) (2024-10-24)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* **state:** Updates State#get to return a Hash instead of an Array ([#76](https://github.com/rubyists/dapr-ruby-client/issues/76)) ([052fcfa](https://github.com/rubyists/dapr-ruby-client/commit/052fcfa6ca6077e13343738d38b5768e693b4c9b))
|
9
|
+
|
3
10
|
## [0.4.0](https://github.com/rubyists/dapr-ruby-client/compare/v0.3.3...v0.4.0) (2024-10-23)
|
4
11
|
|
5
12
|
|
data/Readme.adoc
CHANGED
@@ -126,6 +126,30 @@ TIP: Multiple topics can be subscribed to simultaneously by passing an array of
|
|
126
126
|
|
127
127
|
Implementation of {state-block}
|
128
128
|
|
129
|
+
==== Set state key(s)
|
130
|
+
|
131
|
+
[source,ruby]
|
132
|
+
----
|
133
|
+
require 'dapr/client/state' <1>
|
134
|
+
desired_state = { key1: 'value1', key2: { nested: 'value2' }.to_json } <2>
|
135
|
+
Rubyists::Dapr::Client::State.set(desired_state) <3>
|
136
|
+
----
|
137
|
+
<1> Require the state client.
|
138
|
+
<2> Define the desired state. This must be a hash with simple keys, and the values must be strings (thus the #to_json)
|
139
|
+
<3> Set the state. This will overwrite any existing state with the same key(s) (and update the etag of any updated keys)
|
140
|
+
|
141
|
+
==== Get state key(s)
|
142
|
+
|
143
|
+
[source,ruby]
|
144
|
+
----
|
145
|
+
require 'dapr/client/state' <1>
|
146
|
+
states = Rubyists::Dapr::Client::State.get('key1', 'key2') <2>
|
147
|
+
puts states['key1'].data <3>
|
148
|
+
----
|
149
|
+
<1> Require the state client.
|
150
|
+
<2> Get the state for the specified key(s). This will return a hash whose values respond to #data.
|
151
|
+
<3> Access the data of the state for the `key1` key.
|
152
|
+
|
129
153
|
=== Actors
|
130
154
|
|
131
155
|
Implementation of {actors-block}
|
@@ -178,7 +202,7 @@ Releases are handled by release-please in github actions.
|
|
178
202
|
|
179
203
|
== Contributing
|
180
204
|
|
181
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/rubyists/dapr.
|
205
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/rubyists/dapr-ruby-client.
|
182
206
|
|
183
207
|
=== Conventional Commits
|
184
208
|
|
data/coverage/coverage.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"timestamp":
|
1
|
+
{"timestamp":1729724582,"command_name":"Unit Tests","files":[{"filename":"/home/bougyman/rubyists/dapr/lib/dapr.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,null,null,1,1,7,null,null,null,1,1,1,1,1,null,null]},"covered_strength":1.6,"covered_lines":10,"lines_of_code":10},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,1,1,1,null,1,1,null,1,1,1,1,1,1,null,1,4,null,1,1,null,null,1,11,null,null,1,1,null,null,1,14,null,null,null,1,1,null,1,5,null,null,1,1,1,1,null,1,null,null,1,1,null,null,null,null,null]},"covered_strength":1.8823529411764706,"covered_lines":34,"lines_of_code":34},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client/configuration.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,null,1,1,1,null,1,null,1,1,null,null,1,null,null,1,null,1,1,null,1,1,1,null,null,null,null,null,null,null,1,1,1,1,null,null,1,1,1,null,null,null,null,null]},"covered_strength":1.0,"covered_lines":21,"lines_of_code":21},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client/lock.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,null,1,1,1,null,1,null,1,1,null,null,1,null,null,1,null,1,1,null,null,null,null,null,null,1,6,6,null,null,null,null,null,null,1,6,6,null,null,null,1,6,6,5,5,null,null,1,null,null,null,1,4,4,4,null,3,3,null,null,1,null,null,1,18,null,null,null,null,null,1,6,null,null,null,null,null]},"covered_strength":3.085714285714286,"covered_lines":35,"lines_of_code":35},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/client/state.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,null,1,1,1,null,null,1,null,1,1,null,1,null,1,1,1,1,1,1,1,null,null,null,null,null,null,1,1,null,null,null,null,null,null,null,1,1,null,null,null,null,null,1,2,null,null,null,null,null,null,1,1,1,3,null,null,null,null,1,3,1,1,1,null,null,null,null,null]},"covered_strength":1.1666666666666667,"covered_lines":30,"lines_of_code":30},{"filename":"/home/bougyman/rubyists/dapr/lib/dapr/version.rb","covered_percent":100.0,"coverage":{"lines":[null,null,1,1,null,1,null,null,null]},"covered_strength":1.0,"covered_lines":3,"lines_of_code":3}],"metrics":{"covered_percent":100.0,"covered_strength":1.8571428571428572,"covered_lines":133,"total_lines":133}}
|
data/lib/dapr/client/state.rb
CHANGED
@@ -14,6 +14,7 @@ module Rubyists
|
|
14
14
|
|
15
15
|
attr_reader :store_name
|
16
16
|
|
17
|
+
Item = Struct.new(:data, :etag, :metadata)
|
17
18
|
Empty = Google::Protobuf::Empty
|
18
19
|
Runtime = Client::Runtime
|
19
20
|
GetBulkStateResponse = Runtime::GetBulkStateResponse
|
@@ -53,11 +54,13 @@ module Rubyists
|
|
53
54
|
def get(keys, metadata: {})
|
54
55
|
logger.debug('Getting state', keys:, store_name:, metadata:)
|
55
56
|
response = singleton.get_bulk_state GetStateRequest.new(store_name:, keys:, metadata:)
|
56
|
-
response.items
|
57
|
+
response.items.to_h { |i| [i.key, Item.new(data: i.data, etag: i.etag, metadata: i.metadata)] }
|
57
58
|
end
|
58
59
|
|
59
60
|
# @param states [Hash] states to set (key/values in the state store)
|
60
61
|
# @param metadata [Hash] metadata to include
|
62
|
+
#
|
63
|
+
# @return [Empty] The response from the Dapr State Management component (Empty means success)
|
61
64
|
def set(states, metadata: {})
|
62
65
|
states = states.map { |key, value| { key:, value:, metadata: } }
|
63
66
|
request = SaveStateRequest.new(store_name:, states:)
|
data/lib/dapr/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dapr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tj (bougyman) Vanderpoel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-10-
|
12
|
+
date: 2024-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dapr-ruby
|