CQHTTP 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/CQHTTP/network.rb +1 -0
- data/lib/CQHTTP/service.rb +13 -7
- data/lib/CQHTTP/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34092cf41ddd4500166cafc96a00929708ab0d89
|
4
|
+
data.tar.gz: d6538739475e11d87afcf59dc361f405f9807948
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34f14a7abc215e479faa50ff820395dcb8e43431a185ba594d87504866f303e6353954b1abd0c28b13e0580e3a2c28ae1c774be722928bfcac0b6147aa636ead
|
7
|
+
data.tar.gz: de9111bd89b230a8f2d0f675f8b180acf79108ba3ff0573ad0e37ec1a892ac718313c871e72201969a0ad867c1b9e2e15af65b51fa1d209ede8ae3503880719c
|
data/lib/CQHTTP/network.rb
CHANGED
data/lib/CQHTTP/service.rb
CHANGED
@@ -15,17 +15,23 @@ module CQHTTP
|
|
15
15
|
def run
|
16
16
|
loop do
|
17
17
|
socket = @server.accept
|
18
|
+
accept socket
|
19
|
+
end
|
20
|
+
end
|
18
21
|
|
19
|
-
|
22
|
+
def accept(socket)
|
23
|
+
head socket
|
20
24
|
|
21
|
-
|
22
|
-
|
23
|
-
|
25
|
+
socket.print "HTTP/1.1 204\r\n" \
|
26
|
+
"Content-Type: application/json\r\n" \
|
27
|
+
"Connection: Close\r\n\r\n"
|
28
|
+
data = socket.gets
|
29
|
+
puts data
|
30
|
+
@json = JSON.parse data
|
24
31
|
|
25
|
-
|
32
|
+
@event_method.each { |func| func.call self }
|
26
33
|
|
27
|
-
|
28
|
-
end
|
34
|
+
socket.close
|
29
35
|
end
|
30
36
|
|
31
37
|
private
|
data/lib/CQHTTP/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CQHTTP
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 71e6fd52
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|