nonnative 1.12.0 → 1.13.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: 5ccdd2979601ad074af9108e0cad92b25912bdb4cbfc53ba70c4dab7c833b828
4
- data.tar.gz: af791d87b74e5db4d962405e975ee527e1d3e4522c48120835971f94af3a486a
3
+ metadata.gz: b5c276daf057940e81f971c7f81d468e3d521bc728fa42d7a2ee3ee5a783d148
4
+ data.tar.gz: 16bee98b94493966114a4d660d7af6dd08f13ec4b340db5a7e4046a557516685
5
5
  SHA512:
6
- metadata.gz: 9bc5f8258ebbc338ff5fc6c09b0af4651c9969e4401ba91dbf2daebfe4ff8e4078520b822f51d14a080726ea7279b13dde7ded0d7b247c1c0c10015f4ee1ae96
7
- data.tar.gz: 97ff9785e3eb41370fe71dea80c37497d90b16805e5999b6ef0d17575b16c68fdf8584445dfd151285c8f1c4e6c3410ba33f1d2f81fd6ffdafea2461a9d46178
6
+ metadata.gz: f802c188acdd0729db5ca63b71aae85ee861b51ea3847a4366a7fbfc7a60876fbda981cfd38592d85497ea121455e296bbacfd81302739a33e589108c1d7fba0
7
+ data.tar.gz: 074d2d35b363dcf0bd8a7968655a6555868a623d19a1fead5000e57c344cf7a58b9ea8472bb6f896ac4aa97e761b9cdc949debf24937cc466bbd1e1b427ea49b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.12.0)
4
+ nonnative (1.13.0)
5
5
  cucumber (~> 3.1, >= 3.1.2)
6
6
  grpc (~> 1.28)
7
7
  puma (~> 4.3, >= 4.3.3)
@@ -23,6 +23,7 @@ require 'nonnative/command'
23
23
  require 'nonnative/pool'
24
24
  require 'nonnative/server'
25
25
  require 'nonnative/http_client'
26
+ require 'nonnative/application'
26
27
  require 'nonnative/http_server'
27
28
  require 'nonnative/grpc_server'
28
29
  require 'nonnative/grpc_server'
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Nonnative
4
+ class Application < Sinatra::Application
5
+ set :bind, '0.0.0.0'
6
+ set :server, :puma
7
+ set :logging, false
8
+ set :quiet, true
9
+ end
10
+ end
@@ -26,7 +26,7 @@ module Nonnative
26
26
  protected
27
27
 
28
28
  def wait_start
29
- server.wait_till_running(1)
29
+ server.wait_till_running(service.timeout)
30
30
  end
31
31
 
32
32
  private
@@ -3,6 +3,9 @@
3
3
  module Nonnative
4
4
  class HTTPServer < Nonnative::Server
5
5
  def initialize(service)
6
+ @timeout = Nonnative::Timeout.new(service.timeout)
7
+ @queue = Queue.new
8
+
6
9
  Application.set :port, service.port
7
10
  configure Application
8
11
 
@@ -14,18 +17,25 @@ module Nonnative
14
17
  end
15
18
 
16
19
  def perform_start
17
- Application.start!
20
+ Application.start! do |server|
21
+ queue << server
22
+ end
18
23
  end
19
24
 
20
25
  def perform_stop
21
26
  Application.stop!
22
27
  end
23
28
 
24
- class Application < Sinatra::Application
25
- set :bind, '0.0.0.0'
26
- set :server, :puma
27
- set :logging, false
28
- set :quiet, true
29
+ protected
30
+
31
+ def wait_start
32
+ timeout.perform do
33
+ queue.pop
34
+ end
29
35
  end
36
+
37
+ private
38
+
39
+ attr_reader :timeout, :queue
30
40
  end
31
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '1.12.0'
4
+ VERSION = '1.13.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nonnative
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Falkowski
@@ -270,6 +270,7 @@ files:
270
270
  - bin/console
271
271
  - bin/setup
272
272
  - lib/nonnative.rb
273
+ - lib/nonnative/application.rb
273
274
  - lib/nonnative/before.rb
274
275
  - lib/nonnative/command.rb
275
276
  - lib/nonnative/configuration.rb