code-ruby 3.0.7 → 3.0.8

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: 4241e470b81d44e429887c08e62046e2f6f9a461eba2c44979d0d26891d50dc8
4
- data.tar.gz: 756f4b91f0b73841c14ad652ea28da7d1304c49f1fb0692eec4d9e18fec0d58e
3
+ metadata.gz: 68690c629fa2b9efc377f2c37df52fbd9bc43bdadeb25f4584ab1dade66bd31b
4
+ data.tar.gz: 45bc52004038294c5a64f60af00fa8be25e0e8776e5197f0e16e3d5360081159
5
5
  SHA512:
6
- metadata.gz: bdd9da9845c9785447fe20c56b31c6a25b3ac511e45d015062f1536f93c6db94b01c52d5f80a8ef9f98e223d286c685eb1d47c2d2f53c5dc4f206247011415d6
7
- data.tar.gz: f6af560ee806eb0ab3636370fad3e8ec807f3e7e0825956cca5357a788b02f9eefa14dfc9ec9e5e34f050e71f2a31e635b8864d82cd371eefa93d1d04e673282
6
+ metadata.gz: 3f7fd27f0fa003a92979076a66b10470dc3d63cf4752c04c920a5ba603c1cc21ce3b03ab85e53632b130f1da4bad878ffa4f1c63f66429bae71830bb36fc4724
7
+ data.tar.gz: bfff6eaea1b0c30e1a1247c3266f116e58b2c41757cf40305b1451340f06c9aec4de69acaa8e2f2dd865d202860d641414306243eeb402dad8107f8b51c57492
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- code-ruby (3.0.7)
4
+ code-ruby (3.0.8)
5
5
  activesupport
6
6
  base64
7
7
  bigdecimal
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.7
1
+ 3.0.8
@@ -226,7 +226,7 @@ class Code
226
226
  response = http.request(request)
227
227
  rescue ::Timeout::Error, ::Errno::ETIMEDOUT
228
228
  raise ::Code::Error, "http timeout"
229
- rescue OpenSSL::SSL::SSLError, IOError, SystemCallError
229
+ rescue OpenSSL::SSL::SSLError, IOError, SystemCallError, SocketError
230
230
  raise ::Code::Error, "http error"
231
231
  end
232
232
 
data/lib/code/parser.rb CHANGED
@@ -32,37 +32,37 @@ class Code
32
32
  while
33
33
  ].freeze
34
34
 
35
- MULTI_CHAR_OPERATORS = %w[
36
- &.
37
- &&
38
- &&=
39
- **
40
- *=
41
- +=
42
- -=
43
- ..
44
- ...
45
- /=
46
- ::
47
- <<=
48
- <<
49
- <=>
50
- <=
51
- ===
52
- ==
53
- =~
54
- >=
55
- >>=
56
- >>
57
- ||=
58
- ||
59
- |=
60
- !==
61
- !=
62
- !~
63
- %=
64
- ^=
65
- =>
35
+ MULTI_CHAR_OPERATORS = [
36
+ "&.",
37
+ "&&",
38
+ "&&=",
39
+ "**",
40
+ "*=",
41
+ "+=",
42
+ "-=",
43
+ "..",
44
+ "...",
45
+ "/=",
46
+ "::",
47
+ "<<=",
48
+ "<<",
49
+ "<=>",
50
+ "<=",
51
+ "===",
52
+ "==",
53
+ "=~",
54
+ ">=",
55
+ ">>=",
56
+ ">>",
57
+ "||=",
58
+ "||",
59
+ "|=",
60
+ "!==",
61
+ "!=",
62
+ "!~",
63
+ "%=",
64
+ "^=",
65
+ "=>"
66
66
  ].sort_by(&:length).reverse.freeze
67
67
  CONTINUATION_KEYWORDS = %w[or and rescue].freeze
68
68
  POSTFIX_CONTINUATIONS = %w[. :: &.].freeze
@@ -16,5 +16,18 @@ RSpec.describe Code::Object::Http do
16
16
  )
17
17
  end.to raise_error(Code::Error, "http error")
18
18
  end
19
+
20
+ it "wraps name resolution errors as Code::Error" do
21
+ allow_any_instance_of(Net::HTTP).to receive(:request).and_raise(
22
+ Socket::ResolutionError,
23
+ "getaddrinfo(3): Temporary failure in name resolution"
24
+ )
25
+
26
+ expect do
27
+ described_class.code_get(
28
+ Code::Object::String.new("https://api.github.com")
29
+ )
30
+ end.to raise_error(Code::Error, "http error")
31
+ end
19
32
  end
20
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 3.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié