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.
- data/CHANGES +41 -1
- data/README.md +1 -1
- data/Rakefile +5 -6
- data/lib/plugin_manager/lib/plugin_manager.rb +1 -2
- data/lib/redcar.rb +19 -14
- data/lib/redcar/installer.rb +21 -17
- data/lib/redcar/runner.rb +10 -7
- data/lib/redcar/usage.rb +1 -0
- data/lib/redcar_quick_start.rb +8 -12
- data/lib/regex_replace.rb +3 -3
- data/plugins/application/features/step_definitions/menu_steps.rb +10 -0
- data/plugins/application/features/step_definitions/speedbar_steps.rb +8 -2
- data/plugins/application/features/step_definitions/tree_steps.rb +48 -6
- data/plugins/application/features/step_definitions/window_steps.rb +9 -4
- data/plugins/application/features/support/env.rb +20 -1
- data/plugins/application/features/support/fake_event.rb +14 -0
- data/plugins/application/lib/application.rb +29 -12
- data/plugins/application/lib/application/dialogs/filter_list_dialog.rb +19 -0
- data/plugins/application/lib/application/speedbar.rb +23 -17
- data/plugins/application/lib/application/tab.rb +20 -15
- data/plugins/application/lib/application/treebook.rb +10 -7
- data/plugins/application/lib/application/window.rb +1 -1
- data/plugins/application/plugin.rb +1 -1
- data/plugins/application_swt/lib/application_swt/dialog_adapter.rb +4 -4
- data/plugins/application_swt/lib/application_swt/dialogs/filter_list_dialog_controller.rb +15 -4
- data/plugins/application_swt/lib/application_swt/icon.rb +3 -5
- data/plugins/application_swt/lib/application_swt/notebook/tab_drag_and_drop_listener.rb +4 -4
- data/plugins/application_swt/lib/application_swt/notebook/tab_transfer.rb +5 -5
- data/plugins/application_swt/lib/application_swt/speedbar.rb +34 -120
- data/plugins/application_swt/lib/application_swt/speedbar/button_item.rb +20 -0
- data/plugins/application_swt/lib/application_swt/speedbar/combo_item.rb +38 -0
- data/plugins/application_swt/lib/application_swt/speedbar/label_item.rb +15 -0
- data/plugins/application_swt/lib/application_swt/speedbar/slider_item.rb +32 -0
- data/plugins/application_swt/lib/application_swt/speedbar/text_box_item.rb +36 -0
- data/plugins/application_swt/lib/application_swt/speedbar/toggle_item.rb +29 -0
- data/plugins/application_swt/lib/application_swt/tab.rb +1 -3
- data/plugins/application_swt/lib/application_swt/toolbar.rb +19 -20
- data/plugins/application_swt/lib/application_swt/treebook.rb +24 -9
- data/plugins/application_swt/lib/application_swt/window.rb +110 -98
- data/plugins/application_swt/lib/swt/vtab_folder.rb +77 -32
- data/plugins/application_swt/lib/swt/vtab_item.rb +9 -0
- data/plugins/application_swt/lib/swt/vtab_label.rb +63 -23
- data/plugins/application_swt/plugin.rb +1 -1
- data/plugins/clipboard-viewer/lib/clipboard_viewer/clipboard_bar.rb +2 -2
- data/plugins/comment/features/line_comment.feature +116 -4
- data/plugins/comment/lib/comment.rb +18 -16
- data/plugins/connection_manager/lib/connection_manager/commands.rb +1 -1
- data/plugins/connection_manager/lib/connection_manager/private_key_store.rb +5 -3
- data/plugins/declarations/lib/declarations.rb +1 -1
- data/plugins/declarations/lib/declarations/parser.rb +68 -20
- data/plugins/document_search/features/replace.feature +18 -0
- data/plugins/document_search/lib/document_search.rb +37 -54
- data/plugins/document_search/lib/document_search/replace_all_command.rb +27 -0
- data/plugins/document_search/lib/document_search/replace_command.rb +38 -0
- data/plugins/document_search/lib/document_search/replace_next_command.rb +27 -0
- data/plugins/document_search/lib/document_search/search_and_replace.rb +17 -24
- data/plugins/edit_view/features/step_definitions/editing_steps.rb +4 -4
- data/plugins/edit_view/features/step_definitions/tab_steps.rb +9 -0
- data/plugins/edit_view/features/step_definitions/window_steps.rb +0 -12
- data/plugins/edit_view/lib/edit_view/document.rb +2 -0
- data/plugins/edit_view/lib/edit_view/document/command.rb +8 -8
- data/plugins/edit_view/lib/edit_view/edit_tab.rb +21 -7
- data/plugins/edit_view/lib/edit_view/select_font_dialog.rb +6 -0
- data/plugins/edit_view/lib/edit_view/select_theme_dialog.rb +6 -0
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +92 -43
- data/plugins/edit_view_swt/lib/edit_view_swt/document.rb +17 -4
- data/plugins/find-in-project/lib/find_in_project.rb +1 -4
- data/plugins/find-in-project/lib/find_in_project/commands.rb +0 -14
- data/plugins/find-in-project/lib/find_in_project/controllers.rb +12 -0
- data/plugins/find-in-project/lib/find_in_project/views/index.html.erb +5 -0
- data/plugins/groovy/features/fixtures/test.groovy +0 -0
- data/plugins/groovy/features/step_definitions/groovy_steps.rb +27 -0
- data/plugins/groovy/features/support/env.rb +27 -0
- data/plugins/groovy/features/syntax_check_groovy.feature +72 -0
- data/plugins/groovy/lib/syntax_check/groovy.rb +76 -0
- data/plugins/groovy/plugin.rb +7 -0
- data/plugins/help/lib/help.rb +28 -4
- data/plugins/help/lib/help/help_tab.rb +11 -0
- data/plugins/help/lib/help/view_controller.rb +25 -0
- data/plugins/help/plugin.rb +2 -1
- data/plugins/{view_shortcuts → help}/views/default.css +0 -0
- data/plugins/{view_shortcuts → help}/views/index.html.erb +1 -1
- data/plugins/{view_shortcuts → help}/views/redcar_small_icon.png +0 -0
- data/plugins/html_view/features/browser_bar.feature +47 -0
- data/plugins/html_view/features/fixtures/other.html +1 -0
- data/plugins/html_view/features/fixtures/sample.html +1 -0
- data/plugins/html_view/features/step_definitions/html_view_steps.rb +45 -5
- data/plugins/html_view/features/support/env.rb +26 -0
- data/plugins/html_view/features/web_preview.feature +21 -0
- data/plugins/html_view/lib/html_controller.rb +5 -5
- data/plugins/html_view/lib/html_view.rb +62 -10
- data/plugins/{web_bookmarks/lib/web_bookmarks → html_view/lib/html_view}/browser_bar.rb +32 -20
- data/plugins/html_view/lib/html_view/commands.rb +64 -0
- data/plugins/{web_bookmarks/lib/web_bookmarks/view_controller.rb → html_view/lib/html_view/default_controller.rb} +7 -6
- data/plugins/html_view/lib/html_view/html_tab.rb +17 -6
- data/plugins/html_view/plugin.rb +3 -3
- data/plugins/{web_bookmarks → html_view}/views/index.html.erb +0 -0
- data/plugins/javascript/features/fixtures/test.js +0 -0
- data/plugins/javascript/features/support/env.rb +4 -0
- data/plugins/javascript/features/syntax_check_javascript.feature +27 -0
- data/plugins/javascript/lib/syntax_check/javascript.rb +52 -0
- data/plugins/javascript/plugin.rb +7 -0
- data/plugins/javascript/vendor/jslint.js +539 -0
- data/plugins/macros/lib/macros/commands.rb +3 -3
- data/plugins/open_default_app/lib/open_default_app.rb +29 -3
- data/plugins/open_default_app/plugin.rb +1 -1
- data/plugins/outline_view/features/outline_view.feature +79 -0
- data/plugins/outline_view/features/step_definitions/outline_steps.rb +45 -0
- data/plugins/outline_view/lib/outline_view.rb +1 -1
- data/plugins/outline_view/spec/fixtures/some_project/javascript.js +10 -0
- data/plugins/outline_view/spec/fixtures/some_project/nothing_to_see.rb +0 -0
- data/plugins/outline_view/spec/fixtures/some_project/one_lonely_class.rb +2 -0
- data/plugins/outline_view/spec/fixtures/some_project/similar_names.rb +18 -0
- data/plugins/outline_view/spec/fixtures/some_project/something_fancy.rb +736 -0
- data/plugins/outline_view/spec/fixtures/some_project/trailing_space.rb +5 -0
- data/plugins/outline_view_swt/lib/outline_view_swt.rb +17 -19
- data/plugins/pair_highlighter/lib/pair_highlighter/document_controller.rb +1 -4
- data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +12 -3
- data/plugins/project/features/close_directory_tree.feature +27 -0
- data/plugins/project/features/highlight_focussed_tab.feature +45 -1
- data/plugins/project/features/open_and_save_files.feature +33 -0
- data/plugins/project/features/open_directory_tree.feature +37 -11
- data/plugins/project/features/step_definitions/directory_steps.rb +1 -1
- data/plugins/project/features/step_definitions/drb_steps.rb +40 -0
- data/plugins/project/features/support/env.rb +17 -0
- data/plugins/project/lib/project.rb +12 -2
- data/plugins/project/lib/project/commands.rb +101 -99
- data/plugins/project/lib/project/drb_service.rb +55 -65
- data/plugins/project/lib/project/manager.rb +29 -4
- data/plugins/project/lib/project/project_tree_controller.rb +24 -0
- data/plugins/project/lib/project/support/trash.rb +1 -0
- data/plugins/redcar/redcar.rb +100 -37
- data/plugins/redcar_debug/lib/redcar_debug.rb +3 -3
- data/plugins/repl/features/step_definitions/repl_steps.rb +3 -0
- data/plugins/repl/lib/repl.rb +4 -11
- data/plugins/repl/lib/repl/repl_tab.rb +26 -0
- data/plugins/ruby/features/fixtures/test.rb +0 -0
- data/plugins/ruby/features/support/env.rb +4 -0
- data/plugins/ruby/features/syntax_check_ruby.feature +25 -0
- data/plugins/runnables/features/command_tree.feature +28 -0
- data/plugins/runnables/lib/runnables.rb +1 -0
- data/plugins/runnables/lib/runnables/commands.rb +4 -4
- data/plugins/runnables/lib/runnables/output_processor.rb +5 -5
- data/plugins/runnables/lib/runnables/tree_mirror/tree_controller.rb +2 -7
- data/plugins/runnables/lib/runnables/tree_mirror/tree_mirror.rb +13 -8
- data/plugins/scm_git/lib/scm_git/change.rb +5 -5
- data/plugins/strip_trailing_spaces/features/fixtures/test.txt +3 -0
- data/plugins/strip_trailing_spaces/features/strip_trailing_spaces.feature +34 -0
- data/plugins/strip_trailing_spaces/lib/strip_trailing_spaces.rb +3 -38
- data/plugins/swt/lib/swt.rb +5 -13
- data/plugins/swt/lib/swt/full_swt.rb +15 -13
- data/plugins/syntax_check/features/step_definitions/syntax_check_steps.rb +7 -0
- data/plugins/syntax_check/lib/syntax_check.rb +21 -3
- data/plugins/syntax_check/lib/syntax_check/error.rb +4 -3
- data/plugins/task_manager/lib/task_manager.rb +1 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Preferences/Autocompletions.tmPreferences +345 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Preferences/Symbol List Target.tmPreferences +22 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Snippets/Doc Banner.tmSnippet +20 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/Syntaxes/Ant.tmLanguage +247 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Ant.tmbundle/info.plist +55 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/Syntaxes/GroovyRepl.plist +40 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/RedcarRepl.tmbundle/info.plist +1 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Haml.tmbundle/Syntaxes/Ruby_Haml.tmLanguage +0 -1
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Sass.tmbundle/Syntaxes/Ruby Sass.tmLanguage +626 -0
- data/plugins/textmate/vendor/redcar-bundles/Bundles/Ruby Sass.tmbundle/info.plist +16 -0
- data/plugins/todo_list/features/support/env.rb +8 -0
- data/plugins/todo_list/features/todo_list.feature +26 -0
- data/plugins/todo_list/lib/todo_list.rb +1 -0
- data/plugins/todo_list/lib/todo_list/file_parser.rb +23 -19
- data/plugins/todo_list/lib/todo_list/todo_controller.rb +60 -100
- data/plugins/todo_list/spec/fixtures/project/FIXME.file +3 -0
- data/plugins/todo_list/spec/fixtures/project/NOTE.ignored.file +1 -0
- data/plugins/todo_list/spec/fixtures/project/OPTIMIZE_colon.file +1 -0
- data/plugins/todo_list/spec/fixtures/project/XXX.ignored +1 -0
- data/plugins/todo_list/spec/fixtures/project/ignored_directory/TODO.file +2 -0
- data/plugins/todo_list/spec/fixtures/settings.rb +11 -0
- data/plugins/todo_list/spec/spec_helper.rb +6 -0
- data/plugins/todo_list/spec/todo_list/file_parser_spec.rb +35 -0
- data/plugins/tree/lib/tree.rb +1 -0
- data/plugins/tree/lib/tree/command.rb +5 -0
- data/plugins/web_bookmarks/features/bookmark.feature +37 -0
- data/plugins/web_bookmarks/features/fixtures/other.html +1 -0
- data/plugins/web_bookmarks/features/fixtures/sample.html +1 -0
- data/plugins/web_bookmarks/features/step_definitions/web_steps.rb +4 -0
- data/plugins/web_bookmarks/features/support/env.rb +26 -0
- data/plugins/web_bookmarks/lib/web_bookmarks.rb +0 -10
- data/plugins/web_bookmarks/lib/web_bookmarks/bookmark.rb +10 -1
- data/plugins/web_bookmarks/lib/web_bookmarks/commands.rb +1 -47
- data/plugins/web_bookmarks/lib/web_bookmarks/tree.rb +21 -14
- data/{plugins/application → share}/icons/close.png +0 -0
- data/{plugins/application → share}/icons/darwin-file.png +0 -0
- data/{plugins/application → share}/icons/darwin-folder.png +0 -0
- data/share/icons/open-source-flipped.png +0 -0
- data/{plugins/application/icons/redcar_icon_beta_dev.png → share/icons/redcar-icon-beta-dev.png} +0 -0
- data/{plugins/application/icons/redcar_icon_beta.png → share/icons/redcar-icon-beta.png} +0 -0
- data/{plugins/application → share}/icons/redcar-splash.png +0 -0
- metadata +90 -30
- data/lib/redcar/jvm_options_probe.rb +0 -33
- data/plugins/document_search/lib/document_search/replace.rb +0 -113
- data/plugins/document_search/lib/document_search/search.rb +0 -45
- data/plugins/outline_view_swt/lib/icons/alias.png +0 -0
- data/plugins/outline_view_swt/lib/icons/assignment.png +0 -0
- data/plugins/outline_view_swt/lib/icons/attribute.png +0 -0
- data/plugins/outline_view_swt/lib/icons/class.png +0 -0
- data/plugins/outline_view_swt/lib/icons/interface.png +0 -0
- data/plugins/outline_view_swt/lib/icons/method.png +0 -0
- data/plugins/strip_trailing_spaces/CHANGELOG +0 -12
- data/plugins/strip_trailing_spaces/README.md +0 -32
- data/plugins/view_shortcuts/lib/view_shortcuts.rb +0 -52
- data/plugins/view_shortcuts/plugin.rb +0 -11
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
module Redcar
|
|
2
2
|
class OutlineViewSWT < Redcar::ApplicationSWT::FilterListDialogController
|
|
3
3
|
include Redcar::Controller
|
|
4
|
-
|
|
5
|
-
ICON_PATH = File.expand_path(File.dirname(__FILE__) + "/icons")
|
|
6
|
-
|
|
4
|
+
|
|
7
5
|
ICONS = {
|
|
8
|
-
:method =>
|
|
9
|
-
:class =>
|
|
10
|
-
:attribute =>
|
|
11
|
-
:alias =>
|
|
12
|
-
:assignment =>
|
|
13
|
-
:interface =>
|
|
6
|
+
:method => ApplicationSWT::Icon.swt_image(:node_insert),
|
|
7
|
+
:class => ApplicationSWT::Icon.swt_image(:open_source_flipped),
|
|
8
|
+
:attribute => ApplicationSWT::Icon.swt_image(:status),
|
|
9
|
+
:alias => ApplicationSWT::Icon.swt_image(:arrow_branch),
|
|
10
|
+
:assignment => ApplicationSWT::Icon.swt_image(:arrow),
|
|
11
|
+
:interface => ApplicationSWT::Icon.swt_image(:information),
|
|
12
|
+
:closure => ApplicationSWT::Icon.swt_image(:node_magnifier),
|
|
14
13
|
:none => nil
|
|
15
14
|
}
|
|
16
|
-
|
|
15
|
+
|
|
17
16
|
class OutlineViewDialogSWT < Redcar::ApplicationSWT::FilterListDialogController::FilterListDialog
|
|
18
17
|
attr_reader :list, :text
|
|
19
18
|
attr_accessor :controller
|
|
20
|
-
|
|
19
|
+
|
|
21
20
|
def createDialogArea(parent)
|
|
22
21
|
composite = Swt::Widgets::Composite.new(parent, Swt::SWT::NONE)
|
|
23
22
|
layout = Swt::Layout::RowLayout.new(Swt::SWT::VERTICAL)
|
|
@@ -34,7 +33,7 @@ module Redcar
|
|
|
34
33
|
@list.set_selection(0)
|
|
35
34
|
end
|
|
36
35
|
end
|
|
37
|
-
|
|
36
|
+
|
|
38
37
|
def initialize(model)
|
|
39
38
|
@model = model
|
|
40
39
|
@dialog = OutlineViewDialogSWT.new(Redcar.app.focussed_window.controller.shell)
|
|
@@ -46,7 +45,7 @@ module Redcar
|
|
|
46
45
|
attach_model_listeners
|
|
47
46
|
@associations = {}
|
|
48
47
|
end
|
|
49
|
-
|
|
48
|
+
|
|
50
49
|
def update_list_sync
|
|
51
50
|
if @dialog
|
|
52
51
|
s = Time.now
|
|
@@ -56,13 +55,13 @@ module Redcar
|
|
|
56
55
|
text_focus
|
|
57
56
|
end
|
|
58
57
|
end
|
|
59
|
-
|
|
58
|
+
|
|
60
59
|
def selected
|
|
61
60
|
@model.selected(@associations[@dialog.list.get_selection.first])
|
|
62
61
|
end
|
|
63
|
-
|
|
62
|
+
|
|
64
63
|
private
|
|
65
|
-
|
|
64
|
+
|
|
66
65
|
def populate_table(hash = {})
|
|
67
66
|
@dialog.list.removeAll; @associations.clear
|
|
68
67
|
hash.each do |match, props|
|
|
@@ -70,9 +69,8 @@ module Redcar
|
|
|
70
69
|
item = Swt::Widgets::TableItem.new(@dialog.list, Swt::SWT::NONE)
|
|
71
70
|
@associations[item] = match
|
|
72
71
|
item.text = props[:name]
|
|
73
|
-
|
|
74
|
-
if
|
|
75
|
-
image = Swt::Graphics::Image.new(ApplicationSWT.display, icon)
|
|
72
|
+
image = ICONS[props[:kind].to_sym] if props[:kind]
|
|
73
|
+
if image
|
|
76
74
|
item.image = image
|
|
77
75
|
end
|
|
78
76
|
end
|
|
@@ -75,14 +75,11 @@ module Redcar
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def find_pair(step, offset, search_char, current_char)
|
|
78
|
-
if offset == 0
|
|
79
|
-
return nil
|
|
80
|
-
end
|
|
81
78
|
state = 1;
|
|
82
79
|
quotes = false
|
|
83
80
|
doublequotes = false
|
|
84
81
|
|
|
85
|
-
while offset
|
|
82
|
+
while offset >= 0 and offset < document.length
|
|
86
83
|
offset = offset + step;
|
|
87
84
|
@newchar = styledText.getTextRange(offset, 1)
|
|
88
85
|
if @newchar == search_char and !quotes and !doublequotes
|
|
@@ -12,7 +12,8 @@ module Redcar
|
|
|
12
12
|
sub_menu "Plugins", :priority => 40 do
|
|
13
13
|
group(:priority => :first) {
|
|
14
14
|
item "Plugin Manager", PluginManagerUi::OpenCommand
|
|
15
|
-
item "Reload Plugins", PluginManagerUi::
|
|
15
|
+
item "Reload Plugins", PluginManagerUi::ReloadPluginsCommand
|
|
16
|
+
item "Reload Last Reloaded", PluginManagerUi::ReloadLastReloadedCommand
|
|
16
17
|
separator
|
|
17
18
|
}
|
|
18
19
|
end
|
|
@@ -42,7 +43,14 @@ module Redcar
|
|
|
42
43
|
end
|
|
43
44
|
end
|
|
44
45
|
end
|
|
45
|
-
|
|
46
|
+
|
|
47
|
+
class ReloadPluginsCommand < Redcar::Command
|
|
48
|
+
def execute
|
|
49
|
+
Redcar.add_plugin_sources(Redcar.plugin_manager)
|
|
50
|
+
Redcar.plugin_manager.load_maximal
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
46
54
|
class OpenCommand < Redcar::Command
|
|
47
55
|
class Controller
|
|
48
56
|
include Redcar::HtmlController
|
|
@@ -58,6 +66,7 @@ module Redcar
|
|
|
58
66
|
|
|
59
67
|
def reload_plugin(name)
|
|
60
68
|
plugin = Redcar.plugin_manager.loaded_plugins.detect {|pl| pl.name == name }
|
|
69
|
+
plugin ||= Redcar.plugin_manager.unloaded_plugins.detect {|pl| pl.name == name }
|
|
61
70
|
plugin.load
|
|
62
71
|
Redcar.app.refresh_menu!
|
|
63
72
|
PluginManagerUi.last_reloaded = plugin
|
|
@@ -96,7 +105,7 @@ module Redcar
|
|
|
96
105
|
|
|
97
106
|
def execute
|
|
98
107
|
controller = Controller.new
|
|
99
|
-
tab = win.new_tab(
|
|
108
|
+
tab = win.new_tab(ConfigTab)
|
|
100
109
|
tab.html_view.controller = controller
|
|
101
110
|
tab.focus
|
|
102
111
|
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Feature: Close directory tree
|
|
2
|
+
|
|
3
|
+
Scenario: Close and re-open directory stays in the same window
|
|
4
|
+
Given I will choose "." from the "open_directory" dialog
|
|
5
|
+
When I open a directory
|
|
6
|
+
Then there should be 1 windows
|
|
7
|
+
When I close the directory
|
|
8
|
+
When I open a directory
|
|
9
|
+
Then there should be 1 windows
|
|
10
|
+
|
|
11
|
+
Scenario: Close directory via close icon
|
|
12
|
+
Given I will choose "." from the "open_directory" dialog
|
|
13
|
+
When I open a directory
|
|
14
|
+
And I click the close button
|
|
15
|
+
Then the tree width should be the minimum size
|
|
16
|
+
And the window should have title "Redcar"
|
|
17
|
+
When I open a directory
|
|
18
|
+
Then there should be 1 windows
|
|
19
|
+
|
|
20
|
+
Scenario: Close directory via "Close Tree" menu item
|
|
21
|
+
Given I will choose "." from the "open_directory" dialog
|
|
22
|
+
When I open a directory
|
|
23
|
+
And I close the tree
|
|
24
|
+
Then the tree width should be the minimum size
|
|
25
|
+
And the window should have title "Redcar"
|
|
26
|
+
When I open a directory
|
|
27
|
+
Then there should be 1 windows
|
|
@@ -5,4 +5,48 @@ Feature: Highlight the File of the focussed tab in tree
|
|
|
5
5
|
And I open a directory
|
|
6
6
|
And I have opened "plugins/project/features/highlight_focussed_tab.feature"
|
|
7
7
|
Then there should be one edit tab
|
|
8
|
-
|
|
8
|
+
Then "highlight_focussed_tab.feature" should be selected in the project tree
|
|
9
|
+
|
|
10
|
+
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
|
+
Then "highlight_focussed_tab.feature" should be selected in the project tree
|
|
15
|
+
And I have opened "plugins/project/features/find_file.feature"
|
|
16
|
+
And I have opened "plugins/project/features/move_and_rename_files.feature"
|
|
17
|
+
Then there should be 3 edit tabs
|
|
18
|
+
And "move_and_rename_files.feature" should be selected in the project tree
|
|
19
|
+
And I switch up a tab
|
|
20
|
+
Then "find_file.feature" should be selected in the project tree
|
|
21
|
+
And I switch up a tab
|
|
22
|
+
Then "highlight_focussed_tab.feature" should be selected in the project tree
|
|
23
|
+
|
|
24
|
+
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
|
+
And I have opened "plugins/project/features/find_file.feature"
|
|
29
|
+
And I have opened "plugins/project/features/move_and_rename_files.feature"
|
|
30
|
+
And I have opened "plugins/project/features/sub_project.feature"
|
|
31
|
+
And I make a new notebook
|
|
32
|
+
And I move the tab to the other notebook
|
|
33
|
+
And I move the tab to the other notebook
|
|
34
|
+
And I switch notebooks
|
|
35
|
+
Then "sub_project.feature" should be selected in the project tree
|
|
36
|
+
And I switch up a tab
|
|
37
|
+
Then "move_and_rename_files.feature" should be selected in the project tree
|
|
38
|
+
And I switch notebooks
|
|
39
|
+
Then "find_file.feature" should be selected in the project tree
|
|
40
|
+
|
|
41
|
+
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
|
+
Then there should be one edit tab
|
|
46
|
+
Then "highlight_focussed_tab.feature" should be selected in the project tree
|
|
47
|
+
And I open a "ruby" repl
|
|
48
|
+
Then "highlight_focussed_tab.feature" should be selected in the project tree
|
|
49
|
+
And I open a "clojure" repl
|
|
50
|
+
Then "highlight_focussed_tab.feature" should be selected in the project tree
|
|
51
|
+
And I open a "groovy" repl
|
|
52
|
+
Then "highlight_focussed_tab.feature" should be selected in the project tree
|
|
@@ -6,6 +6,18 @@ Feature: Open and save files
|
|
|
6
6
|
Then there should be one edit tab
|
|
7
7
|
And I should see "Wintersmith" in the edit tab
|
|
8
8
|
|
|
9
|
+
Scenario: Open a file using another Redcar invocation
|
|
10
|
+
Given I open "plugins/project/spec/fixtures/winter.txt" using the redcar command
|
|
11
|
+
Then there should be one edit tab
|
|
12
|
+
And my active tab should be "winter.txt"
|
|
13
|
+
And I should see "Wintersmith" in the edit tab
|
|
14
|
+
|
|
15
|
+
Scenario: Open a new file using a Pipe
|
|
16
|
+
Given I pipe "hi" into redcar
|
|
17
|
+
Then there should be one edit tab
|
|
18
|
+
And my active tab should be "untitled"
|
|
19
|
+
And I should see "hi" in the edit tab
|
|
20
|
+
|
|
9
21
|
Scenario: Opening an already open file focusses the edit tab
|
|
10
22
|
Given I will choose "plugins/project/spec/fixtures/winter.txt" from the "open_file" dialog
|
|
11
23
|
When I open a file
|
|
@@ -29,6 +41,27 @@ Feature: Open and save files
|
|
|
29
41
|
Then the file "plugins/project/spec/fixtures/winter2.txt" should contain "Wintersmith"
|
|
30
42
|
And I should see "Wintersmith" in the edit tab
|
|
31
43
|
|
|
44
|
+
Scenario: Open a file using another Redcar invocation and waiting for the tab to be closed
|
|
45
|
+
Given I open "plugins/project/spec/fixtures/winter.txt" using the redcar command with "-w"
|
|
46
|
+
And I wait "2" seconds
|
|
47
|
+
Then there should be one edit tab
|
|
48
|
+
And my active tab should be "winter.txt"
|
|
49
|
+
And I should see "Wintersmith" in the edit tab
|
|
50
|
+
And the redcar command should not have returned
|
|
51
|
+
Given I close the focussed tab
|
|
52
|
+
Then the redcar command should have returned
|
|
53
|
+
|
|
54
|
+
Scenario: Open a new file using a Pipe and waiting for the tab to be closed
|
|
55
|
+
Given I pipe "hi" into redcar with "-w"
|
|
56
|
+
And I wait "2" seconds
|
|
57
|
+
Then there should be one edit tab
|
|
58
|
+
And my active tab should be "untitled"
|
|
59
|
+
And I should see "hi" in the edit tab
|
|
60
|
+
And the redcar command should not have returned
|
|
61
|
+
Given I will choose "no" from the "message_box" dialog
|
|
62
|
+
And I close the focussed tab
|
|
63
|
+
Then the redcar command should have returned
|
|
64
|
+
|
|
32
65
|
Scenario: Open file in nearest ancestor project window
|
|
33
66
|
Given I will choose "plugins/project/spec" from the "open_directory" dialog
|
|
34
67
|
When I open a directory
|
|
@@ -5,6 +5,10 @@ Feature: Open directory tree
|
|
|
5
5
|
When I open a directory
|
|
6
6
|
Then I should see "bin,lib,plugins" in the tree
|
|
7
7
|
|
|
8
|
+
Scenario: Open a directory using another Redcar invocation
|
|
9
|
+
Given I open "plugins/project/spec/fixtures/myproject" using the redcar command
|
|
10
|
+
Then the window should have title "myproject"
|
|
11
|
+
|
|
8
12
|
Scenario: Open directory then another directory
|
|
9
13
|
Given I will choose "." from the "open_directory" dialog
|
|
10
14
|
When I open a directory
|
|
@@ -12,6 +16,13 @@ Feature: Open directory tree
|
|
|
12
16
|
When I open a directory
|
|
13
17
|
Then I should see "core,application,tree" in the tree
|
|
14
18
|
|
|
19
|
+
Scenario: Open a directory and then the same using another Redcar invocation
|
|
20
|
+
Given I will choose "plugins/project/spec/fixtures/myproject" from the "open_directory" dialog
|
|
21
|
+
When I open a directory
|
|
22
|
+
And I open "plugins/project/spec/fixtures/myproject" using the redcar command
|
|
23
|
+
Then there should be 1 windows
|
|
24
|
+
And the window should have title "myproject"
|
|
25
|
+
|
|
15
26
|
Scenario: Title of window reflects open project
|
|
16
27
|
Given I will choose "plugins/project/spec/fixtures/myproject" from the "open_directory" dialog
|
|
17
28
|
When I open a directory
|
|
@@ -33,29 +44,44 @@ Feature: Open directory tree
|
|
|
33
44
|
When I restore the window size
|
|
34
45
|
Then the tree width should be the default
|
|
35
46
|
|
|
36
|
-
Scenario: Toggle Tree Visibility hides the treebook if the
|
|
47
|
+
Scenario: Toggle Tree Visibility hides the treebook if the tab title is visible, else it opens it
|
|
37
48
|
Given I will choose "plugins/project/spec/fixtures/myproject" from the "open_directory" dialog
|
|
38
49
|
When I open a directory
|
|
39
|
-
|
|
40
|
-
When I toggle tree visibility
|
|
41
|
-
Then the tree width should be 0
|
|
42
|
-
When I manually widen the treebook to show the sash
|
|
50
|
+
And I set the treebook width to the default
|
|
43
51
|
And I toggle tree visibility
|
|
44
|
-
Then the tree width should be
|
|
45
|
-
When I
|
|
52
|
+
Then the tree width should be the minimum size
|
|
53
|
+
When I set the treebook width to only a few pixels
|
|
46
54
|
And I toggle tree visibility
|
|
47
55
|
Then the tree width should be the default
|
|
48
56
|
|
|
49
57
|
Scenario: Treebook becomes visible if hidden and another tree is opened
|
|
50
58
|
Given I will choose "plugins/project/spec/fixtures/myproject" from the "open_directory" dialog
|
|
51
59
|
When I open a directory
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Then the tree width should be
|
|
60
|
+
And I set the treebook width to the default
|
|
61
|
+
And I toggle tree visibility
|
|
62
|
+
Then the tree width should be the minimum size
|
|
55
63
|
When I open the runnables tree
|
|
56
64
|
Then the tree width should be the default
|
|
57
65
|
And I toggle tree visibility
|
|
58
|
-
Then the tree width should be
|
|
66
|
+
Then the tree width should be the minimum size
|
|
67
|
+
|
|
68
|
+
Scenario: Treebooks should keep open to their previous open width
|
|
69
|
+
Given I will choose "plugins/project/spec/fixtures/myproject" from the "open_directory" dialog
|
|
70
|
+
When I open a directory
|
|
71
|
+
When I set the treebook width to the default
|
|
72
|
+
And I set the treebook width to 50 pixels
|
|
73
|
+
And I toggle tree visibility
|
|
74
|
+
Then the tree width should be the minimum size
|
|
75
|
+
When I toggle tree visibility
|
|
76
|
+
Then the tree width should be 50 pixels
|
|
77
|
+
When I set the treebook width to 250 pixels
|
|
78
|
+
And I toggle tree visibility
|
|
79
|
+
And I toggle tree visibility
|
|
80
|
+
Then the tree width should be 250 pixels
|
|
81
|
+
When I toggle tree visibility
|
|
82
|
+
And I set the treebook width to 35 pixels
|
|
83
|
+
And I toggle tree visibility
|
|
84
|
+
Then the tree width should be the minimum size
|
|
59
85
|
|
|
60
86
|
# RSpec matchers have trouble with the multibyte string
|
|
61
87
|
# Scenario: Multibyte files and directories
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
require 'timeout'
|
|
2
|
+
require 'drb'
|
|
3
|
+
|
|
4
|
+
def drb
|
|
5
|
+
DRbObject.new(nil, "druby://127.0.0.1:#{Redcar::DRB_PORT}")
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def tempfile(text)
|
|
9
|
+
f = Tempfile.open("drb_testing")
|
|
10
|
+
f << text
|
|
11
|
+
f.close
|
|
12
|
+
f.path
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Given /^I open "([^"]*)" using the redcar command$/ do |path|
|
|
16
|
+
drb_answer = drb.open_item_drb(File.expand_path(path))
|
|
17
|
+
drb_answer.should == "ok"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Given /^I open "([^"]*)" using the redcar command with "-w"$/ do |path|
|
|
21
|
+
DrbShelloutHelper.drb_system_thread = Thread.new(path) do
|
|
22
|
+
drb_answer = drb.open_item_drb(File.expand_path(path), false, true)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
Given /^I pipe "([^"]*)" into redcar with "-w"$/ do |text|
|
|
27
|
+
DrbShelloutHelper.drb_system_thread = Thread.new(text) do
|
|
28
|
+
drb_answer = drb.open_item_drb(tempfile(text), true, true)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
Given /^I pipe "([^"]*)" into redcar$/ do |text|
|
|
33
|
+
drb_answer = drb.open_item_drb(tempfile(text), true)
|
|
34
|
+
drb_answer.should == "ok"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
Then /^the redcar command should (not )?have returned$/ do |returned|
|
|
38
|
+
(!!DrbShelloutHelper.drb_system_thread.status).should be !!returned # status is false for returned thread
|
|
39
|
+
end
|
|
40
|
+
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
module DrbShelloutHelper
|
|
3
|
+
def self.drb_system_thread
|
|
4
|
+
$drb_system_thread
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def self.drb_system_thread= value
|
|
8
|
+
$drb_system_thread = value
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.kill_thread
|
|
12
|
+
if !($drb_system_thread.nil?) and $drb_system_thread.status
|
|
13
|
+
$drb_system_thread.kill
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
2
18
|
def fixtures_path
|
|
3
19
|
File.expand_path(File.dirname(__FILE__) + "/../../spec/fixtures")
|
|
4
20
|
end
|
|
@@ -36,4 +52,5 @@ end
|
|
|
36
52
|
After do
|
|
37
53
|
reset_project_fixtures
|
|
38
54
|
delete_subproject_fixtures
|
|
55
|
+
DrbShelloutHelper.kill_thread
|
|
39
56
|
end
|
|
@@ -22,6 +22,7 @@ require "project/support/trash"
|
|
|
22
22
|
require "project/commands"
|
|
23
23
|
require "project/dir_mirror"
|
|
24
24
|
require "project/dir_controller"
|
|
25
|
+
require "project/project_tree_controller"
|
|
25
26
|
require "project/drb_service"
|
|
26
27
|
require "project/file_list"
|
|
27
28
|
require "project/file_mirror"
|
|
@@ -96,9 +97,14 @@ module Redcar
|
|
|
96
97
|
end
|
|
97
98
|
|
|
98
99
|
def attach_listeners
|
|
100
|
+
attach_notebook_listeners
|
|
101
|
+
window.treebook.add_listener(:tree_removed, &method(:tree_removed))
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def attach_notebook_listeners
|
|
99
105
|
window.add_listener(:notebook_focussed, &method(:notebook_focussed))
|
|
100
|
-
window.add_listener(:
|
|
101
|
-
window.add_listener(:
|
|
106
|
+
window.add_listener(:notebook_removed, &method(:notebook_closed))
|
|
107
|
+
window.add_listener(:new_notebook, &method(:notebook_added))
|
|
102
108
|
if notebooks = window.notebooks
|
|
103
109
|
notebooks.each do |nb|
|
|
104
110
|
notebook_added(nb)
|
|
@@ -120,6 +126,10 @@ module Redcar
|
|
|
120
126
|
@listeners.delete(notebook)
|
|
121
127
|
end
|
|
122
128
|
|
|
129
|
+
def tree_removed(tree)
|
|
130
|
+
close if tree == @tree
|
|
131
|
+
end
|
|
132
|
+
|
|
123
133
|
# Refresh the DirMirror Tree for the given Window, if
|
|
124
134
|
# there is one.
|
|
125
135
|
def refresh
|