Sha256: 1aedfae3f06877cdf304004c8ce78fa74b625fd58dd5cc00e01df89e0a10a3e4

Contents?: true

Size: 447 Bytes

Versions: 8

Compression:

Stored size: 447 Bytes

Contents

class SCSSBeautifier::Formatters::SilentComment < SCSSBeautifier::Formatters::Base
  def visit_comment(node)
    format_comment(node) if node.type == :normal
  end

  private

  def format_comment(node)
    # Remove /* from the beginning
    node.value.first.gsub!(/^\/\*/, "//")
    # Remove */ from the end
    node.value.last.gsub!(/\*\/$/, "")
    node.value.each do |item|
      item.gsub!(/\n/, "\n//") if String === item
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scss_beautifier-0.1.19 lib/scss_beautifier/formatters/silent_comment.rb
scss_beautifier-0.1.18 lib/scss_beautifier/formatters/silent_comment.rb
scss_beautifier-0.1.17 lib/scss_beautifier/formatters/silent_comment.rb
scss_beautifier-0.1.16 lib/scss_beautifier/formatters/silent_comment.rb
scss_beautifier-0.1.15 lib/scss_beautifier/formatters/silent_comment.rb
scss_beautifier-0.1.14 lib/scss_beautifier/formatters/silent_comment.rb
scss_beautifier-0.1.13 lib/scss_beautifier/formatters/silent_comment.rb
scss_beautifier-0.1.12 lib/scss_beautifier/formatters/silent_comment.rb