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
@@ -18,6 +18,8 @@ module Redcar
|
|
18
18
|
|
19
19
|
class OpenCommand < Redcar::Command
|
20
20
|
class Controller
|
21
|
+
include Redcar::HtmlController
|
22
|
+
|
21
23
|
def title
|
22
24
|
"Plugins"
|
23
25
|
end
|
@@ -32,7 +34,7 @@ module Redcar
|
|
32
34
|
plugin.load
|
33
35
|
Redcar.app.refresh_menu!
|
34
36
|
PluginManagerUi.last_reloaded = plugin
|
35
|
-
|
37
|
+
nil
|
36
38
|
end
|
37
39
|
|
38
40
|
private
|
@@ -27,9 +27,9 @@ Feature: Open directory tree
|
|
27
27
|
Scenario: Directory keeps the same width if maximized
|
28
28
|
Given I will choose "plugins/project/spec/fixtures/myproject" from the "open_directory" dialog
|
29
29
|
When I open a directory
|
30
|
-
Then the
|
30
|
+
Then the tree width should be the default
|
31
31
|
When I maximize the window size
|
32
|
-
Then the
|
32
|
+
Then the tree width should be the default
|
33
33
|
When I restore the window size
|
34
|
-
Then the
|
34
|
+
Then the tree width should be the default
|
35
35
|
|
@@ -66,7 +66,7 @@ module Redcar
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def contains_path?(path)
|
69
|
-
File.expand_path(path) =~ /^#{@path}/
|
69
|
+
File.expand_path(path) =~ /^#{@path}($|\/|\\)/
|
70
70
|
end
|
71
71
|
|
72
72
|
# A list of files previously opened in this session for this project
|
@@ -129,11 +129,9 @@ module Redcar
|
|
129
129
|
File.join(path, ".redcar")
|
130
130
|
end
|
131
131
|
|
132
|
-
def
|
133
|
-
|
134
|
-
|
135
|
-
YAML.load(File.read(file_path))
|
136
|
-
end
|
132
|
+
def config_files(glob)
|
133
|
+
file_glob = File.join(config_dir, glob)
|
134
|
+
Dir[file_glob]
|
137
135
|
end
|
138
136
|
end
|
139
137
|
end
|
@@ -124,5 +124,22 @@ module Redcar
|
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
127
|
+
class RevealInProjectCommand < ProjectCommand
|
128
|
+
def execute
|
129
|
+
tab = Redcar.app.focussed_window.focussed_notebook_tab
|
130
|
+
return unless tab.is_a?(EditTab)
|
131
|
+
|
132
|
+
path = tab.edit_view.document.mirror.path
|
133
|
+
tree = project.tree
|
134
|
+
current = tree.tree_mirror.top
|
135
|
+
while current.any?
|
136
|
+
ancestor_node = current.detect {|node| path =~ /^#{node.path}($|\/)/}
|
137
|
+
tree.expand(ancestor_node)
|
138
|
+
current = ancestor_node.children
|
139
|
+
end
|
140
|
+
tree.select(ancestor_node)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
127
144
|
end
|
128
145
|
end
|
@@ -154,6 +154,8 @@ module Redcar
|
|
154
154
|
end
|
155
155
|
|
156
156
|
class BulkRenameController
|
157
|
+
include Redcar::HtmlController
|
158
|
+
|
157
159
|
attr_reader :pairs, :match_pattern, :replace_pattern
|
158
160
|
|
159
161
|
def initialize(tab, tree, nodes)
|
@@ -192,7 +194,6 @@ module Redcar
|
|
192
194
|
end
|
193
195
|
|
194
196
|
def submit(params)
|
195
|
-
p [:submit, params]
|
196
197
|
@pairs.each do |node, _|
|
197
198
|
old_name = File.basename(node.path)
|
198
199
|
new_name = transform_name(old_name)
|
@@ -19,6 +19,10 @@ module Redcar
|
|
19
19
|
@changed = true
|
20
20
|
end
|
21
21
|
|
22
|
+
def title
|
23
|
+
File.basename(@path) + "/"
|
24
|
+
end
|
25
|
+
|
22
26
|
# Does the directory exist?
|
23
27
|
def exists?
|
24
28
|
File.exist?(@path) && File.directory?(@path)
|
@@ -124,6 +128,10 @@ module Redcar
|
|
124
128
|
def children
|
125
129
|
Node.create_all_from_path(@path)
|
126
130
|
end
|
131
|
+
|
132
|
+
def tooltip_text
|
133
|
+
File.basename(@path)
|
134
|
+
end
|
127
135
|
end
|
128
136
|
end
|
129
137
|
end
|
@@ -106,8 +106,10 @@ module Redcar
|
|
106
106
|
return
|
107
107
|
end
|
108
108
|
if project = find_projects_containing_path(path).first
|
109
|
+
p [:found_containing_project, project.path]
|
109
110
|
window = project.window
|
110
111
|
else
|
112
|
+
p [:didn_t_find_containing_project]
|
111
113
|
window = windows_without_projects.first || Redcar.app.new_window
|
112
114
|
end
|
113
115
|
open_file_in_window(path, window)
|
data/plugins/project/plugin.rb
CHANGED
@@ -0,0 +1,55 @@
|
|
1
|
+
CHANGELOG.rdoc
|
2
|
+
lib/net/sftp/constants.rb
|
3
|
+
lib/net/sftp/errors.rb
|
4
|
+
lib/net/sftp/operations/dir.rb
|
5
|
+
lib/net/sftp/operations/download.rb
|
6
|
+
lib/net/sftp/operations/file.rb
|
7
|
+
lib/net/sftp/operations/file_factory.rb
|
8
|
+
lib/net/sftp/operations/upload.rb
|
9
|
+
lib/net/sftp/packet.rb
|
10
|
+
lib/net/sftp/protocol/01/attributes.rb
|
11
|
+
lib/net/sftp/protocol/01/base.rb
|
12
|
+
lib/net/sftp/protocol/01/name.rb
|
13
|
+
lib/net/sftp/protocol/02/base.rb
|
14
|
+
lib/net/sftp/protocol/03/base.rb
|
15
|
+
lib/net/sftp/protocol/04/attributes.rb
|
16
|
+
lib/net/sftp/protocol/04/base.rb
|
17
|
+
lib/net/sftp/protocol/04/name.rb
|
18
|
+
lib/net/sftp/protocol/05/base.rb
|
19
|
+
lib/net/sftp/protocol/06/attributes.rb
|
20
|
+
lib/net/sftp/protocol/06/base.rb
|
21
|
+
lib/net/sftp/protocol/base.rb
|
22
|
+
lib/net/sftp/protocol.rb
|
23
|
+
lib/net/sftp/request.rb
|
24
|
+
lib/net/sftp/response.rb
|
25
|
+
lib/net/sftp/session.rb
|
26
|
+
lib/net/sftp/version.rb
|
27
|
+
lib/net/sftp.rb
|
28
|
+
Rakefile
|
29
|
+
README.rdoc
|
30
|
+
setup.rb
|
31
|
+
test/common.rb
|
32
|
+
test/protocol/01/test_attributes.rb
|
33
|
+
test/protocol/01/test_base.rb
|
34
|
+
test/protocol/01/test_name.rb
|
35
|
+
test/protocol/02/test_base.rb
|
36
|
+
test/protocol/03/test_base.rb
|
37
|
+
test/protocol/04/test_attributes.rb
|
38
|
+
test/protocol/04/test_base.rb
|
39
|
+
test/protocol/04/test_name.rb
|
40
|
+
test/protocol/05/test_base.rb
|
41
|
+
test/protocol/06/test_attributes.rb
|
42
|
+
test/protocol/06/test_base.rb
|
43
|
+
test/protocol/test_base.rb
|
44
|
+
test/test_all.rb
|
45
|
+
test/test_dir.rb
|
46
|
+
test/test_download.rb
|
47
|
+
test/test_file.rb
|
48
|
+
test/test_file_factory.rb
|
49
|
+
test/test_packet.rb
|
50
|
+
test/test_protocol.rb
|
51
|
+
test/test_request.rb
|
52
|
+
test/test_response.rb
|
53
|
+
test/test_session.rb
|
54
|
+
test/test_upload.rb
|
55
|
+
Manifest
|
@@ -0,0 +1,30 @@
|
|
1
|
+
$LOAD_PATH.unshift "../net-ssh/lib"
|
2
|
+
require './lib/net/sftp/version'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'echoe'
|
6
|
+
rescue LoadError
|
7
|
+
abort "You'll need to have `echoe' installed to use Net::SFTP's Rakefile"
|
8
|
+
end
|
9
|
+
|
10
|
+
version = Net::SFTP::Version::STRING.dup
|
11
|
+
if ENV['SNAPSHOT'].to_i == 1
|
12
|
+
version << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
|
13
|
+
end
|
14
|
+
|
15
|
+
Echoe.new('net-sftp', version) do |p|
|
16
|
+
p.project = "net-ssh"
|
17
|
+
p.changelog = "CHANGELOG.rdoc"
|
18
|
+
|
19
|
+
p.author = "Jamis Buck"
|
20
|
+
p.email = "jamis@jamisbuck.org"
|
21
|
+
p.summary = "A pure Ruby implementation of the SFTP client protocol"
|
22
|
+
p.url = "http://net-ssh.rubyforge.org/sftp"
|
23
|
+
|
24
|
+
p.dependencies = ["net-ssh >=2.0.9"]
|
25
|
+
|
26
|
+
p.need_zip = true
|
27
|
+
p.include_rakefile = true
|
28
|
+
|
29
|
+
p.rdoc_pattern = /^(lib|README.rdoc|CHANGELOG.rdoc)/
|
30
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'net/ssh'
|
2
|
+
require 'net/sftp/session'
|
3
|
+
|
4
|
+
module Net
|
5
|
+
|
6
|
+
# Net::SFTP is a pure-Ruby module for programmatically interacting with a
|
7
|
+
# remote host via the SFTP protocol (that's SFTP as in "Secure File Transfer
|
8
|
+
# Protocol" produced by the Secure Shell Working Group, not "Secure FTP"
|
9
|
+
# and certainly not "Simple FTP").
|
10
|
+
#
|
11
|
+
# See Net::SFTP#start for an introduction to the library. Also, see
|
12
|
+
# Net::SFTP::Session for further documentation.
|
13
|
+
module SFTP
|
14
|
+
# A convenience method for starting a standalone SFTP session. It will
|
15
|
+
# start up an SSH session using the given arguments (see the documentation
|
16
|
+
# for Net::SSH::Session for details), and will then start a new SFTP session
|
17
|
+
# with the SSH session. This will block until the new SFTP is fully open
|
18
|
+
# and initialized before returning it.
|
19
|
+
#
|
20
|
+
# sftp = Net::SFTP.start("localhost", "user")
|
21
|
+
# sftp.upload! "/local/file.tgz", "/remote/file.tgz"
|
22
|
+
#
|
23
|
+
# If a block is given, it will be passed to the SFTP session and will be
|
24
|
+
# called once the SFTP session is fully open and initialized. When the
|
25
|
+
# block terminates, the new SSH session will automatically be closed.
|
26
|
+
#
|
27
|
+
# Net::SFTP.start("localhost", "user") do |sftp|
|
28
|
+
# sftp.upload! "/local/file.tgz", "/remote/file.tgz"
|
29
|
+
# end
|
30
|
+
def self.start(host, user, options={}, &block)
|
31
|
+
session = Net::SSH.start(host, user, options)
|
32
|
+
sftp = Net::SFTP::Session.new(session, &block).connect!
|
33
|
+
|
34
|
+
if block_given?
|
35
|
+
sftp.loop
|
36
|
+
session.close
|
37
|
+
return nil
|
38
|
+
end
|
39
|
+
|
40
|
+
sftp
|
41
|
+
rescue Object => anything
|
42
|
+
begin
|
43
|
+
session.shutdown!
|
44
|
+
rescue ::Exception
|
45
|
+
# swallow exceptions that occur while trying to shutdown
|
46
|
+
end
|
47
|
+
|
48
|
+
raise anything
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
class Net::SSH::Connection::Session
|
55
|
+
# A convenience method for starting up a new SFTP connection on the current
|
56
|
+
# SSH session. Blocks until the SFTP session is fully open, and then
|
57
|
+
# returns the SFTP session.
|
58
|
+
#
|
59
|
+
# Net::SSH.start("localhost", "user", "password") do |ssh|
|
60
|
+
# ssh.sftp.upload!("/local/file.tgz", "/remote/file.tgz")
|
61
|
+
# ssh.exec! "cd /some/path && tar xf /remote/file.tgz && rm /remote/file.tgz"
|
62
|
+
# end
|
63
|
+
def sftp(wait=true)
|
64
|
+
@sftp ||= begin
|
65
|
+
sftp = Net::SFTP::Session.new(self)
|
66
|
+
sftp.connect! if wait
|
67
|
+
sftp
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,187 @@
|
|
1
|
+
module Net module SFTP
|
2
|
+
|
3
|
+
# The packet types and other general constants used by the SFTP protocol.
|
4
|
+
# See the specification for the SFTP protocol for a full discussion of their
|
5
|
+
# meaning and usage.
|
6
|
+
module Constants
|
7
|
+
|
8
|
+
# The various packet types supported by SFTP protocol versions 1 through 6.
|
9
|
+
# The FXP_EXTENDED and FXP_EXTENDED_REPLY packet types are not currently
|
10
|
+
# understood by Net::SFTP.
|
11
|
+
module PacketTypes
|
12
|
+
FXP_INIT = 1
|
13
|
+
FXP_VERSION = 2
|
14
|
+
|
15
|
+
FXP_OPEN = 3
|
16
|
+
FXP_CLOSE = 4
|
17
|
+
FXP_READ = 5
|
18
|
+
FXP_WRITE = 6
|
19
|
+
FXP_LSTAT = 7
|
20
|
+
FXP_FSTAT = 8
|
21
|
+
FXP_SETSTAT = 9
|
22
|
+
FXP_FSETSTAT = 10
|
23
|
+
FXP_OPENDIR = 11
|
24
|
+
FXP_READDIR = 12
|
25
|
+
FXP_REMOVE = 13
|
26
|
+
FXP_MKDIR = 14
|
27
|
+
FXP_RMDIR = 15
|
28
|
+
FXP_REALPATH = 16
|
29
|
+
FXP_STAT = 17
|
30
|
+
FXP_RENAME = 18
|
31
|
+
FXP_READLINK = 19
|
32
|
+
FXP_SYMLINK = 20
|
33
|
+
FXP_LINK = 21
|
34
|
+
FXP_BLOCK = 22
|
35
|
+
FXP_UNBLOCK = 23
|
36
|
+
|
37
|
+
FXP_STATUS = 101
|
38
|
+
FXP_HANDLE = 102
|
39
|
+
FXP_DATA = 103
|
40
|
+
FXP_NAME = 104
|
41
|
+
FXP_ATTRS = 105
|
42
|
+
|
43
|
+
FXP_EXTENDED = 200
|
44
|
+
FXP_EXTENDED_REPLY = 201
|
45
|
+
end
|
46
|
+
|
47
|
+
# Beginning in version 5 of the protocol, Net::SFTP::Session#rename accepts
|
48
|
+
# an optional +flags+ argument that must be either 0 or a combination of
|
49
|
+
# these constants.
|
50
|
+
module RenameFlags
|
51
|
+
OVERWRITE = 0x00000001
|
52
|
+
ATOMIC = 0x00000002
|
53
|
+
NATIVE = 0x00000004
|
54
|
+
end
|
55
|
+
|
56
|
+
# When an FXP_STATUS packet is received from the server, the +code+ will
|
57
|
+
# be one of the following constants.
|
58
|
+
module StatusCodes
|
59
|
+
FX_OK = 0
|
60
|
+
FX_EOF = 1
|
61
|
+
FX_NO_SUCH_FILE = 2
|
62
|
+
FX_PERMISSION_DENIED = 3
|
63
|
+
FX_FAILURE = 4
|
64
|
+
FX_BAD_MESSAGE = 5
|
65
|
+
FX_NO_CONNECTION = 6
|
66
|
+
FX_CONNECTION_LOST = 7
|
67
|
+
FX_OP_UNSUPPORTED = 8
|
68
|
+
FX_INVALID_HANDLE = 9
|
69
|
+
FX_NO_SUCH_PATH = 10
|
70
|
+
FX_FILE_ALREADY_EXISTS = 11
|
71
|
+
FX_WRITE_PROTECT = 12
|
72
|
+
FX_NO_MEDIA = 13
|
73
|
+
FX_NO_SPACE_ON_FILESYSTEM = 14
|
74
|
+
FX_QUOTA_EXCEEDED = 15
|
75
|
+
FX_UNKNOWN_PRINCIPLE = 16
|
76
|
+
FX_LOCK_CONFlICT = 17
|
77
|
+
FX_DIR_NOT_EMPTY = 18
|
78
|
+
FX_NOT_A_DIRECTORY = 19
|
79
|
+
FX_INVALID_FILENAME = 20
|
80
|
+
FX_LINK_LOOP = 21
|
81
|
+
end
|
82
|
+
|
83
|
+
# The Net::SFTP::Session#open operation is one of the worst casualties of
|
84
|
+
# the revisions between SFTP protocol versions. The flags change considerably
|
85
|
+
# between version 1 and version 6. Net::SFTP tries to shield programmers
|
86
|
+
# from the differences, so you'll almost never need to use these flags
|
87
|
+
# directly, but if you ever need to specify some flag that isn't exposed
|
88
|
+
# by the higher-level API, these are the ones that are available to you.
|
89
|
+
module OpenFlags
|
90
|
+
# These are the flags that are understood by versions 1-4 of the the
|
91
|
+
# open operation.
|
92
|
+
module FV1
|
93
|
+
READ = 0x00000001
|
94
|
+
WRITE = 0x00000002
|
95
|
+
APPEND = 0x00000004
|
96
|
+
CREAT = 0x00000008
|
97
|
+
TRUNC = 0x00000010
|
98
|
+
EXCL = 0x00000020
|
99
|
+
end
|
100
|
+
|
101
|
+
# Version 5 of the open operation totally discarded the flags understood
|
102
|
+
# by versions 1-4, and replaced them with these.
|
103
|
+
module FV5
|
104
|
+
CREATE_NEW = 0x00000000
|
105
|
+
CREATE_TRUNCATE = 0x00000001
|
106
|
+
OPEN_EXISTING = 0x00000002
|
107
|
+
OPEN_OR_CREATE = 0x00000003
|
108
|
+
TRUNCATE_EXISTING = 0x00000004
|
109
|
+
|
110
|
+
APPEND_DATA = 0x00000008
|
111
|
+
APPEND_DATA_ATOMIC = 0x00000010
|
112
|
+
TEXT_MODE = 0x00000020
|
113
|
+
READ_LOCK = 0x00000040
|
114
|
+
WRITE_LOCK = 0x00000080
|
115
|
+
DELETE_LOCK = 0x00000100
|
116
|
+
end
|
117
|
+
|
118
|
+
# Version 6 of the open operation added these flags, in addition to the
|
119
|
+
# flags understood by version 5.
|
120
|
+
module FV6
|
121
|
+
ADVISORY_LOCK = 0x00000200
|
122
|
+
NOFOLLOW = 0x00000400
|
123
|
+
DELETE_ON_CLOSE = 0x00000800
|
124
|
+
ACCESS_AUDIT_ALARM_INFO = 0x00001000
|
125
|
+
ACCESS_BACKUP = 0x00002000
|
126
|
+
BACKUP_STREAM = 0x00004000
|
127
|
+
OVERRIDE_OWNER = 0x00008000
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
# The Net::SFTP::Session#block operation, implemented in version 6 of
|
132
|
+
# the protocol, understands these constants for the +mask+ parameter.
|
133
|
+
module LockTypes
|
134
|
+
READ = OpenFlags::FV5::READ_LOCK
|
135
|
+
WRITE = OpenFlags::FV5::WRITE_LOCK
|
136
|
+
DELETE = OpenFlags::FV5::DELETE_LOCK
|
137
|
+
ADVISORY = OpenFlags::FV6::ADVISORY_LOCK
|
138
|
+
end
|
139
|
+
|
140
|
+
module ACE
|
141
|
+
# Access control entry types, used from version 4 of the protocol,
|
142
|
+
# onward. See Net::SFTP::Protocol::V04::Attributes::ACL.
|
143
|
+
module Type
|
144
|
+
ACCESS_ALLOWED = 0x00000000
|
145
|
+
ACCESS_DENIED = 0x00000001
|
146
|
+
SYSTEM_AUDIT = 0x00000002
|
147
|
+
SYSTEM_ALARM = 0x00000003
|
148
|
+
end
|
149
|
+
|
150
|
+
# Access control entry flags, used from version 4 of the protocol,
|
151
|
+
# onward. See Net::SFTP::Protocol::V04::Attributes::ACL.
|
152
|
+
module Flag
|
153
|
+
FILE_INHERIT = 0x00000001
|
154
|
+
DIRECTORY_INHERIT = 0x00000002
|
155
|
+
NO_PROPAGATE_INHERIT = 0x00000004
|
156
|
+
INHERIT_ONLY = 0x00000008
|
157
|
+
SUCCESSFUL_ACCESS = 0x00000010
|
158
|
+
FAILED_ACCESS = 0x00000020
|
159
|
+
IDENTIFIER_GROUP = 0x00000040
|
160
|
+
end
|
161
|
+
|
162
|
+
# Access control entry masks, used from version 4 of the protocol,
|
163
|
+
# onward. See Net::SFTP::Protocol::V04::Attributes::ACL.
|
164
|
+
module Mask
|
165
|
+
READ_DATA = 0x00000001
|
166
|
+
LIST_DIRECTORY = 0x00000001
|
167
|
+
WRITE_DATA = 0x00000002
|
168
|
+
ADD_FILE = 0x00000002
|
169
|
+
APPEND_DATA = 0x00000004
|
170
|
+
ADD_SUBDIRECTORY = 0x00000004
|
171
|
+
READ_NAMED_ATTRS = 0x00000008
|
172
|
+
WRITE_NAMED_ATTRS = 0x00000010
|
173
|
+
EXECUTE = 0x00000020
|
174
|
+
DELETE_CHILD = 0x00000040
|
175
|
+
READ_ATTRIBUTES = 0x00000080
|
176
|
+
WRITE_ATTRIBUTES = 0x00000100
|
177
|
+
DELETE = 0x00010000
|
178
|
+
READ_ACL = 0x00020000
|
179
|
+
WRITE_ACL = 0x00040000
|
180
|
+
WRITE_OWNER = 0x00080000
|
181
|
+
SYNCHRONIZE = 0x00100000
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
end
|
186
|
+
|
187
|
+
end end
|