nonnative 1.29.0 → 1.30.0

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: 38e0bc3edd8186e46c09f6ced347428e59c84d2fd1fa3621b43d750e6869df24
4
- data.tar.gz: bce006f5c6c8efec4ee05eed6e596a387362efd533d39a76730d4c418da3ca96
3
+ metadata.gz: c7fcfc568dcb73f6f1b5263807e8da469598b6c800cac106ae804491a58be884
4
+ data.tar.gz: 814ef1f813b390375f91f01cfffe79fd250aa66b35f985f5923b0192313fe08f
5
5
  SHA512:
6
- metadata.gz: de9987b642545511b4b4357b1b74670ba2f82d15c13b6df442ea6ef8954ac1f4225d2fdd8029395a085491dace93f827bae0fa85256a6c7c8fed90681e252b72
7
- data.tar.gz: aecc4f783443ecfc13dc8a93329e16fbf0677f09dff875bf878316e64c468e19abf3d93f08a8e246de56c33c2c103a14653b07b9048e1be2cde2458e69ca7752
6
+ metadata.gz: 4f2b14b410443eab9974039a71ccfd1fbb68591096441822df23c4a64979e39d9378ff113713918446881b91e25fcef0c3a084edb5bd2fcf40d938dcdd311c4c
7
+ data.tar.gz: eea2c695c8ea090729c65ab0b8d4926d0242125b5c11f4d1ddd62576a013ea50d0f99252ffee62e28735d705e5d0b9b434687967525ee2736bb9c175e90cf62d
@@ -1,6 +1,7 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.6
2
+ TargetRubyVersion: 2.7
3
3
  DisplayCopNames: true
4
+ NewCops: enable
4
5
 
5
6
  Layout/LineLength:
6
7
  Max: 120
@@ -16,72 +17,3 @@ Metrics/AbcSize:
16
17
 
17
18
  Style/Documentation:
18
19
  Enabled: false
19
-
20
- Lint/RaiseException:
21
- Enabled: true
22
-
23
- Style/HashEachMethods:
24
- Enabled: true
25
-
26
- Style/HashTransformKeys:
27
- Enabled: true
28
-
29
- Style/HashTransformValues:
30
- Enabled: true
31
-
32
- Lint/StructNewOverride:
33
- Enabled: true
34
-
35
- Layout/SpaceAroundMethodCallOperator:
36
- Enabled: true
37
-
38
- Style/ExponentialNotation:
39
- Enabled: true
40
-
41
- Layout/EmptyLinesAroundAttributeAccessor:
42
- Enabled: true
43
-
44
- Style/SlicingWithRange:
45
- Enabled: true
46
-
47
- Lint/DeprecatedOpenSSLConstant:
48
- Enabled: true
49
-
50
- Lint/MixedRegexpCaptureTypes:
51
- Enabled: true
52
-
53
- Style/RedundantRegexpCharacterClass:
54
- Enabled: true
55
-
56
- Style/RedundantRegexpEscape:
57
- Enabled: true
58
-
59
- Style/RedundantFetchBlock:
60
- Enabled: true
61
-
62
- Style/AccessorGrouping:
63
- Enabled: true
64
-
65
- Style/BisectedAttrAccessor:
66
- Enabled: true
67
-
68
- Style/RedundantAssignment:
69
- Enabled: true
70
-
71
- Lint/DuplicateElsifCondition:
72
- Enabled: true
73
-
74
- Style/ArrayCoercion:
75
- Enabled: true
76
-
77
- Style/CaseLikeIf:
78
- Enabled: true
79
-
80
- Style/HashAsLastArrayItem:
81
- Enabled: true
82
-
83
- Style/HashLikeCase:
84
- Enabled: true
85
-
86
- Style/RedundantFileExtensionInRequire:
87
- Enabled: true
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.29.0)
4
+ nonnative (1.30.0)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.5)
6
6
  cucumber (>= 4, < 5)
7
7
  grpc (>= 1, < 2)
8
- puma (~> 4.3, >= 4.3.3)
8
+ puma (~> 5.0)
9
9
  rest-client (~> 2.1)
10
10
  rspec-benchmark (~> 0.6.0)
11
11
  rspec-expectations (~> 3.9, >= 3.9.2)
@@ -14,7 +14,7 @@ PATH
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
- activesupport (6.0.3.2)
17
+ activesupport (6.0.3.3)
18
18
  concurrent-ruby (~> 1.0, >= 1.0.2)
19
19
  i18n (>= 0.7, < 2)
20
20
  minitest (~> 5.1)
@@ -27,7 +27,7 @@ GEM
27
27
  benchmark-perf (0.6.0)
28
28
  benchmark-trend (0.4.0)
29
29
  builder (3.2.4)
30
- concurrent-ruby (1.1.6)
30
+ concurrent-ruby (1.1.7)
31
31
  cucumber (4.1.0)
32
32
  builder (~> 3.2, >= 3.2.3)
33
33
  cucumber-core (~> 7.1, >= 7.1.0)
@@ -47,7 +47,7 @@ GEM
47
47
  cucumber-create-meta (1.0.0)
48
48
  cucumber-messages (~> 12.2, >= 12.2.0)
49
49
  sys-uname (~> 1.2, >= 1.2.1)
50
- cucumber-cucumber-expressions (10.2.2)
50
+ cucumber-cucumber-expressions (10.3.0)
51
51
  cucumber-gherkin (14.2.0)
52
52
  cucumber-messages (~> 12.4, >= 12.4.0)
53
53
  cucumber-html-formatter (7.2.0)
@@ -65,50 +65,50 @@ GEM
65
65
  unf (>= 0.0.5, < 1.0.0)
66
66
  e2mmap (0.1.0)
67
67
  ffi (1.13.1)
68
- google-protobuf (3.12.4)
68
+ google-protobuf (3.13.0)
69
69
  googleapis-common-protos-types (1.0.5)
70
70
  google-protobuf (~> 3.11)
71
- grpc (1.30.2)
72
- google-protobuf (~> 3.12)
71
+ grpc (1.32.0)
72
+ google-protobuf (~> 3.13)
73
73
  googleapis-common-protos-types (~> 1.0)
74
- grpc-tools (1.30.2)
74
+ grpc-tools (1.32.0)
75
75
  http-accept (1.7.0)
76
76
  http-cookie (1.0.3)
77
77
  domain_name (~> 0.5)
78
78
  i18n (1.8.5)
79
79
  concurrent-ruby (~> 1.0)
80
80
  jaro_winkler (1.5.4)
81
- json (2.3.0)
81
+ json (2.3.1)
82
82
  maruku (0.7.3)
83
83
  middleware (0.1.0)
84
84
  mime-types (3.3.1)
85
85
  mime-types-data (~> 3.2015)
86
86
  mime-types-data (3.2020.0512)
87
87
  mini_portile2 (2.4.0)
88
- minitest (5.14.1)
88
+ minitest (5.14.2)
89
89
  multi_test (0.1.2)
90
90
  mustermann (1.1.1)
91
91
  ruby2_keywords (~> 0.0.1)
92
92
  netrc (0.11.0)
93
- nio4r (2.5.2)
93
+ nio4r (2.5.4)
94
94
  nokogiri (1.10.10)
95
95
  mini_portile2 (~> 2.4.0)
96
96
  parallel (1.19.2)
97
- parser (2.7.1.4)
97
+ parser (2.7.1.5)
98
98
  ast (~> 2.4.1)
99
99
  protobuf-cucumber (3.10.8)
100
100
  activesupport (>= 3.2)
101
101
  middleware
102
102
  thor
103
103
  thread_safe
104
- puma (4.3.5)
104
+ puma (5.0.0)
105
105
  nio4r (~> 2.0)
106
106
  rack (2.2.3)
107
- rack-protection (2.0.8.1)
107
+ rack-protection (2.1.0)
108
108
  rack
109
109
  rainbow (3.0.0)
110
110
  rake (13.0.1)
111
- regexp_parser (1.7.1)
111
+ regexp_parser (1.8.0)
112
112
  rest-client (2.1.0)
113
113
  http-accept (>= 1.7.0, < 2.0)
114
114
  http-cookie (>= 1.0.2, < 2.0)
@@ -135,17 +135,17 @@ GEM
135
135
  diff-lcs (>= 1.2.0, < 2.0)
136
136
  rspec-support (~> 3.9.0)
137
137
  rspec-support (3.9.3)
138
- rubocop (0.88.0)
138
+ rubocop (0.92.0)
139
139
  parallel (~> 1.10)
140
- parser (>= 2.7.1.1)
140
+ parser (>= 2.7.1.5)
141
141
  rainbow (>= 2.2.2, < 4.0)
142
142
  regexp_parser (>= 1.7)
143
143
  rexml
144
- rubocop-ast (>= 0.1.0, < 1.0)
144
+ rubocop-ast (>= 0.5.0)
145
145
  ruby-progressbar (~> 1.7)
146
146
  unicode-display_width (>= 1.4.0, < 2.0)
147
- rubocop-ast (0.2.0)
148
- parser (>= 2.7.0.1)
147
+ rubocop-ast (0.6.0)
148
+ parser (>= 2.7.1.5)
149
149
  ruby-progressbar (1.10.1)
150
150
  ruby2_keywords (0.0.2)
151
151
  simplecov (0.17.1)
@@ -153,12 +153,12 @@ GEM
153
153
  json (>= 1.8, < 3)
154
154
  simplecov-html (~> 0.10.0)
155
155
  simplecov-html (0.10.2)
156
- sinatra (2.0.8.1)
156
+ sinatra (2.1.0)
157
157
  mustermann (~> 1.0)
158
- rack (~> 2.0)
159
- rack-protection (= 2.0.8.1)
158
+ rack (~> 2.2)
159
+ rack-protection (= 2.1.0)
160
160
  tilt (~> 2.0)
161
- solargraph (0.39.12)
161
+ solargraph (0.39.15)
162
162
  backport (~> 1.1)
163
163
  benchmark
164
164
  bundler (>= 1.17.2)
data/Makefile CHANGED
@@ -13,7 +13,7 @@ analysis:
13
13
  bundle exec rubocop
14
14
 
15
15
  cleanup-analysis:
16
- bundle exec rubocop -a
16
+ bundle exec rubocop -A
17
17
 
18
18
  cleanup-logs:
19
19
  rm -rf features/logs/*.log
@@ -29,7 +29,6 @@ require 'nonnative/server'
29
29
  require 'nonnative/http_client'
30
30
  require 'nonnative/http_server'
31
31
  require 'nonnative/grpc_server'
32
- require 'nonnative/grpc_server'
33
32
  require 'nonnative/observability'
34
33
  require 'nonnative/proxy_factory'
35
34
  require 'nonnative/proxy'
@@ -40,19 +40,21 @@ module Nonnative
40
40
  s.port = fd['port']
41
41
  s.log = fd['log']
42
42
 
43
- proxy = fd['proxy']
44
-
45
- if proxy
46
- s.proxy = {
47
- type: proxy['type'],
48
- port: proxy['port'],
49
- log: proxy['log'],
50
- options: proxy['options']
51
- }
52
- end
43
+ proxy s, fd['proxy']
53
44
  end
54
45
  end
55
46
  end
47
+
48
+ def proxy(server, proxy)
49
+ return unless proxy
50
+
51
+ server.proxy = {
52
+ type: proxy['type'],
53
+ port: proxy['port'],
54
+ log: proxy['log'],
55
+ options: proxy['options']
56
+ }
57
+ end
56
58
  end
57
59
 
58
60
  def initialize
@@ -3,7 +3,7 @@
3
3
  module Nonnative
4
4
  class DelaySocketPair < SocketPair
5
5
  def read(socket)
6
- duration = proxy.options.dig(:delay) || 2
6
+ duration = proxy.options[:delay] || 2
7
7
  sleep duration
8
8
 
9
9
  super socket
@@ -6,10 +6,8 @@ module Nonnative
6
6
  @time = time
7
7
  end
8
8
 
9
- def perform
10
- ::Timeout.timeout(time) do
11
- yield
12
- end
9
+ def perform(&block)
10
+ ::Timeout.timeout(time, &block)
13
11
  rescue ::Timeout::Error
14
12
  false
15
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '1.29.0'
4
+ VERSION = '1.30.0'
5
5
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+
5
6
  require 'nonnative/version'
6
7
 
7
8
  Gem::Specification.new do |spec|
@@ -14,20 +15,18 @@ Gem::Specification.new do |spec|
14
15
  spec.description = spec.summary
15
16
  spec.homepage = 'https://github.com/alexfalkowski/nonnative'
16
17
  spec.license = 'Unlicense'
17
-
18
- # Specify which files should be added to the gem when it is released.
19
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
18
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
19
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
20
  end
23
21
  spec.bindir = 'exe'
24
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
23
  spec.require_paths = ['lib']
24
+ spec.required_ruby_version = ['>= 2.0.0', '< 2.8.0']
26
25
 
27
26
  spec.add_dependency 'concurrent-ruby', '~> 1.0', '>= 1.0.5'
28
27
  spec.add_dependency 'cucumber', ['>= 4', '< 5']
29
28
  spec.add_dependency 'grpc', ['>= 1', '< 2']
30
- spec.add_dependency 'puma', '~> 4.3', '>= 4.3.3'
29
+ spec.add_dependency 'puma', '~> 5.0'
31
30
  spec.add_dependency 'rest-client', '~> 2.1'
32
31
  spec.add_dependency 'rspec-benchmark', '~> 0.6.0'
33
32
  spec.add_dependency 'rspec-expectations', '~> 3.9', '>= 3.9.2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nonnative
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.29.0
4
+ version: 1.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Falkowski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-04 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -76,20 +76,14 @@ dependencies:
76
76
  requirements:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
- version: '4.3'
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 4.3.3
79
+ version: '5.0'
83
80
  type: :runtime
84
81
  prerelease: false
85
82
  version_requirements: !ruby/object:Gem::Requirement
86
83
  requirements:
87
84
  - - "~>"
88
85
  - !ruby/object:Gem::Version
89
- version: '4.3'
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- version: 4.3.3
86
+ version: '5.0'
93
87
  - !ruby/object:Gem::Dependency
94
88
  name: rest-client
95
89
  requirement: !ruby/object:Gem::Requirement
@@ -328,7 +322,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
328
322
  requirements:
329
323
  - - ">="
330
324
  - !ruby/object:Gem::Version
331
- version: '0'
325
+ version: 2.0.0
326
+ - - "<"
327
+ - !ruby/object:Gem::Version
328
+ version: 2.8.0
332
329
  required_rubygems_version: !ruby/object:Gem::Requirement
333
330
  requirements:
334
331
  - - ">="