Sha256: 7e212bbbaf45cf649f1c7a2affc0136ef3e91b392d6135096902c825670fb095

Contents?: true

Size: 685 Bytes

Versions: 7

Compression:

Stored size: 685 Bytes

Contents

require 'sass/tree/node'

module Sass::Tree
  class CommentNode < Node
    attr_accessor :value

    def initialize(value, options)
      @value = value[2..-1].strip
      super(options)
    end

    def ==(other)
      self.value == other.value && super
    end

    def silent?
      !!@options[:silent]
    end

    def to_s(tabs = 0, parent_name = nil)
      return if (@style == :compressed || silent?)

      spaces = '  ' * (tabs - 1)
      spaces + "/* " + ([value] + children.map {|c| c.text}).
        map{|l| l.sub(%r{ ?\*/ *$},'')}.join(@style == :compact ? ' ' : "\n#{spaces} * ") + " */"
    end

    protected

    def _perform(environment)
      self
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
honkster-haml-2.1.0 lib/sass/tree/comment_node.rb
honkster-haml-2.1.1 lib/sass/tree/comment_node.rb
jwhitmire-haml-2.1.0.1 lib/sass/tree/comment_node.rb
jwhitmire-haml-2.1.0.2 lib/sass/tree/comment_node.rb
jwhitmire-haml-2.1.0.3 lib/sass/tree/comment_node.rb
wireframe-haml-2.1.0 lib/sass/tree/comment_node.rb
wireframe-haml-2.1.1 lib/sass/tree/comment_node.rb