emmy-machine 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/emmy_machine/class_methods.rb +10 -7
- data/lib/emmy_machine/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: cbcf6dad55c2c829b3c317639952d0b1d1a73cd9
|
|
4
|
+
data.tar.gz: 2df6741e6561736c9065ffa3a816d88a9cdef981
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9242b823d1f132e80dadc98382f09642c788ff0398142ea5ac9aa9a2c230a909d8b3b490dca89ae52333f91c64fe5b9e1b2a69fe9aad81e54fac6ff84a4cfbe
|
|
7
|
+
data.tar.gz: 8ca89dede626c70cf4c00b266cacf819ba3dac7cdf6618056c7f02f8a2ed2603c2de3fcf362c0362c8998f5daa90fa8171ad3f0ad40efd3dcf032ebf2f4b23fb
|
|
@@ -17,8 +17,11 @@ module EmmyMachine
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def run_block &b
|
|
20
|
-
EventMachine.
|
|
21
|
-
fiber_block
|
|
20
|
+
EventMachine.run do
|
|
21
|
+
fiber_block do
|
|
22
|
+
yield
|
|
23
|
+
EventMachine.stop
|
|
24
|
+
end
|
|
22
25
|
end
|
|
23
26
|
end
|
|
24
27
|
|
|
@@ -55,9 +58,9 @@ module EmmyMachine
|
|
|
55
58
|
# emmy.connect(*emmy.http.get(url))
|
|
56
59
|
def connect(url, *a, &b)
|
|
57
60
|
url = URI(url.to_s)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
handler = a.empty? ? Connection : a.shift
|
|
62
|
+
b ||= a.shift if a.first.is_a?(Proc) || a.first.is_a?(Method)
|
|
63
|
+
|
|
61
64
|
case url.scheme
|
|
62
65
|
when "tcp" then
|
|
63
66
|
EventMachine.connect(url.host, url.port, handler, *a, &b)
|
|
@@ -76,8 +79,8 @@ module EmmyMachine
|
|
|
76
79
|
# emmy.bind(* emmy.server.thin("tcp://localhost:4780", app))
|
|
77
80
|
def bind(url, *a, &b)
|
|
78
81
|
url = URI(url.to_s)
|
|
79
|
-
|
|
80
|
-
|
|
82
|
+
handler = a.empty? ? Connection : a.shift
|
|
83
|
+
b ||= a.shift if a.first.is_a?(Proc) || a.first.is_a?(Method)
|
|
81
84
|
|
|
82
85
|
case url.scheme
|
|
83
86
|
when "tcp" then
|
data/lib/emmy_machine/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: emmy-machine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Che
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-09-
|
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: eventmachine
|