Группа :: Редакторы
Пакет: vim-plugin-rails
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: vim-plugin-rails-2.0-alt1.patch
Скачать
Скачать
.gear-rules | 3 +
.../43ba4b978d1c1be301a77410514d361e279d44e1 | 13 ++++
.gear-tags/list | 1 +
autoload/rails.vim | 22 ++++---
plugin/rails.vim | 4 +
vim-plugin-rails.spec | 74 ++++++++++++++++++++
6 files changed, 108 insertions(+), 9 deletions(-)
diff --git a/.gear-rules b/.gear-rules
new file mode 100644
index 0000000..7724d34
--- /dev/null
+++ b/.gear-rules
@@ -0,0 +1,3 @@
+spec: vim-plugin-rails.spec
+tar: v@version@:. base=rails-@version@ name=rails-@version@
+diff: v@version@:. .
diff --git a/.gear-tags/43ba4b978d1c1be301a77410514d361e279d44e1 b/.gear-tags/43ba4b978d1c1be301a77410514d361e279d44e1
new file mode 100644
index 0000000..73ba84e
--- /dev/null
+++ b/.gear-tags/43ba4b978d1c1be301a77410514d361e279d44e1
@@ -0,0 +1,13 @@
+object eff7ba811960560fb0e4a5cae99df5a5ebbf6298
+type commit
+tag v2.0
+tagger Tim Pope <code@tpope.net> 1211856331 -0400
+
+rails.vim 2.0
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.6 (GNU/Linux)
+
+iD8DBQBIO3XS4J5HSkBKOkURAi9NAJwL1vl+nzsaN+7Achc84heDoMWR0QCeLvkv
+Yvf0KrLTlybJTn90l95JuIM=
+=EJP+
+-----END PGP SIGNATURE-----
diff --git a/.gear-tags/list b/.gear-tags/list
new file mode 100644
index 0000000..cdf378e
--- /dev/null
+++ b/.gear-tags/list
@@ -0,0 +1 @@
+43ba4b978d1c1be301a77410514d361e279d44e1 v2.0
diff --git a/autoload/rails.vim b/autoload/rails.vim
index 2ee0636..f1a4666 100644
--- a/autoload/rails.vim
+++ b/autoload/rails.vim
@@ -7,6 +7,10 @@
" ============================================================================
+if !exists("use_rails_plugin")
+ finish
+endif
+
" Exit quickly when:
" - this plugin was already loaded (or disabled)
" - when 'compatible' is set
@@ -1547,7 +1551,7 @@ function! s:RailsFind()
if res != ""|return res|endif
let res = s:singularize(s:findamethod('has_many\|has_and_belongs_to_many','app/models/\1'))
if res != ""|return res.".rb"|endif
- let res = s:singularize(s:findamethod('create_table\|drop_table\|add_column\|rename_column\|remove_column\|add_index','app/models/\1'))
+ let res = s:singularize(s:findamethod('create_table\|change_table\|drop_table\|add_column\|rename_column\|remove_column\|add_index','app/models/\1'))
if res != ""|return res.".rb"|endif
let res = s:singularize(s:findasymbol('through','app/models/\1'))
if res != ""|return res.".rb"|endif
@@ -1580,7 +1584,9 @@ function! s:RailsFind()
let res = s:sub(s:findfromview('javascript_include_tag','public/javascripts/\1.js'),'/defaults>','/application')
if res != ""|return res|endif
if RailsFileType() =~ '^controller\>'
- let res = s:findit('\s*\<def\s\+\(\k\+\)\>(\=',s:sub(s:sub(RailsFilePath(),'/controllers/','/views/'),'_controller\.rb$','').'/\1')
+ let contr = s:controller()
+ let view = s:findit('\s*\<def\s\+\(\k\+\)\>(\=','/\1')
+ let res = s:findview(contr.'/'.view)
if res != ""|return res|endif
endif
let isf_keep = &isfname
@@ -3100,13 +3106,11 @@ function! s:BufSyntax()
syn keyword rubyRailsAPIMethod api_method inflect_names
endif
if t =~ '^model$' || t =~ '^model-arb\>'
- syn keyword rubyRailsARMethod acts_as_list acts_as_nested_set acts_as_tree composed_of serialize
- syn keyword rubyRailsARAssociationMethod belongs_to has_one has_many has_and_belongs_to_many
- "syn match rubyRailsARCallbackMethod '\<\(before\|after\)_\(create\|destroy\|save\|update\|validation\|validation_on_create\|validation_on_update\)\>'
+ syn keyword rubyRailsARMethod named_scope serialize
+ syn keyword rubyRailsARAssociationMethod belongs_to has_one has_many has_and_belongs_to_many composed_of
syn keyword rubyRailsARCallbackMethod before_create before_destroy before_save before_update before_validation before_validation_on_create before_validation_on_update
syn keyword rubyRailsARCallbackMethod after_create after_destroy after_save after_update after_validation after_validation_on_create after_validation_on_update
syn keyword rubyRailsARClassMethod attr_accessible attr_protected establish_connection set_inheritance_column set_locking_column set_primary_key set_sequence_name set_table_name
- "syn keyword rubyRailsARCallbackMethod after_find after_initialize
syn keyword rubyRailsARValidationMethod validate validate_on_create validate_on_update validates_acceptance_of validates_associated validates_confirmation_of validates_each validates_exclusion_of validates_format_of validates_inclusion_of validates_length_of validates_numericality_of validates_presence_of validates_size_of validates_uniqueness_of
syn keyword rubyRailsMethod logger
endif
@@ -3143,7 +3147,7 @@ function! s:BufSyntax()
syn keyword rubyRailsFilterMethod verify
endif
if t =~ '^\%(db-\)\=\%(migration\|schema\)\>'
- syn keyword rubyRailsMigrationMethod create_table drop_table rename_table add_column rename_column change_column change_column_default remove_column add_index remove_index
+ syn keyword rubyRailsMigrationMethod create_table change_table drop_table rename_table add_column rename_column change_column change_column_default remove_column add_index remove_index
endif
if t =~ '^test\>'
if s:cacheneeds("user_asserts") && filereadable(RailsRoot()."/test/test_helper.rb")
@@ -3849,8 +3853,8 @@ function! s:BufAbbreviations()
Rabbrev mac( add_column
Rabbrev mrnc( rename_column
Rabbrev mrc( remove_column
- Rabbrev mct( create_table
- "Rabbrev mct create_table\ :\ do\ <Bar>t<Bar><CR>end<Esc>k$6hi
+ Rabbrev mct( create_table
+ Rabbrev mcht( change_table
Rabbrev mrnt( rename_table
Rabbrev mdt( drop_table
Rabbrev mcc( t.column
diff --git a/plugin/rails.vim b/plugin/rails.vim
index a27ea33..9dc831f 100644
--- a/plugin/rails.vim
+++ b/plugin/rails.vim
@@ -10,6 +10,10 @@
" ============================================================================
+if !exists("use_rails_plugin")
+ finish
+endif
+
" Exit quickly when:
" - this plugin was already loaded (or disabled)
" - when 'compatible' is set
diff --git a/vim-plugin-rails.spec b/vim-plugin-rails.spec
new file mode 100644
index 0000000..e499145
--- /dev/null
+++ b/vim-plugin-rails.spec
@@ -0,0 +1,74 @@
+# vim: set ft=spec: -*- rpm-spec -*-
+
+%define plugname rails
+
+Name: vim-plugin-%plugname
+Version: 2.0
+Release: alt1
+Serial: 1
+
+Summary: Ruby on Rails: easy file navigation, enhanced syntax highlighting, and more
+Group: Editors
+License: Charityware (Vim)
+Url: http://rails.vim.tpope.net/
+
+Packager: VIm Plugins Development Team <vim-plugins@packages.altlinux.org>
+
+BuildArch: noarch
+
+Source: %plugname-%version.tar
+Patch: %name-%version-%release.patch
+
+PreReq: vim-common >= 4:6.3.007-alt1
+
+BuildRequires(pre): vim-devel
+
+%description
+TextMate may be the latest craze for developing Ruby on Rails applications,
+but Vim is forever. This plugin offers the following features for Ruby on
+Rails application development:
+
+* Automatically detects buffers containing files from Rails applications,
+* Unintrusive.
+* Provides reasonable settings for working with Rails applications.
+* Easy navigation of the Rails directory structure.
+* Enhanced syntax highlighting.
+* Interface to script/*.
+* Partial extraction and migration inversion.
+* Integration with other plugins.
+
+To enable this plugin define "use_rails_plugin" variable somewhere
+in your .vimrc file.
+
+%prep
+%setup -n %plugname-%version
+%patch -p1
+
+%install
+%__mkdir_p %buildroot%vim_runtime_dir
+%__cp -rvp {autoload,doc,plugin} %buildroot%vim_runtime_dir
+
+%post
+%update_vimhelp
+
+%postun
+%clean_vimhelp
+
+%files
+%vim_autoload_dir/*
+%vim_doc_dir/*
+%vim_plugin_dir/*
+
+%changelog
+* Sun Jul 13 2008 Sir Raorn <raorn@altlinux.ru> 1:2.0-alt1
+- Updated to v2.0-3-gb4f93c4 (Rails 2.1 support)
+
+* Wed Dec 13 2006 Sir Raorn <raorn@altlinux.ru> 132-alt1
+- [132]
+
+* Mon Sep 25 2006 Sir Raorn <raorn@altlinux.ru> 128-alt2
+- Removed dependencies on rails and rake
+
+* Mon Sep 25 2006 Sir Raorn <raorn@altlinux.ru> 128-alt1
+- Built for Sisyphus
+