nonnative 1.46.0 → 1.47.0

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: 5ab3f3907cd50fe1984cc57c28da9a17612beba23d73e8e82111ab133569a082
4
- data.tar.gz: 71601b678ec6a2dbf53a1a2347955c691619dcf7310224d974d0b84bdc4de922
3
+ metadata.gz: fadc106377cb9006d00a0a15af09b93e9f63d360737e676595581e0d108a0dbe
4
+ data.tar.gz: 071bc7fc5293f47d425da66c1c98368492c9d62b068645e8d651ebd10562a80b
5
5
  SHA512:
6
- metadata.gz: 0bcee6e1dfcba57e0a6be43cff1be649f9fcff7c1ec94a26cca48e47b1ae0d734a279ff61464acdca5e531ba4abfb79479a9f473bd893f63d97efa575b7387e4
7
- data.tar.gz: 91d0a695d1d2efc013af95e4a10db2637c8d47dfa21ab49a0765098f7f69c34520e514598aadca2652d69610b7baeea76822388c6030f33b3f0c78c33ec039ea
6
+ metadata.gz: 32166837748726de12fdcdd5a25202ef2df5f6c6919459a0bbe53f02cb62e96a1469ea9c208734cbb64edbdcb71c653f8d4ebef94a272b47c54a8c1a58a86b50
7
+ data.tar.gz: a2fd4abffbf60b676d793cd42641bf94511dfddb215f5a0988c1c337f96a411b53e89a125d78f879e1ac2594836b75aef725e099eab7ebdf2f4d5337a1165cf4
data/.rubocop.yml CHANGED
@@ -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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
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.47.0](https://github.com/alexfalkowski/nonnative/compare/v1.46.0...v1.47.0) (2021-05-14)
6
+
7
+
8
+ ### Features
9
+
10
+ * allow to pass env variables to processes ([#88](https://github.com/alexfalkowski/nonnative/issues/88)) ([4401a77](https://github.com/alexfalkowski/nonnative/commit/4401a776ccc50dbefa45b06de01945abf4724864))
11
+
5
12
  ## [1.46.0](https://github.com/alexfalkowski/nonnative/compare/v1.45.0...v1.46.0) (2021-05-10)
6
13
 
7
14
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.46.0)
4
+ nonnative (1.47.0)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.5)
6
6
  cucumber (>= 6, < 7)
7
7
  grpc (>= 1, < 2)
@@ -73,7 +73,7 @@ GEM
73
73
  unf (>= 0.0.5, < 1.0.0)
74
74
  e2mmap (0.1.0)
75
75
  ffi (1.15.0)
76
- google-protobuf (3.16.0)
76
+ google-protobuf (3.17.0)
77
77
  googleapis-common-protos-types (1.0.6)
78
78
  google-protobuf (~> 3.14)
79
79
  grpc (1.37.1)
@@ -113,7 +113,7 @@ GEM
113
113
  middleware
114
114
  thor
115
115
  thread_safe
116
- puma (5.3.0)
116
+ puma (5.3.1)
117
117
  nio4r (~> 2.0)
118
118
  racc (1.5.2)
119
119
  rack (2.2.3)
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
@@ -59,6 +59,7 @@ module Nonnative
59
59
  d.port = fd['port']
60
60
  d.log = fd['log']
61
61
  d.signal = fd['signal']
62
+ d.environment = fd['environment']
62
63
 
63
64
  proxy d, fd['proxy']
64
65
  end
@@ -95,9 +96,7 @@ module Nonnative
95
96
  services.each do |fd|
96
97
  service do |s|
97
98
  s.name = fd['name']
98
- s.timeout = fd['timeout']
99
99
  s.port = fd['port']
100
- s.log = fd['log']
101
100
 
102
101
  proxy s, fd['proxy']
103
102
  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.46.0'
4
+ VERSION = '1.47.0'
5
5
  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.46.0
4
+ version: 1.47.0
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-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby