arvicco-avalon 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/lib/avalon/utils.rb +3 -3
- data/lib/avalon/version.rb +1 -1
- metadata +1 -1
data/lib/avalon/utils.rb
CHANGED
@@ -10,7 +10,7 @@ module Avalon
|
|
10
10
|
file = [ tune,
|
11
11
|
File.expand_path("../../../sound/#{tune}", __FILE__),
|
12
12
|
File.expand_path("~/sound/#{tune}", __FILE__),
|
13
|
-
File.expand_path("/System/Library/Sounds/#{tune}")
|
13
|
+
File.expand_path("/System/Library/Sounds/#{tune}"),
|
14
14
|
].find {|f| File.exist?(f)}
|
15
15
|
|
16
16
|
case system
|
@@ -18,7 +18,7 @@ module Avalon
|
|
18
18
|
`afplay #{file}`
|
19
19
|
when 'Linux'
|
20
20
|
raise 'Please install sox package: sudo apt-get install sox' if `which sox`.empty?
|
21
|
-
`play #{file}`
|
21
|
+
`play -q #{file}`
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -34,7 +34,7 @@ module Avalon
|
|
34
34
|
# Helper method: ping the Node, return ping time in ms
|
35
35
|
def ping ip
|
36
36
|
ping_result = `ping -c 1 #{ip}`
|
37
|
-
if ping_result =~ / 0.0% packet loss/
|
37
|
+
if ping_result =~ /( | 0.)0% packet loss/
|
38
38
|
ping_result.match(/time=([\.\d]*) ms/)[1].to_f
|
39
39
|
end
|
40
40
|
end
|
data/lib/avalon/version.rb
CHANGED