lib/stackprof-webnav/presenter.rb in stackprof-webnav-0.0.3 vs lib/stackprof-webnav/presenter.rb in stackprof-webnav-0.0.4

- old
+ new

@@ -1,8 +1,10 @@ require 'better_errors' require 'stringio' require 'rexml/document' +require 'action_view' +include ActionView::Helpers::NumberHelper module StackProf module Webnav class Presenter attr_reader :report @@ -33,17 +35,19 @@ } end end def listing_dumps + Server.report_dump_listing += "/" unless Server.report_dump_listing.end_with?("/") xml_data = Net::HTTP.get(URI.parse(Server.report_dump_listing)) if xml_data doc = REXML::Document.new(xml_data) dumps = [] doc.elements.each('ListBucketResult/Contents') do |ele| dumps << { :key => ele.elements["Key"].text, - :date => ele.elements["LastModified"].text, + :date => ele.elements["LastModified"].text, + :size => number_with_delimiter(ele.elements["Size"].text.to_i), :uri => Server.report_dump_listing + ele.elements["Key"].text } end end dumps.sort_by! { |hash| hash[:date] }