kagaribi 0.1.2 → 0.2.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 +4 -4
- data/CHANGELOG.md +14 -2
- data/lib/kagaribi/collection.rb +14 -8
- data/lib/kagaribi/version.rb +1 -1
- data/rbs_collection.lock.yaml +22 -18
- data/rbs_collection.yaml +1 -0
- data/sig/kagaribi/collection.rbs +2 -2
- 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: 92c77b5683ce1658304c3df23eac700d3334a1a27672dd9ed583bc30d8a6b469
|
4
|
+
data.tar.gz: c523b8d9f619d9a07f81493af393d26e26851e30cdc8d833691a036573c11b21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a7f346f5283e0fce8518ed8b259d6a5e6e007ad55eafa3d5c53149319b15111874a984ec6441407c6c3dd35d4cc399ef50e5b18efdea999808df9857b9b8fd2
|
7
|
+
data.tar.gz: c68b7ab59ad6a2e7c480f0d1d111e543cfb0351400d70e7f7b8060f950f9f72e5e448746655abbac1808f5edb70d52554c6227b7d09cddf5028ebf272a4bcf64
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
## [Unreleased]
|
2
|
-
[full changelog](http://github.com/sue445/kagaribi/compare/v0.1
|
2
|
+
[full changelog](http://github.com/sue445/kagaribi/compare/v0.2.1...main)
|
3
|
+
|
4
|
+
## [0.2.1](https://github.com/sue445/kagaribi/releases/tag/v0.2.1) - 2025-06-01
|
5
|
+
[full changelog](http://github.com/sue445/kagaribi/compare/v0.2.0...v0.2.1)
|
6
|
+
|
7
|
+
- Tweak `Kagaribi::Collection#exists?` return type
|
8
|
+
- https://github.com/sue445/kagaribi/pull/46
|
9
|
+
|
10
|
+
## [0.2.0](https://github.com/sue445/kagaribi/releases/tag/v0.2.0) - 2025-06-01
|
11
|
+
[full changelog](http://github.com/sue445/kagaribi/compare/v0.1.2...v0.2.0)
|
12
|
+
|
13
|
+
- Automatic retry in `Kagaribi::Collection#set`, `Kagaribi::Collection#update` and `Kagaribi::Collection#delete` error
|
14
|
+
- https://github.com/sue445/kagaribi/pull/44
|
3
15
|
|
4
16
|
## [0.1.2](https://github.com/sue445/kagaribi/releases/tag/v0.1.2) - 2025-05-16
|
5
|
-
[full changelog](http://github.com/sue445/kagaribi/compare/v0.1.
|
17
|
+
[full changelog](http://github.com/sue445/kagaribi/compare/v0.1.1...v0.1.2)
|
6
18
|
|
7
19
|
- Allow retries on `Google::Cloud::UnauthenticatedError`
|
8
20
|
- https://github.com/sue445/kagaribi/pull/40
|
data/lib/kagaribi/collection.rb
CHANGED
@@ -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
|
-
|
61
|
-
|
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
|
-
|
70
|
-
|
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
|
@@ -81,9 +85,9 @@ module Kagaribi
|
|
81
85
|
end
|
82
86
|
end
|
83
87
|
|
84
|
-
# Whether document
|
88
|
+
# Whether document exists in collection
|
85
89
|
# @param doc_key [String]
|
86
|
-
# @return [Boolean]
|
90
|
+
# @return [Boolean,nil]
|
87
91
|
def exists?(doc_key)
|
88
92
|
with_retry("Kagaribi::Collection#exists?") do
|
89
93
|
ref = firestore.doc(full_doc_key(doc_key))
|
@@ -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
|
-
|
99
|
-
|
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]
|
data/lib/kagaribi/version.rb
CHANGED
data/rbs_collection.lock.yaml
CHANGED
@@ -6,23 +6,19 @@ gems:
|
|
6
6
|
source:
|
7
7
|
type: git
|
8
8
|
name: ruby/gem_rbs_collection
|
9
|
-
revision:
|
9
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
10
10
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
11
11
|
repo_dir: gems
|
12
12
|
- name: base64
|
13
|
-
version:
|
13
|
+
version: 0.3.0
|
14
14
|
source:
|
15
|
-
type:
|
16
|
-
name: ruby/gem_rbs_collection
|
17
|
-
revision: 0ef449166f72c767f58f920cc36aca818fbf082f
|
18
|
-
remote: https://github.com/ruby/gem_rbs_collection.git
|
19
|
-
repo_dir: gems
|
15
|
+
type: rubygems
|
20
16
|
- name: bigdecimal
|
21
17
|
version: '3.1'
|
22
18
|
source:
|
23
19
|
type: git
|
24
20
|
name: ruby/gem_rbs_collection
|
25
|
-
revision:
|
21
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
26
22
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
27
23
|
repo_dir: gems
|
28
24
|
- name: concurrent-ruby
|
@@ -30,7 +26,7 @@ gems:
|
|
30
26
|
source:
|
31
27
|
type: git
|
32
28
|
name: ruby/gem_rbs_collection
|
33
|
-
revision:
|
29
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
34
30
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
35
31
|
repo_dir: gems
|
36
32
|
- name: diff-lcs
|
@@ -38,7 +34,7 @@ gems:
|
|
38
34
|
source:
|
39
35
|
type: git
|
40
36
|
name: ruby/gem_rbs_collection
|
41
|
-
revision:
|
37
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
42
38
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
43
39
|
repo_dir: gems
|
44
40
|
- name: faraday
|
@@ -46,7 +42,7 @@ gems:
|
|
46
42
|
source:
|
47
43
|
type: git
|
48
44
|
name: ruby/gem_rbs_collection
|
49
|
-
revision:
|
45
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
50
46
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
51
47
|
repo_dir: gems
|
52
48
|
- name: fileutils
|
@@ -57,12 +53,20 @@ gems:
|
|
57
53
|
version: '0'
|
58
54
|
source:
|
59
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
|
60
64
|
- name: google-cloud-firestore
|
61
65
|
version: '2.15'
|
62
66
|
source:
|
63
67
|
type: git
|
64
68
|
name: ruby/gem_rbs_collection
|
65
|
-
revision:
|
69
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
66
70
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
67
71
|
repo_dir: gems
|
68
72
|
- name: google-protobuf
|
@@ -70,7 +74,7 @@ gems:
|
|
70
74
|
source:
|
71
75
|
type: git
|
72
76
|
name: ruby/gem_rbs_collection
|
73
|
-
revision:
|
77
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
74
78
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
75
79
|
repo_dir: gems
|
76
80
|
- name: googleauth
|
@@ -78,7 +82,7 @@ gems:
|
|
78
82
|
source:
|
79
83
|
type: git
|
80
84
|
name: ruby/gem_rbs_collection
|
81
|
-
revision:
|
85
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
82
86
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
83
87
|
repo_dir: gems
|
84
88
|
- name: grpc
|
@@ -86,7 +90,7 @@ gems:
|
|
86
90
|
source:
|
87
91
|
type: git
|
88
92
|
name: ruby/gem_rbs_collection
|
89
|
-
revision:
|
93
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
90
94
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
91
95
|
repo_dir: gems
|
92
96
|
- name: json
|
@@ -98,7 +102,7 @@ gems:
|
|
98
102
|
source:
|
99
103
|
type: git
|
100
104
|
name: ruby/gem_rbs_collection
|
101
|
-
revision:
|
105
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
102
106
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
103
107
|
repo_dir: gems
|
104
108
|
- name: logger
|
@@ -122,7 +126,7 @@ gems:
|
|
122
126
|
source:
|
123
127
|
type: git
|
124
128
|
name: ruby/gem_rbs_collection
|
125
|
-
revision:
|
129
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
126
130
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
127
131
|
repo_dir: gems
|
128
132
|
- name: signet
|
@@ -130,7 +134,7 @@ gems:
|
|
130
134
|
source:
|
131
135
|
type: git
|
132
136
|
name: ruby/gem_rbs_collection
|
133
|
-
revision:
|
137
|
+
revision: 6f2d93ab244008bec51db7b4fffae68b40232502
|
134
138
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
135
139
|
repo_dir: gems
|
136
140
|
- name: time
|
data/rbs_collection.yaml
CHANGED
data/sig/kagaribi/collection.rbs
CHANGED
@@ -15,7 +15,7 @@ module Kagaribi
|
|
15
15
|
def set: (String doc_key, Hash[untyped, untyped] data) -> void
|
16
16
|
def update: (String doc_key, Hash[untyped, untyped] data) -> void
|
17
17
|
def get: (String doc_key) -> Hash[Symbol, untyped]
|
18
|
-
def exists?: (String doc_key) -> bool
|
18
|
+
def exists?: (String doc_key) -> bool?
|
19
19
|
def delete: (String doc_key) -> void
|
20
20
|
def self.sanitize_key: (String key) -> String
|
21
21
|
|
@@ -25,7 +25,7 @@ module Kagaribi
|
|
25
25
|
def sanitized_collection_name: -> String
|
26
26
|
def sanitize_key: (String key) -> String
|
27
27
|
def full_doc_key: (String doc_key) -> String
|
28
|
-
def with_retry: (String label) { ->
|
28
|
+
def with_retry: [T] (String label) { () -> T } -> T
|
29
29
|
def retryable_error?: (StandardError error) -> bool
|
30
30
|
end
|
31
31
|
end
|