add volume info

This commit is contained in:
bee0005
2016-08-20 12:02:16 +00:00
parent 22a2389c12
commit e008bd3bab
2 changed files with 33 additions and 7 deletions

View File

@@ -1,6 +1,22 @@
class VolumnController < ApplicationController
def info
@output = get_info.split("\n")
@volumes = Array.new
volume = Hash.new
i = 0
output = get_info.split("\n")
for t in 1..(output.length-1)
if output[t].include? ":"
temp = output[t].split(":")
volume[temp[0]] = temp[1]
else
@volumes[i] = volume
volume = Hash.new
i+=1
end
end
@volumes[i] = volume
puts @volumes
end
def get_info