redcar 0.3.7.1 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +16 -0
- data/README.md +5 -0
- data/ROADMAP.md +7 -9
- data/Rakefile +55 -22
- data/lib/redcar.rb +12 -6
- data/lib/redcar/installer.rb +119 -44
- data/plugins/application/features/step_definitions/speedbar_steps.rb +62 -0
- data/plugins/application/features/step_definitions/tree_steps.rb +3 -3
- data/plugins/application/features/support/env.rb +2 -1
- data/plugins/application/lib/application/notebook.rb +53 -7
- data/plugins/application/lib/application/speedbar.rb +12 -0
- data/plugins/application/lib/application/tab.rb +16 -5
- data/plugins/application/lib/application/treebook.rb +21 -1
- data/plugins/application_swt/lib/application_swt.rb +12 -2
- data/plugins/application_swt/lib/application_swt/html_tab.rb +4 -0
- data/plugins/application_swt/lib/application_swt/notebook.rb +5 -3
- data/plugins/application_swt/lib/application_swt/speedbar.rb +15 -27
- data/plugins/application_swt/lib/application_swt/swt_wrapper.rb +1 -0
- data/plugins/application_swt/lib/application_swt/tab.rb +1 -0
- data/plugins/application_swt/lib/application_swt/treebook.rb +36 -8
- data/plugins/application_swt/lib/application_swt/window.rb +24 -18
- data/plugins/auto_completer/lib/auto_completer.rb +5 -20
- data/plugins/core/lib/core.rb +7 -4
- data/plugins/core/lib/core/observable_struct.rb +2 -2
- data/plugins/declarations/lib/declarations.rb +3 -17
- data/plugins/document_search/features/search.feature +163 -0
- data/plugins/document_search/features/support/env.rb +4 -0
- data/plugins/document_search/lib/document_search.rb +121 -0
- data/plugins/document_search/plugin.rb +8 -0
- data/plugins/edit_view/features/line_delimiter.feature +7 -0
- data/plugins/edit_view/features/step_definitions/editing_steps.rb +49 -1
- data/plugins/edit_view/features/step_definitions/tab_steps.rb +10 -11
- data/plugins/edit_view/features/switch_tabs.feature +61 -10
- data/plugins/edit_view/lib/edit_view.rb +4 -0
- data/plugins/edit_view/lib/edit_view/document.rb +56 -0
- data/plugins/edit_view/lib/edit_view/document/command.rb +1 -1
- data/plugins/edit_view/lib/edit_view/edit_tab.rb +0 -8
- data/plugins/edit_view_swt/lib/edit_view_swt.rb +4 -0
- data/plugins/html_view/lib/html_controller.rb +19 -1
- data/plugins/html_view/lib/html_view.rb +28 -1
- data/plugins/html_view/lib/html_view/html_tab.rb +10 -1
- data/plugins/plugin_manager_ui/lib/plugin_manager_ui.rb +3 -1
- data/plugins/project/features/open_directory_tree.feature +3 -3
- data/plugins/project/lib/project.rb +4 -6
- data/plugins/project/lib/project/commands.rb +17 -0
- data/plugins/project/lib/project/dir_controller.rb +2 -1
- data/plugins/project/lib/project/dir_mirror.rb +8 -0
- data/plugins/project/lib/project/manager.rb +2 -0
- data/plugins/project/plugin.rb +2 -1
- data/plugins/project/vendor/net-sftp/Manifest +55 -0
- data/plugins/project/vendor/net-sftp/Rakefile +30 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp.rb +70 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/constants.rb +187 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/errors.rb +39 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/dir.rb +93 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/download.rb +364 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/file.rb +176 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/file_factory.rb +60 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/operations/upload.rb +387 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/packet.rb +21 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol.rb +32 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/attributes.rb +315 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/base.rb +268 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/01/name.rb +43 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/02/base.rb +31 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/03/base.rb +35 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/attributes.rb +152 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/base.rb +94 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/04/name.rb +67 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/05/base.rb +66 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/06/attributes.rb +107 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/06/base.rb +63 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/protocol/base.rb +50 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/request.rb +91 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/response.rb +76 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/session.rb +951 -0
- data/plugins/project/vendor/net-sftp/lib/net/sftp/version.rb +18 -0
- data/plugins/project/vendor/net-sftp/setup.rb +1331 -0
- data/plugins/project/vendor/net-sftp/test/common.rb +171 -0
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_attributes.rb +97 -0
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_base.rb +210 -0
- data/plugins/project/vendor/net-sftp/test/protocol/01/test_name.rb +27 -0
- data/plugins/project/vendor/net-sftp/test/protocol/02/test_base.rb +26 -0
- data/plugins/project/vendor/net-sftp/test/protocol/03/test_base.rb +27 -0
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_attributes.rb +148 -0
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_base.rb +74 -0
- data/plugins/project/vendor/net-sftp/test/protocol/04/test_name.rb +53 -0
- data/plugins/project/vendor/net-sftp/test/protocol/05/test_base.rb +62 -0
- data/plugins/project/vendor/net-sftp/test/protocol/06/test_attributes.rb +124 -0
- data/plugins/project/vendor/net-sftp/test/protocol/06/test_base.rb +51 -0
- data/plugins/project/vendor/net-sftp/test/protocol/test_base.rb +42 -0
- data/plugins/project/vendor/net-sftp/test/test_all.rb +7 -0
- data/plugins/project/vendor/net-sftp/test/test_dir.rb +47 -0
- data/plugins/project/vendor/net-sftp/test/test_download.rb +252 -0
- data/plugins/project/vendor/net-sftp/test/test_file.rb +159 -0
- data/plugins/project/vendor/net-sftp/test/test_file_factory.rb +48 -0
- data/plugins/project/vendor/net-sftp/test/test_packet.rb +9 -0
- data/plugins/project/vendor/net-sftp/test/test_protocol.rb +17 -0
- data/plugins/project/vendor/net-sftp/test/test_request.rb +71 -0
- data/plugins/project/vendor/net-sftp/test/test_response.rb +53 -0
- data/plugins/project/vendor/net-sftp/test/test_session.rb +741 -0
- data/plugins/project/vendor/net-sftp/test/test_upload.rb +219 -0
- data/plugins/project/vendor/net-ssh/Manifest +110 -0
- data/plugins/project/vendor/net-ssh/Rakefile +85 -0
- data/plugins/project/vendor/net-ssh/Rudyfile +96 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh.rb +215 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/agent.rb +179 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/constants.rb +18 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/key_manager.rb +193 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/abstract.rb +60 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/hostbased.rb +71 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/keyboard_interactive.rb +66 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/password.rb +39 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/methods/publickey.rb +92 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/pageant.rb +183 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/authentication/session.rb +134 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/buffer.rb +340 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/buffered_io.rb +198 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/config.rb +202 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/channel.rb +630 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/constants.rb +33 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/session.rb +597 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/connection/term.rb +178 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/errors.rb +85 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/key_factory.rb +102 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/known_hosts.rb +129 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/loggable.rb +61 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/packet.rb +102 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/prompt.rb +93 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/command.rb +75 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/errors.rb +14 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/http.rb +94 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/socks4.rb +70 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/proxy/socks5.rb +142 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/ruby_compat.rb +43 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/service/forward.rb +288 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test.rb +89 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/channel.rb +129 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/extensions.rb +152 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/kex.rb +44 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/local_packet.rb +51 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/packet.rb +81 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/remote_packet.rb +38 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/script.rb +157 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/test/socket.rb +64 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/algorithms.rb +384 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/cipher_factory.rb +97 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/constants.rb +30 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac.rb +31 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/abstract.rb +79 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/md5.rb +12 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/none.rb +15 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/sha1.rb +13 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/identity_cipher.rb +55 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex.rb +13 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +208 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +77 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/openssl.rb +128 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/packet_stream.rb +235 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/server_version.rb +71 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/session.rb +276 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/transport/state.rb +206 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/lenient.rb +30 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/null.rb +12 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/verifiers/strict.rb +53 -0
- data/plugins/project/vendor/net-ssh/lib/net/ssh/version.rb +62 -0
- data/plugins/project/vendor/net-ssh/net-ssh.gemspec +138 -0
- data/plugins/project/vendor/net-ssh/setup.rb +1585 -0
- data/plugins/project/vendor/net-ssh/support/arcfour_check.rb +20 -0
- data/plugins/project/vendor/net-ssh/support/ssh_tunnel_bug.rb +65 -0
- data/plugins/project/vendor/net-ssh/test/README.txt +42 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/common.rb +28 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_abstract.rb +51 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_hostbased.rb +114 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_keyboard_interactive.rb +98 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_password.rb +50 -0
- data/plugins/project/vendor/net-ssh/test/authentication/methods/test_publickey.rb +127 -0
- data/plugins/project/vendor/net-ssh/test/authentication/test_agent.rb +205 -0
- data/plugins/project/vendor/net-ssh/test/authentication/test_key_manager.rb +105 -0
- data/plugins/project/vendor/net-ssh/test/authentication/test_session.rb +93 -0
- data/plugins/project/vendor/net-ssh/test/common.rb +107 -0
- data/plugins/project/vendor/net-ssh/test/configs/eqsign +3 -0
- data/plugins/project/vendor/net-ssh/test/configs/exact_match +8 -0
- data/plugins/project/vendor/net-ssh/test/configs/host_plus +10 -0
- data/plugins/project/vendor/net-ssh/test/configs/multihost +4 -0
- data/plugins/project/vendor/net-ssh/test/configs/nohost +19 -0
- data/plugins/project/vendor/net-ssh/test/configs/numeric_host +4 -0
- data/plugins/project/vendor/net-ssh/test/configs/wild_cards +14 -0
- data/plugins/project/vendor/net-ssh/test/connection/test_channel.rb +467 -0
- data/plugins/project/vendor/net-ssh/test/connection/test_session.rb +488 -0
- data/plugins/project/vendor/net-ssh/test/manual/test_forward.rb +185 -0
- data/plugins/project/vendor/net-ssh/test/test_all.rb +9 -0
- data/plugins/project/vendor/net-ssh/test/test_buffer.rb +336 -0
- data/plugins/project/vendor/net-ssh/test/test_buffered_io.rb +63 -0
- data/plugins/project/vendor/net-ssh/test/test_config.rb +117 -0
- data/plugins/project/vendor/net-ssh/test/test_key_factory.rb +67 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_md5.rb +39 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_md5_96.rb +25 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_none.rb +34 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_sha1.rb +34 -0
- data/plugins/project/vendor/net-ssh/test/transport/hmac/test_sha1_96.rb +25 -0
- data/plugins/project/vendor/net-ssh/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
- data/plugins/project/vendor/net-ssh/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_algorithms.rb +302 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_cipher_factory.rb +213 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_hmac.rb +34 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_identity_cipher.rb +40 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_packet_stream.rb +441 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_server_version.rb +78 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_session.rb +315 -0
- data/plugins/project/vendor/net-ssh/test/transport/test_state.rb +173 -0
- data/plugins/redcar/plugin.rb +3 -1
- data/plugins/redcar/redcar.rb +108 -121
- data/plugins/redcar_debug/lib/redcar_debug.rb +2 -0
- data/plugins/runnables/lib/runnables.rb +80 -23
- data/plugins/runnables/lib/runnables/command_output_controller.rb +102 -0
- data/plugins/runnables/lib/runnables/running_process_checker.rb +34 -0
- data/plugins/runnables/{plugin_no_load.rb → plugin.rb} +2 -1
- data/plugins/runnables/vendor/session-2.4.0/HISTORY +73 -0
- data/plugins/runnables/vendor/session-2.4.0/README +89 -0
- data/plugins/runnables/vendor/session-2.4.0/TODO +3 -0
- data/plugins/runnables/vendor/session-2.4.0/VERSION +1 -0
- data/plugins/runnables/vendor/session-2.4.0/gemspec.rb +22 -0
- data/plugins/runnables/vendor/session-2.4.0/install.rb +143 -0
- data/plugins/runnables/vendor/session-2.4.0/lib/session.rb +757 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/bash.rb +60 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/driver.rb +47 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/session_idl.rb +25 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/session_sh.rb +29 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/sh0.rb +23 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/stdin.rb +17 -0
- data/plugins/runnables/vendor/session-2.4.0/sample/threadtest.rb +42 -0
- data/plugins/runnables/vendor/session-2.4.0/session-2.4.0.gem +0 -0
- data/plugins/runnables/vendor/session-2.4.0/test/session.rb +227 -0
- data/plugins/runnables/views/command_output.html.erb +32 -0
- data/plugins/task_manager/lib/task_manager.rb +2 -0
- data/plugins/textmate/lib/textmate/plist.rb +1 -1
- data/plugins/textmate/lib/textmate/snippet.rb +1 -0
- data/plugins/tree/lib/tree/mirror.rb +8 -1
- data/plugins/tree_view_swt/lib/tree_view_swt.rb +29 -2
- metadata +191 -6
- data/plugins/declarations/TODO +0 -3
- data/plugins/redcar/spec/redcar/redcar_spec.rb +0 -70
- data/plugins/redcar/spec/spec_helper.rb +0 -4
data/plugins/redcar/plugin.rb
CHANGED
data/plugins/redcar/redcar.rb
CHANGED
@@ -17,13 +17,37 @@ module Redcar
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
def self.update_gui
|
21
|
+
ApplicationSWT.sync_exec do
|
22
|
+
safely do
|
23
|
+
yield
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
20
28
|
module Top
|
21
29
|
class QuitCommand < Command
|
22
30
|
|
23
31
|
def execute
|
32
|
+
check_for_modified_tabs_and_quit
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def check_for_modified_tabs_and_quit
|
24
38
|
EditView::ModifiedTabsChecker.new(
|
25
39
|
Redcar.app.all_tabs.select {|t| t.is_a?(EditTab)},
|
26
40
|
"Save all before quitting?",
|
41
|
+
:none => lambda { check_for_running_processes_and_quit },
|
42
|
+
:continue => lambda { check_for_running_processes_and_quit },
|
43
|
+
:cancel => nil
|
44
|
+
).check
|
45
|
+
end
|
46
|
+
|
47
|
+
def check_for_running_processes_and_quit
|
48
|
+
Runnables::RunningProcessChecker.new(
|
49
|
+
Redcar.app.all_tabs.select {|t| t.is_a?(HtmlTab)},
|
50
|
+
"Kill all and quit?",
|
27
51
|
:none => lambda { Redcar.app.quit },
|
28
52
|
:continue => lambda { Redcar.app.quit },
|
29
53
|
:cancel => nil
|
@@ -90,6 +114,16 @@ module Redcar
|
|
90
114
|
EditView::ModifiedTabsChecker.new(
|
91
115
|
win.notebooks.map(&:tabs).flatten.select {|t| t.is_a?(EditTab)},
|
92
116
|
"Save all before closing the window?",
|
117
|
+
:none => lambda { check_for_running_processes_and_close_window },
|
118
|
+
:continue => lambda { check_for_running_processes_and_close_window },
|
119
|
+
:cancel => nil
|
120
|
+
).check
|
121
|
+
end
|
122
|
+
|
123
|
+
def check_for_running_processes_and_close_window
|
124
|
+
Runnables::RunningProcessChecker.new(
|
125
|
+
win.notebooks.map(&:tabs).flatten.select {|t| t.is_a?(HtmlTab)},
|
126
|
+
"Kill them and close the window?",
|
93
127
|
:none => lambda { win.close },
|
94
128
|
:continue => lambda { win.close },
|
95
129
|
:cancel => nil
|
@@ -156,6 +190,14 @@ module Redcar
|
|
156
190
|
end
|
157
191
|
end
|
158
192
|
|
193
|
+
class CloseTreeCommand < Command
|
194
|
+
def execute
|
195
|
+
treebook = Redcar.app.focussed_window.treebook
|
196
|
+
tree = treebook.focussed_tree
|
197
|
+
treebook.remove_tree(tree)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
159
201
|
class AboutCommand < Command
|
160
202
|
def execute
|
161
203
|
new_tab = Top::NewCommand.new.run
|
@@ -219,6 +261,22 @@ module Redcar
|
|
219
261
|
else
|
220
262
|
close_tab
|
221
263
|
end
|
264
|
+
elsif tab.is_a?(HtmlTab)
|
265
|
+
if tab.html_view.controller and message = tab.html_view.controller.ask_before_closing
|
266
|
+
result = Application::Dialog.message_box(
|
267
|
+
message,
|
268
|
+
:buttons => :yes_no_cancel
|
269
|
+
)
|
270
|
+
case result
|
271
|
+
when :yes
|
272
|
+
close_tab
|
273
|
+
when :no
|
274
|
+
close_tab
|
275
|
+
when :cancel
|
276
|
+
end
|
277
|
+
else
|
278
|
+
close_tab
|
279
|
+
end
|
222
280
|
else
|
223
281
|
close_tab
|
224
282
|
end
|
@@ -251,6 +309,20 @@ module Redcar
|
|
251
309
|
end
|
252
310
|
end
|
253
311
|
|
312
|
+
class MoveTabUpCommand < Command
|
313
|
+
|
314
|
+
def execute
|
315
|
+
win.focussed_notebook.move_up
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
class MoveTabDownCommand < Command
|
320
|
+
|
321
|
+
def execute
|
322
|
+
win.focussed_notebook.move_down
|
323
|
+
end
|
324
|
+
end
|
325
|
+
|
254
326
|
class UndoCommand < EditTabCommand
|
255
327
|
sensitize :undoable
|
256
328
|
|
@@ -307,7 +379,7 @@ module Redcar
|
|
307
379
|
if line_ix == doc.line_count - 1
|
308
380
|
doc.cursor_offset = doc.length
|
309
381
|
else
|
310
|
-
doc.cursor_offset = doc.offset_at_line(line_ix + 1) -
|
382
|
+
doc.cursor_offset = doc.offset_at_line(line_ix + 1) - doc.delim.length
|
311
383
|
end
|
312
384
|
doc.ensure_visible(doc.cursor_offset)
|
313
385
|
end
|
@@ -393,7 +465,7 @@ module Redcar
|
|
393
465
|
class SelectAllCommand < Redcar::EditTabCommand
|
394
466
|
|
395
467
|
def execute
|
396
|
-
doc.
|
468
|
+
doc.select_all
|
397
469
|
end
|
398
470
|
end
|
399
471
|
|
@@ -405,6 +477,14 @@ module Redcar
|
|
405
477
|
end
|
406
478
|
end
|
407
479
|
|
480
|
+
class SelectWordCommand < Redcar::EditTabCommand
|
481
|
+
|
482
|
+
def execute
|
483
|
+
range = doc.current_word_range
|
484
|
+
doc.set_selection_range(range.first, range.last)
|
485
|
+
end
|
486
|
+
end
|
487
|
+
|
408
488
|
class CutCommand < Redcar::DocumentCommand
|
409
489
|
|
410
490
|
def execute
|
@@ -544,115 +624,6 @@ module Redcar
|
|
544
624
|
end
|
545
625
|
end
|
546
626
|
|
547
|
-
class SearchForwardCommand < Redcar::EditTabCommand
|
548
|
-
|
549
|
-
class SearchSpeedbar < Redcar::Speedbar
|
550
|
-
class << self
|
551
|
-
attr_accessor :previous_query
|
552
|
-
attr_accessor :previous_is_regex
|
553
|
-
attr_accessor :previous_match_case
|
554
|
-
end
|
555
|
-
|
556
|
-
def after_draw
|
557
|
-
self.query.value = SearchSpeedbar.previous_query || ""
|
558
|
-
self.is_regex.value = SearchSpeedbar.previous_is_regex
|
559
|
-
self.match_case.value = SearchSpeedbar.previous_match_case
|
560
|
-
self.query.edit_view.document.select_all
|
561
|
-
end
|
562
|
-
|
563
|
-
label :label, "Search:"
|
564
|
-
textbox :query
|
565
|
-
|
566
|
-
toggle :is_regex, 'Regex', nil, false do |v|
|
567
|
-
# v is true or false
|
568
|
-
SearchSpeedbar.previous_is_regex = v
|
569
|
-
end
|
570
|
-
|
571
|
-
toggle :match_case, 'Match case', nil, false do |v|
|
572
|
-
SearchSpeedbar.previous_match_case = v
|
573
|
-
end
|
574
|
-
|
575
|
-
button :search, "Search", "Return" do
|
576
|
-
SearchSpeedbar.previous_query = query.value
|
577
|
-
SearchSpeedbar.previous_match_case = match_case.value
|
578
|
-
SearchSpeedbar.previous_is_regex = is_regex.value
|
579
|
-
success = SearchSpeedbar.repeat_query
|
580
|
-
end
|
581
|
-
|
582
|
-
def self.repeat_query
|
583
|
-
current_query = @previous_query
|
584
|
-
if !@previous_is_regex
|
585
|
-
current_query = Regexp.escape(current_query)
|
586
|
-
end
|
587
|
-
FindNextRegex.new(Regexp.new(current_query, !@previous_match_case), true).run
|
588
|
-
end
|
589
|
-
end
|
590
|
-
|
591
|
-
def execute
|
592
|
-
@speedbar = SearchSpeedbar.new
|
593
|
-
win.open_speedbar(@speedbar)
|
594
|
-
end
|
595
|
-
|
596
|
-
end
|
597
|
-
|
598
|
-
class RepeatPreviousSearchForwardCommand < Redcar::EditTabCommand
|
599
|
-
def execute
|
600
|
-
SearchForwardCommand::SearchSpeedbar.repeat_query
|
601
|
-
end
|
602
|
-
end
|
603
|
-
|
604
|
-
class FindNextRegex < Redcar::EditTabCommand
|
605
|
-
def initialize(re, wrap=nil)
|
606
|
-
@re = re
|
607
|
-
@wrap = wrap
|
608
|
-
end
|
609
|
-
|
610
|
-
def to_s
|
611
|
-
"<#{self.class}: @re:#{@re.inspect} wrap:#{!!@wrap}>"
|
612
|
-
end
|
613
|
-
|
614
|
-
def execute
|
615
|
-
# first search the remainder of the current line
|
616
|
-
curr_line = doc.get_line(doc.cursor_line)
|
617
|
-
cursor_line_offset = doc.cursor_offset - doc.offset_at_line(doc.cursor_line)
|
618
|
-
curr_line = curr_line[cursor_line_offset..-1]
|
619
|
-
if curr_line =~ @re
|
620
|
-
line_start = doc.offset_at_line(doc.cursor_line)
|
621
|
-
startoff = line_start + $`.length + cursor_line_offset
|
622
|
-
endoff = startoff + $&.length
|
623
|
-
doc.set_selection_range(endoff, startoff)
|
624
|
-
elsif doc.cursor_line < doc.line_count - 1
|
625
|
-
# next search the rest of the lines
|
626
|
-
found_line_offset = nil
|
627
|
-
found_line_num = nil
|
628
|
-
found_length = nil
|
629
|
-
line_nums = ((doc.cursor_line() + 1)..(doc.line_count() - 1)).to_a # the rest of the document
|
630
|
-
if @wrap
|
631
|
-
line_nums += (0..doc.cursor_line()).to_a
|
632
|
-
end
|
633
|
-
for line_num in line_nums do
|
634
|
-
curr_line = doc.get_line(line_num)
|
635
|
-
if new_offset = (curr_line.to_s =~ @re)
|
636
|
-
found_line_offset = new_offset
|
637
|
-
found_line_num = line_num
|
638
|
-
found_length = $&.length
|
639
|
-
break
|
640
|
-
end
|
641
|
-
end
|
642
|
-
if found_line_num
|
643
|
-
line_start = doc.offset_at_line(found_line_num)
|
644
|
-
startoff = line_start + found_line_offset
|
645
|
-
endoff = startoff + found_length
|
646
|
-
doc.scroll_to_line(found_line_num)
|
647
|
-
doc.set_selection_range(endoff, startoff)
|
648
|
-
true
|
649
|
-
else
|
650
|
-
false
|
651
|
-
end
|
652
|
-
end
|
653
|
-
end
|
654
|
-
end
|
655
|
-
|
656
627
|
class ToggleBlockSelectionCommand < Redcar::EditTabCommand
|
657
628
|
|
658
629
|
def execute
|
@@ -722,6 +693,7 @@ module Redcar
|
|
722
693
|
link "Cmd+Shift+O", Project::DirectoryOpenCommand
|
723
694
|
link "Cmd+S", Project::FileSaveCommand
|
724
695
|
link "Cmd+Shift+S", Project::FileSaveAsCommand
|
696
|
+
link "Cmd+Ctrl+R", Project::RevealInProjectCommand
|
725
697
|
link "Cmd+W", CloseTabCommand
|
726
698
|
link "Cmd+Shift+W", CloseWindowCommand
|
727
699
|
link "Cmd+Q", QuitCommand
|
@@ -743,9 +715,10 @@ module Redcar
|
|
743
715
|
link "Cmd+]", IncreaseIndentCommand
|
744
716
|
link "Cmd+Shift+I", AutoIndenter::IndentCommand
|
745
717
|
link "Cmd+L", GotoLineCommand
|
746
|
-
link "Cmd+F", SearchForwardCommand
|
747
|
-
link "Cmd+
|
718
|
+
link "Cmd+F", DocumentSearch::SearchForwardCommand
|
719
|
+
link "Cmd+Shift+F", DocumentSearch::RepeatPreviousSearchForwardCommand
|
748
720
|
link "Cmd+A", SelectAllCommand
|
721
|
+
link "Ctrl+W", SelectWordCommand
|
749
722
|
link "Cmd+B", ToggleBlockSelectionCommand
|
750
723
|
#link "Escape", AutoCompleter::AutoCompleteCommand
|
751
724
|
link "Ctrl+Escape", AutoCompleter::MenuAutoCompleterCommand
|
@@ -755,6 +728,9 @@ module Redcar
|
|
755
728
|
link "Cmd+Alt+O", SwitchNotebookCommand
|
756
729
|
link "Cmd+Shift+[", SwitchTabDownCommand
|
757
730
|
link "Cmd+Shift+]", SwitchTabUpCommand
|
731
|
+
link "Ctrl+Shift+[", MoveTabDownCommand
|
732
|
+
link "Ctrl+Shift+]", MoveTabUpCommand
|
733
|
+
link "Ctrl+R", Runnables::RunEditTabCommand
|
758
734
|
|
759
735
|
link "Ctrl+Shift+P", PrintScopeCommand
|
760
736
|
|
@@ -778,6 +754,7 @@ module Redcar
|
|
778
754
|
link "Ctrl+Shift+O", Project::DirectoryOpenCommand
|
779
755
|
link "Ctrl+S", Project::FileSaveCommand
|
780
756
|
link "Ctrl+Shift+S", Project::FileSaveAsCommand
|
757
|
+
link "Ctrl+Shift+R", Project::RevealInProjectCommand
|
781
758
|
link "Ctrl+W", CloseTabCommand
|
782
759
|
link "Ctrl+Shift+W", CloseWindowCommand
|
783
760
|
link "Ctrl+Q", QuitCommand
|
@@ -799,22 +776,26 @@ module Redcar
|
|
799
776
|
link "Ctrl+]", IncreaseIndentCommand
|
800
777
|
link "Ctrl+Shift+[", AutoIndenter::IndentCommand
|
801
778
|
link "Ctrl+L", GotoLineCommand
|
802
|
-
link "Ctrl+F", SearchForwardCommand
|
803
|
-
link "F3", RepeatPreviousSearchForwardCommand
|
779
|
+
link "Ctrl+F", DocumentSearch::SearchForwardCommand
|
780
|
+
link "F3", DocumentSearch::RepeatPreviousSearchForwardCommand
|
804
781
|
link "Ctrl+A", SelectAllCommand
|
782
|
+
link "Ctrl+Alt+W", SelectWordCommand
|
805
783
|
link "Ctrl+B", ToggleBlockSelectionCommand
|
806
784
|
link "Ctrl+Space", AutoCompleter::AutoCompleteCommand
|
807
785
|
link "Ctrl+Shift+Space", AutoCompleter::MenuAutoCompleterCommand
|
808
786
|
|
809
787
|
link "Ctrl+T", Project::FindFileCommand
|
810
788
|
link "Ctrl+Shift+Alt+O", MoveTabToOtherNotebookCommand
|
789
|
+
link "Ctrl+R", Runnables::RunEditTabCommand
|
811
790
|
|
812
791
|
link "Ctrl+Shift+P", PrintScopeCommand
|
813
792
|
|
814
793
|
link "Ctrl+Alt+O", SwitchNotebookCommand
|
815
794
|
|
816
|
-
link "Ctrl+Page Up",
|
817
|
-
link "Ctrl+Page Down",
|
795
|
+
link "Ctrl+Page Up", SwitchTabDownCommand
|
796
|
+
link "Ctrl+Page Down", SwitchTabUpCommand
|
797
|
+
link "Ctrl+Shift+Page Up", MoveTabDownCommand
|
798
|
+
link "Ctrl+Shift+Page Down", MoveTabUpCommand
|
818
799
|
link "Ctrl+Shift+R", PluginManagerUi::ReloadLastReloadedCommand
|
819
800
|
|
820
801
|
link "Ctrl+Alt+S", Snippets::OpenSnippetExplorer
|
@@ -846,8 +827,10 @@ module Redcar
|
|
846
827
|
item "Save As", Project::FileSaveAsCommand
|
847
828
|
separator
|
848
829
|
item "Close Tab", CloseTabCommand
|
830
|
+
item "Close Tree", CloseTreeCommand
|
849
831
|
item "Close Window", CloseWindowCommand
|
850
832
|
item "Close Directory", Project::DirectoryCloseCommand
|
833
|
+
item "Reveal in Project", Project::RevealInProjectCommand
|
851
834
|
separator
|
852
835
|
item "Quit", QuitCommand
|
853
836
|
end
|
@@ -872,12 +855,13 @@ module Redcar
|
|
872
855
|
item "Indent", AutoIndenter::IndentCommand
|
873
856
|
separator
|
874
857
|
item "Goto Line", GotoLineCommand
|
875
|
-
item "Regex Search", SearchForwardCommand
|
876
|
-
item "Repeat Last Search", RepeatPreviousSearchForwardCommand
|
858
|
+
item "Regex Search", DocumentSearch::SearchForwardCommand
|
859
|
+
item "Repeat Last Search", DocumentSearch::RepeatPreviousSearchForwardCommand
|
877
860
|
separator
|
878
861
|
sub_menu "Select" do
|
879
862
|
item "All", SelectAllCommand
|
880
863
|
item "Line", SelectLineCommand
|
864
|
+
item "Current Word", SelectWordCommand
|
881
865
|
end
|
882
866
|
item "Toggle Block Selection", ToggleBlockSelectionCommand
|
883
867
|
item "Auto Complete", AutoCompleter::AutoCompleteCommand
|
@@ -886,8 +870,9 @@ module Redcar
|
|
886
870
|
sub_menu "Project" do
|
887
871
|
item "Find File", Project::FindFileCommand
|
888
872
|
item "Refresh Directory", Project::RefreshDirectoryCommand
|
889
|
-
|
890
|
-
|
873
|
+
separator
|
874
|
+
item "Runnables", Runnables::ShowRunnables
|
875
|
+
item "Run Tab", Runnables::RunEditTabCommand
|
891
876
|
end
|
892
877
|
sub_menu "Debug" do
|
893
878
|
item "Task Manager", TaskManager::OpenCommand
|
@@ -910,6 +895,8 @@ module Redcar
|
|
910
895
|
separator
|
911
896
|
item "Previous Tab", SwitchTabDownCommand
|
912
897
|
item "Next Tab", SwitchTabUpCommand
|
898
|
+
item "Move Tab Left", MoveTabDownCommand
|
899
|
+
item "Move Tab Right", MoveTabUpCommand
|
913
900
|
sub_menu "Switch Tab" do
|
914
901
|
(1..9).each do |num|
|
915
902
|
item "Tab #{num}", Top.const_get("SelectTab#{num}Command")
|
@@ -1,15 +1,37 @@
|
|
1
1
|
|
2
|
+
require File.dirname(__FILE__) + "/../vendor/session-2.4.0/lib/session"
|
3
|
+
Session.use_open4 = true
|
4
|
+
|
5
|
+
require 'runnables/command_output_controller'
|
6
|
+
require 'runnables/running_process_checker'
|
7
|
+
|
2
8
|
module Redcar
|
3
9
|
class Runnables
|
10
|
+
TREE_TITLE = "Runnables"
|
11
|
+
|
12
|
+
def self.run_process(command)
|
13
|
+
tab = Redcar.app.focussed_window.new_tab(HtmlTab)
|
14
|
+
controller = CommandOutputController.new(command)
|
15
|
+
tab.html_view.controller = controller
|
16
|
+
tab.focus
|
17
|
+
end
|
4
18
|
|
5
19
|
class TreeMirror
|
6
20
|
include Redcar::Tree::Mirror
|
7
21
|
|
8
22
|
def initialize(project)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
23
|
+
runnable_file_paths = project.config_files("runnables/*.json")
|
24
|
+
|
25
|
+
runnables = []
|
26
|
+
runnable_file_paths.each do |path|
|
27
|
+
json = File.read(path)
|
28
|
+
this_runnables = JSON(json)["commands"]
|
29
|
+
runnables += this_runnables || []
|
30
|
+
end
|
31
|
+
|
32
|
+
if runnables.any?
|
33
|
+
@top = runnables.map do |runnable|
|
34
|
+
Runnable.new(runnable["name"], runnable)
|
13
35
|
end
|
14
36
|
else
|
15
37
|
@top = [HelpItem.new]
|
@@ -17,7 +39,7 @@ module Redcar
|
|
17
39
|
end
|
18
40
|
|
19
41
|
def title
|
20
|
-
|
42
|
+
TREE_TITLE
|
21
43
|
end
|
22
44
|
|
23
45
|
def top
|
@@ -46,25 +68,23 @@ module Redcar
|
|
46
68
|
end
|
47
69
|
|
48
70
|
def leaf?
|
49
|
-
@info[
|
71
|
+
@info["command"]
|
50
72
|
end
|
51
73
|
|
52
74
|
def icon
|
53
75
|
if leaf?
|
54
76
|
File.dirname(__FILE__) + "/../icons/cog.png"
|
77
|
+
else
|
78
|
+
:directory
|
55
79
|
end
|
56
80
|
end
|
57
81
|
|
58
82
|
def children
|
59
|
-
|
60
|
-
|
61
|
-
@info.map do |name, info|
|
62
|
-
Runnable.new(name, info)
|
63
|
-
end
|
83
|
+
[]
|
64
84
|
end
|
65
85
|
|
66
86
|
def command
|
67
|
-
@info[
|
87
|
+
@info["command"]
|
68
88
|
end
|
69
89
|
end
|
70
90
|
|
@@ -76,24 +96,61 @@ module Redcar
|
|
76
96
|
end
|
77
97
|
|
78
98
|
def activated(tree, node)
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
99
|
+
case node
|
100
|
+
when Runnable
|
101
|
+
Runnables.run_process(node.command)
|
102
|
+
when HelpItem
|
103
|
+
tab = Redcar.app.focussed_window.new_tab(HtmlTab)
|
104
|
+
tab.go_to_location("http://wiki.github.com/danlucraft/redcar/users-guide-runnables")
|
105
|
+
tab.title = "Runnables Help"
|
106
|
+
tab.focus
|
107
|
+
end
|
85
108
|
end
|
86
109
|
end
|
87
110
|
|
88
111
|
class ShowRunnables < Redcar::Command
|
89
112
|
def execute
|
113
|
+
if tree = win.treebook.trees.detect {|tree| tree.tree_mirror.title == TREE_TITLE }
|
114
|
+
win.treebook.focus_tree(tree)
|
115
|
+
else
|
116
|
+
project = Project::Manager.in_window(win)
|
117
|
+
tree = Tree.new(
|
118
|
+
TreeMirror.new(project),
|
119
|
+
TreeController.new(project)
|
120
|
+
)
|
121
|
+
win.treebook.add_tree(tree)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
class RunEditTabCommand < Redcar::EditTabCommand
|
127
|
+
def file_mappings
|
90
128
|
project = Project::Manager.in_window(win)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
129
|
+
runnable_file_paths = project.config_files("runnables/*.json")
|
130
|
+
|
131
|
+
file_runners = []
|
132
|
+
runnable_file_paths.each do |path|
|
133
|
+
json = File.read(path)
|
134
|
+
this_file_runners = JSON(json)["file_runners"]
|
135
|
+
file_runners += this_file_runners || []
|
136
|
+
end
|
137
|
+
file_runners
|
138
|
+
end
|
139
|
+
|
140
|
+
def execute
|
141
|
+
file_mappings.each do |file_mapping|
|
142
|
+
regex = Regexp.new(file_mapping["regex"])
|
143
|
+
if tab.edit_view.document.mirror.path =~ regex
|
144
|
+
command_schema = file_mapping["command"]
|
145
|
+
command = command_schema.gsub("__PATH__", tab.edit_view.document.mirror.path)
|
146
|
+
puts command
|
147
|
+
Runnables.run_process(command)
|
148
|
+
end
|
149
|
+
end
|
96
150
|
end
|
97
151
|
end
|
98
152
|
end
|
99
153
|
end
|
154
|
+
|
155
|
+
|
156
|
+
|