Class: Teaspoon::Configuration::Suite
- Inherits:
-
Object
- Object
- Teaspoon::Configuration::Suite
- Defined in:
- lib/teaspoon/deprecated.rb,
lib/teaspoon/configuration.rb
Instance Attribute Summary collapse
-
#body_partial ⇒ Object
Returns the value of attribute body_partial.
-
#boot_partial ⇒ Object
Returns the value of attribute boot_partial.
-
#expand_assets ⇒ Object
Returns the value of attribute expand_assets.
-
#helper ⇒ Object
Returns the value of attribute helper.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#javascripts ⇒ Object
Returns the value of attribute javascripts.
-
#js_extensions ⇒ Object
Returns the value of attribute js_extensions.
-
#matcher ⇒ Object
Returns the value of attribute matcher.
-
#stylesheets ⇒ Object
Returns the value of attribute stylesheets.
Instance Method Summary collapse
- #hook(group = :default, &block) ⇒ Object
-
#initialize(name = nil) ⇒ Suite
constructor
A new instance of Suite.
- #js_config=(*_args) ⇒ Object
- #no_coverage ⇒ Object (also: #no_coverage=)
- #normalize_asset_path=(*_args) ⇒ Object
- #use_framework(name, version = nil) ⇒ Object
- #use_framework=(name, _version = nil) ⇒ Object
Constructor Details
#initialize(name = nil) ⇒ Suite
Returns a new instance of Suite.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# 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 |
Instance Attribute Details
#body_partial ⇒ Object
Returns the value of attribute body_partial.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def body_partial @body_partial end |
#boot_partial ⇒ Object
Returns the value of attribute boot_partial.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def boot_partial @boot_partial end |
#expand_assets ⇒ Object
Returns the value of attribute expand_assets.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def @expand_assets end |
#helper ⇒ Object
Returns the value of attribute helper.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def helper @helper end |
#hooks ⇒ Object
Returns the value of attribute hooks.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def hooks @hooks end |
#javascripts ⇒ Object
Returns the value of attribute javascripts.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def javascripts @javascripts end |
#js_extensions ⇒ Object
Returns the value of attribute js_extensions.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def js_extensions @js_extensions end |
#matcher ⇒ Object
Returns the value of attribute matcher.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def matcher @matcher end |
#stylesheets ⇒ Object
Returns the value of attribute stylesheets.
64 65 66 |
# File 'lib/teaspoon/configuration.rb', line 64 def stylesheets @stylesheets end |
Instance Method Details
#hook(group = :default, &block) ⇒ Object
99 100 101 |
# File 'lib/teaspoon/configuration.rb', line 99 def hook(group = :default, &block) @hooks[group.to_s] << block end |
#js_config=(*_args) ⇒ Object
67 68 69 70 71 72 |
# 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 ⇒ Object Also known as: no_coverage=
81 82 83 84 |
# 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 |
#normalize_asset_path=(*_args) ⇒ Object
74 75 76 77 78 79 |
# 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) ⇒ Object
89 90 91 92 93 94 95 96 97 |
# 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 |