From 21eb9c5e0cc8d1c9bb7aecd66f6bc1f1840e621b Mon Sep 17 00:00:00 2001 From: John Mair Date: Sat, 26 Mar 2011 23:27:18 +1300 Subject: [PATCH] version 0.7.6.1, added slightly better YARD support for syntax highlighting in show-doc command --- CHANGELOG | 4 ++++ lib/pry/commands.rb | 8 +++++--- lib/pry/version.rb | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1a3a0ace..6016ef55 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +26/3/2011 version 0.7.6.1 +* added slightly better support for YARD +* now @param and @return tags are colored green and markdown `code` is syntax highlighted using coderay + 26/3/2011 version 0.7.6 * `whereami` command now accepts parameter AROUND, to display AROUND lines on eitherside of invocation line. * made it so `whereami` is invoked even if no method exists in current context (i.e in rspec tests) diff --git a/lib/pry/commands.rb b/lib/pry/commands.rb index aefc0425..0fb6271a 100644 --- a/lib/pry/commands.rb +++ b/lib/pry/commands.rb @@ -4,7 +4,7 @@ require "pry/command_base" require "pry/pry_instance" begin - require "pry-doc" + require "pry-doc" rescue LoadError end @@ -175,7 +175,7 @@ class Pry # FIX ME!!! this line is screwed # check_for_dynamically_defined_method.call() if file =~ /(\(.*\))|<.*>/ - output.puts "Cannot find local context." + output.puts "Cannot find local context. Did you use `binding.pry` ?" next end @@ -467,7 +467,9 @@ e.g: eval-file -c self "hello.rb" gsub(/(?:\s*\n)?(.*?)\s*<\/em>/m) { Pry.color ? "\e[32m#{$1}\e[0m": $1 }. gsub(/(?:\s*\n)?(.*?)\s*<\/i>/m) { Pry.color ? "\e[34m#{$1}\e[0m" : $1 }. gsub(/\B\+(\w*?)\+\B/) { Pry.color ? "\e[32m#{$1}\e[0m": $1 }. - gsub(/((?:^[ \t]+.+(?:\n+|\Z))+)/) { Pry.color ? CodeRay.scan($1, code_type).term : $1 } + gsub(/((?:^[ \t]+.+(?:\n+|\Z))+)/) { Pry.color ? CodeRay.scan($1, code_type).term : $1 }. + gsub(/`(?:\s*\n)?(.*?)\s*`/) { Pry.color ? CodeRay.scan($1, code_type).term : $1 }. + gsub(/(@param|@return)/) { Pry.color ? "\e[32m#{$1}\e[0m": $1 } end strip_leading_hash_from_ruby_comments = lambda do |comment| diff --git a/lib/pry/version.rb b/lib/pry/version.rb index 900a7f19..81ab0cfe 100644 --- a/lib/pry/version.rb +++ b/lib/pry/version.rb @@ -1,3 +1,3 @@ class Pry - VERSION = "0.7.6" + VERSION = "0.7.6.1" end