lib/stackprof-webnav/presenter.rb in stackprof-webnav-0.0.4 vs lib/stackprof-webnav/presenter.rb in stackprof-webnav-0.1.0
- old
+ new
@@ -1,10 +1,8 @@
require 'better_errors'
require 'stringio'
require 'rexml/document'
-require 'action_view'
-include ActionView::Helpers::NumberHelper
module StackProf
module Webnav
class Presenter
attr_reader :report
@@ -35,18 +33,18 @@
}
end
end
def listing_dumps
- Server.report_dump_listing += "/" unless Server.report_dump_listing.end_with?("/")
+ 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,
+ :key => ele.elements["Key"].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
@@ -72,10 +70,10 @@
end
private
def percent value
- "%2.2f%" % (value*100)
+ "%2.2f%%" % (value*100)
end
def callers frame, info
report.data[:frames].select do |id, other|
other[:edges] && other[:edges].include?(frame)