PATCH: new eruby compiler plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PATCH: new eruby compiler plugin

Doug Kearns
Here's a first cut at a compiler plugin for eruby. I suppose we should
support erb as well, or perhaps instead?

It's not particularly useful yet. ;-)

Regards,
Doug


Index: bin/vim-ruby-install.rb
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/bin/vim-ruby-install.rb,v
retrieving revision 1.9
diff -u -r1.9 vim-ruby-install.rb
--- bin/vim-ruby-install.rb 27 Aug 2005 15:05:42 -0000 1.9
+++ bin/vim-ruby-install.rb 1 Sep 2005 16:30:12 -0000
@@ -18,6 +18,7 @@
 require 'pathname'
 
 SOURCE_FILES = %w{
+  compiler/eruby.vim
   compiler/ruby.vim
   compiler/rubyunit.vim
   ftdetect/ruby.vim
Index: compiler/eruby.vim
===================================================================
RCS file: compiler/eruby.vim
diff -N compiler/eruby.vim
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ compiler/eruby.vim 1 Sep 2005 16:30:12 -0000
@@ -0,0 +1,35 @@
+" Vim compiler file
+" Language: eRuby
+" Maintainer: Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
+" Info: $Id$
+" URL: http://vim-ruby.sourceforge.net
+" Anon CVS: See above site
+" Licence: GPL (http://www.gnu.org)
+" Disclaimer:
+"    This program is distributed in the hope that it will be useful,
+"    but WITHOUT ANY WARRANTY; without even the implied warranty of
+"    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+"    GNU General Public License for more details.
+" ----------------------------------------------------------------------------
+
+if exists("current_compiler")
+  finish
+endif
+let current_compiler = "rubyunit"
+
+if exists(":CompilerSet") != 2 " older Vim always used :setlocal
+  command -nargs=* CompilerSet setlocal <args>
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+CompilerSet makeprg=eruby
+
+CompilerSet errorformat=%E%f:%l:%m,
+       \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: nowrap ts=8 ff=unix
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel
Reply | Threaded
Open this post in threaded view
|

Re: PATCH: new eruby compiler plugin

Doug Kearns
On Fri, Sep 02, 2005 at 02:33:04AM +1000, Doug Kearns wrote:
> Here's a first cut at a compiler plugin for eruby. I suppose we should
> support erb as well, or perhaps instead?

erb, unfortunately, doesn't include the filename in it's output. I'll
submit a patch.
 
> It's not particularly useful yet. ;-)

This should be an improvement...

Regards,
Doug


Index: compiler/eruby.vim
===================================================================
RCS file: /var/cvs/vim-ruby/vim-ruby/compiler/eruby.vim,v
retrieving revision 1.1
diff -u -r1.1 eruby.vim
--- compiler/eruby.vim 1 Sep 2005 16:35:57 -0000 1.1
+++ compiler/eruby.vim 2 Sep 2005 06:08:24 -0000
@@ -1,7 +1,7 @@
 " Vim compiler file
 " Language: eRuby
 " Maintainer: Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
-" Info: $Id: eruby.vim,v 1.1 2005/09/01 16:35:57 dkearns Exp $
+" Info: $Id$
 " URL: http://vim-ruby.sourceforge.net
 " Anon CVS: See above site
 " Licence: GPL (http://www.gnu.org)
@@ -15,7 +15,7 @@
 if exists("current_compiler")
   finish
 endif
-let current_compiler = "rubyunit"
+let current_compiler = "eruby"
 
 if exists(":CompilerSet") != 2 " older Vim always used :setlocal
   command -nargs=* CompilerSet setlocal <args>
@@ -26,7 +26,10 @@
 
 CompilerSet makeprg=eruby
 
-CompilerSet errorformat=%E%f:%l:%m,
+CompilerSet errorformat=eruby:\ %f:%l:%m,
+       \%E%f:%l:\ %m,
+       \%-Z%p^,
+       \%C%m,
        \%-G%.%#
 
 let &cpo = s:cpo_save
_______________________________________________
vim-ruby-devel mailing list
[hidden email]
http://rubyforge.org/mailman/listinfo/vim-ruby-devel