sfc_ikiteru 0.0.4 → 0.0.5
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.
- data/History.txt +4 -0
- data/README.rdoc +6 -5
- data/lib/sfc_ikiteru.rb +7 -7
- data/samples/sample.rb +2 -2
- metadata +3 -3
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -6,6 +6,10 @@
|
|
6
6
|
|
7
7
|
check status of Keio Univ SFC.
|
8
8
|
|
9
|
+
== INSTALL:
|
10
|
+
|
11
|
+
* gem install sfc_ikiteru
|
12
|
+
|
9
13
|
|
10
14
|
== SYNOPSIS:
|
11
15
|
|
@@ -14,6 +18,7 @@ check status of Keio Univ SFC.
|
|
14
18
|
p per
|
15
19
|
p details
|
16
20
|
|
21
|
+
|
17
22
|
== TOOL:
|
18
23
|
|
19
24
|
check status on CUI.
|
@@ -33,11 +38,7 @@ results
|
|
33
38
|
|
34
39
|
== REQUIREMENTS:
|
35
40
|
|
36
|
-
* Ruby 1.8.7
|
37
|
-
|
38
|
-
== INSTALL:
|
39
|
-
|
40
|
-
* gem install sfc_ikiteru
|
41
|
+
* Ruby 1.8.7 or 1.9.2
|
41
42
|
|
42
43
|
== LICENSE:
|
43
44
|
|
data/lib/sfc_ikiteru.rb
CHANGED
@@ -5,7 +5,7 @@ require 'timeout'
|
|
5
5
|
require 'eventmachine'
|
6
6
|
|
7
7
|
module SfcIkiteru
|
8
|
-
VERSION = '0.0.
|
8
|
+
VERSION = '0.0.5'
|
9
9
|
def SfcIkiteru.servers
|
10
10
|
[
|
11
11
|
{:host => 'web.sfc.keio.ac.jp', :service => 'echo'},
|
@@ -21,18 +21,18 @@ module SfcIkiteru
|
|
21
21
|
results = Array.new
|
22
22
|
|
23
23
|
EM::run do
|
24
|
-
servers.each{|s|
|
25
|
-
EM::defer do
|
26
|
-
res = ping(s[:host], timeout, s[:service])
|
27
|
-
results << {:host => s[:host], :ping => res}
|
28
|
-
end
|
29
|
-
}
|
30
24
|
EM::defer do
|
31
25
|
loop do
|
32
26
|
EM::stop if results.size >= servers.size
|
33
27
|
sleep 0.1
|
34
28
|
end
|
35
29
|
end
|
30
|
+
servers.each{|s|
|
31
|
+
EM::defer do
|
32
|
+
res = ping(s[:host], timeout, s[:service])
|
33
|
+
results << {:host => s[:host], :ping => res}
|
34
|
+
end
|
35
|
+
}
|
36
36
|
end
|
37
37
|
count = 0
|
38
38
|
results.each{|i|
|
data/samples/sample.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfc_ikiteru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sho Hashimoto
|