From 79b36aba787d03ff57b214613ba2bd21f076a0c8 Mon Sep 17 00:00:00 2001 From: murphy Date: Mon, 20 Feb 2006 01:41:40 +0000 Subject: plugin.rb: _map loading now without exceptions (doesn't produce rubygem warnings) test/ruby/quotes: second test case added --- lib/coderay/helpers/plugin.rb | 9 +++++---- test/ruby/quotes.in.rb | 2 ++ test/ruby/quotes.out.raydebug | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/coderay/helpers/plugin.rb b/lib/coderay/helpers/plugin.rb index 67d55c8..246b9b4 100644 --- a/lib/coderay/helpers/plugin.rb +++ b/lib/coderay/helpers/plugin.rb @@ -180,10 +180,11 @@ protected # # This is done automatically when plugin_path is called. def load_map - begin - require path_to('_map') - rescue LoadError - warn 'no _map.rb found for %s' % name if $DEBUG + mapfile = path_to '_map' + if File.exist? mapfile + require mapfile + elsif $DEBUG + warn 'no _map.rb found for %s' % name end end diff --git a/test/ruby/quotes.in.rb b/test/ruby/quotes.in.rb index 74bfe77..8c38e1f 100644 --- a/test/ruby/quotes.in.rb +++ b/test/ruby/quotes.in.rb @@ -1 +1,3 @@ +puts %}#{%}b#{%}r}*5}}*7}, immer wieder\n}*5 + print "test\n\\\\".gsub(/[\n\\]/, '\\\\\&') diff --git a/test/ruby/quotes.out.raydebug b/test/ruby/quotes.out.raydebug index 3a55efc..8c19169 100644 --- a/test/ruby/quotes.out.raydebug +++ b/test/ruby/quotes.out.raydebug @@ -1 +1,3 @@ +ident(puts) stringoperator(*)integer(5)delimiter(})>delimiter(})>operator(*)integer(7)delimiter(})>content(, immer wieder)char(\\n)delimiter(})>operator(*)integer(5) + ident(print) stringoperator(.)ident(gsub)operator(()regexpoperator(,) stringoperator(\)) -- cgit v1.2.1