fbe 0.26.0 → 0.26.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: 3febaef5c95ce42ac53465cf0ba6e511c0fee2505e9ea359c9fe488ea384ef5c
4
- data.tar.gz: e17d46ddc79715f655bdef20a8484acd65dd38ac62e4f9d0717a330dcc1a2631
3
+ metadata.gz: 4d139bdf4702ebd62afe4fe4e0edd82b25b1842955c4e233be08c323eb6f8375
4
+ data.tar.gz: 35dc6d0bc91574b1b7f967892232c4b55f9096156538de5eacb51411ee20dcc7
5
5
  SHA512:
6
- metadata.gz: 1410ceb456eb24952e4665275168c67e44495f13c7d10f62a4ea7a93c2fdcbe1352bf445bfcd84b4468ab299233bac8cfa74fcf31730a7c7d9cd2e9b7fa00441
7
- data.tar.gz: 8fa1f5e93abfedb2c9e49323b14ab85c33c2f1322758d9a46237817b9308a5ce19658b3d11fafe565179ed46831912d8e13e0fa899e6d074df8914e328886882
6
+ metadata.gz: 3b65d4e592f10cfef206ff69a3f630cec44851382cfc87c5ca092bb31be7181a430241da91cb2e74628ad2cf3137f2b7034b746a319f940a4378ad3e997dd2f0
7
+ data.tar.gz: 9f894315a98b5972ba20be68cb6848d2c7743a4e64990b48e4cf33504cf9dd5716f054dc081cc99f5b5a8083d257057d527006d00f8464cd663f7f79b6e6bf52
data/Gemfile.lock CHANGED
@@ -189,7 +189,7 @@ GEM
189
189
  regexp_parser (2.10.0)
190
190
  retries (0.0.5)
191
191
  rexml (3.4.1)
192
- rubocop (1.79.0)
192
+ rubocop (1.79.1)
193
193
  json (~> 2.3)
194
194
  language_server-protocol (~> 3.17.0.2)
195
195
  lint_roller (~> 1.1.0)
@@ -199,7 +199,6 @@ GEM
199
199
  regexp_parser (>= 2.9.3, < 3.0)
200
200
  rubocop-ast (>= 1.46.0, < 2.0)
201
201
  ruby-progressbar (~> 1.7)
202
- tsort (>= 0.2.0)
203
202
  unicode-display_width (>= 2.4.0, < 4.0)
204
203
  rubocop-ast (1.46.0)
205
204
  parser (>= 3.3.7.2)
@@ -237,7 +236,6 @@ GEM
237
236
  tago (0.1.0)
238
237
  timeout (0.4.3)
239
238
  total (0.4.1)
240
- tsort (0.2.0)
241
239
  typhoeus (1.4.1)
242
240
  ethon (>= 0.9.0)
243
241
  tzinfo (2.0.6)
data/lib/fbe/octo.rb CHANGED
@@ -185,6 +185,7 @@ def Fbe.octo(options: $options, global: $global, loog: $loog)
185
185
  raise 'The name of the repo is nil' if name.nil?
186
186
  json = @origin.repository(name)
187
187
  id = json[:id]
188
+ raise "Repository #{name} not found" if id.nil?
188
189
  @loog.debug("GitHub repository #{name.inspect} has an ID: ##{id}")
189
190
  id
190
191
  end
data/lib/fbe.rb CHANGED
@@ -10,5 +10,5 @@
10
10
  # License:: MIT
11
11
  module Fbe
12
12
  # Current version of the gem (changed by +.rultor.yml+ on every release)
13
- VERSION = '0.26.0' unless const_defined?(:VERSION)
13
+ VERSION = '0.26.1' unless const_defined?(:VERSION)
14
14
  end
@@ -64,6 +64,29 @@ class TestOcto < Fbe::Test
64
64
  assert_equal('dude56', nick)
65
65
  end
66
66
 
67
+ def test_reads_repo_id_by_name
68
+ WebMock.disable_net_connect!
69
+ stub_request(:get, 'https://api.github.com/rate_limit').to_return(
70
+ { body: '{}', headers: { 'X-RateLimit-Remaining' => '222' } }
71
+ )
72
+ o = Fbe.octo(loog: Loog::NULL, global: {}, options: Judges::Options.new)
73
+ stub_request(:get, 'https://api.github.com/repos/foo/bar').to_return(
74
+ body: { id: 42 }.to_json, headers: { 'Content-Type': 'application/json' }
75
+ )
76
+ id = o.repo_id_by_name('foo/bar')
77
+ assert_equal(42, id)
78
+ end
79
+
80
+ def test_reads_lost_repo_id_by_name
81
+ WebMock.disable_net_connect!
82
+ stub_request(:get, 'https://api.github.com/rate_limit').to_return(
83
+ { body: '{}', headers: { 'X-RateLimit-Remaining' => '222' } }
84
+ )
85
+ o = Fbe.octo(loog: Loog::NULL, global: {}, options: Judges::Options.new)
86
+ stub_request(:get, 'https://api.github.com/repos/foo/bar').to_return(status: 404)
87
+ assert_raises(StandardError) { o.repo_id_by_name('foo/bar') }
88
+ end
89
+
67
90
  def test_fails_user_request_when_off_quota
68
91
  WebMock.disable_net_connect!
69
92
  stub_request(:get, 'https://api.github.com/rate_limit').to_return(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.0
4
+ version: 0.26.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko