dapr 0.4.0 → 0.4.1

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: 5cef0f3267e0f07b9ccedcfb29297c49cd9c5cbc5d16e556c72c82821c1ff4c8
4
- data.tar.gz: 23d4d7a6e7b0aa1e9482c08eae87290deb7b23508820c88bcb31f1e34432dad9
3
+ metadata.gz: 724a4181910c345d6d4b86b0a2ba19f746b9929c8fda03ad5e6b63f98b14b0ba
4
+ data.tar.gz: 5398c729f64961d9b3ea88546e5724584dd68c819642d1ebe084d5203ec6b848
5
5
  SHA512:
6
- metadata.gz: d6f5d917f97ad175316c3552f48b02e3600e585f9cc13dd38ec7f511f84004c6596edc9891e0e2d4ad84797be87b6d5a587093b79c81b83b1054bf7404aac96c
7
- data.tar.gz: 6516a0a52f7538992c413d0fdf8e888124d5840e3f149bdd9247a191763256fdd4a4912037acadccd4bfd87d3b736de163af77f917fee3e5cedb2c1d81a5889e
6
+ metadata.gz: 4f3258854fdfe62627b8038f699b81c968a09972f59814f01cc357097e17a2777c7d78df7449d97158ec1032ff2c782daf5316f9229fcce65583b189375d1665
7
+ data.tar.gz: 9fba6543b90f3174d1ef00fd5ffc26791c61ae39d1b62da224c7228adc624da233c32e38e1476bce27f478a5f022810ab23485ad8b8df2ce72182857605f1eae
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.4.0"
2
+ ".": "0.4.1"
3
3
  }
data/.version.txt CHANGED
@@ -1 +1 @@
1
- 0.4.0
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
 
@@ -1 +1 @@
1
- {"timestamp":1729718516,"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,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,1,null,null,null,null,1,3,1,1,1,null,null,null,null,null]},"covered_strength":1.103448275862069,"covered_lines":29,"lines_of_code":29},{"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.8484848484848484,"covered_lines":132,"total_lines":132}}
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}}
@@ -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
@@ -3,7 +3,7 @@
3
3
  module Rubyists
4
4
  module Dapr
5
5
  # x-release-please-start-version
6
- VERSION = '0.4.0'
6
+ VERSION = '0.4.1'
7
7
  # x-release-please-end
8
8
  end
9
9
  end
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.0
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-23 00:00:00.000000000 Z
12
+ date: 2024-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dapr-ruby