lib/jekyll-import/importers/tumblr.rb in jekyll-import-0.19.2 vs lib/jekyll-import/importers/tumblr.rb in jekyll-import-0.20.0
- old
+ new
@@ -264,11 +264,11 @@
if !block && line =~ indent
block = true
lang = "python"
start = i
elsif block
- lang = "javascript" if line =~ %r!;$!
+ lang = "javascript" if %r!;$!.match?(line)
block = line =~ indent && i < lines.size - 1 # Also handle EOF
unless block
lines[start] = "{% highlight #{lang} %}"
lines[i - 1] = "{% endhighlight %}"
end
@@ -281,10 +281,10 @@
def save_photo(url, ext)
return url unless @grab_images
path = "tumblr_files/#{url.split("/").last}"
- path += ext unless path =~ %r!#{ext}$!
+ path += ext unless %r!#{ext}$!.match?(path)
FileUtils.mkdir_p "tumblr_files"
# Don't fetch if we've already cached this file
unless File.size? path
Jekyll.logger.info "Fetching photo #{url}"