class Teaspoon::Framework::Base

Attributes

_asset_paths[RW]
_install_path[RW]
_install_proc[RW]
_template_paths[RW]
_versions[RW]

Public Class Methods

add_asset_path(path) click to toggle source
# File lib/teaspoon/framework/base.rb, line 40
def add_asset_path(path)
  @_asset_paths << path
end
add_template_path(path) click to toggle source
# File lib/teaspoon/framework/base.rb, line 44
def add_template_path(path)
  @_template_paths << path
end
asset_paths() click to toggle source
# File lib/teaspoon/framework/base.rb, line 57
def asset_paths
  @_asset_paths
end
description() click to toggle source
# File lib/teaspoon/framework/base.rb, line 53
def description
  "#{@_framework_name}[#{@_versions.keys.join(', ')}]"
end
framework_name(name = nil) click to toggle source
# File lib/teaspoon/framework/base.rb, line 19
def framework_name(name = nil)
  name.present? ? @_framework_name ||= name.to_sym : @_framework_name
end
inherited(base) click to toggle source
# File lib/teaspoon/framework/base.rb, line 11
def inherited(base)
  base._versions = {}
  base._asset_paths = []
  base._template_paths = []
  base._install_path = "spec"
  base._install_proc = proc { }
end
install_callback() click to toggle source
# File lib/teaspoon/framework/base.rb, line 81
def install_callback
  _install_proc
end
install_path() click to toggle source
# File lib/teaspoon/framework/base.rb, line 77
def install_path
  _install_path
end
install_to(path, &block) click to toggle source
# File lib/teaspoon/framework/base.rb, line 48
def install_to(path, &block)
  @_install_path = path
  @_install_proc = block if block_given?
end
javascripts_for(version = nil) click to toggle source
# File lib/teaspoon/framework/base.rb, line 69
def javascripts_for(version = nil)
  _versions[version || versions.last]
end
modify_config(_config) click to toggle source
# File lib/teaspoon/framework/base.rb, line 85
def modify_config(_config)
  # noop - Implement this in subclass to modify suite configuration
end
name() click to toggle source
# File lib/teaspoon/framework/base.rb, line 65
def name
  framework_name
end
register_version(version, js_runner, options = {}) click to toggle source
# File lib/teaspoon/framework/base.rb, line 23
def register_version(version, js_runner, options = {})
  dependencies = options[:dependencies] || []
  dev_deps = options[:dev_deps] || []

  if ENV["TEASPOON_DEVELOPMENT"] && dev_deps.any?
    dependencies = dev_deps
  end

  if dependencies.empty?
    raise Teaspoon::UnspecifiedDependencies.new(framework: @_framework_name, version: version)
  end

  dependencies.unshift(js_runner)
  @_versions[version] = dependencies
  Teaspoon.configuration.asset_manifest += dependencies
end
template_paths() click to toggle source
# File lib/teaspoon/framework/base.rb, line 73
def template_paths
  _template_paths
end
versions() click to toggle source
# File lib/teaspoon/framework/base.rb, line 61
def versions
  _versions.keys
end