Permalink
Browse files

Minor clean ups for release

  • Loading branch information...
1 parent ce4ef71 commit fa7a2e8a3582181a2d25610f05b5c53de0ba90f2 @tpope committed Aug 17, 2006
Showing with 26 additions and 16 deletions.
  1. +12 −10 doc/rails.txt
  2. +14 −6 plugin/rails.vim
View
@@ -63,10 +63,12 @@ Rails application development.
":Rgenerate controller Blog" generates a blog controller and edits
app/controllers/blog_controller.rb. |rails-scripts|
-7. Partial extraction. |:Rextract| {file} replaces the desired range (ideally
- selected in visual line mode) with "render :partial => '{file}'", which is
- automatically created with your content. The @{file} instance variable is
- replaced with the {file} local variable. |rails-partials|
+7. Partial extraction and migration inversion. |:Rextract| {file} replaces
+ the desired range (ideally selected in visual line mode) with "render
+ :partial => '{file}'", which is automatically created with your content.
+ The @{file} instance variable is replaced with the {file} local variable.
+ |rails-partials| |:Rinvert| takes a self.up migration and writes a
+ self.down.
8. Integration with other plugins. |:Rproject| creates a new project.vim
project. |:Rdbext| loads database settings from database.yml for dbext.vim
@@ -298,7 +300,7 @@ and opening in a new tab. For :Rmodel, those variants would be :RSmodel,
Model Navigation Commands ~
- *rails-model-naviagtion*
+ *rails-model-navigation*
The default for model navigation commands is the current model, if it can be
determined. For example, test/unit/post_test.rb would have a current model
of post. Otherwise, if a controller name can be determined, said controller
@@ -344,7 +346,7 @@ modeline like: >
:Runittest [{name}] Edit the unit test for the specified model.
Controller Navigation Commands ~
- *rails-controller-naviagtion*
+ *rails-controller-navigation*
The default for model navigation commands is the current controller, if it can
be determined. For example, test/functional/blog_test.rb would have a current
controller of blog. Otherwise, if a model name can be determined, said model
@@ -542,10 +544,10 @@ PLUGIN INTEGRATION *rails-integration*
*rails-cream*
This plugin provides a few additional key bindings if it is running under
-Cream, the user friendly editor which uses Vim as a backend. Ctrl+Enter finds
-the file under the cursor (as in |rails-gf|), and Alt+[ and Alt+] find the
-alternate (|rails-alternate|) and related (|rails-related|) files. There is
-also a GUI menu, which is available in both Cream and GVim.
+Cream, the user friendly editor which uses Vim as a back-end. Ctrl+Enter
+finds the file under the cursor (as in |rails-gf|), and Alt+[ and Alt+] find
+the alternate (|rails-alternate|) and related (|rails-related|) files. There
+is also a GUI menu, which is available in both Cream and GVim.
==============================================================================
ABBREVIATIONS *rails-abbreviations* *rails-snippets*
View
@@ -730,7 +730,7 @@ function! s:Rake(bang,arg)
let oldefm = &efm
"errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f',%X%*\a[%*\d]: Leaving directory `%f',%D%*\a: Entering directory `%
setlocal efm=\%+E%f:%l:\ parse\ error,%W%f:%l:\ warning:\ %m,%E%f:%l:in\ %*[^:]:\ %m,%E%f:%l:\ %m,%-C%\tfrom\ %f:%l:in\ %.%#,%-Z%\tfrom\ %f:%l,%-Z%p^,%-G%.%#
- " Want an error format for a full stack backtrace
+ " Need an error format for a full stack backtrace
endif
let t = RailsFileType()
let arg = a:arg
@@ -796,8 +796,14 @@ function! s:Rake(bang,arg)
make db:migrate
elseif t=~ '^model\>'
make test:units TEST="%:p:r:s?[\/]app[\/]models[\/]?/test/unit/?_test.rb"
+ elseif t=~ '^api\>'
+ make test:units TEST="%:p:r:s?[\/]app[\/]apis[\/]?/test/functional/?_test.rb"
elseif t=~ '^\<\%(controller\|helper\|view\)\>'
- make test:functionals
+ if RailsFilePath() =~ '\<app/' && s:controller() != ""
+ exe 'make test:functionals TEST="'.s:ra().'/test/functional/'.s:controller().'_controller_test.rb"'
+ else
+ make test:functionals
+ endif
else
make
endif
@@ -1621,15 +1627,15 @@ function! s:fixturesEdit(bang,cmd,...)
if a:0
let c = s:underscore(a:1)
else
- let c = s:model(1)
+ let c = s:pluralize(s:model(1))
endif
if c == ""
return s:error("E471: Argument required")
endif
let e = fnamemodify(c,':e')
let e = e == '' ? e : '.'.e
let c = fnamemodify(c,':r')
- let file = 'test/fixtures/'.s:pluralize(c).e
+ let file = 'test/fixtures/'.c.e
if file =~ '\.\w\+$'
call s:edit(a:cmd.(a:bang?'!':''),file)
else
@@ -3535,7 +3541,7 @@ function! s:BufSettings()
setlocal includeexpr=RailsIncludeexpr()
setlocal suffixesadd=.rb,.rhtml,.rxml,.rjs,.mab,.liquid,.css,.js,.yml,.csv,.rake,.sql,.html
endif
- if &filetype == "ruby"
+ if &filetype == "ruby" || &ft == "rjs" || &ft == "rxml"
setlocal suffixesadd=.rb,.rhtml,.rxml,.rjs,.mab,.liquid,.yml,.csv,.rake,s.rb
if expand('%:e') == 'rake'
setlocal define=^\\s*def\\s\\+\\(self\\.\\)\\=\\\|^\\s*\\%(task\\\|file\\)\\s\\+[:'\"]
@@ -3544,7 +3550,9 @@ function! s:BufSettings()
endif
elseif &filetype == "eruby"
"set include=\\<\\zsAct\\f*::Base\\ze\\>\\\|^\\s*\\(require\\\|load\\)\\s\\+['\"]\\zs\\f\\+\\ze\\\|\\zs<%=\\ze
- setlocal suffixesadd=.rhtml,.rxml,.rjs,.mab,.liquid,.rb,.css,.js,.html
+ setlocal suffixesadd=.rhtml,.rxml,.rjs,.mab,.liquid,.rb,.css,.js,.html,.yml,.csv
+ elseif &filetype == "yaml"
+ setlocal suffixesadd=.yml,.csv,.rb,.rhtml,.rxml,.rjs,.mab,.liquid,.rake,s.rb
endif
endfunction

0 comments on commit fa7a2e8

Please sign in to comment.