lib/sprockets/source_line.rb in sprockets-0.9.0 vs lib/sprockets/source_line.rb in sprockets-0.9.1

- old
+ new

@@ -5,23 +5,35 @@ def initialize(source_file, line, number) @source_file = source_file @line = line @number = number end - + def comment @comment ||= line[/^\s*\/\/(.*)/, 1] end def comment? !!comment end + def comment! + @comment = line + end + def begins_multiline_comment? + line =~ /^\s*\/\*(.*)/ + end + + def begins_pdoc_comment? line =~ /^\s*\/\*\*(.*)/ end - def closes_multiline_comment? + def ends_multiline_comment? + line =~ /^(.*)*\*\/\s*/ + end + + def ends_pdoc_comment? line =~ /^(.*)*\*\*\/\s*/ end def require @require ||= (comment || "")[/^=\s+require\s+(\"(.*?)\"|<(.*?)>)\s*$/, 1]