nonnative 0.6.1 → 0.7.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: 50a1f02bb0997bf8aaf11bbd74d89e09156fb9c48d8ffd1998ae19d324a81330
4
- data.tar.gz: 265ce6cda7617e263a873f49340fd1ecace032e32c352fe9c75e72f4693d6c2f
3
+ metadata.gz: caaeeda0c8cfa9f73850eced4aeadc2fa602424f7d749ee28f2f2a9ec45dda10
4
+ data.tar.gz: 7ed9c8e94bfd34a4f714d0a8f9ea63142cda7c63c17810e00d88565d1e77c05d
5
5
  SHA512:
6
- metadata.gz: fed6ce5529d9dec892479d581ef66cd3023d2c1f2ed0aa2a124da69ca7652dd75befece36cd6e708abb1c6e3d3510e4bfb1d73e86862bb25ed9ddc2e9ee66c6e
7
- data.tar.gz: b0724e3ec0c324e7d0357db99499d7b914dbde9086b1748e76b7139e08c3d21927637be8815f415ddc83f3324bf7f38d031792a14f8473b86d247db73698f8f0
6
+ metadata.gz: ee1f63623d00407e211f26b7878a1a8ef5fc56890d94c96a7a84f5e17ef2a450e60760de4e43b8fe9ef7762b33c7564cf254e2fe73852c99a0f7dd66f4c0ed1f
7
+ data.tar.gz: 0a94df8cc89e2a221f75c7c2cdf2c8f6233342f3e5eddaf348e5d2ae9273867b72c4c1865da982281c3991f150157a2c189830a3658b3a1d2a7d6f33d78fa383
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (0.6.1)
4
+ nonnative (0.7.0)
5
5
  cucumber
6
6
  rspec-expectations
7
7
  semantic_logger
data/README.md CHANGED
@@ -30,7 +30,13 @@ Or install it yourself as:
30
30
 
31
31
  ## Usage
32
32
 
33
- Configure nonnative with the process that you want to start, a timeout value and a port to verify it's working.
33
+ Configure nonnative with the following:
34
+
35
+ - Process that you want to start.
36
+ - A timeout value.
37
+ - Port to verify.
38
+ - The file you want STDOUT to be logged to.
39
+ - The strategy (Startup will start the process once and before will hook into cucumbers Before and After).
34
40
 
35
41
  ```ruby
36
42
  require 'nonnative'
@@ -40,5 +46,6 @@ Nonnative.configure do |config|
40
46
  config.timeout = 0.5
41
47
  config.port = 12_321
42
48
  config.file = 'logs/output'
49
+ config.strategy = :startup or :before
43
50
  end
44
51
  ```
@@ -3,12 +3,9 @@
3
3
  require 'socket'
4
4
  require 'timeout'
5
5
 
6
- require 'cucumber'
7
-
8
6
  require 'nonnative/version'
9
7
  require 'nonnative/error'
10
8
  require 'nonnative/configuration'
11
- require 'nonnative/cucumber'
12
9
  require 'nonnative/process'
13
10
  require 'nonnative/logger'
14
11
 
@@ -24,6 +21,8 @@ module Nonnative
24
21
 
25
22
  def configure
26
23
  yield configuration if block_given?
24
+
25
+ require "nonnative/#{configuration.strategy}"
27
26
  end
28
27
 
29
28
  def start
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'cucumber'
4
+
3
5
  Before do
4
6
  Nonnative.start
5
7
  end
@@ -2,9 +2,14 @@
2
2
 
3
3
  module Nonnative
4
4
  class Configuration
5
+ def initialize
6
+ self.strategy = :before
7
+ end
8
+
5
9
  attr_accessor :process
6
10
  attr_accessor :timeout
7
11
  attr_accessor :port
8
12
  attr_accessor :file
13
+ attr_accessor :strategy
9
14
  end
10
15
  end
@@ -7,7 +7,7 @@ module Nonnative
7
7
  end
8
8
 
9
9
  def start
10
- @pid = spawn(configuration.process, %i[out err] => [configuration.file, 'w'])
10
+ @pid = spawn(configuration.process, %i[out err] => [configuration.file, 'a'])
11
11
  [port_open?, pid]
12
12
  end
13
13
 
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ Nonnative.start
4
+
5
+ at_exit do
6
+ Nonnative.stop
7
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '0.6.1'
4
+ VERSION = '0.7.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: 0.6.1
4
+ version: 0.7.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: 2019-08-23 00:00:00.000000000 Z
11
+ date: 2019-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -143,11 +143,12 @@ files:
143
143
  - bin/console
144
144
  - bin/setup
145
145
  - lib/nonnative.rb
146
+ - lib/nonnative/before.rb
146
147
  - lib/nonnative/configuration.rb
147
- - lib/nonnative/cucumber.rb
148
148
  - lib/nonnative/error.rb
149
149
  - lib/nonnative/logger.rb
150
150
  - lib/nonnative/process.rb
151
+ - lib/nonnative/startup.rb
151
152
  - lib/nonnative/version.rb
152
153
  - nonnative.gemspec
153
154
  homepage: https://github.com/alexfalkowski/nonnative