lib/octopress-gist/gist.rb in octopress-gist-1.3.0 vs lib/octopress-gist/gist.rb in octopress-gist-1.3.1

- old
+ new

@@ -41,11 +41,13 @@ lang: (file['language'] || '').downcase }.merge(options) begin code = CodeHighlighter.select_lines(file['content'], opt) code = CodeHighlighter.highlight(code, opt) - code = "<notextile>#{code}</notextile>" if context.registers[:page]['path'].match(/textile/) + if page = context.registers[:page] + code = "<notextile>#{code}</notextile>" if page['path'] && page['path'].match(/textile/) + end output << code rescue => e markup = "{% #{@tag_name} #{@markup.strip} %}" CodeHighlighter.highlight_failed(e, "{% #{@tag_name} [gist_id] [file_name] [options...] %}", markup, file['content']) end @@ -86,9 +88,10 @@ raise if retried retried = true retry end rescue => e + require 'pry-debugger'; binding.pry puts "Failed to download Gist: #{gist}.".red puts e.extend Error end end end