redcar 0.9.2 → 0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. data/CHANGES +34 -4
  2. data/Rakefile +2 -1
  3. data/lib/redcar.rb +3 -3
  4. data/lib/redcar/installer.rb +2 -3
  5. data/plugins/application/features/step_definitions/dialog_steps.rb +7 -0
  6. data/plugins/application/features/step_definitions/key_steps.rb +18 -0
  7. data/plugins/application/features/step_definitions/menu_steps.rb +5 -6
  8. data/plugins/application/features/step_definitions/speedbar_steps.rb +29 -9
  9. data/plugins/application/features/step_definitions/tree_steps.rb +13 -0
  10. data/plugins/application/features/support/env.rb +39 -5
  11. data/plugins/application/features/support/fake_event.rb +12 -0
  12. data/plugins/application/lib/application.rb +5 -6
  13. data/plugins/application/lib/application/dialog.rb +53 -10
  14. data/plugins/application/lib/application/dialogs/modeless_list_dialog.rb +85 -0
  15. data/plugins/application/lib/application/keymap.rb +10 -8
  16. data/plugins/application/lib/application/menu.rb +38 -16
  17. data/plugins/application/lib/application/treebook.rb +30 -0
  18. data/plugins/application/lib/application/window.rb +20 -2
  19. data/plugins/application/spec/application/command/executor_spec.rb +1 -0
  20. data/plugins/application/spec/application/menu_spec.rb +26 -26
  21. data/plugins/application/spec/application/treebook_spec.rb +6 -6
  22. data/plugins/application/spec/spec_helper.rb +10 -1
  23. data/plugins/application_swt/lib/application_swt.rb +25 -3
  24. data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +48 -27
  25. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +22 -11
  26. data/plugins/application_swt/lib/application_swt/dialogs/modeless_dialog.rb +113 -0
  27. data/plugins/application_swt/lib/application_swt/dialogs/modeless_html_dialog.rb +85 -0
  28. data/plugins/application_swt/lib/application_swt/dialogs/modeless_list_dialog_controller.rb +143 -0
  29. data/plugins/application_swt/lib/application_swt/gradient.rb +61 -0
  30. data/plugins/application_swt/lib/application_swt/menu/binding_translator.rb +4 -4
  31. data/plugins/application_swt/lib/application_swt/notebook.rb +5 -8
  32. data/plugins/application_swt/lib/application_swt/speedbar.rb +1 -0
  33. data/plugins/application_swt/lib/application_swt/treebook.rb +6 -8
  34. data/plugins/application_swt/lib/application_swt/window.rb +85 -57
  35. data/plugins/application_swt/lib/swt/graphics_utils.rb +23 -0
  36. data/plugins/application_swt/lib/swt/vtab_folder.rb +7 -0
  37. data/plugins/application_swt/lib/swt/vtab_label.rb +1 -1
  38. data/plugins/application_swt/spec/application_swt/gradient_spec.rb +142 -0
  39. data/plugins/auto_completer/lib/auto_completer.rb +10 -42
  40. data/plugins/auto_completer/lib/auto_completer/list_dialog.rb +21 -0
  41. data/plugins/clojure/lib/clojure.rb +33 -0
  42. data/plugins/{repl/lib/repl/clojure_mirror.rb → clojure/lib/clojure/repl_mirror.rb} +16 -20
  43. data/plugins/clojure/plugin.rb +9 -0
  44. data/plugins/{repl/spec/repl/clojure_mirror_spec.rb → clojure/spec/clojure/repl_mirror_spec.rb} +12 -13
  45. data/plugins/clojure/spec/spec_helper.rb +5 -0
  46. data/plugins/{repl → clojure}/vendor/Wrapper.clj +0 -0
  47. data/plugins/{repl → clojure}/vendor/dummy +0 -0
  48. data/plugins/{repl → clojure}/vendor/enclojure-wrapper.jar +0 -0
  49. data/plugins/connection_manager/lib/connection_manager.rb +13 -13
  50. data/plugins/declarations/lib/declarations.rb +17 -6
  51. data/plugins/document_search/features/find.feature +389 -0
  52. data/plugins/document_search/features/find_and_replace.feature +723 -0
  53. data/plugins/document_search/features/replace.feature +69 -62
  54. data/plugins/document_search/lib/document_search.rb +81 -64
  55. data/plugins/document_search/lib/document_search/commands.rb +258 -0
  56. data/plugins/document_search/lib/document_search/find_and_replace_speedbar.rb +142 -0
  57. data/plugins/document_search/lib/document_search/find_speedbar.rb +102 -0
  58. data/plugins/document_search/lib/document_search/query_options.rb +45 -0
  59. data/plugins/edit_view/features/case_change.feature +9 -5
  60. data/plugins/edit_view/features/step_definitions/editing_steps.rb +19 -0
  61. data/plugins/edit_view/lib/edit_view.rb +15 -12
  62. data/plugins/edit_view/lib/edit_view/actions/arrow_keys.rb +12 -2
  63. data/plugins/edit_view/lib/edit_view/commands/text_conversion_commands.rb +1 -1
  64. data/plugins/edit_view/lib/edit_view/document.rb +129 -99
  65. data/plugins/edit_view_swt/lib/edit_view_swt.rb +33 -15
  66. data/plugins/encryption/encryption.rb +2 -0
  67. data/plugins/find-in-project/lib/find_in_project.rb +3 -5
  68. data/plugins/find-in-project/lib/find_in_project/views/index.html.erb +2 -0
  69. data/plugins/groovy/features/step_definitions/groovy_steps.rb +2 -2
  70. data/plugins/groovy/features/syntax_check_groovy.feature +3 -3
  71. data/plugins/groovy/lib/groovy.rb +38 -0
  72. data/plugins/groovy/lib/groovy/commands.rb +10 -0
  73. data/plugins/{repl/lib/repl/groovy_mirror.rb → groovy/lib/groovy/repl_mirror.rb} +33 -13
  74. data/plugins/groovy/lib/{syntax_check/groovy.rb → groovy/syntax_checker.rb} +13 -8
  75. data/plugins/groovy/plugin.rb +5 -4
  76. data/plugins/{repl/spec/repl/groovy_mirror_spec.rb → groovy/spec/groovy/repl_mirror_spec.rb} +14 -13
  77. data/plugins/groovy/spec/spec_helper.rb +5 -0
  78. data/plugins/html_view/assets/json2.js +476 -0
  79. data/plugins/html_view/lib/html_view.rb +1 -0
  80. data/plugins/java/features/fixtures/test.java +0 -0
  81. data/plugins/java/features/support/env.rb +27 -0
  82. data/plugins/java/features/syntax_check_java.feature +86 -0
  83. data/plugins/java/lib/syntax_check/java.rb +86 -0
  84. data/plugins/java/plugin.rb +7 -0
  85. data/plugins/javascript/features/fixtures/test2.js +5 -0
  86. data/plugins/javascript/features/step_definitions/javascript_steps.rb +16 -0
  87. data/plugins/javascript/features/support/env.rb +14 -0
  88. data/plugins/javascript/features/syntax_check_javascript.feature +46 -3
  89. data/plugins/javascript/lib/syntax_check/javascript.rb +15 -9
  90. data/plugins/line_tools/features/trim_line.feature +49 -0
  91. data/plugins/line_tools/lib/line_tools.rb +5 -1
  92. data/plugins/mirah/README +7 -0
  93. data/plugins/mirah/features/fixtures/test.mirah +2 -0
  94. data/plugins/mirah/features/syntax_check_mirah.feature +46 -0
  95. data/plugins/mirah/lib/mirah.rb +43 -0
  96. data/plugins/mirah/lib/mirah/my_error_handler.rb +22 -0
  97. data/plugins/mirah/lib/mirah/repl_mirror.rb +50 -0
  98. data/plugins/mirah/lib/mirah/syntax_checker.rb +38 -0
  99. data/plugins/mirah/plugin.rb +8 -0
  100. data/plugins/mirah/spec/mirah/repl_mirror_spec.rb +188 -0
  101. data/plugins/mirah/spec/spec_helper.rb +5 -0
  102. data/plugins/mirah/vendor/mirah-parser.jar +0 -0
  103. data/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb +24 -23
  104. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +10 -1
  105. data/plugins/plugin_manager_ui/views/index.html.erb +2 -0
  106. data/plugins/project/features/find_file.feature +40 -16
  107. data/plugins/project/features/highlight_focussed_tab.feature +16 -10
  108. data/plugins/project/features/step_definitions/find_file_steps.rb +11 -0
  109. data/plugins/project/features/step_definitions/project_tree_steps.rb +5 -1
  110. data/plugins/project/features/support/env.rb +5 -0
  111. data/plugins/project/lib/project/commands.rb +8 -1
  112. data/plugins/project/lib/project/dir_controller.rb +4 -1
  113. data/plugins/project/lib/project/find_file_dialog.rb +16 -12
  114. data/plugins/project/lib/project/manager.rb +30 -1
  115. data/plugins/project_search/vendor/lucene/CHANGELOG +147 -0
  116. data/plugins/project_search/vendor/lucene/CONTRIBUTORS +17 -0
  117. data/plugins/project_search/vendor/lucene/Gemfile +9 -0
  118. data/plugins/project_search/vendor/lucene/Gemfile.lock +33 -0
  119. data/plugins/project_search/vendor/lucene/LICENSE +19 -0
  120. data/plugins/project_search/vendor/lucene/README.rdoc +283 -0
  121. data/plugins/project_search/vendor/lucene/Rakefile +35 -0
  122. data/plugins/project_search/vendor/lucene/examples/active_model/serializers.rb +25 -0
  123. data/plugins/project_search/vendor/lucene/examples/active_model/validation.rb +26 -0
  124. data/plugins/project_search/vendor/lucene/examples/admin/Rakefile +4 -0
  125. data/plugins/project_search/vendor/lucene/examples/admin/admin.rb +29 -0
  126. data/plugins/project_search/vendor/lucene/examples/admin/public/jquery.js +4376 -0
  127. data/plugins/project_search/vendor/lucene/examples/admin/public/neo4j.css +153 -0
  128. data/plugins/project_search/vendor/lucene/examples/admin/public/neo_admin.js +18 -0
  129. data/plugins/project_search/vendor/lucene/examples/admin/spec/admin_spec.rb +26 -0
  130. data/plugins/project_search/vendor/lucene/examples/admin/views/index.erb +21 -0
  131. data/plugins/project_search/vendor/lucene/examples/filetree/README.rdoc +9 -0
  132. data/plugins/project_search/vendor/lucene/examples/filetree/app.rb +7 -0
  133. data/plugins/project_search/vendor/lucene/examples/filetree/batch.props +5 -0
  134. data/plugins/project_search/vendor/lucene/examples/filetree/features/step_definitions/add_steps.rb +121 -0
  135. data/plugins/project_search/vendor/lucene/examples/filetree/features/support/env.rb +30 -0
  136. data/plugins/project_search/vendor/lucene/examples/filetree/features/support/rspec_helper.rb +50 -0
  137. data/plugins/project_search/vendor/lucene/examples/filetree/features/treesizes.feature +19 -0
  138. data/plugins/project_search/vendor/lucene/examples/imdb/1_create_neo_db.rb +66 -0
  139. data/plugins/project_search/vendor/lucene/examples/imdb/2_index_db.rb +23 -0
  140. data/plugins/project_search/vendor/lucene/examples/imdb/README +12 -0
  141. data/plugins/project_search/vendor/lucene/examples/imdb/find_actors.rb +56 -0
  142. data/plugins/project_search/vendor/lucene/examples/imdb/install.sh +12 -0
  143. data/plugins/project_search/vendor/lucene/examples/imdb/model.rb +37 -0
  144. data/plugins/project_search/vendor/lucene/examples/railway/README +111 -0
  145. data/plugins/project_search/vendor/lucene/examples/railway/railnet-app.rb +31 -0
  146. data/plugins/project_search/vendor/lucene/examples/railway/railnet-data.rb +42 -0
  147. data/plugins/project_search/vendor/lucene/examples/rest/example.rb +41 -0
  148. data/plugins/project_search/vendor/lucene/examples/you_might_know/YouMightKnow.java +60 -0
  149. data/plugins/project_search/vendor/lucene/examples/you_might_know/all_simple_paths.rb +34 -0
  150. data/plugins/project_search/vendor/lucene/examples/you_might_know/nodes.rb +34 -0
  151. data/plugins/project_search/vendor/lucene/examples/you_might_know/you_might_know.rb +50 -0
  152. data/plugins/project_search/vendor/lucene/lib/lucene.rb +15 -0
  153. data/plugins/project_search/vendor/lucene/lib/lucene/config.rb +145 -0
  154. data/plugins/project_search/vendor/lucene/lib/lucene/document.rb +96 -0
  155. data/plugins/project_search/vendor/lucene/lib/lucene/field_info.rb +144 -0
  156. data/plugins/project_search/vendor/lucene/lib/lucene/hits.rb +54 -0
  157. data/plugins/project_search/vendor/lucene/lib/lucene/index.rb +267 -0
  158. data/plugins/project_search/vendor/lucene/lib/lucene/index_info.rb +146 -0
  159. data/plugins/project_search/vendor/lucene/lib/lucene/index_searcher.rb +157 -0
  160. data/plugins/project_search/vendor/lucene/lib/lucene/jars.rb +5 -0
  161. data/plugins/project_search/vendor/lucene/lib/lucene/query_dsl.rb +135 -0
  162. data/plugins/project_search/vendor/lucene/lib/lucene/transaction.rb +117 -0
  163. data/plugins/project_search/vendor/lucene/lib/lucene/version.rb +3 -0
  164. data/plugins/project_search/vendor/lucene/lucene.gemspec +23 -0
  165. data/plugins/project_search/vendor/lucene/spec/lucene/document_spec.rb +32 -0
  166. data/plugins/project_search/vendor/lucene/spec/lucene/field_info_spec.rb +70 -0
  167. data/plugins/project_search/vendor/lucene/spec/lucene/index_info_spec.rb +76 -0
  168. data/plugins/project_search/vendor/lucene/spec/lucene/index_spec.rb +643 -0
  169. data/plugins/project_search/vendor/lucene/spec/lucene/query_dsl_spec.rb +142 -0
  170. data/plugins/project_search/vendor/lucene/spec/lucene/sort_spec.rb +101 -0
  171. data/plugins/project_search/vendor/lucene/spec/lucene/spec_helper.rb +10 -0
  172. data/plugins/project_search/vendor/lucene/spec/lucene/transaction_spec.rb +118 -0
  173. data/plugins/redcar/features/alter_font_size.feature +25 -0
  174. data/plugins/redcar/features/step_definitions/font_steps.rb +34 -0
  175. data/plugins/redcar/redcar.rb +256 -43
  176. data/plugins/repl/features/command_editing.feature +55 -0
  177. data/plugins/repl/features/command_history.feature +75 -0
  178. data/plugins/repl/features/step_definitions/repl_steps.rb +17 -1
  179. data/plugins/repl/features/support/env.rb +24 -0
  180. data/plugins/repl/features/support/fake_repl.rb +16 -0
  181. data/plugins/repl/lib/repl.rb +17 -74
  182. data/plugins/repl/lib/repl/repl_command.rb +20 -0
  183. data/plugins/repl/lib/repl/repl_mirror.rb +168 -22
  184. data/plugins/repl/lib/repl/repl_tab.rb +131 -6
  185. data/plugins/repl/plugin.rb +1 -1
  186. data/plugins/repl/spec/repl/repl_mirror_spec.rb +72 -0
  187. data/plugins/repl/spec/spec_helper.rb +1 -1
  188. data/plugins/repl_swt/lib/repl_swt.rb +7 -0
  189. data/plugins/repl_swt/lib/repl_swt/key_listener.rb +43 -0
  190. data/plugins/repl_swt/plugin.rb +8 -0
  191. data/plugins/ruby/lib/ruby.rb +35 -0
  192. data/plugins/{repl/lib/repl/ruby_mirror.rb → ruby/lib/ruby/repl_mirror.rb} +12 -12
  193. data/plugins/ruby/lib/{syntax_check/ruby.rb → ruby/syntax_checker.rb} +3 -3
  194. data/plugins/ruby/plugin.rb +5 -4
  195. data/plugins/{repl/spec/repl/ruby_mirror_spec.rb → ruby/spec/ruby/repl_mirror_spec.rb} +38 -29
  196. data/plugins/ruby/spec/spec_helper.rb +5 -0
  197. data/plugins/runnables/lib/runnables.rb +2 -0
  198. data/plugins/runnables/lib/runnables/command_output_controller.rb +5 -0
  199. data/plugins/runnables/lib/runnables/output_processor.rb +14 -3
  200. data/plugins/runnables/views/command_output.html.erb +3 -2
  201. data/plugins/scm/lib/scm.rb +4 -2
  202. data/plugins/scm/lib/scm/diff_mirror.rb +6 -6
  203. data/plugins/scm_git/lib/scm_git.rb +136 -107
  204. data/plugins/scm_git/lib/scm_git/change.rb +28 -19
  205. data/plugins/snippets/lib/snippets/explorer.rb +2 -2
  206. data/plugins/swt/lib/swt/full_swt.rb +1 -0
  207. data/plugins/syntax_check/features/step_definitions/syntax_check_steps.rb +4 -0
  208. data/plugins/syntax_check/features/support/env.rb +3 -0
  209. data/plugins/syntax_check/lib/syntax_check.rb +71 -5
  210. data/plugins/syntax_check/lib/syntax_check/annotation.rb +61 -0
  211. data/plugins/test_runner/lib/test_runner.rb +39 -0
  212. data/plugins/test_runner/lib/test_runner/rspec_runner.rb +20 -0
  213. data/plugins/test_runner/lib/test_runner/run_test_command.rb +63 -0
  214. data/plugins/test_runner/lib/test_runner/runnable_test_runner.rb +26 -0
  215. data/plugins/test_runner/plugin.rb +8 -0
  216. data/plugins/test_runner/spec/run_test_command_spec.rb +51 -0
  217. data/plugins/test_runner/spec/spec_helper.rb +5 -0
  218. data/plugins/textmate/lib/textmate.rb +12 -2
  219. data/plugins/textmate/vendor/redcar-bundles/Bundles/HTML.tmbundle/Syntaxes/HTML.plist +0 -2
  220. data/plugins/textmate/vendor/redcar-bundles/Bundles/Mirah.tmbundle/Syntaxes/Mirah.plist +22 -0
  221. data/plugins/textmate/vendor/redcar-bundles/Bundles/Mirah.tmbundle/info.plist +12 -0
  222. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby.tmbundle/Syntaxes/Ruby.plist +2 -0
  223. data/plugins/todo_list/lib/todo_list.rb +7 -0
  224. data/plugins/todo_list/lib/todo_list/todo_controller.rb +3 -1
  225. data/plugins/tree/lib/tree.rb +4 -0
  226. data/plugins/tree_view_swt/lib/tree_view_swt.rb +5 -0
  227. data/plugins/web_bookmarks/lib/web_bookmarks.rb +10 -0
  228. metadata +137 -22
  229. data/plugins/document_search/features/search.feature +0 -163
  230. data/plugins/document_search/lib/document_search/replace_all_command.rb +0 -27
  231. data/plugins/document_search/lib/document_search/replace_command.rb +0 -38
  232. data/plugins/document_search/lib/document_search/replace_next_command.rb +0 -27
  233. data/plugins/document_search/lib/document_search/search_and_replace.rb +0 -81
  234. data/plugins/ruby/README +0 -6
@@ -17,7 +17,7 @@ module Redcar
17
17
  separator
18
18
  }
19
19
  end
20
- if Redcar.platform == :linux or Redcar.platform == :windows
20
+ if [:linux,:windows].include?(Redcar.platform)
21
21
  sub_menu "Edit" do
22
22
  group(:priority => :last) do
23
23
  separator
@@ -28,6 +28,15 @@ module Redcar
28
28
  end
29
29
  end
30
30
 
31
+ def self.keymaps
32
+ if [:linux,:windows].include?(Redcar.platform)
33
+ map = Redcar::Keymap.build("main", [:linux,:windows]) do
34
+ link "F2", PluginManagerUi::OpenPreferencesCommand
35
+ end
36
+ [map]
37
+ end
38
+ end
39
+
31
40
  class OpenPreferencesCommand < Redcar::Command
32
41
  def execute
33
42
  project = Project::Manager.open_project_for_path(Redcar::Plugin::Storage.storage_dir)
@@ -12,6 +12,8 @@ td.yellow {
12
12
 
13
13
  <% jquery_path = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets jquery-1.4.min.js))) %>
14
14
  <script type="text/javascript" src="file://<%= jquery_path %>"></script>
15
+ <% json_path = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets json2.js))) %>
16
+ <script type="text/javascript" src="file://<%= json_path %>"></script>
15
17
  <% redcar_css = File.expand_path(File.join(Redcar.root, %w(plugins html_view assets redcar.css))) %>
16
18
  <link rel="stylesheet" href="file://<%= redcar_css %>" type="text/css" media="screen">
17
19
 
@@ -5,41 +5,57 @@ Feature: Find file
5
5
  When I open a directory
6
6
 
7
7
  Scenario: No files initially and with nothing typed
8
- When I run the command Redcar::Project::FindFileCommand
8
+ When I open the find file dialog
9
9
  Then there should be a filter dialog open
10
10
  And the filter dialog should have no entries
11
-
11
+
12
12
  Scenario: No matching files
13
- When I run the command Redcar::Project::FindFileCommand
13
+ When I open the find file dialog
14
14
  And I set the filter to "xxx"
15
15
  And I wait "0.4" seconds
16
16
  Then the filter dialog should have 0 entries
17
-
17
+
18
18
  Scenario: One matching file
19
- When I run the command Redcar::Project::FindFileCommand
19
+ When I open the find file dialog
20
20
  And I set the filter to "foo_spec"
21
21
  And I wait "0.4" seconds
22
22
  Then the filter dialog should have 1 entry
23
23
  And I should see "foo_spec.rb (myproject/spec)" at 0 the filter dialog
24
24
 
25
+ Scenario: One matching file - spaces ignored
26
+ When I open the find file dialog
27
+ And I set the filter to "foo spec"
28
+ And I wait "0.4" seconds
29
+ Then the filter dialog should have 1 entry
30
+ And I should see "foo_spec.rb (myproject/spec)" at 0 the filter dialog
31
+
25
32
  Scenario: Two matching files
26
- When I run the command Redcar::Project::FindFileCommand
33
+ When I open the find file dialog
27
34
  And I set the filter to "foo"
28
35
  And I wait "0.4" seconds
29
36
  Then the filter dialog should have 3 entries
30
37
  And I should see "foo_lib.rb (myproject/lib)" at 0 the filter dialog
31
38
  And I should see "foo_lib.rb (myproject/lib_symlink)" at 1 the filter dialog
32
39
  And I should see "foo_spec.rb (myproject/spec)" at 2 the filter dialog
33
-
40
+
41
+ Scenario: Two matching files - spaces ignored
42
+ When I open the find file dialog
43
+ And I set the filter to "foo rb"
44
+ And I wait "0.4" seconds
45
+ Then the filter dialog should have 3 entries
46
+ And I should see "foo_lib.rb (myproject/lib)" at 0 the filter dialog
47
+ And I should see "foo_lib.rb (myproject/lib_symlink)" at 1 the filter dialog
48
+ And I should see "foo_spec.rb (myproject/spec)" at 2 the filter dialog
49
+
34
50
  Scenario: One matching file with arbitrary letters
35
- When I run the command Redcar::Project::FindFileCommand
51
+ When I open the find file dialog
36
52
  And I set the filter to "fsc"
37
53
  And I wait "0.4" seconds
38
54
  Then the filter dialog should have 1 entry
39
55
  And I should see "foo_spec.rb (myproject/spec)" at 0 the filter dialog
40
56
 
41
57
  Scenario: Open a file
42
- When I run the command Redcar::Project::FindFileCommand
58
+ When I open the find file dialog
43
59
  And I set the filter to "fsc"
44
60
  And I wait "0.4" seconds
45
61
  And I select in the filter dialog
@@ -47,18 +63,28 @@ Feature: Find file
47
63
  And I should see "foo spec" in the edit tab
48
64
 
49
65
  Scenario: Open a file then see the file in the initial list
50
- When I run the command Redcar::Project::FindFileCommand
66
+ When I open the find file dialog
51
67
  And I set the filter to "fsc"
52
68
  And I wait "0.4" seconds
53
69
  And I select in the filter dialog
54
- And I run the command Redcar::Project::FindFileCommand
70
+ And I open the find file dialog
55
71
  Then the filter dialog should have 1 entry
56
72
  And I should see "foo_spec.rb (myproject/spec)" at 0 the filter dialog
57
73
 
74
+ Scenario: Ignore patterns
75
+ When I prefer not to see files like ".*spec\.rb$" in the find file dialog
76
+ And I open the find file dialog
77
+ And I set the filter to "foo"
78
+ And I wait "0.4" seconds
79
+ And I select in the filter dialog
80
+ And I open the find file dialog
81
+ Then the filter dialog should have 1 entry
82
+ And I should see "foo_lib.rb (myproject/lib)" at 0 the filter dialog
83
+
58
84
  Scenario: Open two files then see the files in the initial list
59
85
  When I have opened "plugins/project/spec/fixtures/myproject/spec/foo_spec.rb"
60
86
  And I have opened "plugins/project/spec/fixtures/myproject/lib/foo_lib.rb"
61
- And I run the command Redcar::Project::FindFileCommand
87
+ And I open the find file dialog
62
88
  Then the filter dialog should have 2 entries
63
89
  And I should see "foo_spec.rb (myproject/spec)" at 0 the filter dialog
64
90
  And I should see "foo_lib.rb (myproject/lib)" at 1 the filter dialog
@@ -67,10 +93,8 @@ Feature: Find file
67
93
  When I have opened "plugins/project/spec/fixtures/myproject/spec/foo_spec.rb"
68
94
  And I have opened "plugins/project/spec/fixtures/myproject/lib/foo_lib.rb"
69
95
  And I have opened "plugins/project/spec/fixtures/myproject/README"
70
- And I run the command Redcar::Project::FindFileCommand
96
+ And I open the find file dialog
71
97
  Then the filter dialog should have 3 entries
72
98
  And I should see "foo_lib.rb (myproject/lib)" at 0 the filter dialog
73
99
  And I should see "foo_spec.rb (myproject/spec)" at 1 the filter dialog
74
- And I should see "README (fixtures/myproject)" at 2 the filter dialog
75
-
76
-
100
+ And I should see "README (fixtures/myproject)" at 2 the filter dialog
@@ -1,16 +1,15 @@
1
1
  Feature: Highlight the File of the focussed tab in tree
2
2
 
3
- Scenario: Opening a file should reveal it in the tree
3
+ Background:
4
4
  Given I will choose "." from the "open_directory" dialog
5
5
  And I open a directory
6
6
  And I have opened "plugins/project/features/highlight_focussed_tab.feature"
7
+
8
+ Scenario: Opening a file should reveal it in the tree
7
9
  Then there should be one edit tab
8
10
  Then "highlight_focussed_tab.feature" should be selected in the project tree
9
11
 
10
12
  Scenario: Switching between tabs should highlight them in the tree
11
- Given I will choose "." from the "open_directory" dialog
12
- And I open a directory
13
- And I have opened "plugins/project/features/highlight_focussed_tab.feature"
14
13
  Then "highlight_focussed_tab.feature" should be selected in the project tree
15
14
  And I have opened "plugins/project/features/find_file.feature"
16
15
  And I have opened "plugins/project/features/move_and_rename_files.feature"
@@ -22,9 +21,6 @@ Feature: Highlight the File of the focussed tab in tree
22
21
  Then "highlight_focussed_tab.feature" should be selected in the project tree
23
22
 
24
23
  Scenario: Project revelation should work across several notebooks
25
- Given I will choose "." from the "open_directory" dialog
26
- And I open a directory
27
- And I have opened "plugins/project/features/highlight_focussed_tab.feature"
28
24
  And I have opened "plugins/project/features/find_file.feature"
29
25
  And I have opened "plugins/project/features/move_and_rename_files.feature"
30
26
  And I have opened "plugins/project/features/sub_project.feature"
@@ -39,9 +35,6 @@ Feature: Highlight the File of the focussed tab in tree
39
35
  Then "find_file.feature" should be selected in the project tree
40
36
 
41
37
  Scenario: Project revelation doesn't get triggered on REPLs
42
- Given I will choose "." from the "open_directory" dialog
43
- And I open a directory
44
- And I have opened "plugins/project/features/highlight_focussed_tab.feature"
45
38
  Then there should be one edit tab
46
39
  Then "highlight_focussed_tab.feature" should be selected in the project tree
47
40
  And I open a "ruby" repl
@@ -50,3 +43,16 @@ Feature: Highlight the File of the focussed tab in tree
50
43
  Then "highlight_focussed_tab.feature" should be selected in the project tree
51
44
  And I open a "groovy" repl
52
45
  Then "highlight_focussed_tab.feature" should be selected in the project tree
46
+
47
+ Scenario Outline: Highlight focussed tab only works when enabled and project tree is visible
48
+ When I <disable highlighting>
49
+ When I have opened "plugins/project/features/find_file.feature"
50
+ Then "highlight_focussed_tab.feature" should be selected in the project tree
51
+ When I have opened "plugins/project/features/sub_project.feature"
52
+ Then "highlight_focussed_tab.feature" should be selected in the project tree
53
+
54
+ Examples:
55
+ | disable highlighting |
56
+ | toggle tree visibility |
57
+ | click Show Bundles in Tree |
58
+ | prefer to not highlight the focussed tab |
@@ -0,0 +1,11 @@
1
+ When /^I prefer not to see files like "([^"]*)" in the find file dialog$/ do |pattern|
2
+
3
+ ignored = filter_storage['ignore_files_that_match_these_regexes']
4
+ ignored << /#{pattern}/
5
+ filter_storage['ignore_file_patterns'] = true
6
+ filter_storage['ignore_files_that_match_these_regexes'] = ignored
7
+ end
8
+
9
+ When /^I open the find file dialog$/ do
10
+ Redcar::Project::FindFileCommand.new.run
11
+ end
@@ -1,3 +1,7 @@
1
1
  Then /^"([^\"]*)" should be selected in the project tree$/ do |filename|
2
- Redcar.app.focussed_window.treebook.focussed_tree.selection.first.text == filename
2
+ Redcar::Project::Manager.focussed_project.tree.selection.first.text == filename
3
+ end
4
+
5
+ When /^I prefer to not highlight the focussed tab$/ do
6
+ Redcar::Project::Manager.reveal_files = false
3
7
  end
@@ -45,11 +45,16 @@ def delete_subproject_fixtures
45
45
  FileUtils.rm_rf(fixtures_path + "/myproject/test2")
46
46
  end
47
47
 
48
+ def filter_storage
49
+ Redcar::Project::FindFileDialog.storage
50
+ end
51
+
48
52
  Before do
49
53
  reset_project_fixtures
50
54
  end
51
55
 
52
56
  After do
57
+ Redcar::Project::Manager.reveal_files = true
53
58
  reset_project_fixtures
54
59
  delete_subproject_fixtures
55
60
  DrbShelloutHelper.kill_thread
@@ -226,7 +226,7 @@ module Redcar
226
226
 
227
227
  class RevealInProjectCommand < ProjectCommand
228
228
  def execute
229
- if project and project.window.trees_visible?
229
+ if Project::Manager.reveal_file?(project)
230
230
  tab = Redcar.app.focussed_window.focussed_notebook_tab
231
231
  if tab.is_a?(EditTab)
232
232
  return unless mirror = tab.edit_view.document.mirror and mirror.respond_to? :path
@@ -249,6 +249,13 @@ module Redcar
249
249
  end
250
250
  end
251
251
 
252
+ class ToggleRevealInProject < ProjectCommand
253
+ def execute
254
+ toggle = Project::Manager.reveal_files?
255
+ Project::Manager.reveal_files = !toggle
256
+ end
257
+ end
258
+
252
259
  # FIXME: XXX: The rest of this file is outright ugly. The Redcar.platform ultimately
253
260
  # needs to return a platform object which we can dispatch to for commandlines,
254
261
  # configuration, escaping and all that.
@@ -33,10 +33,11 @@ module Redcar
33
33
  end
34
34
 
35
35
  def can_drop?(nodes, target, position)
36
- nodes.all? {|node| droppable?(node, target)}
36
+ nodes and nodes.all? {|node| droppable?(node, target)}
37
37
  end
38
38
 
39
39
  def do_drop(nodes, target, position)
40
+ return unless nodes
40
41
  paths = nodes.map {|node| node.path }
41
42
  non_nested_paths = remove_nested_paths(paths)
42
43
  non_nested_paths.each do |path|
@@ -52,6 +53,8 @@ module Redcar
52
53
  private
53
54
 
54
55
  def droppable?(from_node, target_node)
56
+ return false unless from_node
57
+
55
58
  # you can always drop into the top level of the tree
56
59
  return true if target_node == nil
57
60
 
@@ -7,14 +7,15 @@ module Redcar
7
7
  def self.storage
8
8
  @storage ||= begin
9
9
  storage = Plugin::Storage.new('find_file_dialog')
10
+ storage.set_default('ignore_file_patterns', false)
10
11
  storage.set_default('ignore_files_that_match_these_regexes', [])
11
12
  storage.set_default('ignore_files_that_match_these_regexes_example_for_reference', [/.*\.class/i])
12
13
  storage
13
14
  end
14
15
  end
15
-
16
+
16
17
  attr_reader :project
17
-
18
+
18
19
  def initialize(project)
19
20
  super()
20
21
  @project = project
@@ -77,7 +78,7 @@ module Redcar
77
78
  # show the full subdirs in the case of collisions
78
79
  n = -100
79
80
  end
80
-
81
+
81
82
  if path.count('/') > 0
82
83
  count_back = [-path.count('/'), n].max
83
84
  path.split("/").last +
@@ -88,24 +89,27 @@ module Redcar
88
89
  path
89
90
  end
90
91
  end
91
-
92
+
92
93
  def ignore_regexes
93
94
  self.class.storage['ignore_files_that_match_these_regexes']
94
95
  end
95
-
96
+
96
97
  def ignore_file?(filename)
97
- ignore_regexes.any? {|re| re =~ filename }
98
+ if self.class.storage['ignore_file_patterns']
99
+ ignore_regexes.any? {|re| re =~ filename }
100
+ end
98
101
  end
99
-
102
+
100
103
  def find_files_from_list(text, file_list)
101
- re = make_regex(text)
102
- file_list.select { |fn|
103
- fn.split('/').last =~ re
104
+ re = make_regex(text.gsub(/\s/, ""))
105
+ file_list.select { |fn|
106
+ fn.split('/').last =~ re and not ignore_file?(fn)
104
107
  }.compact
105
108
  end
106
-
109
+
107
110
  def find_files(text, directories)
108
- filter_and_rank_by(project.all_files.sort, text) do |fn|
111
+ files = project.all_files.sort.select {|fn| not ignore_file?(fn)}
112
+ filter_and_rank_by(files, text.gsub(/\s/, "")) do |fn|
109
113
  fn.split("/").last
110
114
  end
111
115
  end
@@ -92,7 +92,35 @@ module Redcar
92
92
  end
93
93
 
94
94
  def self.storage
95
- @storage = Plugin::Storage.new('project_plugin')
95
+ @storage ||= begin
96
+ storage = Plugin::Storage.new('project_plugin')
97
+ storage.set_default('reveal_files_in_project_tree',true)
98
+ storage.set_default('reveal_files_only_when_tree_is_focussed',true)
99
+ storage
100
+ end
101
+ end
102
+
103
+ def self.reveal_files?
104
+ storage['reveal_files_in_project_tree']
105
+ end
106
+
107
+ def self.reveal_files=(toggle)
108
+ storage['reveal_files_in_project_tree'] = toggle
109
+ end
110
+
111
+ def self.reveal_file_only_when_tree_focussed?
112
+ storage['reveal_files_only_when_tree_is_focussed']
113
+ end
114
+
115
+ def self.reveal_file?(project)
116
+ if project and tree = project.tree
117
+ if reveal_files? and project.window.trees_visible?
118
+ ftree = project.window.treebook.focussed_tree
119
+ unless tree != ftree and reveal_file_only_when_tree_focussed?
120
+ true
121
+ end
122
+ end
123
+ end
96
124
  end
97
125
 
98
126
  def self.filter_path
@@ -354,6 +382,7 @@ module Redcar
354
382
  item "Find File", Project::FindFileCommand
355
383
  item "Refresh Directory", Project::RefreshDirectoryCommand
356
384
  end
385
+ item "Reveal Open File in Tree", :command => Project::ToggleRevealInProject, :type => :check, :active => Project::Manager.reveal_files?
357
386
  end
358
387
  end
359
388
  end
@@ -0,0 +1,147 @@
1
+ == 0.4.6 / 2010-08-31
2
+ * Bug fix: Using a has_one - should only delete the relationship to the old node, NOT delete the old node (#123)
3
+
4
+ == 0.4.5 / 2010-08-18
5
+ * Bug fix: When setting an indexed property = nil, raises an undefined method "root_class" exception (#122)
6
+
7
+ == 0.4.4 / 2010-08-01
8
+ * Fixed bug on traversing when using the RelationshipMixin (#121)
9
+ * BatchInserter and JRuby 1.6 - Fix iteration error with trying to modify in-place hash
10
+
11
+ == 0.4.3 / 2010-04-10
12
+ * Fixed .gitignore - make sure that we do not include unnecessarily files like neo4j databases. Release 0.4.2 contained test data.
13
+ * Added synchronize around Index.new so that two thread can't modify the same index at the same time.
14
+
15
+ == 0.4.2 / 2010-04-08
16
+ * No index on properties for the initialize method bug (#116)
17
+ * Tidy up Thread Synchronization in Lucene wrapper - lucene indexing performance improvement (#117)
18
+ * Permission bug loading neo4j jar file (#118)
19
+ * Spike: Make NodeMixin ActiveModel complient - experimental (#115)
20
+
21
+ == 0.4.1 / 2010-03-11
22
+ * Migrations (#108)
23
+ * BatchInserter (#111)
24
+ * Neo4j::Relationship.new should take a hash of properties (#110)
25
+ * Upgrade to neo4j-1.0 (#114)
26
+ * Bigfix: has_one should replace old relationship (#106)
27
+ * Bugfix: custom accessors for NodeMixin#update (#113)
28
+ * Bugfix: Indexed properties problem on extented ruby classes critical "properties indexer" (#112)
29
+
30
+ == 0.4.0 / 2010-02-06
31
+ * Performance improvements and Refactoring: Use and Extend Neo4j Java Classes (#97)
32
+ * Support for Index and Declaration of Properties on Relationships (#91)
33
+ * Upgrade to neo4j-1.0 rc (#100)
34
+ * All internal properties should be prefix with a '_',0.4.0 (#105)
35
+ * Generate relationship accessor methods for declared has_n and has_one relationships (#104)
36
+ * New way of creating relationship - Neo4j::Relationship.new (#103)
37
+ * Neo4j#init_node method should take one or more args (#98)
38
+ * Namespaced relationships: has_one...from using the wrong has_n...to(#92)
39
+ * Neo4j::NodeMixin and Neo4j::Node should allow a hash for initialization (#99)
40
+
41
+ == 0.3.3 / 2009-11-25
42
+ * Support for a counter property on has_lists (#75)
43
+ * Support for Cascade delete. On has_n, had_one and has_list (#81)
44
+ * NodeMixin#all should work with inheritance - Child classes should have a relationship of their own. (#64)
45
+ * Support for other lucene analyzer then StandardAnalyzer (#87)
46
+ * NodeMixin initialize should accept block like docs (#82)
47
+ * Add incoming relationship should work as expected: n1.relationships.incoming(:foo) << n2 (#80)
48
+ * Delete node from a has_list relationship should work as expected (#79)
49
+ * Improve stacktraces (#94)
50
+ * Removed sideeffect of rspecs (#90)
51
+ * Add debug method on NodeMixin to print it self (#88)
52
+ * Removed to_a method (#73)
53
+ * Upgrade to neo4j-1.0b10 (#95)
54
+ * Upgrade to lucene 2.9.0 (#83)
55
+ * Refactoring: RSpecs (#74)
56
+ * Refactoring: aggregate each, renamed to property aggregator (#72)
57
+ * BugFix: neo4j gem cannot be built from the source (#86)
58
+ * BugFix: Neo4j::relationship should not raise Exception if there are no relationships (#78)
59
+
60
+ == 0.3.2 / 2009-09-17
61
+ * Added support for aggregating nodes (#65)
62
+ * Wrapped Neo4j GraphAlgo AllSimplePath (#70)
63
+ * Added traversal with traversal position (#71)
64
+ * Removed DynamicAccessors mixin, replaced by [] operator (#67)
65
+ * Impl Neo4j.all_nodes (#69)
66
+ * Upgrated Neo4j jar file to 1.0-b9
67
+ * The Neo4j#relationship method now allows a filter parameter (#66)
68
+ * Neo4j.rb now can read database not created by Neo4j.rb - does not require classname property (#63)
69
+ * REST - added an "all" value for the depth traversal query parameter (#62)
70
+ * REST - Performance improvments using the Rest Mixin (#60)
71
+
72
+ == 0.3.1 / 2009-07-25
73
+ * Feature, extension - find path between given pair of nodes (#58)
74
+ * Fix a messy exception on GET /nodes/UnknownClassName (#57)
75
+ * Bug - exception on GET /nodes/classname/rel if rel is a has_one relationship (#56)
76
+ * Bug: GET /nodes/classname missing out nodes with no properties (#55)
77
+ * Bug: Lucene sorting caused exception if there were no documents (#54)
78
+ * Bug: reindexer fails to connect nodes to the IndexNode (#53)
79
+
80
+ == 0.3.0 / 2009-06-25
81
+ * Neo4j should track node changes
82
+ * RESTful support for lucene queries, sorting and paging
83
+ * RESTful support for Relationships
84
+ * RESTful support for Node and properties
85
+ * Experimental support for Master-Slave Replication via REST
86
+ * RESTful Node representation should contain hyperlinks to relationships
87
+ * Added some handy method like first and empty? on relationships
88
+ * Use new neo4j: neo-1.0-b8
89
+ * Add an event handler for create/delete nodes start/stop neo, update property/relationship
90
+ * The NodeMixin should behave like a hash, added [] and []= methods
91
+ * Support list topology - has_list and belongs_to_list Neo4j::NodeMixin Classmethods
92
+ * Should be possible to add relationships without declaring them (Neo4j#relationships.outgoing(:friends) << node)
93
+ * Neo4j extensions file structure, should be easy to create your own extensions
94
+ * Rename relation to relationship (Neo4j::Relations => Neo4j::Relationships, DynamicRelation => Relationship) [data incompatible change]
95
+ * Auto Transaction is now optional
96
+ * Setting Float properties fails under JRuby1.2.0
97
+ * Bug: Indexing relationships does not work
98
+ * Make the ReferenceNode include Neo4j::NodeMixin
99
+ * Added handy Neo4j class that simply includes the Neo4j::NodeMixin
100
+ * Neo4j::IndexNode now holds references to all nodes (Neo4j.ref_node -> Neo4j::IndexNode -> ...)
101
+
102
+
103
+ == 0.2.1 / 2009-03-15
104
+ * Refactoring of lucene indexing of the node space (28)
105
+ * Fixed bug on Neo4j::Nodemixin#property? (#22)
106
+
107
+
108
+ == 0.2.0 / 2009-01-20
109
+ * Impl. Neo4j::Node#traverse - enables traversal and filtering using TraversalPosition info (#17,#19)
110
+ * Impl. traversal to any depth (#15)
111
+ * Impl. traversal several relationships type at the same time (#16)
112
+ * Fixed a Lucene timezone bug (#20)
113
+ * Lots of refactoring of the neo4j.rb traversal code and RSpecs
114
+
115
+ == 0.1.0 / 2008-12-18
116
+ * Property can now be of any type (and not only String, Fixnum, Float)
117
+ * Indexing and Query with Date and DateTime
118
+ * YARD documentation
119
+ * Properties can be removed
120
+ * A property can be set to nil (it will then be removed).
121
+
122
+ == 0.0.7 / 2008-12-10
123
+ * Added method to_param and methods on the value object needed for Ruby on Rails
124
+ * Impl. update from a value object/hash for a node
125
+ * Impl. generation of value object classes/instances from a node.
126
+ * Refactoring the Transaction handling (reuse PlaceboTransaction instances if possible)
127
+ * Removed the need to start and stop neo. It will be done automatically when needed.
128
+
129
+
130
+ == 0.0.6 / 2008-12-03
131
+ * Removed the configuration from the Neo4j.start method. Now exist in Neo4j::Config and Lucene::Config.
132
+ * Implemented sort_by method.
133
+ * Lazy loading of search result. Execute the query and load the nodes only if needed.
134
+ * Added support to use lucene query language, example: Person.find("name:foo AND age:42")
135
+ * All test now uses RAM based lucene indexes.
136
+
137
+ == 0.0.5 / 2008-11-17
138
+ * Supports keeping lucene index in memory instead of on disk
139
+ * Added support for lucene full text search
140
+ * Fixed so neo4j runs on JRuby 1.1.5
141
+ * Implemented support for reindex all instances of a node class. This is needed if the lucene index is kept in memory or if the index is changed.
142
+ * Added ReferenceNode. All nodes now have a relationship from this reference node.
143
+ * Lots of refactoring
144
+ * Added the IMDB example. It shows how to create a neo database, lucene queries and node traversals.
145
+
146
+ == 0.0.4 / 2008-10-23
147
+ * First release to rubyforge