Sha256: ae66d32f8365ab3294a39002fdf68e3012c205c936783e808552d44d23f63e4c

Contents?: true

Size: 711 Bytes

Versions: 9

Compression:

Stored size: 711 Bytes

Contents

class Teabag.Runner

  @run: false

  constructor: ->
    return if @constructor.run
    @constructor.run = true
    @fixturePath = "#{Teabag.root}/fixtures"
    @params = Teabag.params = @getParams()
    @setup()


  getParams: ->
    params = {}
    for param in Teabag.location.search.substring(1).split("&")
      [name, value] = param.split("=")
      params[decodeURIComponent(name)] = decodeURIComponent(value)
    params


  getReporter: ->
    if @params["reporter"]
      Teabag.Reporters[@params["reporter"]]
    else
      if window.navigator.userAgent.match(/PhantomJS/)
        Teabag.Reporters.Console
      else
        Teabag.Reporters.HTML


  setup: ->
    # left for subclasses to implement

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
teabag-0.7.3 app/assets/javascripts/teabag/base/runner.coffee
teabag-0.7.2 app/assets/javascripts/teabag/base/runner.coffee
teabag-0.7.1 app/assets/javascripts/teabag/base/runner.coffee
teabag-0.7.0 app/assets/javascripts/teabag/base/runner.coffee
teabag-0.6.0 app/assets/javascripts/teabag/base/runner.coffee
teabag-0.5.5 app/assets/javascripts/teabag/base/runner.coffee
teabag-0.5.4 app/assets/javascripts/teabag/base/runner.coffee
teabag-0.5.3 app/assets/javascripts/teabag/base/runner.coffee
teabag-0.5.2 app/assets/javascripts/teabag/base/runner.coffee