niklas-vimmate 0.8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. data/.autotest +10 -0
  2. data/CHANGELOG +108 -0
  3. data/COPYING +20 -0
  4. data/README +221 -0
  5. data/Rakefile +97 -0
  6. data/TODO +21 -0
  7. data/bin/vimmate +95 -0
  8. data/config/environment.rb +33 -0
  9. data/controllers/file_filter_controller.rb +85 -0
  10. data/controllers/file_popup_menu_controller.rb +40 -0
  11. data/controllers/vim_controller.rb +28 -0
  12. data/controllers/vim_mate_controller.rb +76 -0
  13. data/images/file.png +0 -0
  14. data/images/file_green.png +0 -0
  15. data/images/file_orange.png +0 -0
  16. data/images/file_red.png +0 -0
  17. data/images/folder.png +0 -0
  18. data/images/folder_green.png +0 -0
  19. data/images/folder_orange.png +0 -0
  20. data/images/folder_red.png +0 -0
  21. data/images/processing.png +0 -0
  22. data/images/svn_added.png +0 -0
  23. data/images/svn_conflict.png +0 -0
  24. data/images/svn_deleted.png +0 -0
  25. data/images/svn_locked.png +0 -0
  26. data/images/svn_modified.png +0 -0
  27. data/images/svn_normal.png +0 -0
  28. data/images/svn_readonly.png +0 -0
  29. data/images/vimmate16.png +0 -0
  30. data/images/vimmate32.png +0 -0
  31. data/images/vimmate48.png +0 -0
  32. data/lib/active_window.rb +8 -0
  33. data/lib/active_window/active_column.rb +218 -0
  34. data/lib/active_window/active_tree_store.rb +13 -0
  35. data/lib/active_window/active_tree_store/columns.rb +88 -0
  36. data/lib/active_window/active_tree_store/extentions.rb +81 -0
  37. data/lib/active_window/active_tree_store/index.rb +53 -0
  38. data/lib/active_window/application.rb +133 -0
  39. data/lib/active_window/controller.rb +58 -0
  40. data/lib/active_window/dot_file.rb +29 -0
  41. data/lib/active_window/filtered_active_tree_store.rb +114 -0
  42. data/lib/active_window/listed_item.rb +127 -0
  43. data/lib/active_window/signal.rb +46 -0
  44. data/lib/config_window.rb +90 -0
  45. data/lib/file_tree_store.rb +73 -0
  46. data/lib/filtered_file_tree_store.rb +34 -0
  47. data/lib/gtk_thread_helper.rb +73 -0
  48. data/lib/listed_directory.rb +43 -0
  49. data/lib/listed_file.rb +67 -0
  50. data/lib/try.rb +9 -0
  51. data/lib/vim/buffers.rb +18 -0
  52. data/lib/vim/integration.rb +36 -0
  53. data/lib/vim/netbeans.rb +156 -0
  54. data/lib/vim/source.vim +18 -0
  55. data/lib/vim_mate/config.rb +132 -0
  56. data/lib/vim_mate/dummy_window.rb +14 -0
  57. data/lib/vim_mate/files_menu.rb +110 -0
  58. data/lib/vim_mate/icons.rb +156 -0
  59. data/lib/vim_mate/nice_singleton.rb +53 -0
  60. data/lib/vim_mate/plugins.rb +6 -0
  61. data/lib/vim_mate/plugins/inotify/init.rb +4 -0
  62. data/lib/vim_mate/plugins/inotify/lib/INotify.rb +206 -0
  63. data/lib/vim_mate/plugins/inotify/lib/directory.rb +58 -0
  64. data/lib/vim_mate/plugins/subversion/init.rb +7 -0
  65. data/lib/vim_mate/plugins/subversion/lib/file.rb +59 -0
  66. data/lib/vim_mate/plugins/subversion/lib/menu.rb +96 -0
  67. data/lib/vim_mate/plugins/subversion/lib/subversion.rb +157 -0
  68. data/lib/vim_mate/requirer.rb +68 -0
  69. data/lib/vim_mate/search_window.rb +227 -0
  70. data/lib/vim_mate/tags_window.rb +167 -0
  71. data/lib/vim_mate/terminals_window.rb +163 -0
  72. data/lib/vim_mate/version.rb +29 -0
  73. data/lib/vim_mate/vim_widget.rb +150 -0
  74. data/spec/active_window/active_column_spec.rb +41 -0
  75. data/spec/active_window/active_tree_store_spec.rb +312 -0
  76. data/spec/active_window/controller_spec.rb +6 -0
  77. data/spec/lib/file_tree_store_spec.rb +40 -0
  78. data/spec/lib/listed_directory_spec.rb +26 -0
  79. data/spec/lib/listed_file_spec.rb +53 -0
  80. data/spec/nice_singleton_spec.rb +23 -0
  81. data/spec/spec.opts +6 -0
  82. data/spec/spec_helper.rb +10 -0
  83. data/views/vim_mate.glade +308 -0
  84. data/vimmate.gemspec +131 -0
  85. metadata +168 -0
data/.autotest ADDED
@@ -0,0 +1,10 @@
1
+ Autotest.add_hook :initialize do |at|
2
+ at.clear_mappings
3
+ at.add_mapping(%r%^lib/.*\.rb$%) {
4
+ at.files_matching %r%^spec/.*_spec\.rb$%
5
+ }
6
+ at.add_mapping(%r%^spec/.*\.rb$%) { |file,_|
7
+ file
8
+ }
9
+ end
10
+
data/CHANGELOG ADDED
@@ -0,0 +1,108 @@
1
+ = Changelog
2
+
3
+ === Version 0.6.6
4
+ - # 15198: After a file was opened in Vim, the focus was not in Vim, so if you
5
+ started typing, you would type in the file list, not in Vim. This has been
6
+ corrected. Thanks to Gerda Shank for the bug report.
7
+ - # 14387: A new option is now available to start a login shell by default in
8
+ the terminal window. The option :terminals_login_shell is set to false by
9
+ default. If set to true, it will launch the $SHELL command if defined, the
10
+ shell defined in /etc/passwd if defined and /bin/sh otherwise. In all cases,
11
+ it will pass the -l option to the shell. Thanks to Pablo Castellazzi for the
12
+ patch.
13
+ - # 14886: When filtering, directories that contain no matching files are now
14
+ automatically hidden. Also, a new option is now available to automatically
15
+ expand the file tree when filtering. The option is
16
+ :files_auto_expand_on_filter and is set to false by default. Thanks to
17
+ Stefan for the original patch.
18
+
19
+ === Version 0.6.5
20
+ - VimMate would crash when VTE was not present when using shortcut keys
21
+ - Changed some shortcut keys:
22
+ - CTRL+SHIFT+S: Set focus to current terminal (shell)
23
+ - CTRL+SHIFT+T: Create a new terminal
24
+ - CTRL+SHIFT+E: Set focus to search file list
25
+ - # 13210: A new option is now available to hide the status of the files. This helps
26
+ when using ellipsis since it leaves more space for the file names. The new
27
+ option is :files_show_status and it's set to true by default. Thanks to
28
+ Stephen Walker who sent me a patch for this.
29
+
30
+ === Version 0.6.4
31
+ - VimMate now has shortcut keys to control it's various parts. Here is the
32
+ list of the shortcut keys that where added:
33
+ - CTRL+SHIFT+T: Set focus to current terminal
34
+ - CTRL+SHIFT+N: Create a new terminal
35
+ - CTRL+SHIFT+W: Close current terminal
36
+ - CTRL+PAGEDOWN: Next terminal
37
+ - CTRL+PAGEDOWN: Previous terminal
38
+ - CTRL+SHIFT+L: Set focus to file filter
39
+ - CTRL+SHIFT+F: Set focus to file list
40
+ - CTRL+SHIFT+S: Set focus to search file list
41
+ - CTRL+SHIFT+V: Set focus to Vim
42
+ Setting the focus to Vim doesn't work perfectly. If it doesn't seem to work,
43
+ you can try to press TAB or the Up or Down keys on your keyboard after using
44
+ the CTRL+SHIFT+V shortcut and it works most of the time. Thanks to Florian
45
+ Frank who sent me a patch for the first 5 shortcuts. The other shortcuts
46
+ where also added thanks to this patch by Florian Frank.
47
+
48
+ === Version 0.6.3
49
+ - # 13212: VimMate could not be resized properly.
50
+ - # 7399, partially. A new warning has been added when too many files are
51
+ loaded by VimMate. The warning asks the user if he wants to continue. The
52
+ default number of files is 300 and can be changed by setting the option
53
+ :files_warn_too_many_files to an other number. The warning is popped every
54
+ multiple of this settings, which means at 300, 600, 900... This can be
55
+ changed by setting the option :files_warn_too_many_files_each_step to
56
+ false.
57
+
58
+ === Version 0.6.2
59
+ - # 7028: It's now possible to install VimMate using the provided setup.rb
60
+ or with Ruby Gems.
61
+ - Two layouts are now available. The old layout, with big terminals:
62
+ -------------
63
+ | F | |
64
+ | i | |
65
+ | l | Vim |
66
+ | e | |
67
+ | s | |
68
+ -------------
69
+ | Terminals |
70
+ -------------
71
+ And the new layout, with a big file list:
72
+ -------------
73
+ | | |
74
+ | F | |
75
+ | i | Vim |
76
+ | l | |
77
+ | e | |
78
+ | s ---------
79
+ | | Term |
80
+ -------------
81
+ The new layout is now the default. You can change this by setting the
82
+ :layout_big_terminals option to true.
83
+ - # 6761: A new way of opening files is now available. A new list of files
84
+ allows you to type only a part of a file name to see the possible files
85
+ filtered instantly. You can then select the file from the list or type
86
+ <tt>Enter</tt> directly if the file you are searching for is selected.
87
+ You can remove this new list by setting the option :files_use_search
88
+ to false. You can also specify if the search is case sensitive or not
89
+ with the option :files_search_ignore_case. The case is ignored by default.
90
+ - Long file names in the file list are now shorten with ellipsis. You can
91
+ disable ellipsis by setting the option :files_use_ellipsis to false.
92
+ - Files or directories can now be excluded on the command line. You can specify
93
+ a comma separated list of names that will be matched against the end of the
94
+ path of each files of directories. So <tt>vimmate -x html,pkg,README</tt>
95
+ will exclude any files with the names html, pkg or README. But,
96
+ <tt>vimmate -x bin/README</tt> will only exclude the file README in the bin
97
+ directory. Note that <tt>vimmate -x ME</tt> will only exclude files or
98
+ directories named ME and not files ending with ME like README.
99
+
100
+ === Version 0.6.1
101
+ - # 6721: Added "Tab Open" in the menu. "Tab Open" is the default when opening
102
+ a file not from the menu. This can be changed by setting the option
103
+ :files_default_open_in_tabs to false.
104
+ - Better Subversion integration: Add a new menu Subversion with Add, Rename,
105
+ Delete and Revert as sub-menus.
106
+
107
+ === Version 0.6.0
108
+ - First release
data/COPYING ADDED
@@ -0,0 +1,20 @@
1
+ = VimMate: Vim graphical add-on
2
+ Copyright (c) 2006 Guillaume Benny
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8
+ of the Software, and to permit persons to whom the Software is furnished to do
9
+ so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
data/README ADDED
@@ -0,0 +1,221 @@
1
+ = Description
2
+
3
+ VimMate is a graphical add-on to Vim with IDE-like features: it does more
4
+ than the plain Vim while still being lightweight. Even with the additional
5
+ features, it stays out of the way for it's main task: editing files with Vim.
6
+ VimMate adds functionality to Vim by embedding Vim GTK GUI (gVim) within
7
+ VimMate.
8
+
9
+ Some of the ideas of VimMate comes from PIDA[http://pida.berlios.de/]
10
+ and others from TextMate[http://macromates.com/] (although I've never
11
+ used TextMate).
12
+
13
+ VimMate's homepage: http://vimmate.rubyforge.org
14
+
15
+ = Features
16
+
17
+ VimMate has the following features:
18
+ - Uses Vim[http://www.vim.org/] for the text editor so it has all of
19
+ Vim's qualities.
20
+ - Written in Ruby[http://www.ruby-lang.org/] so the code is nice and clean.
21
+ - Integrated, hideable and searchable file tree with filter for easy
22
+ project viewing.
23
+ - Multiple integrated terminals <i>(Optional)</i>.
24
+ - Basic Subversion[http://subversion.tigris.org/] integration: <i>(Optional)</i>
25
+ - The file status is displayed in the file tree.
26
+ - You can add, rename, delete and revert a file from the file tree.
27
+ - Navigate the various part of the interface with the keyboard
28
+
29
+ = Installation
30
+ VimMate has only been tested under Linux (in fact,
31
+ {Gentoo Linux}[http://www.gentoo.org/]). It might work under other OSs,
32
+ although I do not know. I think only the file list will work under
33
+ Windows because Vim does not use GTK under Windows so it cannot be embedded.
34
+ I know nothing about MacOSX so I cannot say if it works or not.
35
+
36
+ To install:
37
+ - Make sure Vim[http://www.vim.org/] is installed and compiled with the
38
+ graphical interface. Try running +gvim+ to see if it works. Only Vim
39
+ version 7.0 has been tested.
40
+ - Make sure Ruby[http://www.ruby-lang.org/] version 1.8 or more is installed.
41
+ Try running <tt>ruby --version</tt> in a terminal.
42
+ - Install the Ruby bindings to GTK and GNOME (for the VTE terminal). See
43
+ {Ruby-GNOME2 website}[http://ruby-gnome2.sourceforge.jp/]. Only
44
+ Ruby-GNOME2 version 0.15 and 0.16 has been tested. You don't need VTE: if
45
+ it's not installed, VimMate will not have terminals but will run anyway.
46
+ - If you want to use the Subversion integration feature, you must install
47
+ the subversion bindings for Ruby. Check if it's available for your OS
48
+ or get the sources from
49
+ {Subversion's website}[http://subversion.tigris.org/] and compile them.
50
+ - Download the latest VimMate on
51
+ {VimMate's homepage}[http://vimmate.rubyforge.org/].
52
+ - You now have 3 choices to install VimMate: manually, with Ruby Gems or with
53
+ <tt>setup.rb</tt>:
54
+ - With Ruby Gems
55
+ - Simply run <tt>gem install VimMate</tt> .
56
+ - With <tt>setup.rb</tt>
57
+ - Simply run <tt>ruby setup.rb</tt> . Run <tt>ruby setup.rb --help</tt> for
58
+ more information.
59
+ - Manually
60
+ - Copy the file <tt>bin/vimmate</tt> and the directory
61
+ <tt>lib/vimmatelib</tt> to a directory somewhere in your path.
62
+ - Make sure +vimmate+ is executable: <tt>chmod u+x vimmate</tt>
63
+ - cd to a directory where your project is. (Watch out for directories
64
+ with too many files. See <i>Limitations</i> below.)
65
+ - Run +vimmate+
66
+
67
+ Run <tt>vimmate --help</tt> for more information.
68
+
69
+ = Configuration
70
+ Note that you don't have to do what's described in this section:
71
+ everything will work anyway. It's just filled with nice tricks.
72
+
73
+ VimMate doesn't need any special configuration to run. But, when VimMate is
74
+ first run, it creates a file named <tt>.vimmaterc</tt> in your HOME directory.
75
+ You can edit this file at your own risk. If anything goes wrong, you can
76
+ always delete this file and it will be recreated with the default
77
+ configuration.
78
+
79
+ Most variables are self explanatory. One variable deserves a special
80
+ explanation because it can be useful to change. It's the line that
81
+ starts with <tt>:terminals_autoexec:</tt>. This line specifies a string
82
+ that is automatically executed by every terminals that are created by
83
+ VimMate. I'm sure you can think about a way to use this, but the idea
84
+ of this configuration line is to initialize the terminal so that it can
85
+ execute Vim (the console <tt>vim</tt>) without weird warnings about
86
+ escape characters. Here is how to configure it so that it works without
87
+ warnings with the bash shell:
88
+
89
+ # Other configurations before...
90
+ # (Because of a small quirk in rdoc, I put a space between the
91
+ # colon (:) and terminals_autoexec but there must be no space.)
92
+ : terminals_autoexec: |
93
+ export TERM="gnome"
94
+ clear
95
+
96
+ # Other configurations after...
97
+
98
+ You can adapt those commands for your shell. If you wonder about the
99
+ syntax of this file, it's a Ruby hash with Ruby symbols as keys dumped
100
+ with YAML[http://www.yaml.org/].
101
+
102
+ If you have problems getting it to work, watch out for whitespace because
103
+ YAML is whitespace sensitive (like python). If you still can't get it to
104
+ work, try running this in a shell:
105
+
106
+ ruby -ryaml -e 'puts({:terminals_autoexec => %{export TERM="gnome"\nclear}}.to_yaml)'
107
+
108
+ You can redirect the output of this command to overwrite your .vimmaterc file
109
+ and then run VimMate: it should work this time.
110
+
111
+ An other nice trick is to add a special alias that exists only within
112
+ VimMate's terminals (Thanks to Jonathan Hankins for this updated tip,
113
+ see {#13432}[http://rubyforge.org/tracker/index.php?func=detail&aid=13432&group_id=2612&atid=10058]
114
+ for details):
115
+
116
+ # Other configurations before...
117
+ # (Because of a small quirk in rdoc, I put a space between the
118
+ # colon (:) and terminals_autoexec but there must be no space.)
119
+ : terminals_autoexec: |
120
+ alias vm='gvim --servername $(gvim --serverlist | grep "VIMMATE_$PPID") --remote-tab'
121
+ export TERM="gnome"
122
+ clear
123
+
124
+ # Other configurations after...
125
+
126
+ Again, you have to adapt for your shell because this is for bash. This
127
+ will also only works if you have only one VimMate running. This will allow
128
+ you to type
129
+
130
+ vm a_file
131
+
132
+ to edit <tt>a_file</tt> with the running VimMate. This can be handy for those
133
+ who prefer the command line to the file tree.
134
+
135
+ If you use Subversion (SVN), you can add yet an other line to be able to
136
+ edit your commit messages within VimMate:
137
+
138
+ # Other configurations before...
139
+ # (Because of a small quirk in rdoc, I put a space between the
140
+ # colon (:) and terminals_autoexec but there must be no space.)
141
+ : terminals_autoexec: |
142
+ alias vm='gvim --servername $(gvim --serverlist | grep "VIMMATE_$PPID") --remote-tab'
143
+ export SVN_EDITOR='gvim --servername `gvim --serverlist | grep VIMMATE_` --remote-wait'
144
+ export TERM="gnome"
145
+ clear
146
+
147
+ # Other configurations after...
148
+
149
+ Then, when you run:
150
+
151
+ svn commit
152
+
153
+ the commit message will be edited within VimMate and Subversion will wait for
154
+ the buffer containing the file to be deleted with the command
155
+
156
+ :bd
157
+
158
+ within Vim.
159
+
160
+ = Interesting Vim scripts
161
+ Here are some of the Vim scripts that I think are useful with VimMate to
162
+ make Vim more powerful:
163
+ - matchit[http://www.vim.org/scripts/script.php?script_id=39]:
164
+ Extends the Vim command <tt>%</tt> to easily navigate in
165
+ matching language constructs for many languages.
166
+ - rails[http://www.vim.org/scripts/script.php?script_id=1567]:
167
+ Easy navigation for {Ruby on Rails}[http://www.rubyonrails.org/]
168
+ - grep[http://www.vim.org/scripts/script.php?script_id=311]:
169
+ Nice grep integration. I frequently use the command <tt>:Rgrep</tt>.
170
+ - dbext[http://www.vim.org/scripts/script.php?script_id=356]:
171
+ Database access within Vim. Integrates well with <tt>rails.vim</tt>.
172
+ - SimpleFold[http://eigenclass.org/hiki.rb?simplefold+plugin+0.4.0]:
173
+ Nicely folds classes and methods for easy navigation.
174
+ - snippetsEmu[http://www.vim.org/scripts/script.php?script_id=1318]:
175
+ TextMate-like snippet expansion.
176
+ - vcscommand[http://www.vim.org/scripts/script.php?script_id=90]:
177
+ Integration for CVS and Subversion (SVN). Supports lots of things like
178
+ viewing the version control system log, integrated Vim diff, etc.
179
+ - surround[http://www.vim.org/scripts/script.php?script_id=1697]:
180
+ A nice script to add, change or remove "surroundings", like
181
+ parentheses, brackets, quotes, XML tags...
182
+ - ruby-block-conv[http://eigenclass.org/hiki.rb?Ruby+block+conversion+macros+for+Vim]:
183
+ Convert single line blocks from {} into do/end and the other way around.
184
+
185
+ There are a lot of other nice script out there so check
186
+ {Vim's web site}[http://www.vim.org/] for more scripts.
187
+
188
+ = Keyboard shortcuts
189
+ Here is a list of the various shortcut keys:
190
+ - CTRL+SHIFT+S: Set focus to current terminal (shell)
191
+ - CTRL+SHIFT+T: Create a new terminal
192
+ - CTRL+SHIFT+W: Close current terminal
193
+ - CTRL+PAGEDOWN: Next terminal
194
+ - CTRL+PAGEDOWN: Previous terminal
195
+ - CTRL+SHIFT+L: Set focus to file filter
196
+ - CTRL+SHIFT+F: Set focus to file list
197
+ - CTRL+SHIFT+E: Set focus to search file list
198
+ - CTRL+SHIFT+V: Set focus to Vim
199
+ Thanks to Florian Frank who sent me a patch for the first 5 shortcuts. The
200
+ other shortcuts where also added thanks to this patch by Florian Frank. (Note
201
+ that if there are bugs in the processing of those shortcut keys, it's probably
202
+ my fault and not is.)
203
+
204
+ = Limitations
205
+ - VimMate cannot handle well a directory tree with thousands of files,
206
+ although it has no problems with hundreds of files although it can take
207
+ some time to start.
208
+ - Vim loads after VimMate is started. If you close VimMate or open a file
209
+ before Vim starts and is connected to VimMate, this can lead to weird
210
+ things. You should wait for Vim before you start playing with VimMate.
211
+ Weird things can also happen if you close VimMate without saving in
212
+ Vim before.
213
+ - Setting the focus to Vim with the shortcut key doesn't work perfectly. If it
214
+ doesn't seem to work, you can try to press TAB or the Up or Down keys on
215
+ your keyboard after using the shortcut key and it works most of the time.
216
+
217
+ = Author and Copyright
218
+
219
+ VimMate was written and is Copyright (C) 2006 Guillaume Benny
220
+
221
+ See COPYING[link:files/COPYING.html] for more information.
data/Rakefile ADDED
@@ -0,0 +1,97 @@
1
+ =begin
2
+ = VimMate: Vim graphical add-on
3
+ Copyright (c) 2006 Guillaume Benny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+ =end
23
+
24
+ require 'rake/gempackagetask'
25
+ require 'rake/rdoctask'
26
+
27
+ require './lib/vimmatelib/version.rb'
28
+
29
+ task :default => :package
30
+
31
+ # Documentation Task
32
+ Rake::RDocTask.new("rdoc") do |t|
33
+ t.rdoc_files.include('README',
34
+ 'COPYING',
35
+ 'TODO',
36
+ 'CHANGELOG',
37
+ 'bin/**',
38
+ 'lib/**/*.rb')
39
+ t.main = 'README'
40
+ t.title = "VimMate #{VimMate::VERSION} documentation"
41
+ end
42
+
43
+ # Gem Specification
44
+ gem_specification = Gem::Specification.new do |s|
45
+ s.name = 'VimMate'
46
+ s.version = VimMate::VERSION
47
+ s.author = 'Guillaume Benny'
48
+ s.homepage = 'http://vimmate.rubyforge.org'
49
+ s.summary = 'VimMate is a graphical add-on to Vim with IDE-like features.'
50
+
51
+ s.executables = ['vimmate']
52
+
53
+ s.files = FileList['README',
54
+ 'COPYING',
55
+ 'TODO',
56
+ 'CHANGELOG',
57
+ 'Rakefile',
58
+ 'setup.rb',
59
+ 'bin/**/*',
60
+ 'lib/**/*',
61
+ 'images/**/*']
62
+ end
63
+
64
+ # Gem Task
65
+ Rake::GemPackageTask.new(gem_specification) do |pkg|
66
+ pkg.need_zip = false
67
+ pkg.need_tar = true
68
+ end
69
+ task :package => [:rdoc]
70
+
71
+ desc 'Remove rdoc and package'
72
+ task :clobber => [:clobber_rdoc, :clobber_package]
73
+
74
+ desc 'Upload rdoc to Rubyforge'
75
+ task :upload_rdoc => [:add_tracker] do
76
+ sh "scp -r html bennygui@rubyforge.org:/var/www/gforge-projects/vimmate"
77
+ end
78
+
79
+ desc 'Add google tracker'
80
+ task :add_tracker => [:rdoc] do
81
+ Dir['html/**/*.html'].each do |file|
82
+ h = File.read(file).sub(/<\/body>/, <<-EOS)
83
+ <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
84
+ </script>
85
+ <script type='text/javascript'>
86
+ //<![CDATA[
87
+ _uacct = "UA-2894512-3";
88
+ if (typeof(window['urchinTracker']) != "undefined") { urchinTracker(); }
89
+ //]]>
90
+ </script>
91
+ </body>
92
+ EOS
93
+ open(file, 'w') do |f|
94
+ f.write(h)
95
+ end
96
+ end
97
+ end