fbe 0.21.2 → 0.21.3

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: f6593e4483941c4ff99de6f85aab33f62832d4293b1efb2a8e84d0b78ad79147
4
- data.tar.gz: 134ceee60e4eb50c33b8c71194ffa0464c822e07884bd230776e5c59f025e2f7
3
+ metadata.gz: 94437e7a9ee360556e5efadf0dda8990f44ae8b5166cb12682b4f77d4d8c054f
4
+ data.tar.gz: 042b18778e3007c9ea15a6ac60a0f76aa7dfe9f471c2523b657291e9a72df72d
5
5
  SHA512:
6
- metadata.gz: a43a4fb0ef720d9e459d348437c7d3824625fae9aad064c768885fc945d25e0ba68b0034132c97dd0835bf93edbcd960d64d4aa9f9bbd31af5c5589f2121ef44
7
- data.tar.gz: 5f76047d167636f220b5bcab707b2f69bbe47a471b5954a4dbe324055fb08556cec5470ac7d1d9bb22da436b91d69056b5205bf485b4ca3b63ea212eb0f649ad
6
+ metadata.gz: 9566f00402a00f1235452c6ab352b6e2824d1d930b2068c3a10f6acd8201093a6c54a096b987a2603f867927bd1b33402865b48327a8f52559c32ae1927beefe
7
+ data.tar.gz: 27ce07102a08f9324c6261eedc1bc76d249267df198a1e8834c2ab104a034e9cc7a307e49f8b5aab4dc974a5f6d5f01ad10370c0ced8005b7ccd83543ea350ca
data/fbe.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  'manipulate the facts and create new ones'
19
19
  s.authors = ['Yegor Bugayenko']
20
20
  s.email = 'yegor256@gmail.com'
21
- s.homepage = 'http://github.com/zerocracy/fbe'
21
+ s.homepage = 'https://github.com/zerocracy/fbe'
22
22
  s.files = `git ls-files`.split($RS)
23
23
  s.rdoc_options = ['--charset=UTF-8']
24
24
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
data/lib/fbe/octo.rb CHANGED
@@ -176,7 +176,9 @@ def Fbe.octo(options: $options, global: $global, loog: $loog)
176
176
  end
177
177
  o =
178
178
  others(o:) do |*args|
179
- raise "We are off-quota (remaining: #{@o.rate_limit.remaining})" if args.first != :off_quota? && @o.off_quota?
179
+ if args.first != :off_quota? && args.first != :print_trace! && @o.off_quota?
180
+ raise "We are off-quota (remaining: #{@o.rate_limit.remaining})"
181
+ end
180
182
  @o.__send__(*args)
181
183
  end
182
184
  o
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.21.2' unless const_defined?(:VERSION)
13
+ VERSION = '0.21.3' unless const_defined?(:VERSION)
14
14
  end
@@ -56,8 +56,7 @@ class TestOcto < Fbe::Test
56
56
  stub_request(:get, 'https://api.github.com/rate_limit').to_return(
57
57
  { body: '{}', headers: { 'X-RateLimit-Remaining' => '222' } }
58
58
  )
59
- global = {}
60
- o = Fbe.octo(loog: Loog::NULL, global:, options: Judges::Options.new)
59
+ o = Fbe.octo(loog: Loog::NULL, global: {}, options: Judges::Options.new)
61
60
  stub_request(:get, 'https://api.github.com/user/42').to_return(
62
61
  body: { login: 'Dude56' }.to_json, headers: { 'Content-Type': 'application/json' }
63
62
  )
@@ -65,6 +64,24 @@ class TestOcto < Fbe::Test
65
64
  assert_equal('dude56', nick)
66
65
  end
67
66
 
67
+ def test_fails_user_request_when_off_quota
68
+ WebMock.disable_net_connect!
69
+ stub_request(:get, 'https://api.github.com/rate_limit').to_return(
70
+ { body: '{}', headers: { 'X-RateLimit-Remaining' => '3' } }
71
+ )
72
+ o = Fbe.octo(loog: Loog::NULL, global: {}, options: Judges::Options.new)
73
+ assert_raises(StandardError) { o.user(42) }
74
+ end
75
+
76
+ def test_no_failure_on_printing_when_off_quota
77
+ WebMock.disable_net_connect!
78
+ stub_request(:get, 'https://api.github.com/rate_limit').to_return(
79
+ { body: '{}', headers: { 'X-RateLimit-Remaining' => '3' } }
80
+ )
81
+ o = Fbe.octo(loog: Loog::NULL, global: {}, options: Judges::Options.new)
82
+ o.print_trace!
83
+ end
84
+
68
85
  def test_reads_repo_name_by_id
69
86
  WebMock.disable_net_connect!
70
87
  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.21.2
4
+ version: 0.21.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
@@ -358,7 +358,7 @@ files:
358
358
  - test/fbe/test_who.rb
359
359
  - test/test__helper.rb
360
360
  - test/test_fbe.rb
361
- homepage: http://github.com/zerocracy/fbe
361
+ homepage: https://github.com/zerocracy/fbe
362
362
  licenses:
363
363
  - MIT
364
364
  metadata: