kagaribi 0.1.1 → 0.2.0

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: 6341d635aacd9883dd113c02dd8d96494a1f7cbc52e727f521fa25210dbc4951
4
- data.tar.gz: 4cc8aa1c3c4243a403c0a7299313063c20be62eb534b02c8f59a1c1b0f8dea85
3
+ metadata.gz: 7c118a3defeaf46cead6a66583f8ce80b93e84af69ca7de7988cfc23eef93359
4
+ data.tar.gz: 2383c3a82a27a44434e5ddbcc199f094b5827916f24180605bafe62030b296a6
5
5
  SHA512:
6
- metadata.gz: f91c7d409d479cb25648a2cf873751a9d9c30c009ea4053593802a7eb1a05a4d8d9ba080ec80a666759cc2563ff8fee19431d454876f536db416403abc2ad33e
7
- data.tar.gz: 04e176fa8b69703742932bde47be84b3c6e969ee8f9c41dc375fb2cda5e134e5201c92065c6c0b1e1a70655d0b48c8b19188144a08c719a95aff2b1b70102149
6
+ metadata.gz: 404642bdd2074683ce7a68103dc0f71c66e14393f67bb4ed6238e4f785bffefa8d369503aed606afc8d3a412eb5fa8356a221e0d3c729b0c88ff274f1c5177c8
7
+ data.tar.gz: 76d2755dc10e89e631147885b6dcbbe9fa22d045b90a3ff5dfe80a67192421b7bd54b0f70e09fa39fe2073c995a48b7bdf6a7e3e514596211b6d4d6d23386841
data/CHANGELOG.md CHANGED
@@ -1,12 +1,24 @@
1
1
  ## [Unreleased]
2
- [full changelog](http://github.com/sue445/kagaribi/compare/v0.1.1...main)
2
+ [full changelog](http://github.com/sue445/kagaribi/compare/v0.2.0...main)
3
3
 
4
- ## [0.1.1] - 2024-05-12
4
+ ## [0.2.0](https://github.com/sue445/kagaribi/releases/tag/v0.2.0) - 2025-06-01
5
+ [full changelog](http://github.com/sue445/kagaribi/compare/v0.1.2...v0.2.0)
6
+
7
+ - Automatic retry in `Kagaribi::Collection#set`, `Kagaribi::Collection#update` and `Kagaribi::Collection#delete` error
8
+ - https://github.com/sue445/kagaribi/pull/44
9
+
10
+ ## [0.1.2](https://github.com/sue445/kagaribi/releases/tag/v0.1.2) - 2025-05-16
11
+ [full changelog](http://github.com/sue445/kagaribi/compare/v0.1.1...v0.1.2)
12
+
13
+ - Allow retries on `Google::Cloud::UnauthenticatedError`
14
+ - https://github.com/sue445/kagaribi/pull/40
15
+
16
+ ## [0.1.1](https://github.com/sue445/kagaribi/releases/tag/v0.1.1) - 2024-05-12
5
17
  [full changelog](http://github.com/sue445/kagaribi/compare/v0.1.0...v0.1.1)
6
18
 
7
19
  - Add missing rbs
8
20
  - https://github.com/sue445/kagaribi/pull/18
9
21
 
10
- ## [0.1.0] - 2024-05-11
22
+ ## [0.1.0](https://github.com/sue445/kagaribi/releases/tag/v0.1.0) - 2024-05-11
11
23
 
12
24
  - Initial release
data/README.md CHANGED
@@ -54,6 +54,14 @@ All methods are followings
54
54
 
55
55
  https://sue445.github.io/kagaribi/Kagaribi/Collection
56
56
 
57
+ ## Features
58
+ ### Auto retry
59
+ The Cloud Firestore API is sometimes unstable.
60
+
61
+ Error, but retry the same operation and it may succeed.
62
+
63
+ Therefore, if an error occurs in some operations (e.g. [Kagaribi::Collection#get](https://sue445.github.io/kagaribi/Kagaribi/Collection.html#get-instance_method)), the retry will be performed automatically.
64
+
57
65
  ## Development
58
66
  At first, install [Firebase Local Emulator Suite](https://firebase.google.com/docs/emulator-suite/install_and_configure)
59
67
 
@@ -57,8 +57,10 @@ module Kagaribi
57
57
  # @param doc_key [String]
58
58
  # @param data [Hash]
59
59
  def set(doc_key, data)
60
- ref = firestore.doc(full_doc_key(doc_key))
61
- ref.set(data)
60
+ with_retry("Kagaribi::Collection#set") do
61
+ ref = firestore.doc(full_doc_key(doc_key))
62
+ ref.set(data)
63
+ end
62
64
  end
63
65
 
64
66
  # Update a document that has already been saved
@@ -66,8 +68,10 @@ module Kagaribi
66
68
  # @param doc_key [String]
67
69
  # @param data [Hash]
68
70
  def update(doc_key, data)
69
- ref = firestore.doc(full_doc_key(doc_key))
70
- ref.update(data)
71
+ with_retry("Kagaribi::Collection#update") do
72
+ ref = firestore.doc(full_doc_key(doc_key))
73
+ ref.update(data)
74
+ end
71
75
  end
72
76
 
73
77
  # Get document from collection
@@ -95,8 +99,10 @@ module Kagaribi
95
99
  # Delete document in collection
96
100
  # @param doc_key [String]
97
101
  def delete(doc_key)
98
- ref = firestore.doc(full_doc_key(doc_key))
99
- ref.delete
102
+ with_retry("Kagaribi::Collection#delete") do
103
+ ref = firestore.doc(full_doc_key(doc_key))
104
+ ref.delete
105
+ end
100
106
  end
101
107
 
102
108
  # @param key [String]
@@ -133,7 +139,7 @@ module Kagaribi
133
139
  # @yield
134
140
  def with_retry(label)
135
141
  yield
136
- rescue TypeError, GRPC::Unavailable, RuntimeError, Signet::AuthorizationError => error
142
+ rescue TypeError, GRPC::Unavailable, RuntimeError, Signet::AuthorizationError, Google::Cloud::UnauthenticatedError => error
137
143
  raise error unless retryable_error?(error)
138
144
 
139
145
  retry_count ||= 0
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kagaribi
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -1,18 +1,110 @@
1
1
  ---
2
2
  path: ".gem_rbs_collection"
3
3
  gems:
4
+ - name: addressable
5
+ version: '2.8'
6
+ source:
7
+ type: git
8
+ name: ruby/gem_rbs_collection
9
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
10
+ remote: https://github.com/ruby/gem_rbs_collection.git
11
+ repo_dir: gems
12
+ - name: base64
13
+ version: 0.3.0
14
+ source:
15
+ type: rubygems
16
+ - name: bigdecimal
17
+ version: '3.1'
18
+ source:
19
+ type: git
20
+ name: ruby/gem_rbs_collection
21
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
22
+ remote: https://github.com/ruby/gem_rbs_collection.git
23
+ repo_dir: gems
24
+ - name: concurrent-ruby
25
+ version: '1.1'
26
+ source:
27
+ type: git
28
+ name: ruby/gem_rbs_collection
29
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
30
+ remote: https://github.com/ruby/gem_rbs_collection.git
31
+ repo_dir: gems
4
32
  - name: diff-lcs
5
33
  version: '1.5'
6
34
  source:
7
35
  type: git
8
36
  name: ruby/gem_rbs_collection
9
- revision: 7a105f52053ce1c708b605dfa9c1ab8473424036
37
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
38
+ remote: https://github.com/ruby/gem_rbs_collection.git
39
+ repo_dir: gems
40
+ - name: faraday
41
+ version: '2.7'
42
+ source:
43
+ type: git
44
+ name: ruby/gem_rbs_collection
45
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
10
46
  remote: https://github.com/ruby/gem_rbs_collection.git
11
47
  repo_dir: gems
12
48
  - name: fileutils
13
49
  version: '0'
14
50
  source:
15
51
  type: stdlib
52
+ - name: forwardable
53
+ version: '0'
54
+ source:
55
+ type: stdlib
56
+ - name: google-cloud-errors
57
+ version: '1.5'
58
+ source:
59
+ type: git
60
+ name: ruby/gem_rbs_collection
61
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
62
+ remote: https://github.com/ruby/gem_rbs_collection.git
63
+ repo_dir: gems
64
+ - name: google-cloud-firestore
65
+ version: '2.15'
66
+ source:
67
+ type: git
68
+ name: ruby/gem_rbs_collection
69
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
70
+ remote: https://github.com/ruby/gem_rbs_collection.git
71
+ repo_dir: gems
72
+ - name: google-protobuf
73
+ version: '3.22'
74
+ source:
75
+ type: git
76
+ name: ruby/gem_rbs_collection
77
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
78
+ remote: https://github.com/ruby/gem_rbs_collection.git
79
+ repo_dir: gems
80
+ - name: googleauth
81
+ version: '1.11'
82
+ source:
83
+ type: git
84
+ name: ruby/gem_rbs_collection
85
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
86
+ remote: https://github.com/ruby/gem_rbs_collection.git
87
+ repo_dir: gems
88
+ - name: grpc
89
+ version: '1.63'
90
+ source:
91
+ type: git
92
+ name: ruby/gem_rbs_collection
93
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
94
+ remote: https://github.com/ruby/gem_rbs_collection.git
95
+ repo_dir: gems
96
+ - name: json
97
+ version: '0'
98
+ source:
99
+ type: stdlib
100
+ - name: jwt
101
+ version: '2.5'
102
+ source:
103
+ type: git
104
+ name: ruby/gem_rbs_collection
105
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
106
+ remote: https://github.com/ruby/gem_rbs_collection.git
107
+ repo_dir: gems
16
108
  - name: logger
17
109
  version: '0'
18
110
  source:
@@ -21,12 +113,40 @@ gems:
21
113
  version: '0'
22
114
  source:
23
115
  type: stdlib
116
+ - name: net-http
117
+ version: '0'
118
+ source:
119
+ type: stdlib
120
+ - name: net-protocol
121
+ version: '0'
122
+ source:
123
+ type: stdlib
24
124
  - name: rake
25
125
  version: '13.0'
26
126
  source:
27
127
  type: git
28
128
  name: ruby/gem_rbs_collection
29
- revision: 7a105f52053ce1c708b605dfa9c1ab8473424036
129
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
130
+ remote: https://github.com/ruby/gem_rbs_collection.git
131
+ repo_dir: gems
132
+ - name: signet
133
+ version: '0.19'
134
+ source:
135
+ type: git
136
+ name: ruby/gem_rbs_collection
137
+ revision: 6f2d93ab244008bec51db7b4fffae68b40232502
30
138
  remote: https://github.com/ruby/gem_rbs_collection.git
31
139
  repo_dir: gems
140
+ - name: time
141
+ version: '0'
142
+ source:
143
+ type: stdlib
144
+ - name: timeout
145
+ version: '0'
146
+ source:
147
+ type: stdlib
148
+ - name: uri
149
+ version: '0'
150
+ source:
151
+ type: stdlib
32
152
  gemfile_lock_path: Gemfile.lock
data/rbs_collection.yaml CHANGED
@@ -24,3 +24,7 @@ gems:
24
24
  ignore: true
25
25
 
26
26
  - name: logger
27
+ - name: google-cloud-firestore
28
+ - name: google-cloud-errors
29
+ - name: grpc
30
+ - name: signet
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kagaribi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-05-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-firestore
@@ -110,7 +109,6 @@ metadata:
110
109
  changelog_uri: https://github.com/sue445/kagaribi/blob/main/CHANGELOG.md
111
110
  documentation_uri: https://sue445.github.io/kagaribi/
112
111
  rubygems_mfa_required: 'true'
113
- post_install_message:
114
112
  rdoc_options: []
115
113
  require_paths:
116
114
  - lib
@@ -125,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
123
  - !ruby/object:Gem::Version
126
124
  version: '0'
127
125
  requirements: []
128
- rubygems_version: 3.5.9
129
- signing_key:
126
+ rubygems_version: 3.6.7
130
127
  specification_version: 4
131
128
  summary: Simple client for Cloud Firestore
132
129
  test_files: []