class Attractor::SinatraReporter

serving the HTML locally

Public Instance Methods

report() click to toggle source
Calls superclass method Attractor::BaseReporter#report
# File lib/attractor/reporters/sinatra_reporter.rb, line 46
def report
  super

  app = AttractorApp.new(self)

  puts "Serving attractor at http://localhost:7890"

  if @open_browser
    Launchy.open("http://localhost:7890") if @open_browser
    puts "Opening browser window..."
  end

  Rack::Handler::WEBrick.run app, Port: 7890
end
watch() click to toggle source
# File lib/attractor/reporters/sinatra_reporter.rb, line 61
def watch
  @suggestions = @suggester.suggest

  app = AttractorApp.new(self)

  puts "Serving attractor at http://localhost:7890"
  if @open_browser
    Launchy.open("http://localhost:7890")
    puts "Opening browser window..."
  end

  Rack::Handler::WEBrick.run Rack::LiveReload.new(app), Port: 7890
end