Sha256: 5f8bb89bba01725ae97915d51efa3080176b6f477a57d28dade240b9cb6d1119

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 KB

Contents

#= require_self
#= require teabag/base/runner
#= require teabag/base/fixture
#= require teabag/base/reporters/html
#= require teabag/base/reporters/console

class @Teabag
  @defer:     false
  @slow:      75
  @root:      null
  @started:   false
  @finished:  false
  @Reporters: {}
  @Date:      Date
  @location:  window.location
  @console:   window.console
  @messages:  []

  @execute: ->
    if @defer
      @defer = false
      return
    @started = true
    new Teabag.Runner()


  # provides interface for AMD usage -- pass all dependencies in as an array, and params will be checked for matches
  @resolveDependenciesFromParams: (all = []) ->
    deps = []
    return all if (paths = window.location.search.match(/[\?&]file(\[\])?=[^&\?]*/gi)) == null

    for path in paths
      parts = decodeURIComponent(path.replace(/\+/g, " ")).match(/\/(.+)\.(js|js.coffee|coffee)$/i)
      continue if parts == null
      file = parts[1].substr(parts[1].lastIndexOf("/") + 1)
      for dep in all then deps.push(dep) if dep.indexOf(file) >= 0
    deps


  # logging methods -- used by selenium / phantomJS to get information back to ruby
  @log: ->
    @messages.push(arguments[0])
    @console.log(arguments...)


  @getMessages: ->
    messages = @messages
    @messages = []
    messages

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
teabag-0.5.5 app/assets/javascripts/teabag/base/teabag.coffee
teabag-0.5.4 app/assets/javascripts/teabag/base/teabag.coffee