lightio 0.4.0 → 0.4.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: 7bce34bd364d03347bca1a76cceede8fbad2838a
4
- data.tar.gz: f99f66ed5d275bf5cd2e214faf131a5a391abb88
3
+ metadata.gz: 924070966457c426a62607d4273deb386f2717bd
4
+ data.tar.gz: e12903fe1825a6076d076e369a9a3e9c84d9281d
5
5
  SHA512:
6
- metadata.gz: 61e90a11df62adf44a9e28f380a4083671b086830474a2f142622d74e8d2c2925cdfdd0941487589cf8206f98b218521d1907acb0e6f730235574695e5fd52c1
7
- data.tar.gz: 2d8d16a78c200c491bd1ab4eba245e10888354aab0a2bd04bd00c220a8b780b87e6bd70b870c92d5f31fac14bc3f6f9e889dc5a4cf3aca946ecb8a2c9dbf8ec3
6
+ metadata.gz: e7e4b6081e60112ed2d077439b13a2a3786c6e76dd6366262597dc656192e78e6b36514035943813b684aa308cf92ade03129d68c6cdfca86b1a8b695987c716
7
+ data.tar.gz: 8bff2669c62c7b0ee425dc82ad2a32a0c64809b9caf3e4e29f2d30c46c142677102981fb73183a528f22b94259cbef2f5524128fa61f80ad6881371e4cc72c81
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lightio (0.4.0)
4
+ lightio (0.4.1)
5
5
  nio4r (~> 2.2)
6
6
 
7
7
  GEM
@@ -5,13 +5,13 @@ LightIO::Monkey.patch_all!
5
5
  require 'net/http'
6
6
 
7
7
  host = 'github.com'
8
- port = 80
8
+ port = 443
9
9
 
10
10
  start = Time.now
11
11
 
12
12
  10.times.map do
13
13
  Thread.new do
14
- Net::HTTP.start(host, port, use_ssl: false) do |http|
14
+ Net::HTTP.start(host, port, use_ssl: true) do |http|
15
15
  res = http.request_get('/ping')
16
16
  p res.code
17
17
  end
@@ -12,7 +12,10 @@ module LightIO::Library
12
12
  wrap_blocking_methods :connect, :accept
13
13
 
14
14
  def initialize(io, *args)
15
- io = io.send(:light_io_raw_obj) if io.is_a?(LightIO::Library::IO)
15
+ if io.is_a?(LightIO::Library::IO)
16
+ @_wrapped_socket = io
17
+ io = io.send(:light_io_raw_obj)
18
+ end
16
19
  super(io, *args)
17
20
  end
18
21
 
@@ -20,6 +23,12 @@ module LightIO::Library
20
23
  socket = @obj.accept_nonblock(*args)
21
24
  socket.is_a?(Symbol) ? socket : self.class._wrap(socket)
22
25
  end
26
+
27
+ def to_io
28
+ @_wrapped_socket || @obj.io
29
+ end
30
+
31
+ alias io to_io
23
32
  end
24
33
  end
25
34
  end
@@ -1,3 +1,3 @@
1
1
  module LightIO
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lightio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jiang Jinyang