redcar 0.8.1 → 0.9.0

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 (210) hide show
  1. data/CHANGES +41 -1
  2. data/README.md +1 -1
  3. data/Rakefile +5 -6
  4. data/lib/plugin_manager/lib/plugin_manager.rb +1 -2
  5. data/lib/redcar.rb +19 -14
  6. data/lib/redcar/installer.rb +21 -17
  7. data/lib/redcar/runner.rb +10 -7
  8. data/lib/redcar/usage.rb +1 -0
  9. data/lib/redcar_quick_start.rb +8 -12
  10. data/lib/regex_replace.rb +3 -3
  11. data/plugins/application/features/step_definitions/menu_steps.rb +10 -0
  12. data/plugins/application/features/step_definitions/speedbar_steps.rb +8 -2
  13. data/plugins/application/features/step_definitions/tree_steps.rb +48 -6
  14. data/plugins/application/features/step_definitions/window_steps.rb +9 -4
  15. data/plugins/application/features/support/env.rb +20 -1
  16. data/plugins/application/features/support/fake_event.rb +14 -0
  17. data/plugins/application/lib/application.rb +29 -12
  18. data/plugins/application/lib/application/dialogs/filter_list_dialog.rb +19 -0
  19. data/plugins/application/lib/application/speedbar.rb +23 -17
  20. data/plugins/application/lib/application/tab.rb +20 -15
  21. data/plugins/application/lib/application/treebook.rb +10 -7
  22. data/plugins/application/lib/application/window.rb +1 -1
  23. data/plugins/application/plugin.rb +1 -1
  24. data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +4 -4
  25. data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +15 -4
  26. data/plugins/application_swt/lib/application_swt/icon.rb +3 -5
  27. data/plugins/application_swt/lib/application_swt/notebook/tab_drag_and_drop_listener.rb +4 -4
  28. data/plugins/application_swt/lib/application_swt/notebook/tab_transfer.rb +5 -5
  29. data/plugins/application_swt/lib/application_swt/speedbar.rb +34 -120
  30. data/plugins/application_swt/lib/application_swt/speedbar/button_item.rb +20 -0
  31. data/plugins/application_swt/lib/application_swt/speedbar/combo_item.rb +38 -0
  32. data/plugins/application_swt/lib/application_swt/speedbar/label_item.rb +15 -0
  33. data/plugins/application_swt/lib/application_swt/speedbar/slider_item.rb +32 -0
  34. data/plugins/application_swt/lib/application_swt/speedbar/text_box_item.rb +36 -0
  35. data/plugins/application_swt/lib/application_swt/speedbar/toggle_item.rb +29 -0
  36. data/plugins/application_swt/lib/application_swt/tab.rb +1 -3
  37. data/plugins/application_swt/lib/application_swt/toolbar.rb +19 -20
  38. data/plugins/application_swt/lib/application_swt/treebook.rb +24 -9
  39. data/plugins/application_swt/lib/application_swt/window.rb +110 -98
  40. data/plugins/application_swt/lib/swt/vtab_folder.rb +77 -32
  41. data/plugins/application_swt/lib/swt/vtab_item.rb +9 -0
  42. data/plugins/application_swt/lib/swt/vtab_label.rb +63 -23
  43. data/plugins/application_swt/plugin.rb +1 -1
  44. data/plugins/clipboard-viewer/lib/clipboard_viewer/clipboard_bar.rb +2 -2
  45. data/plugins/comment/features/line_comment.feature +116 -4
  46. data/plugins/comment/lib/comment.rb +18 -16
  47. data/plugins/connection_manager/lib/connection_manager/commands.rb +1 -1
  48. data/plugins/connection_manager/lib/connection_manager/private_key_store.rb +5 -3
  49. data/plugins/declarations/lib/declarations.rb +1 -1
  50. data/plugins/declarations/lib/declarations/parser.rb +68 -20
  51. data/plugins/document_search/features/replace.feature +18 -0
  52. data/plugins/document_search/lib/document_search.rb +37 -54
  53. data/plugins/document_search/lib/document_search/replace_all_command.rb +27 -0
  54. data/plugins/document_search/lib/document_search/replace_command.rb +38 -0
  55. data/plugins/document_search/lib/document_search/replace_next_command.rb +27 -0
  56. data/plugins/document_search/lib/document_search/search_and_replace.rb +17 -24
  57. data/plugins/edit_view/features/step_definitions/editing_steps.rb +4 -4
  58. data/plugins/edit_view/features/step_definitions/tab_steps.rb +9 -0
  59. data/plugins/edit_view/features/step_definitions/window_steps.rb +0 -12
  60. data/plugins/edit_view/lib/edit_view/document.rb +2 -0
  61. data/plugins/edit_view/lib/edit_view/document/command.rb +8 -8
  62. data/plugins/edit_view/lib/edit_view/edit_tab.rb +21 -7
  63. data/plugins/edit_view/lib/edit_view/select_font_dialog.rb +6 -0
  64. data/plugins/edit_view/lib/edit_view/select_theme_dialog.rb +6 -0
  65. data/plugins/edit_view_swt/lib/edit_view_swt.rb +92 -43
  66. data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +17 -4
  67. data/plugins/find-in-project/lib/find_in_project.rb +1 -4
  68. data/plugins/find-in-project/lib/find_in_project/commands.rb +0 -14
  69. data/plugins/find-in-project/lib/find_in_project/controllers.rb +12 -0
  70. data/plugins/find-in-project/lib/find_in_project/views/index.html.erb +5 -0
  71. data/plugins/groovy/features/fixtures/test.groovy +0 -0
  72. data/plugins/groovy/features/step_definitions/groovy_steps.rb +27 -0
  73. data/plugins/groovy/features/support/env.rb +27 -0
  74. data/plugins/groovy/features/syntax_check_groovy.feature +72 -0
  75. data/plugins/groovy/lib/syntax_check/groovy.rb +76 -0
  76. data/plugins/groovy/plugin.rb +7 -0
  77. data/plugins/help/lib/help.rb +28 -4
  78. data/plugins/help/lib/help/help_tab.rb +11 -0
  79. data/plugins/help/lib/help/view_controller.rb +25 -0
  80. data/plugins/help/plugin.rb +2 -1
  81. data/plugins/{view_shortcuts → help}/views/default.css +0 -0
  82. data/plugins/{view_shortcuts → help}/views/index.html.erb +1 -1
  83. data/plugins/{view_shortcuts → help}/views/redcar_small_icon.png +0 -0
  84. data/plugins/html_view/features/browser_bar.feature +47 -0
  85. data/plugins/html_view/features/fixtures/other.html +1 -0
  86. data/plugins/html_view/features/fixtures/sample.html +1 -0
  87. data/plugins/html_view/features/step_definitions/html_view_steps.rb +45 -5
  88. data/plugins/html_view/features/support/env.rb +26 -0
  89. data/plugins/html_view/features/web_preview.feature +21 -0
  90. data/plugins/html_view/lib/html_controller.rb +5 -5
  91. data/plugins/html_view/lib/html_view.rb +62 -10
  92. data/plugins/{web_bookmarks/lib/web_bookmarks → html_view/lib/html_view}/browser_bar.rb +32 -20
  93. data/plugins/html_view/lib/html_view/commands.rb +64 -0
  94. data/plugins/{web_bookmarks/lib/web_bookmarks/view_controller.rb → html_view/lib/html_view/default_controller.rb} +7 -6
  95. data/plugins/html_view/lib/html_view/html_tab.rb +17 -6
  96. data/plugins/html_view/plugin.rb +3 -3
  97. data/plugins/{web_bookmarks → html_view}/views/index.html.erb +0 -0
  98. data/plugins/javascript/features/fixtures/test.js +0 -0
  99. data/plugins/javascript/features/support/env.rb +4 -0
  100. data/plugins/javascript/features/syntax_check_javascript.feature +27 -0
  101. data/plugins/javascript/lib/syntax_check/javascript.rb +52 -0
  102. data/plugins/javascript/plugin.rb +7 -0
  103. data/plugins/javascript/vendor/jslint.js +539 -0
  104. data/plugins/macros/lib/macros/commands.rb +3 -3
  105. data/plugins/open_default_app/lib/open_default_app.rb +29 -3
  106. data/plugins/open_default_app/plugin.rb +1 -1
  107. data/plugins/outline_view/features/outline_view.feature +79 -0
  108. data/plugins/outline_view/features/step_definitions/outline_steps.rb +45 -0
  109. data/plugins/outline_view/lib/outline_view.rb +1 -1
  110. data/plugins/outline_view/spec/fixtures/some_project/javascript.js +10 -0
  111. data/plugins/outline_view/spec/fixtures/some_project/nothing_to_see.rb +0 -0
  112. data/plugins/outline_view/spec/fixtures/some_project/one_lonely_class.rb +2 -0
  113. data/plugins/outline_view/spec/fixtures/some_project/similar_names.rb +18 -0
  114. data/plugins/outline_view/spec/fixtures/some_project/something_fancy.rb +736 -0
  115. data/plugins/outline_view/spec/fixtures/some_project/trailing_space.rb +5 -0
  116. data/plugins/outline_view_swt/lib/outline_view_swt.rb +17 -19
  117. data/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb +1 -4
  118. data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +12 -3
  119. data/plugins/project/features/close_directory_tree.feature +27 -0
  120. data/plugins/project/features/highlight_focussed_tab.feature +45 -1
  121. data/plugins/project/features/open_and_save_files.feature +33 -0
  122. data/plugins/project/features/open_directory_tree.feature +37 -11
  123. data/plugins/project/features/step_definitions/directory_steps.rb +1 -1
  124. data/plugins/project/features/step_definitions/drb_steps.rb +40 -0
  125. data/plugins/project/features/support/env.rb +17 -0
  126. data/plugins/project/lib/project.rb +12 -2
  127. data/plugins/project/lib/project/commands.rb +101 -99
  128. data/plugins/project/lib/project/drb_service.rb +55 -65
  129. data/plugins/project/lib/project/manager.rb +29 -4
  130. data/plugins/project/lib/project/project_tree_controller.rb +24 -0
  131. data/plugins/project/lib/project/support/trash.rb +1 -0
  132. data/plugins/redcar/redcar.rb +100 -37
  133. data/plugins/redcar_debug/lib/redcar_debug.rb +3 -3
  134. data/plugins/repl/features/step_definitions/repl_steps.rb +3 -0
  135. data/plugins/repl/lib/repl.rb +4 -11
  136. data/plugins/repl/lib/repl/repl_tab.rb +26 -0
  137. data/plugins/ruby/features/fixtures/test.rb +0 -0
  138. data/plugins/ruby/features/support/env.rb +4 -0
  139. data/plugins/ruby/features/syntax_check_ruby.feature +25 -0
  140. data/plugins/runnables/features/command_tree.feature +28 -0
  141. data/plugins/runnables/lib/runnables.rb +1 -0
  142. data/plugins/runnables/lib/runnables/commands.rb +4 -4
  143. data/plugins/runnables/lib/runnables/output_processor.rb +5 -5
  144. data/plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb +2 -7
  145. data/plugins/runnables/lib/runnables/tree_mirror/tree_mirror.rb +13 -8
  146. data/plugins/scm_git/lib/scm_git/change.rb +5 -5
  147. data/plugins/strip_trailing_spaces/features/fixtures/test.txt +3 -0
  148. data/plugins/strip_trailing_spaces/features/strip_trailing_spaces.feature +34 -0
  149. data/plugins/strip_trailing_spaces/lib/strip_trailing_spaces.rb +3 -38
  150. data/plugins/swt/lib/swt.rb +5 -13
  151. data/plugins/swt/lib/swt/full_swt.rb +15 -13
  152. data/plugins/syntax_check/features/step_definitions/syntax_check_steps.rb +7 -0
  153. data/plugins/syntax_check/lib/syntax_check.rb +21 -3
  154. data/plugins/syntax_check/lib/syntax_check/error.rb +4 -3
  155. data/plugins/task_manager/lib/task_manager.rb +1 -1
  156. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Preferences/Autocompletions.tmPreferences +345 -0
  157. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Preferences/Symbol List Target.tmPreferences +22 -0
  158. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Snippets/Doc Banner.tmSnippet +20 -0
  159. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Syntaxes/Ant.tmLanguage +247 -0
  160. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/info.plist +55 -0
  161. data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/Syntaxes/GroovyRepl.plist +40 -0
  162. data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/info.plist +1 -1
  163. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Haml.tmbundle/Syntaxes/Ruby_Haml.tmLanguage +0 -1
  164. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Sass.tmbundle/Syntaxes/Ruby Sass.tmLanguage +626 -0
  165. data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Sass.tmbundle/info.plist +16 -0
  166. data/plugins/todo_list/features/support/env.rb +8 -0
  167. data/plugins/todo_list/features/todo_list.feature +26 -0
  168. data/plugins/todo_list/lib/todo_list.rb +1 -0
  169. data/plugins/todo_list/lib/todo_list/file_parser.rb +23 -19
  170. data/plugins/todo_list/lib/todo_list/todo_controller.rb +60 -100
  171. data/plugins/todo_list/spec/fixtures/project/FIXME.file +3 -0
  172. data/plugins/todo_list/spec/fixtures/project/NOTE.ignored.file +1 -0
  173. data/plugins/todo_list/spec/fixtures/project/OPTIMIZE_colon.file +1 -0
  174. data/plugins/todo_list/spec/fixtures/project/XXX.ignored +1 -0
  175. data/plugins/todo_list/spec/fixtures/project/ignored_directory/TODO.file +2 -0
  176. data/plugins/todo_list/spec/fixtures/settings.rb +11 -0
  177. data/plugins/todo_list/spec/spec_helper.rb +6 -0
  178. data/plugins/todo_list/spec/todo_list/file_parser_spec.rb +35 -0
  179. data/plugins/tree/lib/tree.rb +1 -0
  180. data/plugins/tree/lib/tree/command.rb +5 -0
  181. data/plugins/web_bookmarks/features/bookmark.feature +37 -0
  182. data/plugins/web_bookmarks/features/fixtures/other.html +1 -0
  183. data/plugins/web_bookmarks/features/fixtures/sample.html +1 -0
  184. data/plugins/web_bookmarks/features/step_definitions/web_steps.rb +4 -0
  185. data/plugins/web_bookmarks/features/support/env.rb +26 -0
  186. data/plugins/web_bookmarks/lib/web_bookmarks.rb +0 -10
  187. data/plugins/web_bookmarks/lib/web_bookmarks/bookmark.rb +10 -1
  188. data/plugins/web_bookmarks/lib/web_bookmarks/commands.rb +1 -47
  189. data/plugins/web_bookmarks/lib/web_bookmarks/tree.rb +21 -14
  190. data/{plugins/application → share}/icons/close.png +0 -0
  191. data/{plugins/application → share}/icons/darwin-file.png +0 -0
  192. data/{plugins/application → share}/icons/darwin-folder.png +0 -0
  193. data/share/icons/open-source-flipped.png +0 -0
  194. data/{plugins/application/icons/redcar_icon_beta_dev.png → share/icons/redcar-icon-beta-dev.png} +0 -0
  195. data/{plugins/application/icons/redcar_icon_beta.png → share/icons/redcar-icon-beta.png} +0 -0
  196. data/{plugins/application → share}/icons/redcar-splash.png +0 -0
  197. metadata +90 -30
  198. data/lib/redcar/jvm_options_probe.rb +0 -33
  199. data/plugins/document_search/lib/document_search/replace.rb +0 -113
  200. data/plugins/document_search/lib/document_search/search.rb +0 -45
  201. data/plugins/outline_view_swt/lib/icons/alias.png +0 -0
  202. data/plugins/outline_view_swt/lib/icons/assignment.png +0 -0
  203. data/plugins/outline_view_swt/lib/icons/attribute.png +0 -0
  204. data/plugins/outline_view_swt/lib/icons/class.png +0 -0
  205. data/plugins/outline_view_swt/lib/icons/interface.png +0 -0
  206. data/plugins/outline_view_swt/lib/icons/method.png +0 -0
  207. data/plugins/strip_trailing_spaces/CHANGELOG +0 -12
  208. data/plugins/strip_trailing_spaces/README.md +0 -32
  209. data/plugins/view_shortcuts/lib/view_shortcuts.rb +0 -52
  210. data/plugins/view_shortcuts/plugin.rb +0 -11
data/CHANGES CHANGED
@@ -1,9 +1,49 @@
1
+ Version 0.9 (25 November 2010)
2
+ ==============================
3
+
4
+ Enhancements:
5
+
6
+ * Vertical tree tabs now have a close button like edit view tabs (Tim Felgentreff)
7
+ * Strip Trailing Spaces is now _much_ faster (Tim Felgentreff)
8
+ * "Online Help" and "Submit a Bug" open the default system browser (Johannes Wollert)
9
+ * -l command line switch to jump to a file number (Johannes Wollert)
10
+ * Font and Theme dialogs now update the setting on selection change for instant feedback (Tim Felgentreff)
11
+ * Tabs now display an alert icon if the underlying file is unwritable (Delisa Mason)
12
+ * Browser bar URL field now supports project-relative paths (Delisa Mason)
13
+ * URLs can be opened in the internal browser or the OS-default based on preferences (Delisa Mason)
14
+ * Syntax checking for Groovy (Delisa Mason)
15
+ * Jump to declaration for Groovy (Delisa Mason)
16
+ * Margin is drawn with a line or a shaded area (Tim Felgentreff)
17
+ * Syntax checking for JavaScript (Delisa Mason)
18
+ * Word wrap wraps at the margin column (Daniel Lucraft)
19
+ * Improvements and optimizations to replace-all function (Tim Felgentreff)
20
+ * .redcar plugins dir is created on startup to help people know they can put plugins there (Philip Arndt)
21
+ * Add jruby jar to JVM bootclasspath to speedup startup marginally (Tim Felgentreff)
22
+
23
+ Bug fixes:
24
+
25
+ * Declarations plugin is able to deal with similarly named ruby methods
26
+ * Declarations plugin lets Ruby methods have trailing spaces (Johannes Wollert)
27
+ * Fix Application::Dialog#tool_tip to set the location correctly on Windows (Patrik Sundberg)
28
+ * 64bit Soylatte JDK7 can now be used to run Redcar on Mac OS X
29
+ * Run Tab now checks for underlying file (Delisa Mason)
30
+ * Hovering on annotations only displays the tooltip(s) under the cursor, not all of them (Delisa Mason)
31
+ * Fix for installing on Ruby 1.8.6 (Dan Lucraft)
32
+ * Connection manager should not try and read directories and unreadable files when looking for private keys (Antono Vasiljev)
33
+ * Required cucumber version is specified in the Gemfile (Tianyi Cui)
34
+ * Pair highlighter works on first and last character in the document (Kirill Nikitin)
35
+
36
+ Internal changes:
37
+
38
+ * Code coverage is above 70% (up from 60%) (everyone)
39
+ * Code cleanup and refactoring in various plugins (everyone)
40
+ * Speedbar can now contain sliders (Tim Felgentreff)
1
41
 
2
42
  Version 0.8.1 (26 October 2010)
3
43
  ===============================
4
44
 
5
- * Remove files with multi-byte names from the gem so windows rubygems is happy (Dan Lucraft)
6
45
  * Replace all is a single undo operation (Steven Hancock)
46
+ * Remove files with multi-byte names from the gem so windows rubygems is happy (Dan Lucraft)
7
47
 
8
48
  Version 0.8 (26 October 2010)
9
49
  =============================
data/README.md CHANGED
@@ -58,7 +58,7 @@ If you are running a source version of Redcar and you have pulled changes from m
58
58
 
59
59
  ## TESTS
60
60
 
61
- NB. Redcar features are known to work with Cucumber 0.8.5, and known NOT to work with Cucumber >= 0.9
61
+ NB. Redcar features are known to work with Cucumber 0.9.2, and known NOT to work with Cucumber < 0.9
62
62
 
63
63
  To run the tests you need JRuby installed. You also need rspec and cucumber installed as Jruby gems. See jruby.org for this, or install with rvm.
64
64
 
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- REDCAR_VERSION = "0.8.1" # also change in lib/redcar.rb!
1
+ REDCAR_VERSION = "0.9.0" # also change in lib/redcar.rb!
2
2
  require 'rubygems'
3
3
  require 'fileutils'
4
4
  require 'spec/rake/spectask'
@@ -56,7 +56,7 @@ def find_ci_reporter(filename)
56
56
  end
57
57
 
58
58
  def rcov_run(cmd, opts)
59
- cmd = %{rcov --aggregate #{COVERAGE_DATA} -x "features/,spec/,vendor/,openssl/,yaml/,json/,yaml,gems,file:,(eval),(__FORWARDABLE__)" #{cmd} -- #{opts}}
59
+ cmd = %{rcov --aggregate #{COVERAGE_DATA} -x "jsignal_internal,(erb),features/,spec/,vendor/,openssl/,yaml/,json/,yaml,gems,file:,(eval),(__FORWARDABLE__)" #{cmd} -- #{opts}}
60
60
  jruby_run(cmd)
61
61
  end
62
62
 
@@ -96,10 +96,8 @@ end
96
96
  desc "Run features"
97
97
  task :cucumber do
98
98
  cmd = "jruby "
99
- if Config::CONFIG["host_os"] == "darwin"
100
- cmd += "-J-XstartOnFirstThread "
101
- end
102
- cmd += "bin/cucumber -cf progress"
99
+ cmd << "-J-XstartOnFirstThread " if Config::CONFIG["host_os"] == "darwin"
100
+ cmd << "bin/cucumber -cf progress"
103
101
  Dir["plugins/*/features"].each do |f|
104
102
  sh("#{cmd} #{f} && echo 'done'")
105
103
  end
@@ -230,6 +228,7 @@ task :release => :gem do
230
228
  }
231
229
 
232
230
  s3_uploads.each do |source, target|
231
+ puts [source, target]
233
232
  AWS::S3::S3Object.store(target, open(source), 'redcar', :access => :public_read)
234
233
  end
235
234
  end
@@ -120,8 +120,6 @@ class PluginManager
120
120
  @plugins.select {|pl| pl.name == name }.sort_by {|pl| pl.version }.last
121
121
  end
122
122
 
123
- private
124
-
125
123
  def load_plugin(plugin)
126
124
  begin
127
125
  @output.puts "[PluginManager] loading #{plugin.name}" if ENV["PLUGIN_DEBUG"]
@@ -143,6 +141,7 @@ class PluginManager
143
141
  while ready_plugin = @unloaded_plugins.detect {|pl| pl.dependencies.all? {|dep| dep.satisfied? }}
144
142
  load_plugin(ready_plugin)
145
143
  end
144
+ @load_observer = nil # After loading all possible plugins, remove the load observer
146
145
  end
147
146
 
148
147
  def expand_dependencies(dependency_array)
@@ -51,10 +51,10 @@ end
51
51
  #
52
52
  # and so on.
53
53
  module Redcar
54
- VERSION = '0.8.1' # also change in the Rakefile!
54
+ VERSION = '0.9.0' # also change in the Rakefile!
55
55
  VERSION_MAJOR = 0
56
- VERSION_MINOR = 8
57
- VERSION_RELEASE = 1
56
+ VERSION_MINOR = 9
57
+ VERSION_RELEASE = 0
58
58
 
59
59
  ENVIRONMENTS = [:user, :debug, :test]
60
60
 
@@ -87,12 +87,16 @@ module Redcar
87
87
  def self.plugin_manager
88
88
  @plugin_manager ||= begin
89
89
  m = PluginManager.new
90
- m.add_plugin_source(File.join(root, "plugins"))
91
- m.add_plugin_source(File.join(user_dir, "plugins"))
90
+ add_plugin_sources(m)
92
91
  m
93
92
  end
94
93
  end
95
94
 
95
+ def self.add_plugin_sources(manager)
96
+ manager.add_plugin_source(File.join(root, "plugins"))
97
+ manager.add_plugin_source(File.join(user_dir, "plugins"))
98
+ end
99
+
96
100
  def self.load_prerequisites
97
101
  exit if ARGV.include?("--quit-immediately")
98
102
 
@@ -201,17 +205,18 @@ module Redcar
201
205
  #
202
206
  # @return [String] expanded path
203
207
  def self.home_dir
204
- @userdir ||= if arg = ARGV.detect {|v| v.start_with? "--home-dir=" }
205
- arg =~ /\-\-home\-dir=(.*)/
206
- File.expand_path($1)
207
- elsif platform == :windows
208
- if ENV['USERPROFILE'].nil?
209
- "C:/My Documents/"
208
+ @userdir ||= begin
209
+ if arg = ARGV.map {|v| v[/^--home-dir=(.*)/, 1] }.compact.first
210
+ File.expand_path(arg)
211
+ elsif platform == :windows
212
+ if ENV['USERPROFILE'].nil?
213
+ "C:/My Documents/"
214
+ else
215
+ ENV['USERPROFILE']
216
+ end
210
217
  else
211
- ENV['USERPROFILE']
218
+ ENV['HOME'] unless ENV['HOME'].nil?
212
219
  end
213
- else
214
- ENV['HOME'] unless ENV['HOME'].nil?
215
220
  end
216
221
  end
217
222
 
@@ -18,24 +18,25 @@ module Redcar
18
18
  end
19
19
  puts "found latest XULRunner release version: #{xulrunner_version}" if Redcar.platform == :windows
20
20
  end
21
-
21
+
22
22
  def install
23
23
  Redcar.environment = :user
24
24
  puts "Downloading >10MB of binary assets. This may take a while the first time."
25
25
  fetch_all_assets
26
26
  precache_textmate_bundles
27
+ ensure_user_plugins_directory_exists
27
28
  puts "Done! You're ready to run Redcar."
28
29
  end
29
-
30
+
30
31
  def plugins_dir
31
32
  File.expand_path(File.join(File.dirname(__FILE__), %w(.. .. plugins)))
32
33
  end
33
-
34
+
34
35
  def fetch_all_assets
35
36
  assets = assets_by_platform[:all].merge(assets_by_platform[Redcar.platform])
36
37
  assets.each {|source, target| fetch_asset(source, target) }
37
38
  end
38
-
39
+
39
40
  def assets_by_platform
40
41
  { :all => {
41
42
  "http://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-complete-1.5.3.jar" => "/jruby-complete-1.5.3.jar",
@@ -61,7 +62,8 @@ module Redcar
61
62
  "http://redcar.s3.amazonaws.com/clojure-contrib-1.2beta1.jar" => "/clojure-contrib.jar",
62
63
  "http://redcar.s3.amazonaws.com/org-enclojure-repl-server.jar" => nil,
63
64
  "http://mirrors.ibiblio.org/pub/mirrors/maven2/org/codehaus/groovy/groovy-all/1.7.4/groovy-all-1.7.4.jar" => "/groovy-all.jar",
64
- "http://mirrors.ibiblio.org/pub/mirrors/maven2/org/tmatesoft/svnkit/svnkit/1.3.4/svnkit-1.3.4.jar" => "/svnkit.jar"
65
+ "http://mirrors.ibiblio.org/pub/mirrors/maven2/org/tmatesoft/svnkit/svnkit/1.3.4/svnkit-1.3.4.jar" => "/svnkit.jar",
66
+ "http://mirrors.ibiblio.org/pub/mirrors/maven2/rhino/js/1.7R2/js-1.7R2.jar" => "/js.jar"
65
67
  },
66
68
  :windows => {
67
69
  "http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/#{xulrunner_version}/runtimes/xulrunner-#{xulrunner_version}.en-US.win32.zip" => "xulrunner-#{xulrunner_version}.en-US.win32.zip",
@@ -77,7 +79,7 @@ module Redcar
77
79
  }
78
80
  }
79
81
  end
80
-
82
+
81
83
  def fetch_asset(source, target)
82
84
  relative_target = target || implicit_target(source)
83
85
  absolute_target = File.join(Redcar.asset_dir, relative_target)
@@ -85,11 +87,11 @@ module Redcar
85
87
  download_file_to(source, absolute_target)
86
88
  unzip_file(absolute_target) if absolute_target =~ /\.zip$/
87
89
  end
88
-
90
+
89
91
  def implicit_target(source)
90
92
  URI.parse(source).path.gsub(/^\//, "")
91
93
  end
92
-
94
+
93
95
  def download_file_to(uri, destination_file)
94
96
  print " downloading #{uri}... "; $stdout.flush
95
97
  temporary_target = destination_file + ".part"
@@ -97,18 +99,18 @@ module Redcar
97
99
  File.open(temporary_target, "wb") do |write_out|
98
100
  write_out.print @connection.get(URI.parse(uri))
99
101
  end
100
-
102
+
101
103
  if File.open(temporary_target).read(200) =~ /Access Denied/
102
104
  puts "\n\n*** Error downloading #{uri}, got Access Denied from S3."
103
105
  FileUtils.rm_rf(temporary_target)
104
106
  exit
105
107
  end
106
-
108
+
107
109
  FileUtils.cp(temporary_target, destination_file)
108
110
  FileUtils.rm_rf(temporary_target)
109
111
  puts "done!"
110
112
  end
111
-
113
+
112
114
  # unzip a .zip file into the directory it is located
113
115
  def unzip_file(path)
114
116
  print "unzipping #{path}..."; $stdout.flush
@@ -125,15 +127,19 @@ module Redcar
125
127
  end
126
128
  end
127
129
  end
128
-
130
+
129
131
  def precache_textmate_bundles
130
132
  puts "Precaching textmate bundles..."
131
133
  Runner.new.construct_command(["--no-gui", "--compute-textmate-cache-and-quit", "--multiple-instance"]) do |cmd|
132
134
  %x{#{cmd.join(' ')}}
133
135
  end
134
136
  end
135
-
136
- # Xulrunner releases don't hang around very long, so we scrape their site to figure out
137
+
138
+ def ensure_user_plugins_directory_exists
139
+ FileUtils.mkpath File.join(Redcar.user_dir, 'plugins')
140
+ end
141
+
142
+ # Xulrunner releases don't hang around very long, so we scrape their site to figure out
137
143
  # which one to download this time.
138
144
  def xulrunner_version
139
145
  @xulrunner_version ||= begin
@@ -142,6 +148,4 @@ module Redcar
142
148
  end
143
149
  end
144
150
  end
145
- end
146
-
147
-
151
+ end
@@ -67,7 +67,8 @@ module Redcar
67
67
  # unfortuanately, ruby doesn't support [a, *b, c]
68
68
  command = ["java"]
69
69
  command.push(*java_args)
70
- command.push("-Xmx500m", "-Xss1024k", "-Djruby.memory.max=500m", "-Djruby.stack.max=1024k", "-cp", jruby_complete, "org.jruby.Main")
70
+ command.push("-Xbootclasspath/a:#{jruby_complete}")
71
+ command.push("-Xmx320m", "-Xss1024k", "-Djruby.memory.max=320m", "-Djruby.stack.max=1024k", "org.jruby.Main")
71
72
  command.push "--debug" if debug_mode?
72
73
  command.push(bin)
73
74
  command.push(*cleaned_args)
@@ -105,14 +106,16 @@ module Redcar
105
106
  str.push "-Djruby.debug.loadService.timing=true"
106
107
  end
107
108
 
108
- require 'redcar/jvm_options_probe'
109
-
110
- jvm_options_probe = JvmOptionsProbe.new
111
-
112
- str.push "-d32" if jvm_options_probe.can_use_d32?
113
- str.push "-client" if jvm_options_probe.can_use_client?
109
+ str.push "-d32" if JvmOptionsProbe::D32
110
+ str.push "-client" if JvmOptionsProbe::Client
114
111
 
115
112
  str
116
113
  end
114
+
115
+ class JvmOptionsProbe
116
+ Redirect = "> #{Redcar.null_device} 2>&1"
117
+ D32 = system("java -d32 #{Redirect}")
118
+ Client = system("java -client #{Redirect}")
119
+ end
117
120
  end
118
121
  end
@@ -27,6 +27,7 @@ module Redcar
27
27
  puts " --no-window Don't force opening a window on Redcar startup"
28
28
  puts " --home-dir=PATH Use the specified directory as Redcar home directory"
29
29
  puts " -w Open the specified files and wait until they are closed"
30
+ puts " -l[NUMBER] Open a specified file at line NUMBER. Multiple comma-seperated args for multiple files are allowed."
30
31
  #puts "To associate with right click in windows explorer:"
31
32
  #puts
32
33
  #puts " C:> redcar --associate_with_any_right_click"
@@ -4,7 +4,7 @@ require 'rbconfig'
4
4
  module Redcar
5
5
  DRB_PORT = 10021
6
6
  DONT_READ_STDIN_ARG = "--ignore-stdin"
7
-
7
+
8
8
  def self.read_stdin
9
9
  if not $stdin.tty? and not ARGV.include?(DONT_READ_STDIN_ARG)
10
10
  data = ""
@@ -14,7 +14,7 @@ module Redcar
14
14
  # retry
15
15
  rescue EOFError
16
16
  end
17
-
17
+
18
18
  if data.size > 0
19
19
  require 'tmpdir'
20
20
  file = File.join(Dir.tmpdir, "tmp#{$$}.txt")
@@ -23,21 +23,21 @@ module Redcar
23
23
  end
24
24
  end
25
25
  end
26
-
26
+
27
27
  def self.try_to_load_via_drb
28
28
  return if ARGV.find {|arg| arg == "--multiple-instance" || arg == '--help' || arg == '-h'}
29
29
  begin
30
30
  begin
31
31
  TCPSocket.new('127.0.0.1', DRB_PORT).close
32
- rescue Errno::ECONNREFUSED
32
+ rescue Errno::ECONNREFUSED
33
33
  # no other instance is currently running...
34
34
  return
35
35
  end
36
36
  puts 'attempting to start via running instance' if $VERBOSE
37
-
37
+
38
38
  require 'drb' # late require to avoid loadup time
39
39
  drb = DRbObject.new(nil, "druby://127.0.0.1:#{DRB_PORT}")
40
-
40
+
41
41
  if ARGV.any?
42
42
  ARGV.each do |arg|
43
43
  if arg =~ /--untitled-file=(.*)/
@@ -47,11 +47,7 @@ module Redcar
47
47
  path = File.expand_path(arg)
48
48
  end
49
49
  next unless path
50
- if ARGV.include? "-w" and File.file?(path)
51
- drb_answer = drb.open_file_and_wait(path, untitled)
52
- else
53
- drb_answer = drb.open_item_drb(path, untitled)
54
- end
50
+ drb_answer = drb.open_item_drb(path, untitled, ARGV.include?("-w"))
55
51
  return unless drb_answer == 'ok'
56
52
  end
57
53
  else
@@ -79,7 +75,7 @@ module Redcar
79
75
  :linux
80
76
  end
81
77
  end
82
-
78
+
83
79
  def self.null_device
84
80
  case platform
85
81
  when :windows
@@ -45,12 +45,12 @@ class RegexReplace
45
45
  while left.length > 0
46
46
  md = re.match(left)
47
47
  if md
48
- newstr += md.pre_match
48
+ newstr << md.pre_match
49
49
  r = yield md
50
- newstr += r
50
+ newstr << r
51
51
  left = md.post_match
52
52
  else
53
- newstr += left
53
+ newstr << left
54
54
  left = ""
55
55
  end
56
56
  end
@@ -31,3 +31,13 @@ Then /^the menu item "([^\"]*)\|([^\"]*)" should be (active|inactive)$/ do |menu
31
31
  item.enabled.should be_false
32
32
  end
33
33
  end
34
+
35
+ When /^I (?:open the|click) "([^"]*)" from the "([^"]*)" menu$/ do |menu_item, menu_name|
36
+ menu_items = menu_name.split("/").inject(main_menu.get_items.to_a.dup) do |items, item_name|
37
+ m = items.detect {|i| i.text == item_name }
38
+ items = m.get_menu.get_items.to_a
39
+ end
40
+ item = menu_items.detect {|i| i.text.split("\t").first == menu_item }
41
+ FakeEvent.new(Swt::SWT::Selection, item)
42
+ end
43
+
@@ -58,5 +58,11 @@ Then /^"([^"]*)" should not be checked in the speedbar$/ do |checkbox_name|
58
58
  item.value.should be_false
59
59
  end
60
60
 
61
-
62
-
61
+ Then /^there should( not)? be an open speedbar$/ do |negate|
62
+ speedbar = Redcar.app.focussed_window.speedbar
63
+ if negate
64
+ speedbar.should == nil
65
+ else
66
+ speedbar.should_not == nil
67
+ end
68
+ end
@@ -10,6 +10,37 @@ When /^I toggle tree visibility$/ do
10
10
  Redcar::Top::ToggleTreesCommand.new.run
11
11
  end
12
12
 
13
+ When "I close the tree" do
14
+ Redcar::Top::CloseTreeCommand.new.run
15
+ end
16
+
17
+ When "I click the close button" do
18
+ vtabitem = focussed_window.treebook.controller.tab_folder.selection
19
+ swtlabel = swt_label_for_item(vtabitem)
20
+
21
+ # Make sure the close icon is showing
22
+ FakeEvent.new(Swt::SWT::MouseEnter, swtlabel)
23
+
24
+ # Fire the click event
25
+ FakeEvent.new(Swt::SWT::MouseUp, swtlabel,
26
+ :x => Swt::Widgets::VTabLabel::ICON_PADDING + 1,
27
+ :y => Swt::Widgets::VTabLabel::ICON_PADDING + 1)
28
+ end
29
+
30
+ When /^I (?:(left|right)-)?click the (project|directory|"[^\"]*") tree tab$/ do |button, target|
31
+ if target =~ /(project|directory)/
32
+ path = Redcar::Project::Manager.in_window(Redcar.app.focussed_window).path
33
+ target = File.basename(path) + "/"
34
+ end
35
+ target.gsub!('"', '')
36
+ vtabitem = focussed_window.treebook.controller.tab_folder.get_item(target)
37
+ swtlabel = swt_label_for_item(vtabitem)
38
+
39
+ button = (button == "right" ? 2 : 1)
40
+ FakeEvent.new(Swt::SWT::MouseEnter, swtlabel)
41
+ FakeEvent.new(Swt::SWT::MouseUp, swtlabel, :x => 1, :y => 1, :button => button)
42
+ end
43
+
13
44
  Then /^I should (not )?see "([^\"]*)" in the tree$/ do |negate, rows|
14
45
  item_names = visible_tree_items(top_tree).map(&:get_text)
15
46
  rows.split(',').map(&:strip).each do |row|
@@ -21,13 +52,24 @@ Then /^I should (not )?see "([^\"]*)" in the tree$/ do |negate, rows|
21
52
  end
22
53
  end
23
54
 
24
- Then /^the tree width should be (0|the default)$/ do |w|
25
- width = Redcar.app.focussed_window.treebook.controller.tab_folder.bounds.width
26
- if w == 0
27
- width.should == 0
55
+ Then /^there should (not )?be a tree titled "([^\"]*)"$/ do |negate,title|
56
+ if negate
57
+ tree_with_title(title).should == nil
58
+ else
59
+ tree_with_title(title).should_not == nil
60
+ end
61
+ end
62
+
63
+ Then /^the tree width should be (the default|\d+ pixels|the minimum size)$/ do |w|
64
+ width = focussed_treebook_width
65
+ if w == "the default"
66
+ unless width == default_treebook_width
67
+ raise "The tree width was #{width}, expected #{default_treebook_width}"
68
+ end
69
+ elsif w == "the minimum size"
70
+ width.should == Redcar::ApplicationSWT::Window::MINIMUM_TREEBOOK_WIDTH
28
71
  else
29
- default = Redcar::ApplicationSWT::Window::TREEBOOK_WIDTH + Redcar::ApplicationSWT::Window::SASH_WIDTH - 5
30
- raise "The tree width was #{width}, expected #{default}" unless width == default
72
+ width.should == w.split(" ")[0].to_i
31
73
  end
32
74
  end
33
75