Sha256: f103289a795314dca4e03f9c7691651e5a3c86994867ddf9e13ed2139e0e6760

Contents?: true

Size: 422 Bytes

Versions: 43

Compression:

Stored size: 422 Bytes

Contents

class DF
	
	include RunCommand
	
	command :df, :k => ""
	
	def data
		headers = false
		output = []
		command_output.split("\n").map {|line| line.split("\s") }.each do |line|
			if !headers
				headers = line.map {|hdr| hdr.downcase.to_sym}
				headers.pop
				next
			end
			next unless headers
			pkt = {}
			line.each_with_index do |itm,idx|
				pkt[headers[idx]] = itm
			end
			output << pkt
		end
		output
	end
	
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
city-watch-0.7.9 lib/city_watch/commands/df.rb
city-watch-0.7.8 lib/city_watch/commands/df.rb
city-watch-0.7.7 lib/city_watch/commands/df.rb
city-watch-0.7.6 lib/city_watch/commands/df.rb
city-watch-0.7.5 lib/city_watch/commands/df.rb
city-watch-0.7.4 lib/city_watch/commands/df.rb
city-watch-0.7.3 lib/city_watch/commands/df.rb
city-watch-0.7.2 lib/city_watch/commands/df.rb
city-watch-0.7.1 lib/city_watch/commands/df.rb
city-watch-0.7.0 lib/city_watch/commands/df.rb
city-watch-0.6.9 lib/city_watch/commands/df.rb
city-watch-0.6.8 lib/city_watch/commands/df.rb
city-watch-0.6.7 lib/city_watch/commands/df.rb
city-watch-0.6.6 lib/city_watch/commands/df.rb
city-watch-0.6.5 lib/city_watch/commands/df.rb
city-watch-0.6.4 lib/city_watch/commands/df.rb
city-watch-0.6.3 lib/city_watch/commands/df.rb
city-watch-0.6.2 lib/city_watch/commands/df.rb
city-watch-0.6.1 lib/city_watch/commands/df.rb
city-watch-0.6.0 lib/city_watch/commands/df.rb