nonnative 1.45.0 → 1.51.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: 85f5fe8fb5f61dce67f48ddf86ea0d2b76a6446e0e249af0f5afd22229bf3d3d
4
- data.tar.gz: 178d46b667d50d4f8b68b0e18946ca2aa265e41fd3f8c869229a6e464ddf6e41
3
+ metadata.gz: 1b2f84dcef4f0274b78d6b719b9ebc448fef5c15a25e41df7d1b4c87cc5ddd31
4
+ data.tar.gz: 7d1fc75bd501606f6222524726b3df93f7ccdde927a3459b08e0b23ed342b5b3
5
5
  SHA512:
6
- metadata.gz: 782d41b50946ad3741bdf1deedaff39c47db9d890d00f6e2d3ea854c8dff0a9ca3e96d3960f6e2c9d8776b41f4dc6170ca7d0fd65fb86fb65809922258b9f2df
7
- data.tar.gz: 317a75048db20140a4cd99dfc87ab8001fa4bcbfda7fc750fc3fb00ab8bfb7f7e25e16a38be17faff2c100c683281fac4f1fa9054cc4a39f510baabf6f174bb6
6
+ metadata.gz: a8f0162cbb7b0e8728a06fc371ab9e31316ad79a1f09955e6f5a64e0d98863c586ed58c0b39b5ffc3bff63b63cf8413952d9fff9991f2d22acd0ab3343e144f5
7
+ data.tar.gz: d8d1bd8ee57d0dc4b8f5de8e203883c4816e1a0193fbe296bc3684ba7252d1d0a39dae315886073b85928415ea03058bd060ad2acc092c7fd3a53b6c6f45d09f
data/.circleci/config.yml CHANGED
@@ -3,7 +3,7 @@ version: 2.1
3
3
  jobs:
4
4
  build:
5
5
  docker:
6
- - image: alexfalkowski/ruby:2.7
6
+ - image: alexfalkowski/ruby:3.0
7
7
  steps:
8
8
  - checkout
9
9
  - restore_cache:
@@ -28,7 +28,7 @@ jobs:
28
28
  - image: alexfalkowski/release:2.0
29
29
  steps:
30
30
  - checkout
31
- - run: release.sh
31
+ - run: release
32
32
 
33
33
  workflows:
34
34
  nonnative:
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.7
2
+ TargetRubyVersion: 3.0
3
3
  DisplayCopNames: true
4
4
  NewCops: enable
5
5
 
@@ -13,7 +13,7 @@ Metrics/BlockLength:
13
13
  Max: 80
14
14
 
15
15
  Metrics/AbcSize:
16
- Max: 20
16
+ Max: 22
17
17
 
18
18
  Style/Documentation:
19
19
  Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.7.2
1
+ ruby-3.0.0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,57 @@
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.51.1](https://github.com/alexfalkowski/nonnative/compare/v1.51.0...v1.51.1) (2021-07-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * to version 1.51.1 ([#94](https://github.com/alexfalkowski/nonnative/issues/94)) ([06e2199](https://github.com/alexfalkowski/nonnative/commit/06e21997f1a18ebf40eb3db92b55a5af8f45b50f))
11
+
12
+ ## [1.51.0](https://github.com/alexfalkowski/nonnative/compare/v1.50.1...v1.51.0) (2021-07-20)
13
+
14
+
15
+ ### Features
16
+
17
+ * **deps:** update cucumber to 7.0.0 ([#93](https://github.com/alexfalkowski/nonnative/issues/93)) ([996c014](https://github.com/alexfalkowski/nonnative/commit/996c014eb843950b62febfc4fbd3f82c959c42ae))
18
+
19
+ ### [1.50.1](https://github.com/alexfalkowski/nonnative/compare/v1.50.0...v1.50.1) (2021-07-19)
20
+
21
+ ## [1.50.0](https://github.com/alexfalkowski/nonnative/compare/v1.49.0...v1.50.0) (2021-06-06)
22
+
23
+
24
+ ### Features
25
+
26
+ * **deps:** update ([#91](https://github.com/alexfalkowski/nonnative/issues/91)) ([9817716](https://github.com/alexfalkowski/nonnative/commit/9817716fdf27da6af5713d0a8847a64a62f978dd))
27
+
28
+ ## [1.49.0](https://github.com/alexfalkowski/nonnative/compare/v1.48.0...v1.49.0) (2021-05-28)
29
+
30
+
31
+ ### Features
32
+
33
+ * **deps:** update ([#90](https://github.com/alexfalkowski/nonnative/issues/90)) ([2644345](https://github.com/alexfalkowski/nonnative/commit/2644345e8f735276e778e3e977514b3b047c7c01))
34
+
35
+ ## [1.48.0](https://github.com/alexfalkowski/nonnative/compare/v1.47.0...v1.48.0) (2021-05-15)
36
+
37
+
38
+ ### Features
39
+
40
+ * **deps:** update to ruby version 3.0.0 ([#89](https://github.com/alexfalkowski/nonnative/issues/89)) ([e2b37bf](https://github.com/alexfalkowski/nonnative/commit/e2b37bfc6e6dd922258cc1d1bc5b6abc4d78fd02))
41
+
42
+ ## [1.47.0](https://github.com/alexfalkowski/nonnative/compare/v1.46.0...v1.47.0) (2021-05-14)
43
+
44
+
45
+ ### Features
46
+
47
+ * allow to pass env variables to processes ([#88](https://github.com/alexfalkowski/nonnative/issues/88)) ([4401a77](https://github.com/alexfalkowski/nonnative/commit/4401a776ccc50dbefa45b06de01945abf4724864))
48
+
49
+ ## [1.46.0](https://github.com/alexfalkowski/nonnative/compare/v1.45.0...v1.46.0) (2021-05-10)
50
+
51
+
52
+ ### Features
53
+
54
+ * add loading config through configure ([#87](https://github.com/alexfalkowski/nonnative/issues/87)) ([a95e8b6](https://github.com/alexfalkowski/nonnative/commit/a95e8b6817380afd732d0aefb170726f905548cb))
55
+
5
56
  ## [1.45.0](https://github.com/alexfalkowski/nonnative/compare/v1.44.1...v1.45.0) (2021-05-10)
6
57
 
7
58
 
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.45.0)
4
+ nonnative (1.51.1)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.5)
6
- cucumber (>= 6, < 7)
6
+ cucumber (>= 7, < 8)
7
7
  grpc (>= 1, < 2)
8
8
  grpc-tools (>= 1, < 2)
9
9
  puma (~> 5.0)
@@ -15,105 +15,89 @@ PATH
15
15
  GEM
16
16
  remote: https://rubygems.org/
17
17
  specs:
18
- activesupport (6.1.3.2)
19
- concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (>= 1.6, < 2)
21
- minitest (>= 5.1)
22
- tzinfo (~> 2.0)
23
- zeitwerk (~> 2.3)
24
18
  ast (2.4.2)
25
- backport (1.1.2)
19
+ backport (1.2.0)
26
20
  benchmark (0.1.1)
27
21
  benchmark-malloc (0.2.0)
28
22
  benchmark-perf (0.6.0)
29
23
  benchmark-trend (0.4.0)
30
24
  builder (3.2.4)
31
- concurrent-ruby (1.1.8)
25
+ concurrent-ruby (1.1.9)
32
26
  coveralls (0.8.23)
33
27
  json (>= 1.8, < 3)
34
28
  simplecov (~> 0.16.1)
35
29
  term-ansicolor (~> 1.3)
36
30
  thor (>= 0.19.4, < 2.0)
37
31
  tins (~> 1.6)
38
- cucumber (6.0.0)
32
+ cucumber (7.0.0)
39
33
  builder (~> 3.2, >= 3.2.4)
40
- cucumber-core (~> 9.0, >= 9.0.0)
41
- cucumber-create-meta (~> 4.0, >= 4.0.0)
34
+ cucumber-core (~> 10.0, >= 10.0.1)
35
+ cucumber-create-meta (~> 6.0, >= 6.0.1)
42
36
  cucumber-cucumber-expressions (~> 12.1, >= 12.1.1)
43
- cucumber-gherkin (~> 18.1, >= 18.1.0)
44
- cucumber-html-formatter (~> 13.0, >= 13.0.0)
45
- cucumber-messages (~> 15.0, >= 15.0.0)
46
- cucumber-wire (~> 5.0, >= 5.0.0)
37
+ cucumber-gherkin (~> 20.0, >= 20.0.1)
38
+ cucumber-html-formatter (~> 16.0, >= 16.0.1)
39
+ cucumber-messages (~> 17.0, >= 17.0.1)
40
+ cucumber-wire (~> 6.0, >= 6.0.1)
47
41
  diff-lcs (~> 1.4, >= 1.4.4)
48
42
  mime-types (~> 3.3, >= 3.3.1)
49
43
  multi_test (~> 0.1, >= 0.1.2)
50
44
  sys-uname (~> 1.2, >= 1.2.2)
51
- cucumber-core (9.0.0)
52
- cucumber-gherkin (~> 18.1, >= 18.1.0)
53
- cucumber-messages (~> 15.0, >= 15.0.0)
45
+ cucumber-core (10.0.1)
46
+ cucumber-gherkin (~> 20.0, >= 20.0.1)
47
+ cucumber-messages (~> 17.0, >= 17.0.1)
54
48
  cucumber-tag-expressions (~> 3.0, >= 3.0.1)
55
- cucumber-create-meta (4.0.0)
56
- cucumber-messages (~> 15.0, >= 15.0.0)
49
+ cucumber-create-meta (6.0.1)
50
+ cucumber-messages (~> 17.0, >= 17.0.1)
57
51
  sys-uname (~> 1.2, >= 1.2.2)
58
52
  cucumber-cucumber-expressions (12.1.1)
59
- cucumber-gherkin (18.1.1)
60
- cucumber-messages (~> 15.0, >= 15.0.0)
61
- cucumber-html-formatter (13.0.0)
62
- cucumber-messages (~> 15.0, >= 15.0.0)
63
- cucumber-messages (15.0.0)
64
- protobuf-cucumber (~> 3.10, >= 3.10.8)
53
+ cucumber-gherkin (20.0.1)
54
+ cucumber-messages (~> 17.0, >= 17.0.1)
55
+ cucumber-html-formatter (16.0.1)
56
+ cucumber-messages (~> 17.0, >= 17.0.1)
57
+ cucumber-messages (17.0.1)
65
58
  cucumber-tag-expressions (3.0.1)
66
- cucumber-wire (5.0.0)
67
- cucumber-core (~> 9.0, >= 9.0.0)
59
+ cucumber-wire (6.0.1)
60
+ cucumber-core (~> 10.0, >= 10.0.1)
68
61
  cucumber-cucumber-expressions (~> 12.1, >= 12.1.1)
69
- cucumber-messages (~> 15.0, >= 15.0.0)
62
+ cucumber-messages (~> 17.0, >= 17.0.1)
70
63
  diff-lcs (1.4.4)
71
- docile (1.3.5)
64
+ docile (1.4.0)
72
65
  domain_name (0.5.20190701)
73
66
  unf (>= 0.0.5, < 1.0.0)
74
67
  e2mmap (0.1.0)
75
- ffi (1.15.0)
76
- google-protobuf (3.16.0)
77
- googleapis-common-protos-types (1.0.6)
68
+ ffi (1.15.3)
69
+ google-protobuf (3.17.3)
70
+ googleapis-common-protos-types (1.1.0)
78
71
  google-protobuf (~> 3.14)
79
- grpc (1.37.1)
72
+ grpc (1.38.0)
80
73
  google-protobuf (~> 3.15)
81
74
  googleapis-common-protos-types (~> 1.0)
82
- grpc-tools (1.37.1)
75
+ grpc-tools (1.38.0)
83
76
  http-accept (1.7.0)
84
- http-cookie (1.0.3)
77
+ http-cookie (1.0.4)
85
78
  domain_name (~> 0.5)
86
- i18n (1.8.10)
87
- concurrent-ruby (~> 1.0)
88
79
  jaro_winkler (1.5.4)
89
80
  json (2.5.1)
90
81
  kramdown (2.3.1)
91
82
  rexml
92
83
  kramdown-parser-gfm (1.1.0)
93
84
  kramdown (~> 2.0)
94
- middleware (0.1.0)
95
85
  mime-types (3.3.1)
96
86
  mime-types-data (~> 3.2015)
97
- mime-types-data (3.2021.0225)
98
- mini_portile2 (2.5.0)
99
- minitest (5.14.4)
87
+ mime-types-data (3.2021.0704)
88
+ mini_portile2 (2.5.3)
100
89
  multi_test (0.1.2)
101
90
  mustermann (1.1.1)
102
91
  ruby2_keywords (~> 0.0.1)
103
92
  netrc (0.11.0)
104
93
  nio4r (2.5.7)
105
- nokogiri (1.11.3)
94
+ nokogiri (1.11.7)
106
95
  mini_portile2 (~> 2.5.0)
107
96
  racc (~> 1.4)
108
97
  parallel (1.20.1)
109
- parser (3.0.1.1)
98
+ parser (3.0.2.0)
110
99
  ast (~> 2.4.1)
111
- protobuf-cucumber (3.10.8)
112
- activesupport (>= 3.2)
113
- middleware
114
- thor
115
- thread_safe
116
- puma (5.3.0)
100
+ puma (5.3.2)
117
101
  nio4r (~> 2.0)
118
102
  racc (1.5.2)
119
103
  rack (2.2.3)
@@ -147,19 +131,19 @@ GEM
147
131
  diff-lcs (>= 1.2.0, < 2.0)
148
132
  rspec-support (~> 3.10.0)
149
133
  rspec-support (3.10.2)
150
- rubocop (1.14.0)
134
+ rubocop (1.18.3)
151
135
  parallel (~> 1.10)
152
136
  parser (>= 3.0.0.0)
153
137
  rainbow (>= 2.2.2, < 4.0)
154
138
  regexp_parser (>= 1.8, < 3.0)
155
139
  rexml
156
- rubocop-ast (>= 1.5.0, < 2.0)
140
+ rubocop-ast (>= 1.7.0, < 2.0)
157
141
  ruby-progressbar (~> 1.7)
158
142
  unicode-display_width (>= 1.4.0, < 3.0)
159
- rubocop-ast (1.5.0)
143
+ rubocop-ast (1.8.0)
160
144
  parser (>= 3.0.1.1)
161
145
  ruby-progressbar (1.11.0)
162
- ruby2_keywords (0.0.4)
146
+ ruby2_keywords (0.0.5)
163
147
  simplecov (0.16.1)
164
148
  docile (~> 1.1)
165
149
  json (>= 1.8, < 3)
@@ -170,10 +154,11 @@ GEM
170
154
  rack (~> 2.2)
171
155
  rack-protection (= 2.1.0)
172
156
  tilt (~> 2.0)
173
- solargraph (0.40.4)
174
- backport (~> 1.1)
157
+ solargraph (0.42.4)
158
+ backport (~> 1.2)
175
159
  benchmark
176
160
  bundler (>= 1.17.2)
161
+ diff-lcs (~> 1.4)
177
162
  e2mmap
178
163
  jaro_winkler (~> 1.5)
179
164
  kramdown (~> 2.3)
@@ -189,29 +174,25 @@ GEM
189
174
  ffi (~> 1.1)
190
175
  term-ansicolor (1.7.1)
191
176
  tins (~> 1.0)
192
- thor (1.0.1)
193
- thread_safe (0.3.6)
177
+ thor (1.1.0)
194
178
  tilt (2.0.10)
195
- tins (1.28.0)
179
+ tins (1.29.1)
196
180
  sync
197
- tzinfo (2.0.4)
198
- concurrent-ruby (~> 1.0)
199
181
  unf (0.1.4)
200
182
  unf_ext
201
183
  unf_ext (0.0.7.7)
202
184
  unicode-display_width (2.0.0)
203
185
  yard (0.9.26)
204
- zeitwerk (2.4.2)
205
186
 
206
187
  PLATFORMS
207
188
  ruby
208
189
 
209
190
  DEPENDENCIES
210
- bundler (~> 2.1, >= 2.1.4)
191
+ bundler (~> 2.2, >= 2.2.17)
211
192
  coveralls (~> 0.8.23)
212
193
  nonnative!
213
- rubocop (~> 1.14)
214
- solargraph (~> 0.40.4)
194
+ rubocop (~> 1.16)
195
+ solargraph (~> 0.41)
215
196
 
216
197
  BUNDLED WITH
217
- 2.1.4
198
+ 2.2.17
data/README.md CHANGED
@@ -69,7 +69,10 @@ Nonnative.configure do |config|
69
69
  p.timeout = config.strategy.timeout
70
70
  p.port = 12_321
71
71
  p.log = 'features/logs/12_321.log'
72
- p.signal = 'INT' # Possible values are described in Signal.list.keys
72
+ p.signal = 'INT' # Possible values are described in Signal.list.keys.
73
+ p.environment = { # Pass environment variables to process.
74
+ 'TEST' => 'true'
75
+ }
73
76
  end
74
77
 
75
78
  config.process do |p|
@@ -94,7 +97,9 @@ processes:
94
97
  timeout: 5
95
98
  port: 12321
96
99
  log: features/logs/12_321.log
97
- signal: INT # Possible values are described in Signal.list.keys
100
+ signal: INT # Possible values are described in Signal.list.keys.
101
+ environment: # Pass environment variables to process.
102
+ TEST: true
98
103
  -
99
104
  name: start_2
100
105
  command: features/support/bin/start 12_322
@@ -108,7 +113,9 @@ Then load the file with
108
113
  ```ruby
109
114
  require 'nonnative'
110
115
 
111
- Nonnative.load_configuration('configuration.yml')
116
+ Nonnative.configure do |config|
117
+ config.load_file('configuration.yml')
118
+ end
112
119
  ```
113
120
 
114
121
  ### Servers
@@ -189,7 +196,9 @@ Then load the file with:
189
196
  ```ruby
190
197
  require 'nonnative'
191
198
 
192
- Nonnative.load_configuration('configuration.yml')
199
+ Nonnative.configure do |config|
200
+ config.load_file('configuration.yml')
201
+ end
193
202
  ```
194
203
 
195
204
  #### HTTP
@@ -255,7 +264,9 @@ Then load the file with:
255
264
  ```ruby
256
265
  require 'nonnative'
257
266
 
258
- Nonnative.load_configuration('configuration.yml')
267
+ Nonnative.configure do |config|
268
+ config.load_file('configuration.yml')
269
+ end
259
270
  ```
260
271
 
261
272
  #### gRPC
@@ -317,7 +328,9 @@ Then load the file with:
317
328
  ```ruby
318
329
  require 'nonnative'
319
330
 
320
- Nonnative.load_configuration('configuration.yml')
331
+ Nonnative.configure do |config|
332
+ config.load_file('configuration.yml')
333
+ end
321
334
  ```
322
335
 
323
336
  ### Services
@@ -363,7 +376,9 @@ Then load the file with
363
376
  ```ruby
364
377
  require 'nonnative'
365
378
 
366
- Nonnative.load_configuration('configuration.yml')
379
+ Nonnative.configure do |config|
380
+ config.load_file('configuration.yml')
381
+ end
367
382
  ```
368
383
 
369
384
  #### Proxies
data/lib/nonnative.rb CHANGED
@@ -60,10 +60,6 @@ module Nonnative
60
60
  Nonnative::GoCommand.new(exec, output).executable(cmd, params)
61
61
  end
62
62
 
63
- def load_configuration(path)
64
- @configuration ||= Nonnative::Configuration.load_file(path) # rubocop:disable Naming/MemoizedInstanceVariableName
65
- end
66
-
67
63
  def configuration
68
64
  @configuration ||= Nonnative::Configuration.new
69
65
  end
@@ -2,87 +2,6 @@
2
2
 
3
3
  module Nonnative
4
4
  class Configuration
5
- class << self
6
- def load_file(path)
7
- file = YAML.load_file(path)
8
-
9
- new.tap do |c|
10
- c.strategy = file['strategy']
11
-
12
- processes(file, c)
13
- servers(file, c)
14
- services(file, c)
15
- end
16
- end
17
-
18
- private
19
-
20
- def processes(file, config)
21
- processes = file['processes'] || []
22
- processes.each do |fd|
23
- config.process do |d|
24
- d.name = fd['name']
25
- d.command = command(fd)
26
- d.timeout = fd['timeout']
27
- d.port = fd['port']
28
- d.log = fd['log']
29
- d.signal = fd['signal']
30
-
31
- proxy d, fd['proxy']
32
- end
33
- end
34
- end
35
-
36
- def command(process)
37
- go = process['go']
38
- if go
39
- Nonnative.go_executable(go['output'], go['executable'], go['command'], *go['parameters'])
40
- else
41
- process['command']
42
- end
43
- end
44
-
45
- def servers(file, config)
46
- servers = file['servers'] || []
47
- servers.each do |fd|
48
- config.server do |s|
49
- s.name = fd['name']
50
- s.klass = Object.const_get(fd['class'])
51
- s.timeout = fd['timeout']
52
- s.port = fd['port']
53
- s.log = fd['log']
54
-
55
- proxy s, fd['proxy']
56
- end
57
- end
58
- end
59
-
60
- def services(file, config)
61
- services = file['services'] || []
62
- services.each do |fd|
63
- config.service do |s|
64
- s.name = fd['name']
65
- s.timeout = fd['timeout']
66
- s.port = fd['port']
67
- s.log = fd['log']
68
-
69
- proxy s, fd['proxy']
70
- end
71
- end
72
- end
73
-
74
- def proxy(server, proxy)
75
- return unless proxy
76
-
77
- server.proxy = {
78
- type: proxy['type'],
79
- port: proxy['port'],
80
- log: proxy['log'],
81
- options: proxy['options']
82
- }
83
- end
84
- end
85
-
86
5
  def initialize
87
6
  @strategy = Strategy.new
88
7
  @processes = []
@@ -93,6 +12,16 @@ module Nonnative
93
12
  attr_accessor :processes, :servers, :services
94
13
  attr_reader :strategy
95
14
 
15
+ def load_file(path)
16
+ file = YAML.load_file(path)
17
+
18
+ self.strategy = file['strategy']
19
+
20
+ add_processes(file)
21
+ add_servers(file)
22
+ add_services(file)
23
+ end
24
+
96
25
  def strategy=(value)
97
26
  @strategy = Strategy.new(value)
98
27
  end
@@ -117,5 +46,72 @@ module Nonnative
117
46
 
118
47
  services << service
119
48
  end
49
+
50
+ private
51
+
52
+ def add_processes(file)
53
+ processes = file['processes'] || []
54
+ processes.each do |fd|
55
+ process do |d|
56
+ d.name = fd['name']
57
+ d.command = command(fd)
58
+ d.timeout = fd['timeout']
59
+ d.port = fd['port']
60
+ d.log = fd['log']
61
+ d.signal = fd['signal']
62
+ d.environment = fd['environment']
63
+
64
+ proxy d, fd['proxy']
65
+ end
66
+ end
67
+ end
68
+
69
+ def command(process)
70
+ go = process['go']
71
+ if go
72
+ params = go['parameters'] || []
73
+ Nonnative.go_executable(go['output'], go['executable'], go['command'], *params)
74
+ else
75
+ process['command']
76
+ end
77
+ end
78
+
79
+ def add_servers(file)
80
+ servers = file['servers'] || []
81
+ servers.each do |fd|
82
+ server do |s|
83
+ s.name = fd['name']
84
+ s.klass = Object.const_get(fd['class'])
85
+ s.timeout = fd['timeout']
86
+ s.port = fd['port']
87
+ s.log = fd['log']
88
+
89
+ proxy s, fd['proxy']
90
+ end
91
+ end
92
+ end
93
+
94
+ def add_services(file)
95
+ services = file['services'] || []
96
+ services.each do |fd|
97
+ service do |s|
98
+ s.name = fd['name']
99
+ s.port = fd['port']
100
+
101
+ proxy s, fd['proxy']
102
+ end
103
+ end
104
+ end
105
+
106
+ def proxy(runner, proxy)
107
+ return unless proxy
108
+
109
+ runner.proxy = {
110
+ type: proxy['type'],
111
+ port: proxy['port'],
112
+ log: proxy['log'],
113
+ options: proxy['options']
114
+ }
115
+ end
120
116
  end
121
117
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nonnative
4
4
  class ConfigurationProcess < ConfigurationRunner
5
- attr_accessor :command, :signal
5
+ attr_accessor :command, :signal, :timeout, :log, :environment
6
6
  end
7
7
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Nonnative
4
4
  class ConfigurationRunner
5
- attr_accessor :name, :timeout, :port, :log
5
+ attr_accessor :name, :port
6
6
  attr_reader :proxy
7
7
 
8
8
  def initialize
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nonnative
4
4
  class ConfigurationServer < ConfigurationRunner
5
- attr_accessor :klass
5
+ attr_accessor :klass, :timeout, :log
6
6
  end
7
7
  end
@@ -2,6 +2,12 @@
2
2
 
3
3
  module Nonnative
4
4
  class Process < Runner
5
+ def initialize(service)
6
+ super service
7
+
8
+ @timeout = Nonnative::Timeout.new(service.timeout)
9
+ end
10
+
5
11
  def start
6
12
  unless process_exists?
7
13
  proxy.start
@@ -32,7 +38,7 @@ module Nonnative
32
38
 
33
39
  private
34
40
 
35
- attr_reader :pid
41
+ attr_reader :pid, :timeout
36
42
 
37
43
  def process_kill
38
44
  signal = Signal.list[service.signal || 'INT'] || Signal.list['INT']
@@ -40,7 +46,10 @@ module Nonnative
40
46
  end
41
47
 
42
48
  def process_spawn
43
- spawn(service.command, %i[out err] => [service.log, 'a'])
49
+ environment = service.environment || {}
50
+ environment = environment.transform_keys(&:to_s).transform_values(&:to_s)
51
+
52
+ spawn(environment, service.command, %i[out err] => [service.log, 'a'])
44
53
  end
45
54
 
46
55
  def process_exists?
@@ -6,7 +6,6 @@ module Nonnative
6
6
 
7
7
  def initialize(service)
8
8
  @service = service
9
- @timeout = Nonnative::Timeout.new(service.timeout)
10
9
  @proxy = Nonnative::ProxyFactory.create(service)
11
10
  end
12
11
 
@@ -16,7 +15,7 @@ module Nonnative
16
15
 
17
16
  protected
18
17
 
19
- attr_reader :service, :timeout
18
+ attr_reader :service
20
19
 
21
20
  def wait_start
22
21
  sleep 0.1
@@ -2,6 +2,12 @@
2
2
 
3
3
  module Nonnative
4
4
  class Server < Runner
5
+ def initialize(service)
6
+ super service
7
+
8
+ @timeout = Nonnative::Timeout.new(service.timeout)
9
+ end
10
+
5
11
  def start
6
12
  unless thread
7
13
  proxy.start
@@ -28,6 +34,6 @@ module Nonnative
28
34
 
29
35
  private
30
36
 
31
- attr_reader :thread
37
+ attr_reader :thread, :timeout
32
38
  end
33
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '1.45.0'
4
+ VERSION = '1.51.1'
5
5
  end
data/nonnative.gemspec CHANGED
@@ -21,10 +21,10 @@ Gem::Specification.new do |spec|
21
21
  spec.bindir = 'exe'
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ['lib']
24
- spec.required_ruby_version = ['>= 2.7.0', '< 2.8.0']
24
+ spec.required_ruby_version = ['>= 3.0.0', '< 4.0.0']
25
25
 
26
26
  spec.add_dependency 'concurrent-ruby', '~> 1.0', '>= 1.0.5'
27
- spec.add_dependency 'cucumber', ['>= 6', '< 7']
27
+ spec.add_dependency 'cucumber', ['>= 7', '< 8']
28
28
  spec.add_dependency 'grpc', ['>= 1', '< 2']
29
29
  spec.add_dependency 'grpc-tools', ['>= 1', '< 2']
30
30
  spec.add_dependency 'puma', '~> 5.0'
@@ -33,8 +33,8 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency 'rspec-expectations', '~> 3.9', '>= 3.9.2'
34
34
  spec.add_dependency 'sinatra', '~> 2.0', '>= 2.0.8.1'
35
35
 
36
- spec.add_development_dependency 'bundler', '~> 2.1', '>= 2.1.4'
36
+ spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.17'
37
37
  spec.add_development_dependency 'coveralls', '~> 0.8.23'
38
- spec.add_development_dependency 'rubocop', '~> 1.14'
39
- spec.add_development_dependency 'solargraph', '~> 0.40.4'
38
+ spec.add_development_dependency 'rubocop', '~> 1.16'
39
+ spec.add_development_dependency 'solargraph', '~> 0.41'
40
40
  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.45.0
4
+ version: 1.51.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: 2021-05-10 00:00:00.000000000 Z
11
+ date: 2021-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -36,20 +36,20 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: '6'
39
+ version: '7'
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: '7'
42
+ version: '8'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: '6'
49
+ version: '7'
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: '7'
52
+ version: '8'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: grpc
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -178,20 +178,20 @@ dependencies:
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: '2.1'
181
+ version: '2.2'
182
182
  - - ">="
183
183
  - !ruby/object:Gem::Version
184
- version: 2.1.4
184
+ version: 2.2.17
185
185
  type: :development
186
186
  prerelease: false
187
187
  version_requirements: !ruby/object:Gem::Requirement
188
188
  requirements:
189
189
  - - "~>"
190
190
  - !ruby/object:Gem::Version
191
- version: '2.1'
191
+ version: '2.2'
192
192
  - - ">="
193
193
  - !ruby/object:Gem::Version
194
- version: 2.1.4
194
+ version: 2.2.17
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: coveralls
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -212,28 +212,28 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '1.14'
215
+ version: '1.16'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: '1.14'
222
+ version: '1.16'
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: solargraph
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: 0.40.4
229
+ version: '0.41'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: 0.40.4
236
+ version: '0.41'
237
237
  description: Allows you to keep using the power of ruby to test other systems
238
238
  email:
239
239
  - alexrfalkowski@gmail.com
@@ -307,17 +307,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
307
  requirements:
308
308
  - - ">="
309
309
  - !ruby/object:Gem::Version
310
- version: 2.7.0
310
+ version: 3.0.0
311
311
  - - "<"
312
312
  - !ruby/object:Gem::Version
313
- version: 2.8.0
313
+ version: 4.0.0
314
314
  required_rubygems_version: !ruby/object:Gem::Requirement
315
315
  requirements:
316
316
  - - ">="
317
317
  - !ruby/object:Gem::Version
318
318
  version: '0'
319
319
  requirements: []
320
- rubygems_version: 3.1.4
320
+ rubygems_version: 3.2.3
321
321
  signing_key:
322
322
  specification_version: 4
323
323
  summary: Allows you to keep using the power of ruby to test other systems