From 34ce6b2e31242da05ec3b4c869a799d15b2be185 Mon Sep 17 00:00:00 2001 From: "Christopher H. Laco" Date: Thu, 3 Feb 2011 23:12:10 -0500 Subject: [PATCH] Added start of jasmine compiler for :make Map m in jasmine buffers to :make, which is rake -f Rakefile jasmine:ci --- README.textile | 1 + autoload/jasmine.vim | 2 +- compiler/jasmine.vim | 12 ++++++++++++ ftplugin/jasmine.vim | 3 +++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 compiler/jasmine.vim diff --git a/README.textile b/README.textile index 0f1753f..1858dbd 100644 --- a/README.textile +++ b/README.textile @@ -39,6 +39,7 @@ By default, the plugin assumes the templates are in bundle/jasmine/template and h2. Running Specs I'm slowly working on interactive spec running support. Currently, the Jasmine() command is provided for jasmine buffers. When invoked, it searches the current/parent directories of that buffer for the nearest Rakefile and invokes rake jasmine:ci to run all specs. +Jasmine buffers now have compiler set to the jasmine compiler and m is mapped to run :Jasmine -> jasmine#un_tests -> :make -> rake jasmine:ci I plan on adding Red/Green support, as well as quickfix error support. diff --git a/autoload/jasmine.vim b/autoload/jasmine.vim index d294743..d51c966 100644 --- a/autoload/jasmine.vim +++ b/autoload/jasmine.vim @@ -72,7 +72,7 @@ endfunction function jasmine#run_tests() let b:jasmine_root = jasmine#find_root() - execute "!rake --rakefile=\"".b:jasmine_rakefile."\" jasmine:ci" + execute "make --rakefile=\"".b:jasmine_rakefile."\" jasmine:ci" endfunction function jasmine#redbar() diff --git a/compiler/jasmine.vim b/compiler/jasmine.vim new file mode 100644 index 0000000..36b8def --- /dev/null +++ b/compiler/jasmine.vim @@ -0,0 +1,12 @@ +if exists("current_compiler") + finish +endif + +let current_compiler = "jasmine" + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=rake "$*" +CompilerSet errorformat=\ %#%f(%l\\\,%c):\ %m diff --git a/ftplugin/jasmine.vim b/ftplugin/jasmine.vim index 51f25fc..f0ed19d 100644 --- a/ftplugin/jasmine.vim +++ b/ftplugin/jasmine.vim @@ -4,6 +4,9 @@ endif let b:did_ftplugin = 1 +compiler jasmine +map m :Jasmine + call jasmine#load_snippets() command! Jasmine :call jasmine#run_tests()