drb-websocket 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: c4af96ea554d51d5d2e744d6d49380487d5e3633
4
- data.tar.gz: f1f445f420f670f8b6de1b42e39aab2e8c0b5343
3
+ metadata.gz: '09245285a4bf2d658f2557a741ed7181382ce7a3'
4
+ data.tar.gz: 152a31071adcade6e234522d0030bb16c0896060
5
5
  SHA512:
6
- metadata.gz: 9c14f3b8ff719ccf7c57f364f9f04732ff066a9130f0cee2e0679bbb7c14fb99b35d0ca2f9643e6fc6dbc28af06110ce1a9b33ac7fb21cd0ac25198f6e68af2a
7
- data.tar.gz: 991489d663cffde1db4cc133e2364fafa65b7897cafb9ef0c3ceb7a5a9926db8b673726b78cd2a4fc676531a54a86ced87ee62324fe2206dc0c8fcb809f7a693
6
+ metadata.gz: 3fd1c8e41edf0584f091b3d5f3f8bd47b9ab75c62a815558273f79b734c1731747491115227e951e08452cbb18432ebd11f652f50cfc713cc050939cc04f7f0f
7
+ data.tar.gz: 9f4049e8f560f5a45101c80998b81eccce9d30f88d7b3ef4acbb3f5db1691455cf2bf683cdda86ee93108df6b3d61c4b1b4d001e8e975f358f84c731c04283bb
@@ -3,6 +3,7 @@ module DRb
3
3
  class RackApp
4
4
  def initialize(app)
5
5
  @app = app
6
+ RackApp.config.use_rack = true
6
7
  end
7
8
 
8
9
  @servers = {}
@@ -50,6 +51,24 @@ module DRb
50
51
  @app.call(env)
51
52
  end
52
53
  end
54
+
55
+ def self.config
56
+ @config ||= Config.new
57
+ yield @config if block_given?
58
+ @config
59
+ end
60
+
61
+ class Config
62
+ attr_reader :standalone
63
+
64
+ def initialize
65
+ @standalone = true
66
+ end
67
+
68
+ def use_rack=(flag)
69
+ @standalone = !flag
70
+ end
71
+ end
53
72
  end
54
73
  end
55
74
  end
@@ -52,6 +52,14 @@ module DRb
52
52
 
53
53
  u = URI.parse(uri)
54
54
  RackApp.register("#{u.host}:#{u.port}", self)
55
+
56
+ if RackApp.config.standalone
57
+ Thread.new do
58
+ app = RackApp.new(-> { [400, {}, []] })
59
+ thin = Rack::Handler.get('thin')
60
+ thin.run(app, Host: u.host, Port: u.port)
61
+ end.run
62
+ end
55
63
  end
56
64
 
57
65
  def close
@@ -1,5 +1,5 @@
1
1
  module Drb
2
2
  module Websocket
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drb-websocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - youchan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-24 00:00:00.000000000 Z
11
+ date: 2017-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faye-websocket