Skip to content

Commit fe7f022

Browse files
committed
TODO implemented, added a Makefile and a .gitignore to avoid the swap files
1 parent dcebc18 commit fe7f022

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.swp

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
install:
2+
cp -v plugin/* ~/.vim/plugin/
3+
cp -v syntax/* ~/.vim/syntax/

plugin/vim-rspec.vim

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"
22
" Vim Rspec
33
" Last change: March 3 2009
4-
" Version> 0.0.1
4+
" Version> 0.0.2
55
" Maintainer: Eustáquio 'TaQ' Rangel
66
" License: GPL
77
" URL: git://github.com/taq/vim-rspec
@@ -56,11 +56,18 @@ function! s:RunSpecMain(type)
5656
if isdirectory(l:dir."/spec")>0
5757
call s:notice_msg("Running spec on the spec directory ...")
5858
else
59-
" try to find a /spec on the current path
60-
" TODO: walk on the path to find the spec directory
61-
let l:mend = matchend(l:dir,'/spec')
62-
if l:mend>0
63-
let l:dir = strpart(l:dir,0,l:mend)
59+
" try to find a spec directory on the current path
60+
let l:tokens = split(l:dir,"/")
61+
let l:dir = ""
62+
for l:item in l:tokens
63+
call remove(l:tokens,-1)
64+
let l:path = "/".join(l:tokens,"/")."/spec"
65+
if isdirectory(l:path)
66+
let l:dir = l:path
67+
break
68+
end
69+
endfor
70+
if len(l:dir)>0
6471
call s:notice_msg("Running spec on the spec directory found (".l:dir.") ...")
6572
else
6673
call s:error_msg("No ".l:dir."/spec directory found")

0 commit comments

Comments
 (0)