Class: StackProf::Webnav::Server

Inherits:
Sinatra::Application
  • Object
show all
Defined in:
lib/stackprof-webnav/server.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cmd_optionsObject

Returns the value of attribute cmd_options.



11
12
13
# File 'lib/stackprof-webnav/server.rb', line 11

def cmd_options
  @cmd_options
end

.report_dump_listingObject

Returns the value of attribute report_dump_listing.



11
12
13
# File 'lib/stackprof-webnav/server.rb', line 11

def report_dump_listing
  @report_dump_listing
end

.report_dump_pathObject

Returns the value of attribute report_dump_path.



11
12
13
# File 'lib/stackprof-webnav/server.rb', line 11

def report_dump_path
  @report_dump_path
end

.report_dump_uriObject

Returns the value of attribute report_dump_uri.



11
12
13
# File 'lib/stackprof-webnav/server.rb', line 11

def report_dump_uri
  @report_dump_uri
end

Class Method Details

.presenter(regenerate = false) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/stackprof-webnav/server.rb', line 13

def presenter regenerate=false
  return @presenter unless regenerate || @presenter.nil?
  process_options
  if self.report_dump_path || self.report_dump_uri
    report_contents = if report_dump_path.nil?
                        Net::HTTP.get(URI.parse(report_dump_uri))
                      else
                        File.open(report_dump_path).read
                      end
    report = StackProf::Report.new(Marshal.load(report_contents))
  end
  @presenter = Presenter.new(report)
end