Skip to content
Browse files

Fix handling of Gists that don't have the new "frontmatter"-style com…

…ments
  • Loading branch information...
1 parent a13d41d commit 850ecd414b159cc8a836eedae0faaaa960c6492b @jedfoster committed Mar 22, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 sassmeister.rb
View
10 sassmeister.rb
@@ -113,16 +113,18 @@ def sass_convert(from_syntax, to_syntax, sass)
def unpack_dependencies(sass)
frontmatter = sass.slice(/^\/\/ ---\n(?:\/\/ .+\n)*\/\/ ---\n/)
-
- return '' if frontmatter.nil?
- frontmatter = frontmatter.to_s.gsub(/(\/\/ |---|\(.+$)/, '').strip.split(/\n/)
+ if frontmatter.nil?
+ frontmatter = sass.split(/(^\/\/ | v\d)/)
+ else
+ frontmatter = frontmatter.to_s.gsub(/(\/\/ |---|\(.+$)/, '').strip.split(/\n/)
+ end
frontmatter.delete_if do |x|
! @plugins.key?(x.to_s.strip)
end
- frontmatter[0].strip
+ frontmatter[0].strip unless frontmatter.empty?
end
def pack_dependencies(params)

0 comments on commit 850ecd4

Please sign in to comment.
Something went wrong with that request. Please try again.