Class Index [+]

Quicksearch

Sass::Tree::WarnNode

A dynamic node representing a Sass `@warn` statement.

@see Sass::Tree

Public Class Methods

new(expr) click to toggle source

@param expr [Script::Node] The expression to print

    # File lib/sass/tree/warn_node.rb, line 8
 8:       def initialize(expr)
 9:         @expr = expr
10:         super()
11:       end

Protected Instance Methods

_perform(environment) click to toggle source

Prints the expression to STDERR with a stylesheet trace.

@param environment [Sass::Environment] The lexical environment containing

  variable and mixin values
    # File lib/sass/tree/warn_node.rb, line 24
24:       def _perform(environment)
25:         environment.push_frame(:filename => filename, :line => line)
26:         res = @expr.perform(environment)
27:         res = res.value if res.is_a?(Sass::Script::String)
28:         msg = "WARNING: #{res}\n"
29:         environment.stack.reverse.each_with_index do |entry, i|
30:           msg << "        #{i == 0 ? "on" : "from"} line #{entry[:line]}" <<
31:             " of #{entry[:filename] || "an unknown file"}"
32:           msg << ", in `#{entry[:mixin]}'" if entry[:mixin]
33:           msg << "\n"
34:         end
35:         Haml::Util.haml_warn msg
36:         []
37:       ensure
38:         environment.pop_frame
39:       end
to_src(tabs, opts, fmt) click to toggle source

@see Node#to_src

    # File lib/sass/tree/warn_node.rb, line 16
16:       def to_src(tabs, opts, fmt)
17:         "#{'  ' * tabs}@warn #{@expr.to_sass(opts)}#{semi fmt}\n"
18:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.