anycable 1.0.0.rc1 → 1.0.0.rc2

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: deebe94f2e541a9d14ccf4a56df910cdb5a2fb17ae6815ffaaa2f761fdcd07ad
4
- data.tar.gz: e96c5b0d28dd7617c2cfa1249fde5bd357465be7596915720c27718f486c4f16
3
+ metadata.gz: d42f34d7d5f20b9978b36e5fb56cbf46b3cfd711d44d9fd50c6cf1f8257b5c9f
4
+ data.tar.gz: e8d121977adbec6aa7f1a08bc682eba32e84ac5b71f5ae2b4f88f711e95e06ba
5
5
  SHA512:
6
- metadata.gz: b585f2797184d7bc78cc761707b741dcfa8a6b796df91cccd7ac1e44c9210a84852daba838adaaa6b2f1548d2d0f82cf57713b32a4a86d0ffa671f64321b9df1
7
- data.tar.gz: dccd27127eaafc5b7821ba18404546269e9aaf3163faccffaba864e166cb1c19cdc914ccf9de87da963cac447541058e0d7ba906674298f9dda8573ca4e917c8
6
+ metadata.gz: fd47edb035d0be736e0309bc8c1a0fcd8c8f7fe88fff79662b35edcaa65f2bfc9bd80f7491e5c2be230eb4577fee97b5191190dd5244735e2c8613037065baa4
7
+ data.tar.gz: 424143bad004b0016f0953d46ae4c926cd367efa1a7c3e59d3541895aa49773b4554d8cabcc77cee0a8070e695bcf66dd043e667fc0c4253df4efd2e2e65b16e
@@ -1,5 +1,9 @@
1
1
  # Change log
2
2
 
3
+ ## 1.0.0.rc2 (2020-06-24)
4
+
5
+ - Add `embedded` option to CLI runner. ([@palkan][])
6
+
3
7
  ## 1.0.0.rc1 (2020-06-10)
4
8
 
5
9
  - Add `Env#istate` and `EnvResponse#istate` to store channel state. ([@palkan][])
@@ -20,17 +20,22 @@ module AnyCable
20
20
  # Wait for external process termination (s)
21
21
  WAIT_PROCESS = 2
22
22
 
23
- attr_reader :server, :health_server
23
+ attr_reader :server, :health_server, :embedded
24
+ alias embedded? embedded
25
+
26
+ def initialize(embedded: false)
27
+ @embedded = embedded
28
+ end
24
29
 
25
30
  # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
26
- def run(args = {})
31
+ def run(args = [])
27
32
  @at_stop = []
28
33
 
29
34
  extra_options = parse_cli_options!(args)
30
35
 
31
36
  # Boot app first, 'cause it might change
32
37
  # configuration, loggin settings, etc.
33
- boot_app!
38
+ boot_app! unless embedded?
34
39
 
35
40
  parse_gem_options!(extra_options)
36
41
 
@@ -40,7 +45,7 @@ module AnyCable
40
45
 
41
46
  print_versions!
42
47
 
43
- logger.info "Serving #{defined?(::Rails) ? "Rails " : ""}application from #{boot_file}"
48
+ logger.info "Serving #{defined?(::Rails) ? "Rails " : ""}application from #{boot_file}" unless embedded?
44
49
 
45
50
  verify_connection_factory!
46
51
 
@@ -66,6 +71,8 @@ module AnyCable
66
71
 
67
72
  run_custom_server_command! unless server_command.nil?
68
73
 
74
+ return if embedded?
75
+
69
76
  begin
70
77
  wait_till_terminated
71
78
  rescue Interrupt => e
@@ -81,7 +88,7 @@ module AnyCable
81
88
 
82
89
  def shutdown
83
90
  at_stop.each(&:call)
84
- server.stop
91
+ server&.stop
85
92
  end
86
93
 
87
94
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AnyCable
4
- VERSION = "1.0.0.rc1"
4
+ VERSION = "1.0.0.rc2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config