From 957f540952342650c8be036d5105815c62296bf3 Mon Sep 17 00:00:00 2001 From: tdreyno Date: Thu, 24 Sep 2009 16:35:12 -0700 Subject: [PATCH] use gem/rip versions of deps instead of vendoring --- lib/middleman/sprockets+ruby19.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/middleman/sprockets+ruby19.rb diff --git a/lib/middleman/sprockets+ruby19.rb b/lib/middleman/sprockets+ruby19.rb new file mode 100644 index 00000000..59894983 --- /dev/null +++ b/lib/middleman/sprockets+ruby19.rb @@ -0,0 +1,29 @@ +module Sprockets + class SourceFile + def source_lines + @lines ||= begin + lines = [] + + comments = [] + File.open(pathname.absolute_location, 'rb') do |file| + file.each do |line| + lines << line = SourceLine.new(self, line, file.lineno) + + if line.begins_pdoc_comment? || comments.any? + comments << line + end + + if line.ends_multiline_comment? + if line.ends_pdoc_comment? + comments.each { |l| l.comment! } + end + comments.clear + end + end + end + + lines + end + end + end +end \ No newline at end of file