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
@@ -0,0 +1,6 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe ActiveWindow::Controller do
4
+
5
+ end
6
+
@@ -0,0 +1,40 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe FileTreeStore do
4
+ it "should inherit from ActiveWindow::ActiveTreeStore" do
5
+ FileTreeStore.should < ActiveWindow::ActiveTreeStore
6
+ end
7
+
8
+ context "new" do
9
+ before( :each ) do
10
+ @tree = FileTreeStore.new
11
+ end
12
+
13
+ it "should have an empty exclude list" do
14
+ @tree.excludes.should be_empty
15
+ end
16
+
17
+ context "excluding tmp, doc and public dirs" do
18
+ before( :each ) do
19
+ @rules = %w(tmp doc public)
20
+ @rules.each do |rule|
21
+ lambda { @tree.exclude! rule }.should change(@tree.excludes, :count).by(1)
22
+ end
23
+ end
24
+
25
+ it "should have stored the rules in excludes" do
26
+ @tree.excludes.should_not be_empty
27
+ end
28
+
29
+ it "should ignore paths that end with /$rule" do
30
+ @tree.should be_excludes("foo/tmp")
31
+ @tree.should be_excludes("foo/bar/tmp")
32
+ end
33
+
34
+ it "should not ignore that contain $rule somewhere else the end" do
35
+ @tree.should_not be_excludes("foo/tmp/more")
36
+ end
37
+ end
38
+ end
39
+ end
40
+
@@ -0,0 +1,26 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe ListedDirectory do
4
+ before(:each) do
5
+ @files_count = 7
6
+ @path = File.expand_path(File.dirname(__FILE__))
7
+ @dir = ListedDirectory.new(:full_path => @path)
8
+ end
9
+ it "should be a listed file" do
10
+ @dir.should be_instance_of(ListedDirectory)
11
+ end
12
+
13
+ it "should have an icon_type of folder" do
14
+ @dir.icon_name.should == "folder"
15
+ end
16
+
17
+ it "should have the path set" do
18
+ @dir.full_path.should == @path
19
+ end
20
+
21
+ it "should have some files in it" do
22
+ pending "where is the count?"
23
+ @dir.files_count.should == @files_count
24
+ end
25
+ end
26
+
@@ -0,0 +1,53 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe ListedFile do
4
+ context "giving a file path" do
5
+ before( :each ) do
6
+ @path = File.expand_path(__FILE__)
7
+ end
8
+ before(:each) do
9
+ @attrs = {
10
+ :full_path => @path,
11
+ :status => 'normal'
12
+ }
13
+ @file = ListedFile.create(@attrs)
14
+ end
15
+ it "should be recognized as a listed file" do
16
+ @file.should be_a(ListedFile)
17
+ end
18
+
19
+ it "should save the given attributes" do
20
+ @file.full_path.should == @path
21
+ @file.name.should == 'listed_file_spec.rb'
22
+ end
23
+
24
+ it "should have an icon" do
25
+ @file.icon.should_not be_nil
26
+ end
27
+ end
28
+
29
+ context "giving a directory path" do
30
+ before( :each ) do
31
+ @path = File.dirname File.expand_path(__FILE__)
32
+ end
33
+ before(:each) do
34
+ @attrs = {
35
+ :full_path => @path,
36
+ :status => 'normal'
37
+ }
38
+ @file = ListedFile.create(@attrs)
39
+ end
40
+ it "should be recognized as a listed directry" do
41
+ @file.should be_a(ListedDirectory)
42
+ end
43
+
44
+ it "should save the given attributes" do
45
+ @file.full_path.should == @path
46
+ @file.name.should == 'lib'
47
+ end
48
+
49
+ it "should have an icon" do
50
+ @file.icon.should_not be_nil
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,23 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe VimMate::NiceSingleton do
4
+ before(:each) do
5
+ class MySingleton
6
+ include VimMate::NiceSingleton
7
+
8
+ def hello
9
+ "hello"
10
+ end
11
+ end
12
+ end
13
+
14
+ it "should respond to .hello" do
15
+ MySingleton.hello.should == 'hello'
16
+ end
17
+
18
+ it "should not respond to .goodbye" do
19
+ lambda do
20
+ MySingleton.goodbye
21
+ end.should raise_error(NoMethodError)
22
+ end
23
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1,6 @@
1
+ --colour
2
+ --format
3
+ progress
4
+ --loadby
5
+ mtime
6
+ --reverse
@@ -0,0 +1,10 @@
1
+ require 'config/environment'
2
+
3
+ def iter_mock
4
+ mock(:[] => 'value', :[]= => true)
5
+ end
6
+
7
+ def tree_mock
8
+ mock(:has_path? => true) # so that inotify is not called
9
+ end
10
+
@@ -0,0 +1,308 @@
1
+ <?xml version="1.0"?>
2
+ <glade-interface>
3
+ <!-- interface-requires gtk+ 2.16 -->
4
+ <!-- interface-naming-policy project-wide -->
5
+ <widget class="GtkWindow" id="VimMate">
6
+ <signal name="key_press_event" handler="vim_mate.pressed_key"/>
7
+ <child>
8
+ <widget class="GtkHPaned" id="MainPane">
9
+ <property name="visible">True</property>
10
+ <property name="can_focus">True</property>
11
+ <child>
12
+ <widget class="GtkNotebook" id="SideTabs">
13
+ <property name="visible">True</property>
14
+ <property name="can_focus">True</property>
15
+ <property name="tab_pos">left</property>
16
+ <child>
17
+ <widget class="GtkVBox" id="FilesBox">
18
+ <property name="visible">True</property>
19
+ <property name="orientation">vertical</property>
20
+ <child>
21
+ <widget class="GtkHBox" id="FilesFilterBox">
22
+ <property name="visible">True</property>
23
+ <child>
24
+ <widget class="GtkEntry" id="FilesFilterTerm">
25
+ <property name="visible">True</property>
26
+ <property name="can_focus">True</property>
27
+ <property name="invisible_char">&#x25CF;</property>
28
+ <signal name="changed" handler="file_filter.changed"/>
29
+ </widget>
30
+ <packing>
31
+ <property name="padding">5</property>
32
+ <property name="position">0</property>
33
+ </packing>
34
+ </child>
35
+ <child>
36
+ <widget class="GtkToggleButton" id="FilesFilterButton">
37
+ <property name="label" translatable="yes">Filter</property>
38
+ <property name="visible">True</property>
39
+ <property name="can_focus">True</property>
40
+ <property name="receives_default">True</property>
41
+ <property name="focus_on_click">False</property>
42
+ <property name="active">True</property>
43
+ <property name="draw_indicator">True</property>
44
+ <signal name="toggled" handler="file_filter.toggle"/>
45
+ </widget>
46
+ <packing>
47
+ <property name="expand">False</property>
48
+ <property name="padding">5</property>
49
+ <property name="position">1</property>
50
+ </packing>
51
+ </child>
52
+ </widget>
53
+ <packing>
54
+ <property name="expand">False</property>
55
+ <property name="padding">7</property>
56
+ <property name="position">0</property>
57
+ </packing>
58
+ </child>
59
+ <child>
60
+ <widget class="GtkVPaned" id="FilesPane">
61
+ <property name="visible">True</property>
62
+ <property name="can_focus">True</property>
63
+ <property name="orientation">vertical</property>
64
+ <child>
65
+ <widget class="GtkVBox" id="TreeVBox">
66
+ <property name="visible">True</property>
67
+ <property name="orientation">vertical</property>
68
+ <child>
69
+ <widget class="GtkScrolledWindow" id="TreeScroller">
70
+ <property name="visible">True</property>
71
+ <property name="can_focus">True</property>
72
+ <property name="hscrollbar_policy">automatic</property>
73
+ <property name="vscrollbar_policy">automatic</property>
74
+ <child>
75
+ <widget class="GtkTreeView" id="FileTreeView">
76
+ <property name="visible">True</property>
77
+ <property name="can_focus">True</property>
78
+ <signal name="button_press_event" handler="file_filter.button_pressed"/>
79
+ <signal name="row_activated" handler="vim.open_selected_file"/>
80
+ </widget>
81
+ </child>
82
+ </widget>
83
+ <packing>
84
+ <property name="position">0</property>
85
+ </packing>
86
+ </child>
87
+ <child>
88
+ <widget class="GtkLabel" id="SelectedPathLabel">
89
+ <property name="visible">True</property>
90
+ <property name="label" translatable="yes">---</property>
91
+ <property name="ellipsize">start</property>
92
+ </widget>
93
+ <packing>
94
+ <property name="expand">False</property>
95
+ <property name="padding">3</property>
96
+ <property name="position">1</property>
97
+ </packing>
98
+ </child>
99
+ </widget>
100
+ <packing>
101
+ <property name="resize">False</property>
102
+ <property name="shrink">True</property>
103
+ </packing>
104
+ </child>
105
+ <child>
106
+ <widget class="GtkScrolledWindow" id="ListScroller">
107
+ <property name="visible">True</property>
108
+ <property name="can_focus">True</property>
109
+ <property name="hscrollbar_policy">automatic</property>
110
+ <property name="vscrollbar_policy">automatic</property>
111
+ <child>
112
+ <placeholder/>
113
+ </child>
114
+ </widget>
115
+ <packing>
116
+ <property name="resize">True</property>
117
+ <property name="shrink">True</property>
118
+ </packing>
119
+ </child>
120
+ </widget>
121
+ <packing>
122
+ <property name="position">1</property>
123
+ </packing>
124
+ </child>
125
+ </widget>
126
+ </child>
127
+ <child>
128
+ <widget class="GtkLabel" id="FilesTabs">
129
+ <property name="visible">True</property>
130
+ <property name="label" translatable="yes">Files</property>
131
+ <property name="angle">90</property>
132
+ </widget>
133
+ <packing>
134
+ <property name="tab_fill">False</property>
135
+ <property name="type">tab</property>
136
+ </packing>
137
+ </child>
138
+ <child>
139
+ <widget class="GtkVBox" id="TagsBox">
140
+ <property name="visible">True</property>
141
+ <property name="orientation">vertical</property>
142
+ <child>
143
+ <widget class="GtkHBox" id="TagsFilterBox">
144
+ <property name="visible">True</property>
145
+ <child>
146
+ <widget class="GtkEntry" id="TagsFilterTerm">
147
+ <property name="visible">True</property>
148
+ <property name="can_focus">True</property>
149
+ <property name="invisible_char">&#x25CF;</property>
150
+ </widget>
151
+ <packing>
152
+ <property name="padding">5</property>
153
+ <property name="position">0</property>
154
+ </packing>
155
+ </child>
156
+ <child>
157
+ <widget class="GtkToggleButton" id="TagsFilterButton">
158
+ <property name="label" translatable="yes">Filter</property>
159
+ <property name="visible">True</property>
160
+ <property name="can_focus">True</property>
161
+ <property name="receives_default">True</property>
162
+ <property name="focus_on_click">False</property>
163
+ <property name="active">True</property>
164
+ <property name="draw_indicator">True</property>
165
+ </widget>
166
+ <packing>
167
+ <property name="expand">False</property>
168
+ <property name="padding">5</property>
169
+ <property name="position">1</property>
170
+ </packing>
171
+ </child>
172
+ </widget>
173
+ <packing>
174
+ <property name="padding">7</property>
175
+ <property name="position">0</property>
176
+ </packing>
177
+ </child>
178
+ <child>
179
+ <widget class="GtkScrolledWindow" id="TagsScroller">
180
+ <property name="visible">True</property>
181
+ <property name="can_focus">True</property>
182
+ <property name="hscrollbar_policy">automatic</property>
183
+ <property name="vscrollbar_policy">automatic</property>
184
+ <child>
185
+ <placeholder/>
186
+ </child>
187
+ </widget>
188
+ <packing>
189
+ <property name="position">1</property>
190
+ </packing>
191
+ </child>
192
+ </widget>
193
+ <packing>
194
+ <property name="position">1</property>
195
+ </packing>
196
+ </child>
197
+ <child>
198
+ <widget class="GtkLabel" id="TagsTabs">
199
+ <property name="visible">True</property>
200
+ <property name="label" translatable="yes">Tags</property>
201
+ <property name="angle">90</property>
202
+ </widget>
203
+ <packing>
204
+ <property name="position">1</property>
205
+ <property name="tab_fill">False</property>
206
+ <property name="type">tab</property>
207
+ </packing>
208
+ </child>
209
+ </widget>
210
+ <packing>
211
+ <property name="resize">False</property>
212
+ <property name="shrink">True</property>
213
+ </packing>
214
+ </child>
215
+ <child>
216
+ <placeholder/>
217
+ </child>
218
+ </widget>
219
+ </child>
220
+ </widget>
221
+ <widget class="GtkMenu" id="FilePopup">
222
+ <property name="visible">True</property>
223
+ <child>
224
+ <widget class="GtkImageMenuItem" id="OpenFile">
225
+ <property name="label">gtk-open</property>
226
+ <property name="visible">True</property>
227
+ <property name="use_underline">True</property>
228
+ <property name="use_stock">True</property>
229
+ <property name="always_show_image">True</property>
230
+ <signal name="activate" handler="vim.open_selected_file"/>
231
+ </widget>
232
+ </child>
233
+ <child>
234
+ <widget class="GtkMenuItem" id="SplitOpenFile">
235
+ <property name="visible">True</property>
236
+ <property name="label" translatable="yes">Split Open</property>
237
+ <property name="use_underline">True</property>
238
+ <signal name="activate" handler="vim.open_selected_file_split"/>
239
+ </widget>
240
+ </child>
241
+ <child>
242
+ <widget class="GtkMenuItem" id="TabOpenFile">
243
+ <property name="visible">True</property>
244
+ <property name="label" translatable="yes">Tab Open</property>
245
+ <property name="use_underline">True</property>
246
+ <signal name="activate" handler="vim.open_selected_file_tab"/>
247
+ </widget>
248
+ </child>
249
+ <child>
250
+ <widget class="GtkSeparatorMenuItem" id="sep1">
251
+ <property name="visible">True</property>
252
+ </widget>
253
+ </child>
254
+ <child>
255
+ <widget class="GtkImageMenuItem" id="NewFile">
256
+ <property name="label">gtk-new</property>
257
+ <property name="visible">True</property>
258
+ <property name="use_underline">True</property>
259
+ <property name="use_stock">True</property>
260
+ <signal name="activate" handler="file_popup_menu.new_file"/>
261
+ </widget>
262
+ </child>
263
+ <child>
264
+ <widget class="GtkImageMenuItem" id="NewDirectory">
265
+ <property name="label">gtk-add</property>
266
+ <property name="visible">True</property>
267
+ <property name="use_underline">True</property>
268
+ <property name="use_stock">True</property>
269
+ <signal name="activate" handler="on_new_directory_clicked"/>
270
+ </widget>
271
+ </child>
272
+ <child>
273
+ <widget class="GtkSeparatorMenuItem" id="sep2">
274
+ <property name="visible">True</property>
275
+ </widget>
276
+ </child>
277
+ <child>
278
+ <widget class="GtkMenuItem" id="RenameItem">
279
+ <property name="visible">True</property>
280
+ <property name="label" translatable="yes">Rename</property>
281
+ <property name="use_underline">True</property>
282
+ </widget>
283
+ </child>
284
+ <child>
285
+ <widget class="GtkImageMenuItem" id="DeleteItem">
286
+ <property name="label">gtk-delete</property>
287
+ <property name="visible">True</property>
288
+ <property name="use_underline">True</property>
289
+ <property name="use_stock">True</property>
290
+ <signal name="activate" handler="on_delete_item_clicked"/>
291
+ </widget>
292
+ </child>
293
+ <child>
294
+ <widget class="GtkSeparatorMenuItem" id="sep3">
295
+ <property name="visible">True</property>
296
+ </widget>
297
+ </child>
298
+ <child>
299
+ <widget class="GtkImageMenuItem" id="RefreshItem">
300
+ <property name="label">gtk-refresh</property>
301
+ <property name="visible">True</property>
302
+ <property name="use_underline">True</property>
303
+ <property name="use_stock">True</property>
304
+ <signal name="activate" handler="on_refresh_item_clicked"/>
305
+ </widget>
306
+ </child>
307
+ </widget>
308
+ </glade-interface>