em-websocketio-client 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/README.md +8 -4
- data/Rakefile +6 -0
- data/em-websocketio-client.gemspec +1 -1
- data/lib/em-websocketio-client/client.rb +1 -1
- data/lib/em-websocketio-client/version.rb +1 -1
- data/test/app.rb +3 -34
- data/test/app/main.rb +0 -5
- data/test/test_em_websocketio_client.rb +0 -8
- data/test/test_helper.rb +0 -9
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d06291870ec93d17dc9417ed93f06321c850d01
|
4
|
+
data.tar.gz: 788550881b480d534b0ced4c709fa00c181dcf15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ea2f6e5fbd88be250e8641abf6215c6a396ba5e62612a79b5ec135faccfc06a16e77db46948cb2a6a892dbe881fc67acb961a0f3b181e132522ebc1966fb14f
|
7
|
+
data.tar.gz: 20b995fbfa2bfeb2499fe18020fbc15f5b1505b1d28afd378c10324f643d6f05972147e9b9adfc3446ef19173139a66a71b15fb1e6ef05d34822617b826951c7
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -68,10 +68,14 @@ Test
|
|
68
68
|
|
69
69
|
% gem install bundler
|
70
70
|
% bundle install
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
% rake
|
71
|
+
|
72
|
+
start test server
|
73
|
+
|
74
|
+
% bundle exec rake test_server
|
75
|
+
|
76
|
+
run test
|
77
|
+
|
78
|
+
% bundle exec rake test
|
75
79
|
|
76
80
|
|
77
81
|
Contributing
|
data/Rakefile
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency "sinatra-websocketio"
|
25
25
|
spec.add_development_dependency "thin"
|
26
26
|
|
27
|
-
spec.add_dependency "em-websocket-client"
|
27
|
+
spec.add_dependency "em-websocket-client", "0.1.2"
|
28
28
|
spec.add_dependency "eventmachine"
|
29
29
|
spec.add_dependency "event_emitter"
|
30
30
|
spec.add_dependency "json"
|
data/test/app.rb
CHANGED
@@ -16,46 +16,15 @@ class App
|
|
16
16
|
"ws://localhost:#{ws_port}"
|
17
17
|
end
|
18
18
|
|
19
|
-
def self.pid_file
|
20
|
-
ENV['PID_FILE'] || "/tmp/em-websocketio-testapp.pid"
|
21
|
-
end
|
22
|
-
|
23
19
|
def self.app_dir
|
24
20
|
File.expand_path 'app', File.dirname(__FILE__)
|
25
21
|
end
|
26
22
|
|
27
|
-
def self.pid
|
28
|
-
return unless @running
|
29
|
-
File.open(pid_file) do |f|
|
30
|
-
pid = f.gets.strip.to_i
|
31
|
-
return pid if pid > 0
|
32
|
-
end
|
33
|
-
return
|
34
|
-
end
|
35
|
-
|
36
23
|
def self.start
|
37
|
-
return if
|
38
|
-
File.delete pid_file if File.exists? pid_file
|
39
|
-
Thread.new do
|
40
|
-
IO::popen "cd #{app_dir} && PID_FILE=#{pid_file} WS_PORT=#{ws_port} rackup config.ru -p #{port} > /dev/null 2>&1"
|
41
|
-
end
|
24
|
+
return if running
|
42
25
|
@running = true
|
43
|
-
|
44
|
-
|
45
|
-
sleep 1
|
46
|
-
return true
|
47
|
-
end
|
48
|
-
sleep 0.1
|
49
|
-
end
|
50
|
-
@running = false
|
51
|
-
return false
|
52
|
-
end
|
53
|
-
|
54
|
-
def self.stop
|
55
|
-
return unless @running
|
56
|
-
system "kill #{pid}"
|
57
|
-
File.delete pid_file if File.exists? pid_file
|
58
|
-
@running = false
|
26
|
+
cmd = "cd #{app_dir} && WS_PORT=#{ws_port} rackup config.ru -p #{port}"
|
27
|
+
system cmd
|
59
28
|
end
|
60
29
|
|
61
30
|
end
|
data/test/app/main.rb
CHANGED
@@ -2,14 +2,6 @@ require File.expand_path 'test_helper', File.dirname(__FILE__)
|
|
2
2
|
|
3
3
|
class TestEmWebSocketIOClient < MiniTest::Test
|
4
4
|
|
5
|
-
def setup
|
6
|
-
App.start
|
7
|
-
end
|
8
|
-
|
9
|
-
def teardown
|
10
|
-
App.stop
|
11
|
-
end
|
12
|
-
|
13
5
|
def test_simple
|
14
6
|
post_data = {:time => Time.now.to_s, :msg => 'hello!!'}
|
15
7
|
res = nil
|
data/test/test_helper.rb
CHANGED
@@ -4,12 +4,3 @@ $:.unshift File.expand_path '../lib', File.dirname(__FILE__)
|
|
4
4
|
require 'minitest/autorun'
|
5
5
|
require 'em-websocketio-client'
|
6
6
|
require File.expand_path 'app', File.dirname(__FILE__)
|
7
|
-
|
8
|
-
['SIGHUP', 'SIGINT', 'SIGKILL', 'SIGTERM'].each do |sig|
|
9
|
-
Kernel.trap sig do
|
10
|
-
App.stop
|
11
|
-
EM::add_timer do
|
12
|
-
EM::stop
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: em-websocketio-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: em-websocket-client
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - '
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.1.2
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - '
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.1.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: eventmachine
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
181
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.
|
182
|
+
rubygems_version: 2.1.5
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: Sinatra WebSocketIO client for eventmachine
|