RVM does not always provide an executable for specific ruby version
that is loaded (the "system" version).
RVM, or whatever else the user uses, should always setup "ruby" to point
to the correct version so this can always be used.
Make all the easy updates. There are still quite a few to do, but in
doing these ones I can see that syntastic#makeprg#build() needs to
accept a few more options. Namely:
* "postargs" that appear after the filename
* "tail" that appears after everything - used for things like
redirecting output and piping to grep/sed/etc
* the filename itself - only the java checkers needed this since they
specify the directory of the file to check as well
There are still a few other things to do as well:
* remove the options from the checkers that are now provided by
syntastic#makeprg#build implicitly - i.e. the checker exe and args.
* also, we need to doc the above implicit checker options
Query RVM for the version of ruby that should be used to do the syntax
check.
This wont work if the user has different versions of ruby for different
directories (e.g. if they are using a project rvmrc) as it will only a
single ruby version per vim instance.
I think this should satisfy almost everyone though, so we can wait for
feedback before doing anything more hardcore.
If the line a ruby error occurs on is 'too long' it will truncate the line it
displays in the error output and wrap it in `...`. This breaks %p from finding
the correct column so this patch ignores lines starting with `...`
e.g. %p working
```
ruby -w -T1 -c broken.rb
broken.rb:2: syntax error, unexpected tIDENTIFIER, expecting $end
puts sprintf "%d, %.2f, %.2f, %.2f, %d" k, v
^
```
%p not working
```
ruby -w -T1 -c broken.rb
broken.rb:2: syntax error, unexpected tIDENTIFIER, expecting $end
...tf "%d, %.2f, %.2f, %.2f, %d" k, v[:cost], v[:val], v[:carri...
... ^
```
On systems where Ruby 1.8.7 is the default Ruby and users use
alternative suffixes (e.g., ruby19) or even rbenv or rvm Rubies, modern
Ruby syntax will be highlighted as an error.
The default behaviour in Syntastic is to run 'ruby' to check the syntax
of the script in question. This patch allows the user to specify a
different binary which may even be a full path. This should work on all
platforms.
let g:syntastic_ruby_exec = 'ruby19'
let g:syntastic_ruby_exec = '~/.rbenv/versions/1.9.2-p318/bin/ruby'
Previously we were using "medium verbosity" with `-W1`. The reason for
this is because using full verbosity caused some bogus repeated warnings
to appear in rspec files.
Enable full verbosity again and filter out the bogus warnings.
Closes#290
* move the existing ruby checker to syntax_checkers/ruby/mri.vim
* add a skeleton checker for jruby
* load mri by default but add an option to specify which ruby checker to
load
This is in response to #185