nonnative 1.57.0 → 1.58.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d9620b9a9416b10419818af1325090b652954957e61cb2af8145350c67cbda8
4
- data.tar.gz: 53f816756bc6d2012765a673b38940767adca626f05db397009b8e7fdb12a68e
3
+ metadata.gz: 88835872283609a031fa43adb3c75d8d223690726e8d3812d6cf8c0872c1ea3f
4
+ data.tar.gz: e812abb523322839232c515a039af8acd9077bb956fdca2e3a8ec587f18d1c6a
5
5
  SHA512:
6
- metadata.gz: 01e32801f3bb31a582448a7631be074e52dd6b862aecd55c0c8d9b290760cfadb5c9d661b4d28ee0333d783813c574b7f57298dd840b671c728664a5203ec4f0
7
- data.tar.gz: eb5fc0b72af274bcb5c8d60805cdb7fe110f7001ff52a9eff8ac992572f551cb71e90163ff25c2e3913abc97f9003895b125705a4f5ab2484ee2be49f96bb1cc
6
+ metadata.gz: 48218441348e0a589a35f4c05450a655fec6e8734e0e661d292fb427b7ca274f17717e7774bd5329150ef0240265dd54e40297f973e8944eff58ec499ff5b211
7
+ data.tar.gz: 6d3d307ced857b6e7f72b1977ba7817d34dedf6c35b7df7c2925aa750b02f9476728b305be9cc93a3c6a61fea4461db707f99792569ee09dcafc1bd2acaedb08
data/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.58.1](https://github.com/alexfalkowski/nonnative/compare/v1.58.0...v1.58.1) (2022-04-06)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * use host ([#115](https://github.com/alexfalkowski/nonnative/issues/115)) ([98cccf3](https://github.com/alexfalkowski/nonnative/commit/98cccf3f7c0918cfb00650283cf472dd4e24fbbc))
11
+
12
+ ## [1.58.0](https://github.com/alexfalkowski/nonnative/compare/v1.57.1...v1.58.0) (2022-04-06)
13
+
14
+
15
+ ### Features
16
+
17
+ * allow services and proxy to use a host ([#114](https://github.com/alexfalkowski/nonnative/issues/114)) ([0e3fbd8](https://github.com/alexfalkowski/nonnative/commit/0e3fbd8bc7ba76b5c5219615b66e80da4b9545ee))
18
+
19
+ ### [1.57.1](https://github.com/alexfalkowski/nonnative/compare/v1.57.0...v1.57.1) (2022-03-28)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **command:** make sure we recreate with every execution ([#113](https://github.com/alexfalkowski/nonnative/issues/113)) ([efe2c76](https://github.com/alexfalkowski/nonnative/commit/efe2c761a54eacfa2e4afe99afea2a9c2f8eeb74))
25
+
5
26
  ## [1.57.0](https://github.com/alexfalkowski/nonnative/compare/v1.56.1...v1.57.0) (2022-03-28)
6
27
 
7
28
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.57.0)
4
+ nonnative (1.58.1)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.5)
6
6
  cucumber (>= 7, < 8)
7
7
  get_process_mem (~> 0.2.1)
@@ -24,12 +24,11 @@ GEM
24
24
  benchmark-trend (0.4.0)
25
25
  builder (3.2.4)
26
26
  concurrent-ruby (1.1.10)
27
- coveralls (0.8.23)
28
- json (>= 1.8, < 3)
29
- simplecov (~> 0.16.1)
30
- term-ansicolor (~> 1.3)
31
- thor (>= 0.19.4, < 2.0)
32
- tins (~> 1.6)
27
+ coveralls_reborn (0.24.0)
28
+ simplecov (>= 0.18.1, < 0.22.0)
29
+ term-ansicolor (~> 1.6)
30
+ thor (>= 0.20.3, < 2.0)
31
+ tins (~> 1.16)
33
32
  cucumber (7.1.0)
34
33
  builder (~> 3.2, >= 3.2.4)
35
34
  cucumber-core (~> 10.1, >= 10.1.0)
@@ -68,8 +67,8 @@ GEM
68
67
  ffi (1.15.5)
69
68
  get_process_mem (0.2.7)
70
69
  ffi (~> 1.0)
71
- google-protobuf (3.19.4-x86_64-darwin)
72
- googleapis-common-protos-types (1.3.0)
70
+ google-protobuf (3.20.0-x86_64-darwin)
71
+ googleapis-common-protos-types (1.3.1)
73
72
  google-protobuf (~> 3.14)
74
73
  grpc (1.45.0-universal-darwin)
75
74
  google-protobuf (~> 3.19)
@@ -79,8 +78,7 @@ GEM
79
78
  http-cookie (1.0.4)
80
79
  domain_name (~> 0.5)
81
80
  jaro_winkler (1.5.4)
82
- json (2.6.1)
83
- kramdown (2.3.1)
81
+ kramdown (2.3.2)
84
82
  rexml
85
83
  kramdown-parser-gfm (1.1.0)
86
84
  kramdown (~> 2.0)
@@ -94,10 +92,10 @@ GEM
94
92
  nio4r (2.5.8)
95
93
  nokogiri (1.13.3-x86_64-darwin)
96
94
  racc (~> 1.4)
97
- parallel (1.22.0)
95
+ parallel (1.22.1)
98
96
  parser (3.1.1.0)
99
97
  ast (~> 2.4.1)
100
- puma (5.6.2)
98
+ puma (5.6.4)
101
99
  nio4r (~> 2.0)
102
100
  racc (1.6.0)
103
101
  rack (2.2.3)
@@ -127,7 +125,7 @@ GEM
127
125
  rspec-expectations (3.11.0)
128
126
  diff-lcs (>= 1.2.0, < 2.0)
129
127
  rspec-support (~> 3.11.0)
130
- rspec-mocks (3.11.0)
128
+ rspec-mocks (3.11.1)
131
129
  diff-lcs (>= 1.2.0, < 2.0)
132
130
  rspec-support (~> 3.11.0)
133
131
  rspec-support (3.11.0)
@@ -144,11 +142,12 @@ GEM
144
142
  parser (>= 3.1.1.0)
145
143
  ruby-progressbar (1.11.0)
146
144
  ruby2_keywords (0.0.5)
147
- simplecov (0.16.1)
145
+ simplecov (0.21.2)
148
146
  docile (~> 1.1)
149
- json (>= 1.8, < 3)
150
- simplecov-html (~> 0.10.0)
151
- simplecov-html (0.10.2)
147
+ simplecov-html (~> 0.11)
148
+ simplecov_json_formatter (~> 0.1)
149
+ simplecov-html (0.12.3)
150
+ simplecov_json_formatter (0.1.4)
152
151
  sinatra (2.2.0)
153
152
  mustermann (~> 1.0)
154
153
  rack (~> 2.2)
@@ -191,7 +190,7 @@ PLATFORMS
191
190
 
192
191
  DEPENDENCIES
193
192
  bundler (~> 2.3)
194
- coveralls (~> 0.8.23)
193
+ coveralls_reborn (~> 0.24.0)
195
194
  nonnative!
196
195
  rubocop (~> 1.26)
197
196
  solargraph (~> 0.44.3)
data/README.md CHANGED
@@ -65,7 +65,7 @@ Nonnative.configure do |config|
65
65
 
66
66
  config.process do |p|
67
67
  p.name = 'start_1'
68
- p.command = 'features/support/bin/start 12_321'
68
+ p.command = -> { 'features/support/bin/start 12_321' }
69
69
  p.timeout = config.strategy.timeout
70
70
  p.port = 12_321
71
71
  p.log = 'features/logs/12_321.log'
@@ -77,7 +77,7 @@ Nonnative.configure do |config|
77
77
 
78
78
  config.process do |p|
79
79
  p.name = 'start_2'
80
- p.command = 'features/support/bin/start 12_322'
80
+ p.command = -> { 'features/support/bin/start 12_322' }
81
81
  p.timeout = 0.5
82
82
  p.port = 12_322
83
83
  p.log = 'features/logs/12_322.log'
@@ -134,7 +134,7 @@ Define your server:
134
134
  module Nonnative
135
135
  class EchoServer < Nonnative::Server
136
136
  def perform_start
137
- @socket_server = TCPServer.new('0.0.0.0', port)
137
+ @socket_server = TCPServer.new(service.host, service.port)
138
138
 
139
139
  loop do
140
140
  client_socket = @socket_server.accept
@@ -70,9 +70,9 @@ module Nonnative
70
70
  go = process['go']
71
71
  if go
72
72
  params = go['parameters'] || []
73
- Nonnative.go_executable(go['output'], go['executable'], go['command'], *params)
73
+ -> { Nonnative.go_executable(go['output'], go['executable'], go['command'], *params) }
74
74
  else
75
- process['command']
75
+ -> { process['command'] }
76
76
  end
77
77
  end
78
78
 
@@ -96,6 +96,7 @@ module Nonnative
96
96
  services.each do |fd|
97
97
  service do |s|
98
98
  s.name = fd['name']
99
+ s.host = fd['host'] if fd['host']
99
100
  s.port = fd['port']
100
101
 
101
102
  proxy s, fd['proxy']
@@ -106,12 +107,16 @@ module Nonnative
106
107
  def proxy(runner, proxy)
107
108
  return unless proxy
108
109
 
109
- runner.proxy = {
110
+ p = {
110
111
  type: proxy['type'],
111
112
  port: proxy['port'],
112
113
  log: proxy['log'],
113
114
  options: proxy['options']
114
115
  }
116
+
117
+ p[:host] = proxy['host'] if proxy['host']
118
+
119
+ runner.proxy = p
115
120
  end
116
121
  end
117
122
  end
@@ -2,10 +2,11 @@
2
2
 
3
3
  module Nonnative
4
4
  class ConfigurationProxy
5
- attr_accessor :type, :port, :log, :options
5
+ attr_accessor :type, :host, :port, :log, :options
6
6
 
7
7
  def initialize
8
8
  self.type = 'none'
9
+ self.host = '0.0.0.0'
9
10
  self.port = 0
10
11
  self.options = {}
11
12
  end
@@ -2,15 +2,19 @@
2
2
 
3
3
  module Nonnative
4
4
  class ConfigurationRunner
5
- attr_accessor :name, :port
5
+ attr_accessor :name, :host, :port
6
6
  attr_reader :proxy
7
7
 
8
8
  def initialize
9
+ self.host = '0.0.0.0'
10
+ self.port = 0
11
+
9
12
  @proxy = Nonnative::ConfigurationProxy.new
10
13
  end
11
14
 
12
15
  def proxy=(value)
13
16
  proxy.type = value[:type]
17
+ proxy.host = value[:host] if value[:host]
14
18
  proxy.port = value[:port]
15
19
  proxy.log = value[:log]
16
20
  proxy.options = value[:options]
@@ -12,7 +12,7 @@ module Nonnative
12
12
  end
13
13
 
14
14
  def start
15
- @tcp_server = ::TCPServer.new('0.0.0.0', service.port)
15
+ @tcp_server = ::TCPServer.new(service.host, service.port)
16
16
  @thread = Thread.new { perform_start }
17
17
  end
18
18
 
@@ -37,6 +37,10 @@ module Nonnative
37
37
  apply_state :none
38
38
  end
39
39
 
40
+ def host
41
+ service.proxy.host
42
+ end
43
+
40
44
  def port
41
45
  service.proxy.port
42
46
  end
@@ -17,7 +17,7 @@ module Nonnative
17
17
  protected
18
18
 
19
19
  def perform_start
20
- server.add_http2_port("0.0.0.0:#{proxy.port}", :this_port_is_insecure)
20
+ server.add_http2_port("#{proxy.host}:#{proxy.port}", :this_port_is_insecure)
21
21
  server.run
22
22
  end
23
23
 
@@ -13,7 +13,7 @@ module Nonnative
13
13
  protected
14
14
 
15
15
  def perform_start
16
- server.add_tcp_listener '0.0.0.0', proxy.port
16
+ server.add_tcp_listener proxy.host, proxy.port
17
17
  server.run.join
18
18
  end
19
19
 
@@ -10,6 +10,10 @@ module Nonnative
10
10
  # Do nothing.
11
11
  end
12
12
 
13
+ def host
14
+ service.host
15
+ end
16
+
13
17
  def port
14
18
  service.port
15
19
  end
@@ -34,7 +34,7 @@ module Nonnative
34
34
  attr_reader :process, :timeout
35
35
 
36
36
  def open_socket
37
- TCPSocket.new('0.0.0.0', process.port).close
37
+ TCPSocket.new(process.host, process.port).close
38
38
  end
39
39
 
40
40
  def sleep_interval
@@ -59,7 +59,7 @@ module Nonnative
59
59
  environment[k] = ENV[k] || environment[k]
60
60
  end
61
61
 
62
- spawn(environment, service.command, %i[out err] => [service.log, 'a'])
62
+ spawn(environment, service.command.call, %i[out err] => [service.log, 'a'])
63
63
  end
64
64
 
65
65
  def process_exists?
@@ -25,7 +25,7 @@ module Nonnative
25
25
  attr_reader :proxy
26
26
 
27
27
  def create_remote_socket
28
- ::TCPSocket.new('0.0.0.0', proxy.port)
28
+ ::TCPSocket.new(proxy.host, proxy.port)
29
29
  end
30
30
 
31
31
  def pipe(ready, socket1, socket2)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '1.57.0'
4
+ VERSION = '1.58.1'
5
5
  end
data/nonnative.gemspec CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency 'sinatra', '~> 2.0', '>= 2.0.8.1'
37
37
 
38
38
  spec.add_development_dependency 'bundler', '~> 2.3'
39
- spec.add_development_dependency 'coveralls', '~> 0.8.23'
39
+ spec.add_development_dependency 'coveralls_reborn', '~> 0.24.0'
40
40
  spec.add_development_dependency 'rubocop', '~> 1.26'
41
41
  spec.add_development_dependency 'solargraph', '~> 0.44.3'
42
42
  end
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.57.0
4
+ version: 1.58.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Falkowski
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-28 00:00:00.000000000 Z
11
+ date: 2022-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -201,19 +201,19 @@ dependencies:
201
201
  - !ruby/object:Gem::Version
202
202
  version: '2.3'
203
203
  - !ruby/object:Gem::Dependency
204
- name: coveralls
204
+ name: coveralls_reborn
205
205
  requirement: !ruby/object:Gem::Requirement
206
206
  requirements:
207
207
  - - "~>"
208
208
  - !ruby/object:Gem::Version
209
- version: 0.8.23
209
+ version: 0.24.0
210
210
  type: :development
211
211
  prerelease: false
212
212
  version_requirements: !ruby/object:Gem::Requirement
213
213
  requirements:
214
214
  - - "~>"
215
215
  - !ruby/object:Gem::Version
216
- version: 0.8.23
216
+ version: 0.24.0
217
217
  - !ruby/object:Gem::Dependency
218
218
  name: rubocop
219
219
  requirement: !ruby/object:Gem::Requirement