From 65dc45b7a13c92b27bc3589e37a3b52c29b7fbee Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 14 Mar 2011 16:52:19 -0700 Subject: linux: avoid Array#first/Array#last More confusing for me, actually... --- lib/raindrops/linux.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb index 55887f0..8a67887 100644 --- a/lib/raindrops/linux.rb +++ b/lib/raindrops/linux.rb @@ -50,8 +50,8 @@ module Raindrops::Linux # no point in pread since we can't stat for size on this file File.read(*PROC_NET_UNIX_ARGS).scan(paths) do |s| - path = s.last - case s.first.to_i + path = s[-1] + case s[0].to_i when 2 then rv[path].queued += 1 when 3 then rv[path].active += 1 end -- cgit v1.2.3-24-ge0c7