Sha256: c571dc1f0524d2875d2e911ab5387e70218fbb1789df31e0089878ecb36636d8

Contents?: true

Size: 924 Bytes

Versions: 209

Compression:

Stored size: 924 Bytes

Contents

module Sass
  module Tree
    # A dynamic node representing a Sass `@debug` statement.
    #
    # @see Sass::Tree
    class DebugNode < Node
      # @param expr [Script::Node] The expression to print
      def initialize(expr)
        @expr = expr
        super()
      end

      protected

      # @see Node#to_src
      def to_src(tabs, opts, fmt)
        "#{'  ' * tabs}@debug #{@expr.to_sass(opts)}#{semi fmt}\n"
      end

      # Prints the expression to STDERR.
      #
      # @param environment [Sass::Environment] The lexical environment containing
      #   variable and mixin values
      def _perform(environment)
        res = @expr.perform(environment)
        res = res.value if res.is_a?(Sass::Script::String)
        if filename
          $stderr.puts "#{filename}:#{line} DEBUG: #{res}"
        else
          $stderr.puts "Line #{line} DEBUG: #{res}"
        end
        []
      end
    end
  end
end

Version data entries

209 entries across 208 versions & 5 rubygems

Version Path
radiant-1.0.0.rc1 vendor/plugins/haml/lib/sass/tree/debug_node.rb
haml-3.1.0 vendor/sass/lib/sass/tree/debug_node.rb
haml-3.1.0.alpha.147 vendor/sass/lib/sass/tree/debug_node.rb
haml-3.1.0.alpha.145 vendor/sass/lib/sass/tree/debug_node.rb
haml-3.0.25 lib/sass/tree/debug_node.rb
haml-3.1.0.alpha.144 vendor/sass/lib/sass/tree/debug_node.rb
haml-3.1.0.alpha.141 vendor/sass/lib/sass/tree/debug_node.rb
haml-3.1.0.alpha.37 vendor/sass/lib/sass/tree/debug_node.rb
radiantcms-couchrest_model-0.1.3 vendor/plugins/haml/lib/sass/tree/debug_node.rb
radiantcms-couchrest_model-0.1.2 vendor/plugins/haml/lib/sass/tree/debug_node.rb
radiantcms-couchrest_model-0.1.1 vendor/plugins/haml/lib/sass/tree/debug_node.rb
radiantcms-couchrest_model-0.1 vendor/plugins/haml/lib/sass/tree/debug_node.rb
sass-3.1.0.alpha.48 lib/sass/tree/debug_node.rb
sass-3.1.0.alpha.47 lib/sass/tree/debug_node.rb
sass-3.1.0.alpha.46 lib/sass/tree/debug_node.rb
sass-3.1.0.alpha.45 lib/sass/tree/debug_node.rb
sass-3.1.0.alpha.44 lib/sass/tree/debug_node.rb
sass-3.1.0.alpha.43 lib/sass/tree/debug_node.rb
haml-3.1.0.alpha.36 vendor/sass/lib/sass/tree/debug_node.rb
sass-3.1.0.alpha.42 lib/sass/tree/debug_node.rb