fbe 0.0.79 → 0.0.80

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: ebef11abe73e837c5c5d7c6aa46e78d6f7d966e5aece1c50935b2cbfa90a3e6e
4
- data.tar.gz: b7fc21e82bdec29ed980b00f84249cf7c68ef000c930f87622769513dea10582
3
+ metadata.gz: 255e6cb01f7b7f3c1d6c63330582be13ef8a2504b4f6a8e539b0e3578413ac83
4
+ data.tar.gz: 4e21ae89eca27737d626fc91ea753cba2cc4c427756e4ad5987daa8d88860fb5
5
5
  SHA512:
6
- metadata.gz: ae7f0dfbf143569ce8d0b088b53a1d7febfbb083b784885e35fbf578db2a8fd4bed2320d053d28a2e378f1e7fbb613a23cfd24f271efc0fe39e07266a28ed0a8
7
- data.tar.gz: 6c2f4ff1c9c950a30837657742961a4f404f2358f82282db0285710589cf4890688f8070bb8569329255e3bd49d8902f16ced914811f0dcbff909983defbaa04
6
+ metadata.gz: 44ed1c6714f0c767173b8fba46aea58872862a151413ed7ab8910642bdfe2ff65b2974da7b265d3bb74e76f7fce26520df3710393d00e3e5fcdece0e0d5be77f
7
+ data.tar.gz: e7c56fbbd700bdf48d6cc481a2a9165a334b6ae47c7f02cfcd10525d2c6825bdbdc3c704ab064a04e9e7c864edf3514cb034637115c01405b96decb9e416d990
@@ -27,4 +27,4 @@ jobs:
27
27
  runs-on: ubuntu-24.04
28
28
  steps:
29
29
  - uses: actions/checkout@v4
30
- - uses: yegor256/copyrights-action@0.0.5
30
+ - uses: yegor256/copyrights-action@0.0.8
@@ -31,7 +31,7 @@ jobs:
31
31
  name: test
32
32
  strategy:
33
33
  matrix:
34
- os: [ubuntu-22.04, macos-12]
34
+ os: [ubuntu-24.04, macos-15]
35
35
  ruby: [3.2]
36
36
  runs-on: ${{ matrix.os }}
37
37
  steps:
data/.rubocop.yml CHANGED
@@ -50,6 +50,8 @@ Metrics/PerceivedComplexity:
50
50
  Enabled: false
51
51
  Metrics/ClassLength:
52
52
  Enabled: false
53
+ Style/SafeNavigationChainLength:
54
+ Enabled: false
53
55
  Layout/EmptyLineAfterGuardClause:
54
56
  Enabled: false
55
57
  Naming/MethodParameterName:
data/Gemfile CHANGED
@@ -24,13 +24,13 @@ source 'https://rubygems.org'
24
24
  gemspec
25
25
 
26
26
  gem 'graphql-client'
27
- gem 'minitest', '5.25.1', require: false
27
+ gem 'minitest', '5.25.4', require: false
28
28
  gem 'minitest-reporters', '1.7.1', require: false
29
29
  gem 'rake', '13.2.1', require: false
30
- gem 'rspec-rails', '7.0.1', require: false
31
- gem 'rubocop', '1.66.1', require: false
32
- gem 'rubocop-performance', '1.22.1', require: false
33
- gem 'rubocop-rspec', '3.1.0', require: false
30
+ gem 'rspec-rails', '7.1.0', require: false
31
+ gem 'rubocop', '1.69.2', require: false
32
+ gem 'rubocop-performance', '1.23.0', require: false
33
+ gem 'rubocop-rspec', '3.3.0', require: false
34
34
  gem 'simplecov', '0.22.0', require: false
35
35
  gem 'simplecov-cobertura', '2.1.0', require: false
36
36
  gem 'webmock', '3.24.0', require: false
data/Gemfile.lock CHANGED
@@ -22,25 +22,25 @@ PATH
22
22
  GEM
23
23
  remote: https://rubygems.org/
24
24
  specs:
25
- actionpack (7.2.1)
26
- actionview (= 7.2.1)
27
- activesupport (= 7.2.1)
25
+ actionpack (8.0.1)
26
+ actionview (= 8.0.1)
27
+ activesupport (= 8.0.1)
28
28
  nokogiri (>= 1.8.5)
29
- racc
30
- rack (>= 2.2.4, < 3.2)
29
+ rack (>= 2.2.4)
31
30
  rack-session (>= 1.0.1)
32
31
  rack-test (>= 0.6.3)
33
32
  rails-dom-testing (~> 2.2)
34
33
  rails-html-sanitizer (~> 1.6)
35
34
  useragent (~> 0.16)
36
- actionview (7.2.1)
37
- activesupport (= 7.2.1)
35
+ actionview (8.0.1)
36
+ activesupport (= 8.0.1)
38
37
  builder (~> 3.1)
39
38
  erubi (~> 1.11)
40
39
  rails-dom-testing (~> 2.2)
41
40
  rails-html-sanitizer (~> 1.6)
42
- activesupport (7.2.1)
41
+ activesupport (8.0.1)
43
42
  base64
43
+ benchmark (>= 0.3)
44
44
  bigdecimal
45
45
  concurrent-ruby (~> 1.0, >= 1.3.1)
46
46
  connection_pool (>= 2.2.5)
@@ -50,6 +50,7 @@ GEM
50
50
  minitest (>= 5.1)
51
51
  securerandom (>= 0.3)
52
52
  tzinfo (~> 2.0, >= 2.0.5)
53
+ uri (>= 0.13.1)
53
54
  addressable (2.8.7)
54
55
  public_suffix (>= 2.0.2, < 7.0)
55
56
  ansi (1.5.0)
@@ -68,6 +69,7 @@ GEM
68
69
  retries (~> 0)
69
70
  tago (~> 0)
70
71
  typhoeus (~> 1.3)
72
+ benchmark (0.4.0)
71
73
  bigdecimal (3.1.8)
72
74
  builder (3.3.0)
73
75
  concurrent-ruby (1.3.4)
@@ -76,6 +78,7 @@ GEM
76
78
  bigdecimal
77
79
  rexml
78
80
  crass (1.0.6)
81
+ date (3.4.1)
79
82
  decoor (0.0.1)
80
83
  diff-lcs (1.5.1)
81
84
  docile (1.4.1)
@@ -95,16 +98,16 @@ GEM
95
98
  others (> 0)
96
99
  tago (> 0)
97
100
  yaml (~> 0.3)
98
- faraday (2.12.0)
99
- faraday-net_http (>= 2.0, < 3.4)
101
+ faraday (2.12.2)
102
+ faraday-net_http (>= 2.0, < 3.5)
100
103
  json
101
104
  logger
102
105
  faraday-http-cache (2.5.1)
103
106
  faraday (>= 0.8)
104
- faraday-multipart (1.0.4)
105
- multipart-post (~> 2)
106
- faraday-net_http (3.3.0)
107
- net-http
107
+ faraday-multipart (1.1.0)
108
+ multipart-post (~> 2.0)
109
+ faraday-net_http (3.4.0)
110
+ net-http (>= 0.5.0)
108
111
  faraday-retry (2.2.1)
109
112
  faraday (~> 2.0)
110
113
  ffi (1.17.0-arm64-darwin)
@@ -112,22 +115,22 @@ GEM
112
115
  ffi (1.17.0-x86_64-darwin)
113
116
  ffi (1.17.0-x86_64-linux-gnu)
114
117
  fiber-storage (1.0.0)
115
- gli (2.21.5)
116
- graphql (2.3.18)
118
+ gli (2.22.0)
119
+ graphql (2.4.8)
117
120
  base64
118
121
  fiber-storage
119
- graphql-client (0.23.0)
122
+ graphql-client (0.25.0)
120
123
  activesupport (>= 3.0)
121
124
  graphql (>= 1.13.0)
122
- hashdiff (1.1.1)
125
+ hashdiff (1.1.2)
123
126
  i18n (1.14.6)
124
127
  concurrent-ruby (~> 1.0)
125
- io-console (0.7.2)
126
- irb (1.14.1)
128
+ io-console (0.8.0)
129
+ irb (1.14.3)
127
130
  rdoc (>= 4.0.0)
128
131
  reline (>= 0.4.2)
129
132
  iri (0.8.0)
130
- json (2.7.2)
133
+ json (2.9.0)
131
134
  judges (0.27.0)
132
135
  backtrace (~> 0)
133
136
  baza.rb (~> 0)
@@ -145,12 +148,12 @@ GEM
145
148
  typhoeus (~> 1.3)
146
149
  language_server-protocol (3.17.0.3)
147
150
  liquid (5.5.1)
148
- logger (1.6.1)
149
- loofah (2.22.0)
151
+ logger (1.6.3)
152
+ loofah (2.23.1)
150
153
  crass (~> 1.0.2)
151
154
  nokogiri (>= 1.12.0)
152
155
  loog (0.6.0)
153
- minitest (5.25.1)
156
+ minitest (5.25.4)
154
157
  minitest-reporters (1.7.1)
155
158
  ansi
156
159
  builder
@@ -158,26 +161,27 @@ GEM
158
161
  ruby-progressbar
159
162
  moments (0.3.0)
160
163
  multipart-post (2.4.1)
161
- net-http (0.4.1)
164
+ net-http (0.6.0)
162
165
  uri
163
- nokogiri (1.16.7-arm64-darwin)
166
+ nokogiri (1.17.2-arm64-darwin)
164
167
  racc (~> 1.4)
165
- nokogiri (1.16.7-x64-mingw-ucrt)
168
+ nokogiri (1.17.2-x64-mingw-ucrt)
166
169
  racc (~> 1.4)
167
- nokogiri (1.16.7-x86_64-darwin)
170
+ nokogiri (1.17.2-x86_64-darwin)
168
171
  racc (~> 1.4)
169
- nokogiri (1.16.7-x86_64-linux)
172
+ nokogiri (1.17.2-x86_64-linux)
170
173
  racc (~> 1.4)
171
174
  obk (0.3.1)
172
- octokit (9.1.0)
175
+ octokit (9.2.0)
173
176
  faraday (>= 1, < 3)
174
177
  sawyer (~> 0.9)
175
178
  others (0.0.3)
176
179
  parallel (1.26.3)
177
- parser (3.3.5.0)
180
+ parser (3.3.6.0)
178
181
  ast (~> 2.4.1)
179
182
  racc
180
- psych (5.1.2)
183
+ psych (5.2.2)
184
+ date
181
185
  stringio
182
186
  public_suffix (6.0.1)
183
187
  racc (1.8.1)
@@ -186,19 +190,18 @@ GEM
186
190
  rack (>= 3.0.0)
187
191
  rack-test (2.1.0)
188
192
  rack (>= 1.3)
189
- rackup (2.1.0)
193
+ rackup (2.2.1)
190
194
  rack (>= 3)
191
- webrick (~> 1.8)
192
195
  rails-dom-testing (2.2.0)
193
196
  activesupport (>= 5.0.0)
194
197
  minitest
195
198
  nokogiri (>= 1.6)
196
- rails-html-sanitizer (1.6.0)
199
+ rails-html-sanitizer (1.6.2)
197
200
  loofah (~> 2.21)
198
- nokogiri (~> 1.14)
199
- railties (7.2.1)
200
- actionpack (= 7.2.1)
201
- activesupport (= 7.2.1)
201
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
202
+ railties (8.0.1)
203
+ actionpack (= 8.0.1)
204
+ activesupport (= 8.0.1)
202
205
  irb (~> 1.13)
203
206
  rackup (>= 1.0.0)
204
207
  rake (>= 12.2)
@@ -206,14 +209,14 @@ GEM
206
209
  zeitwerk (~> 2.6)
207
210
  rainbow (3.1.1)
208
211
  rake (13.2.1)
209
- rdoc (6.7.0)
212
+ rdoc (6.10.0)
210
213
  psych (>= 4.0.0)
211
- regexp_parser (2.9.2)
212
- reline (0.5.10)
214
+ regexp_parser (2.9.3)
215
+ reline (0.6.0)
213
216
  io-console (~> 0.5)
214
217
  retries (0.0.5)
215
- rexml (3.3.8)
216
- rspec-core (3.13.1)
218
+ rexml (3.4.0)
219
+ rspec-core (3.13.2)
217
220
  rspec-support (~> 3.13.0)
218
221
  rspec-expectations (3.13.3)
219
222
  diff-lcs (>= 1.2.0, < 2.0)
@@ -221,7 +224,7 @@ GEM
221
224
  rspec-mocks (3.13.2)
222
225
  diff-lcs (>= 1.2.0, < 2.0)
223
226
  rspec-support (~> 3.13.0)
224
- rspec-rails (7.0.1)
227
+ rspec-rails (7.1.0)
225
228
  actionpack (>= 7.0)
226
229
  activesupport (>= 7.0)
227
230
  railties (>= 7.0)
@@ -229,29 +232,29 @@ GEM
229
232
  rspec-expectations (~> 3.13)
230
233
  rspec-mocks (~> 3.13)
231
234
  rspec-support (~> 3.13)
232
- rspec-support (3.13.1)
233
- rubocop (1.66.1)
235
+ rspec-support (3.13.2)
236
+ rubocop (1.69.2)
234
237
  json (~> 2.3)
235
238
  language_server-protocol (>= 3.17.0)
236
239
  parallel (~> 1.10)
237
240
  parser (>= 3.3.0.2)
238
241
  rainbow (>= 2.2.2, < 4.0)
239
- regexp_parser (>= 2.4, < 3.0)
240
- rubocop-ast (>= 1.32.2, < 2.0)
242
+ regexp_parser (>= 2.9.3, < 3.0)
243
+ rubocop-ast (>= 1.36.2, < 2.0)
241
244
  ruby-progressbar (~> 1.7)
242
- unicode-display_width (>= 2.4.0, < 3.0)
243
- rubocop-ast (1.32.3)
245
+ unicode-display_width (>= 2.4.0, < 4.0)
246
+ rubocop-ast (1.37.0)
244
247
  parser (>= 3.3.1.0)
245
- rubocop-performance (1.22.1)
248
+ rubocop-performance (1.23.0)
246
249
  rubocop (>= 1.48.1, < 2.0)
247
250
  rubocop-ast (>= 1.31.1, < 2.0)
248
- rubocop-rspec (3.1.0)
251
+ rubocop-rspec (3.3.0)
249
252
  rubocop (~> 1.61)
250
253
  ruby-progressbar (1.13.0)
251
254
  sawyer (0.9.2)
252
255
  addressable (>= 2.3.5)
253
256
  faraday (>= 0.17.3, < 3)
254
- securerandom (0.3.1)
257
+ securerandom (0.4.1)
255
258
  simplecov (0.22.0)
256
259
  docile (~> 1.1)
257
260
  simplecov-html (~> 0.11)
@@ -261,16 +264,18 @@ GEM
261
264
  simplecov (~> 0.19)
262
265
  simplecov-html (0.13.1)
263
266
  simplecov_json_formatter (0.1.4)
264
- stringio (3.1.1)
267
+ stringio (3.1.2)
265
268
  tago (0.0.2)
266
269
  thor (1.3.2)
267
270
  typhoeus (1.4.1)
268
271
  ethon (>= 0.9.0)
269
272
  tzinfo (2.0.6)
270
273
  concurrent-ruby (~> 1.0)
271
- unicode-display_width (2.6.0)
272
- uri (0.13.1)
273
- useragent (0.16.10)
274
+ unicode-display_width (3.1.2)
275
+ unicode-emoji (~> 4.0, >= 4.0.4)
276
+ unicode-emoji (4.0.4)
277
+ uri (1.0.2)
278
+ useragent (0.16.11)
274
279
  verbose (0.0.2)
275
280
  loog (~> 0.2)
276
281
  tago (~> 0.0)
@@ -278,13 +283,13 @@ GEM
278
283
  addressable (>= 2.8.0)
279
284
  crack (>= 0.3.2)
280
285
  hashdiff (>= 0.4.0, < 2.0.0)
281
- webrick (1.8.2)
282
- yaml (0.3.0)
286
+ yaml (0.4.0)
283
287
  yard (0.9.37)
284
- zeitwerk (2.7.0)
288
+ zeitwerk (2.7.1)
285
289
 
286
290
  PLATFORMS
287
291
  arm64-darwin-22
292
+ arm64-darwin-23
288
293
  x64-mingw-ucrt
289
294
  x86_64-darwin-20
290
295
  x86_64-darwin-21
@@ -293,13 +298,13 @@ PLATFORMS
293
298
  DEPENDENCIES
294
299
  fbe!
295
300
  graphql-client
296
- minitest (= 5.25.1)
301
+ minitest (= 5.25.4)
297
302
  minitest-reporters (= 1.7.1)
298
303
  rake (= 13.2.1)
299
- rspec-rails (= 7.0.1)
300
- rubocop (= 1.66.1)
301
- rubocop-performance (= 1.22.1)
302
- rubocop-rspec (= 3.1.0)
304
+ rspec-rails (= 7.1.0)
305
+ rubocop (= 1.69.2)
306
+ rubocop-performance (= 1.23.0)
307
+ rubocop-rspec (= 3.3.0)
303
308
  simplecov (= 0.22.0)
304
309
  simplecov-cobertura (= 2.1.0)
305
310
  webmock (= 3.24.0)
data/lib/fbe/octo.rb CHANGED
@@ -116,7 +116,7 @@ def Fbe.octo(options: $options, global: $global, loog: $loog)
116
116
  def off_quota
117
117
  left = @origin.rate_limit.remaining
118
118
  if left < 5
119
- @loog.info("To much GitHub API quota consumed already (remaining=#{left}), stopping")
119
+ @loog.info("Too much GitHub API quota consumed already (remaining=#{left}), stopping")
120
120
  true
121
121
  else
122
122
  false
data/lib/fbe/overwrite.rb CHANGED
@@ -37,11 +37,11 @@ require_relative 'fb'
37
37
  # @param [Factbase::Fact] fact The fact to modify
38
38
  # @param [String] property The name of the property to set
39
39
  # @param [Any] value The value to set
40
- # @return [nil] Nothing
40
+ # @return [Factbase::Fact] Returns new fact or previous one
41
41
  def Fbe.overwrite(fact, property, value, fb: Fbe.fb)
42
42
  raise 'The fact is nil' if fact.nil?
43
43
  raise "The property is not a String but #{property.class} (#{property})" unless property.is_a?(String)
44
- return if !fact[property].nil? && fact[property].size == 1 && fact[property].first == value
44
+ return fact if !fact[property].nil? && fact[property].size == 1 && fact[property].first == value
45
45
  before = {}
46
46
  fact.all_properties.each do |prop|
47
47
  before[prop.to_s] = fact[prop]
@@ -57,5 +57,5 @@ def Fbe.overwrite(fact, property, value, fb: Fbe.fb)
57
57
  n.send("#{k}=", v)
58
58
  end
59
59
  end
60
- nil
60
+ n
61
61
  end
data/lib/fbe.rb CHANGED
@@ -27,5 +27,5 @@
27
27
  # License:: MIT
28
28
  module Fbe
29
29
  # Current version of the gem (changed by +.rultor.yml+ on every release)
30
- VERSION = '0.0.79'
30
+ VERSION = '0.0.80'
31
31
  end
@@ -77,6 +77,14 @@ class TestOcto < Minitest::Test
77
77
  o.user('yegor256')
78
78
  end
79
79
 
80
+ def test_off_quota
81
+ WebMock.disable_net_connect!
82
+ stub_request(:get, 'https://api.github.com/rate_limit')
83
+ .to_return(status: 200, body: '{}', headers: { 'X-RateLimit-Remaining' => '1000' })
84
+ o = Fbe.octo(loog: Loog::NULL, global: {}, options: Judges::Options.new)
85
+ assert(!o.off_quota)
86
+ end
87
+
80
88
  def test_retrying
81
89
  WebMock.disable_net_connect!
82
90
  global = {}
@@ -46,6 +46,15 @@ class TestOverwrite < Minitest::Test
46
46
  assert_equal(2, fb.query('(always)').each.to_a.first['many'].size)
47
47
  end
48
48
 
49
+ def test_overwrite_twice
50
+ fb = Factbase.new
51
+ f = fb.insert
52
+ f._id = 1
53
+ f2 = Fbe.overwrite(f, 'foo', 42, fb:)
54
+ Fbe.overwrite(f2, 'bar', 7, fb:)
55
+ assert_equal(42, fb.query('(exists foo)').each.to_a.first.foo)
56
+ end
57
+
49
58
  def test_no_need_to_overwrite
50
59
  fb = Factbase.new
51
60
  f = fb.insert
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.79
4
+ version: 0.0.80
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace