class Teaspoon::Configuration::Suite

Attributes

body_partial[RW]
boot_partial[RW]
expand_assets[RW]
helper[RW]
hooks[RW]
javascripts[RW]
js_extensions[RW]
matcher[RW]
stylesheets[RW]

Public Class Methods

new(name = nil) { |self| ... } click to toggle source
# File lib/teaspoon/configuration.rb, line 68
def initialize(name = nil)
  @matcher       = "{spec/javascripts,app/assets}/**/*_spec.{js,js.coffee,coffee,es6,js.es6}"
  @helper        = "spec_helper"
  @javascripts   = []
  @stylesheets   = ["teaspoon"]

  @boot_partial  = "boot"
  @body_partial  = "body"

  @hooks         = Hash.new { |h, k| h[k] = [] }
  @expand_assets = true
  @js_extensions = [/(\.js)?\.coffee/, /(\.js)?\.es6/, ".es6.js"]

  default = Teaspoon.configuration.suite_configs["default"]
  instance_eval(&default[:block]) if default
  if block_given?
    yield self
    raise Teaspoon::UnspecifiedFramework.new(name: name) if @javascripts.length == 0
  end
end

Public Instance Methods

hook(group = :default, &block) click to toggle source
# File lib/teaspoon/configuration.rb, line 99
def hook(group = :default, &block)
  @hooks[group.to_s] << block
end
js_config=(*_args) click to toggle source
# File lib/teaspoon/deprecated.rb, line 67
def js_config=(*_args)
  Teaspoon.dep(
    "the teaspoon suite js_config directive is no longer used, use the install generator to install the boot " +
    "partial and customize it instead.", :js_config
  )
end
no_coverage(*) click to toggle source
# File lib/teaspoon/deprecated.rb, line 81
def no_coverage(*)
  Teaspoon.dep("suite.no_coverage has been removed in Teaspoon 1.0. Please use coverage.ignore instead. https://github.com/jejacks0n/teaspoon/blob/master/CHANGELOG.md")
  []
end
Also aliased as: no_coverage=
no_coverage=(*)
Alias for: no_coverage
normalize_asset_path=(*_args) click to toggle source
# File lib/teaspoon/deprecated.rb, line 74
def normalize_asset_path=(*_args)
  Teaspoon.dep(
    "the teaspoon suite normalize_asset_path directive is no longer used, reopen Teaspoon::Suite and define a " +
    "normalize_js_extension method instead.", :normalize_asset_path
  )
end
use_framework(name, version = nil) click to toggle source
# File lib/teaspoon/configuration.rb, line 89
def use_framework(name, version = nil)
  framework = Teaspoon::Framework.fetch(name)
  framework.modify_config(self)

  @javascripts = framework.javascripts_for(version)
  return if @javascripts

  raise Teaspoon::UnknownFrameworkVersion.new(name: name, version: version)
end
use_framework=(name, _version = nil) click to toggle source
# File lib/teaspoon/deprecated.rb, line 87
def use_framework=(name, _version = nil)
  Teaspoon.dep("suite.use_framework= is deprecated, use suite.use_framework instead.")
  use_framework(*name)
end