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
@@ -0,0 +1,219 @@
|
|
1
|
+
require "common"
|
2
|
+
|
3
|
+
class UploadTest < Net::SFTP::TestCase
|
4
|
+
def setup
|
5
|
+
prepare_progress!
|
6
|
+
end
|
7
|
+
|
8
|
+
def test_upload_file_should_send_file_contents
|
9
|
+
expect_file_transfer("/path/to/local", "/path/to/remote", "here are the contents")
|
10
|
+
assert_scripted_command { sftp.upload("/path/to/local", "/path/to/remote") }
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_upload_file_with_progress_should_report_progress
|
14
|
+
expect_file_transfer("/path/to/local", "/path/to/remote", "here are the contents")
|
15
|
+
|
16
|
+
assert_scripted_command do
|
17
|
+
sftp.upload("/path/to/local", "/path/to/remote") { |*args| record_progress(args) }
|
18
|
+
end
|
19
|
+
|
20
|
+
assert_progress_reported_open(:remote => "/path/to/remote")
|
21
|
+
assert_progress_reported_put(0, "here are the contents", :remote => "/path/to/remote")
|
22
|
+
assert_progress_reported_close(:remote => "/path/to/remote")
|
23
|
+
assert_progress_reported_finish
|
24
|
+
assert_no_more_reported_events
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_upload_file_with_progress_handler_should_report_progress
|
28
|
+
expect_file_transfer("/path/to/local", "/path/to/remote", "here are the contents")
|
29
|
+
|
30
|
+
assert_scripted_command do
|
31
|
+
sftp.upload("/path/to/local", "/path/to/remote", :progress => ProgressHandler.new(@progress))
|
32
|
+
end
|
33
|
+
|
34
|
+
assert_progress_reported_open(:remote => "/path/to/remote")
|
35
|
+
assert_progress_reported_put(0, "here are the contents", :remote => "/path/to/remote")
|
36
|
+
assert_progress_reported_close(:remote => "/path/to/remote")
|
37
|
+
assert_progress_reported_finish
|
38
|
+
assert_no_more_reported_events
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_upload_file_should_read_chunks_of_size(requested_size=nil)
|
42
|
+
size = requested_size || Net::SFTP::Operations::Upload::DEFAULT_READ_SIZE
|
43
|
+
expect_sftp_session :server_version => 3 do |channel|
|
44
|
+
channel.sends_packet(FXP_OPEN, :long, 0, :string, "/path/to/remote", :long, 0x1A, :long, 0)
|
45
|
+
channel.gets_packet(FXP_HANDLE, :long, 0, :string, "handle")
|
46
|
+
channel.sends_packet(FXP_WRITE, :long, 1, :string, "handle", :int64, 0, :string, "a" * size)
|
47
|
+
channel.sends_packet(FXP_WRITE, :long, 2, :string, "handle", :int64, size, :string, "b" * size)
|
48
|
+
channel.sends_packet(FXP_WRITE, :long, 3, :string, "handle", :int64, size*2, :string, "c" * size)
|
49
|
+
channel.gets_packet(FXP_STATUS, :long, 1, :long, 0)
|
50
|
+
channel.sends_packet(FXP_WRITE, :long, 4, :string, "handle", :int64, size*3, :string, "d" * size)
|
51
|
+
channel.gets_packet(FXP_STATUS, :long, 2, :long, 0)
|
52
|
+
channel.sends_packet(FXP_CLOSE, :long, 5, :string, "handle")
|
53
|
+
channel.gets_packet(FXP_STATUS, :long, 3, :long, 0)
|
54
|
+
channel.gets_packet(FXP_STATUS, :long, 4, :long, 0)
|
55
|
+
channel.gets_packet(FXP_STATUS, :long, 5, :long, 0)
|
56
|
+
end
|
57
|
+
|
58
|
+
expect_file("/path/to/local", "a" * size + "b" * size + "c" * size + "d" * size)
|
59
|
+
|
60
|
+
assert_scripted_command do
|
61
|
+
opts = {}
|
62
|
+
opts[:read_size] = size if requested_size
|
63
|
+
sftp.upload("/path/to/local", "/path/to/remote", opts)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_upload_file_with_custom_read_size_should_read_chunks_of_that_size
|
68
|
+
test_upload_file_should_read_chunks_of_size(100)
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_upload_file_with_custom_requests_should_start_that_many_writes
|
72
|
+
size = Net::SFTP::Operations::Upload::DEFAULT_READ_SIZE
|
73
|
+
expect_sftp_session :server_version => 3 do |channel|
|
74
|
+
channel.sends_packet(FXP_OPEN, :long, 0, :string, "/path/to/remote", :long, 0x1A, :long, 0)
|
75
|
+
channel.gets_packet(FXP_HANDLE, :long, 0, :string, "handle")
|
76
|
+
channel.sends_packet(FXP_WRITE, :long, 1, :string, "handle", :int64, 0, :string, "a" * size)
|
77
|
+
channel.sends_packet(FXP_WRITE, :long, 2, :string, "handle", :int64, size, :string, "b" * size)
|
78
|
+
channel.sends_packet(FXP_WRITE, :long, 3, :string, "handle", :int64, size*2, :string, "c" * size)
|
79
|
+
channel.sends_packet(FXP_WRITE, :long, 4, :string, "handle", :int64, size*3, :string, "d" * size)
|
80
|
+
channel.gets_packet(FXP_STATUS, :long, 1, :long, 0)
|
81
|
+
channel.sends_packet(FXP_CLOSE, :long, 5, :string, "handle")
|
82
|
+
channel.gets_packet(FXP_STATUS, :long, 2, :long, 0)
|
83
|
+
channel.gets_packet(FXP_STATUS, :long, 3, :long, 0)
|
84
|
+
channel.gets_packet(FXP_STATUS, :long, 4, :long, 0)
|
85
|
+
channel.gets_packet(FXP_STATUS, :long, 5, :long, 0)
|
86
|
+
end
|
87
|
+
|
88
|
+
expect_file("/path/to/local", "a" * size + "b" * size + "c" * size + "d" * size)
|
89
|
+
|
90
|
+
assert_scripted_command do
|
91
|
+
sftp.upload("/path/to/local", "/path/to/remote", :requests => 3)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_upload_directory_should_mirror_directory_structure_remotely
|
96
|
+
prepare_directory
|
97
|
+
|
98
|
+
assert_scripted_command do
|
99
|
+
sftp.upload("/path/to/local", "/path/to/remote")
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_upload_directory_with_handler_should_report_progress
|
104
|
+
prepare_directory
|
105
|
+
|
106
|
+
assert_scripted_command do
|
107
|
+
sftp.upload("/path/to/local", "/path/to/remote") { |*args| record_progress(args) }
|
108
|
+
end
|
109
|
+
|
110
|
+
assert_progress_reported_open(:remote => "/path/to/remote/file1")
|
111
|
+
assert_progress_reported_open(:remote => "/path/to/remote/file2")
|
112
|
+
assert_progress_reported_open(:remote => "/path/to/remote/file3")
|
113
|
+
assert_progress_reported_mkdir("/path/to/remote/subdir")
|
114
|
+
assert_progress_reported_open(:remote => "/path/to/remote/subdir/other1")
|
115
|
+
assert_progress_reported_open(:remote => "/path/to/remote/subdir/other2")
|
116
|
+
assert_progress_reported_put(0, "contents of file1", :remote => "/path/to/remote/file1")
|
117
|
+
assert_progress_reported_put(0, "contents of file2", :remote => "/path/to/remote/file2")
|
118
|
+
assert_progress_reported_put(0, "contents of file3", :remote => "/path/to/remote/file3")
|
119
|
+
assert_progress_reported_close(:remote => "/path/to/remote/file1")
|
120
|
+
assert_progress_reported_put(0, "contents of other1", :remote => "/path/to/remote/subdir/other1")
|
121
|
+
assert_progress_reported_put(0, "contents of other2", :remote => "/path/to/remote/subdir/other2")
|
122
|
+
assert_progress_reported_close(:remote => "/path/to/remote/file2")
|
123
|
+
assert_progress_reported_close(:remote => "/path/to/remote/file3")
|
124
|
+
assert_progress_reported_close(:remote => "/path/to/remote/subdir/other1")
|
125
|
+
assert_progress_reported_close(:remote => "/path/to/remote/subdir/other2")
|
126
|
+
assert_progress_reported_finish
|
127
|
+
assert_no_more_reported_events
|
128
|
+
end
|
129
|
+
|
130
|
+
def test_upload_io_should_send_io_as_file
|
131
|
+
expect_sftp_session :server_version => 3 do |channel|
|
132
|
+
channel.sends_packet(FXP_OPEN, :long, 0, :string, "/path/to/remote", :long, 0x1A, :long, 0)
|
133
|
+
channel.gets_packet(FXP_HANDLE, :long, 0, :string, "handle")
|
134
|
+
channel.sends_packet(FXP_WRITE, :long, 1, :string, "handle", :int64, 0, :string, "this is some text")
|
135
|
+
channel.sends_packet(FXP_CLOSE, :long, 2, :string, "handle")
|
136
|
+
channel.gets_packet(FXP_STATUS, :long, 1, :long, 0)
|
137
|
+
channel.gets_packet(FXP_STATUS, :long, 2, :long, 0)
|
138
|
+
end
|
139
|
+
|
140
|
+
assert_scripted_command do
|
141
|
+
sftp.upload(StringIO.new("this is some text"), "/path/to/remote")
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
private
|
146
|
+
|
147
|
+
def prepare_directory
|
148
|
+
expect_directory("/path/to/local", %w(. .. file1 file2 file3 subdir))
|
149
|
+
expect_directory("/path/to/local/subdir", %w(. .. other1 other2))
|
150
|
+
expect_file("/path/to/local/file1", "contents of file1")
|
151
|
+
expect_file("/path/to/local/file2", "contents of file2")
|
152
|
+
expect_file("/path/to/local/file3", "contents of file3")
|
153
|
+
expect_file("/path/to/local/subdir/other1", "contents of other1")
|
154
|
+
expect_file("/path/to/local/subdir/other2", "contents of other2")
|
155
|
+
|
156
|
+
expect_sftp_session :server_version => 3 do |ch|
|
157
|
+
ch.sends_packet(FXP_MKDIR, :long, 0, :string, "/path/to/remote", :long, 0)
|
158
|
+
ch.gets_packet(FXP_STATUS, :long, 0, :long, 0)
|
159
|
+
ch.sends_packet(FXP_OPEN, :long, 1, :string, "/path/to/remote/file1", :long, 0x1A, :long, 0)
|
160
|
+
ch.sends_packet(FXP_OPEN, :long, 2, :string, "/path/to/remote/file2", :long, 0x1A, :long, 0)
|
161
|
+
ch.sends_packet(FXP_OPEN, :long, 3, :string, "/path/to/remote/file3", :long, 0x1A, :long, 0)
|
162
|
+
ch.sends_packet(FXP_MKDIR, :long, 4, :string, "/path/to/remote/subdir", :long, 0)
|
163
|
+
ch.sends_packet(FXP_OPEN, :long, 5, :string, "/path/to/remote/subdir/other1", :long, 0x1A, :long, 0)
|
164
|
+
ch.sends_packet(FXP_OPEN, :long, 6, :string, "/path/to/remote/subdir/other2", :long, 0x1A, :long, 0)
|
165
|
+
ch.gets_packet(FXP_HANDLE, :long, 1, :string, "hfile1")
|
166
|
+
ch.sends_packet(FXP_WRITE, :long, 7, :string, "hfile1", :int64, 0, :string, "contents of file1")
|
167
|
+
ch.gets_packet(FXP_HANDLE, :long, 2, :string, "hfile2")
|
168
|
+
ch.sends_packet(FXP_WRITE, :long, 8, :string, "hfile2", :int64, 0, :string, "contents of file2")
|
169
|
+
ch.gets_packet(FXP_HANDLE, :long, 3, :string, "hfile3")
|
170
|
+
ch.sends_packet(FXP_WRITE, :long, 9, :string, "hfile3", :int64, 0, :string, "contents of file3")
|
171
|
+
ch.gets_packet(FXP_STATUS, :long, 4, :long, 0)
|
172
|
+
ch.gets_packet(FXP_HANDLE, :long, 5, :string, "hother1")
|
173
|
+
ch.sends_packet(FXP_CLOSE, :long, 10, :string, "hfile1")
|
174
|
+
ch.sends_packet(FXP_WRITE, :long, 11, :string, "hother1", :int64, 0, :string, "contents of other1")
|
175
|
+
ch.gets_packet(FXP_HANDLE, :long, 6, :string, "hother2")
|
176
|
+
ch.sends_packet(FXP_WRITE, :long, 12, :string, "hother2", :int64, 0, :string, "contents of other2")
|
177
|
+
ch.gets_packet(FXP_STATUS, :long, 7, :long, 0)
|
178
|
+
ch.sends_packet(FXP_CLOSE, :long, 13, :string, "hfile2")
|
179
|
+
ch.gets_packet(FXP_STATUS, :long, 8, :long, 0)
|
180
|
+
ch.sends_packet(FXP_CLOSE, :long, 14, :string, "hfile3")
|
181
|
+
ch.gets_packet(FXP_STATUS, :long, 9, :long, 0)
|
182
|
+
ch.sends_packet(FXP_CLOSE, :long, 15, :string, "hother1")
|
183
|
+
ch.gets_packet(FXP_STATUS, :long, 10, :long, 0)
|
184
|
+
ch.sends_packet(FXP_CLOSE, :long, 16, :string, "hother2")
|
185
|
+
ch.gets_packet(FXP_STATUS, :long, 11, :long, 0)
|
186
|
+
ch.gets_packet(FXP_STATUS, :long, 12, :long, 0)
|
187
|
+
ch.gets_packet(FXP_STATUS, :long, 13, :long, 0)
|
188
|
+
ch.gets_packet(FXP_STATUS, :long, 14, :long, 0)
|
189
|
+
ch.gets_packet(FXP_STATUS, :long, 15, :long, 0)
|
190
|
+
ch.gets_packet(FXP_STATUS, :long, 16, :long, 0)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
def expect_file(path, data)
|
195
|
+
File.stubs(:directory?).with(path).returns(false)
|
196
|
+
File.stubs(:exists?).with(path).returns(true)
|
197
|
+
file = StringIO.new(data)
|
198
|
+
file.stubs(:stat).returns(stub("stat", :size => data.length))
|
199
|
+
File.stubs(:open).with(path, "rb").returns(file)
|
200
|
+
end
|
201
|
+
|
202
|
+
def expect_directory(path, entries)
|
203
|
+
Dir.stubs(:entries).with(path).returns(entries)
|
204
|
+
File.stubs(:directory?).with(path).returns(true)
|
205
|
+
end
|
206
|
+
|
207
|
+
def expect_file_transfer(local, remote, data)
|
208
|
+
expect_sftp_session :server_version => 3 do |channel|
|
209
|
+
channel.sends_packet(FXP_OPEN, :long, 0, :string, remote, :long, 0x1A, :long, 0)
|
210
|
+
channel.gets_packet(FXP_HANDLE, :long, 0, :string, "handle")
|
211
|
+
channel.sends_packet(FXP_WRITE, :long, 1, :string, "handle", :int64, 0, :string, data)
|
212
|
+
channel.sends_packet(FXP_CLOSE, :long, 2, :string, "handle")
|
213
|
+
channel.gets_packet(FXP_STATUS, :long, 1, :long, 0)
|
214
|
+
channel.gets_packet(FXP_STATUS, :long, 2, :long, 0)
|
215
|
+
end
|
216
|
+
|
217
|
+
expect_file(local, data)
|
218
|
+
end
|
219
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
CHANGELOG.rdoc
|
2
|
+
Manifest
|
3
|
+
README.rdoc
|
4
|
+
Rakefile
|
5
|
+
Rudyfile
|
6
|
+
THANKS.rdoc
|
7
|
+
lib/net/ssh.rb
|
8
|
+
lib/net/ssh/authentication/agent.rb
|
9
|
+
lib/net/ssh/authentication/constants.rb
|
10
|
+
lib/net/ssh/authentication/key_manager.rb
|
11
|
+
lib/net/ssh/authentication/methods/abstract.rb
|
12
|
+
lib/net/ssh/authentication/methods/hostbased.rb
|
13
|
+
lib/net/ssh/authentication/methods/keyboard_interactive.rb
|
14
|
+
lib/net/ssh/authentication/methods/password.rb
|
15
|
+
lib/net/ssh/authentication/methods/publickey.rb
|
16
|
+
lib/net/ssh/authentication/pageant.rb
|
17
|
+
lib/net/ssh/authentication/session.rb
|
18
|
+
lib/net/ssh/buffer.rb
|
19
|
+
lib/net/ssh/buffered_io.rb
|
20
|
+
lib/net/ssh/config.rb
|
21
|
+
lib/net/ssh/connection/channel.rb
|
22
|
+
lib/net/ssh/connection/constants.rb
|
23
|
+
lib/net/ssh/connection/session.rb
|
24
|
+
lib/net/ssh/connection/term.rb
|
25
|
+
lib/net/ssh/errors.rb
|
26
|
+
lib/net/ssh/key_factory.rb
|
27
|
+
lib/net/ssh/known_hosts.rb
|
28
|
+
lib/net/ssh/loggable.rb
|
29
|
+
lib/net/ssh/packet.rb
|
30
|
+
lib/net/ssh/prompt.rb
|
31
|
+
lib/net/ssh/proxy/command.rb
|
32
|
+
lib/net/ssh/proxy/errors.rb
|
33
|
+
lib/net/ssh/proxy/http.rb
|
34
|
+
lib/net/ssh/proxy/socks4.rb
|
35
|
+
lib/net/ssh/proxy/socks5.rb
|
36
|
+
lib/net/ssh/ruby_compat.rb
|
37
|
+
lib/net/ssh/service/forward.rb
|
38
|
+
lib/net/ssh/test.rb
|
39
|
+
lib/net/ssh/test/channel.rb
|
40
|
+
lib/net/ssh/test/extensions.rb
|
41
|
+
lib/net/ssh/test/kex.rb
|
42
|
+
lib/net/ssh/test/local_packet.rb
|
43
|
+
lib/net/ssh/test/packet.rb
|
44
|
+
lib/net/ssh/test/remote_packet.rb
|
45
|
+
lib/net/ssh/test/script.rb
|
46
|
+
lib/net/ssh/test/socket.rb
|
47
|
+
lib/net/ssh/transport/algorithms.rb
|
48
|
+
lib/net/ssh/transport/cipher_factory.rb
|
49
|
+
lib/net/ssh/transport/constants.rb
|
50
|
+
lib/net/ssh/transport/hmac.rb
|
51
|
+
lib/net/ssh/transport/hmac/abstract.rb
|
52
|
+
lib/net/ssh/transport/hmac/md5.rb
|
53
|
+
lib/net/ssh/transport/hmac/md5_96.rb
|
54
|
+
lib/net/ssh/transport/hmac/none.rb
|
55
|
+
lib/net/ssh/transport/hmac/sha1.rb
|
56
|
+
lib/net/ssh/transport/hmac/sha1_96.rb
|
57
|
+
lib/net/ssh/transport/identity_cipher.rb
|
58
|
+
lib/net/ssh/transport/kex.rb
|
59
|
+
lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb
|
60
|
+
lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb
|
61
|
+
lib/net/ssh/transport/openssl.rb
|
62
|
+
lib/net/ssh/transport/packet_stream.rb
|
63
|
+
lib/net/ssh/transport/server_version.rb
|
64
|
+
lib/net/ssh/transport/session.rb
|
65
|
+
lib/net/ssh/transport/state.rb
|
66
|
+
lib/net/ssh/verifiers/lenient.rb
|
67
|
+
lib/net/ssh/verifiers/null.rb
|
68
|
+
lib/net/ssh/verifiers/strict.rb
|
69
|
+
lib/net/ssh/version.rb
|
70
|
+
net-ssh.gemspec
|
71
|
+
setup.rb
|
72
|
+
support/arcfour_check.rb
|
73
|
+
support/ssh_tunnel_bug.rb
|
74
|
+
test/authentication/methods/common.rb
|
75
|
+
test/authentication/methods/test_abstract.rb
|
76
|
+
test/authentication/methods/test_hostbased.rb
|
77
|
+
test/authentication/methods/test_keyboard_interactive.rb
|
78
|
+
test/authentication/methods/test_password.rb
|
79
|
+
test/authentication/methods/test_publickey.rb
|
80
|
+
test/authentication/test_agent.rb
|
81
|
+
test/authentication/test_key_manager.rb
|
82
|
+
test/authentication/test_session.rb
|
83
|
+
test/common.rb
|
84
|
+
test/configs/eqsign
|
85
|
+
test/configs/exact_match
|
86
|
+
test/configs/host_plus
|
87
|
+
test/configs/multihost
|
88
|
+
test/configs/wild_cards
|
89
|
+
test/connection/test_channel.rb
|
90
|
+
test/connection/test_session.rb
|
91
|
+
test/test_all.rb
|
92
|
+
test/test_buffer.rb
|
93
|
+
test/test_buffered_io.rb
|
94
|
+
test/test_config.rb
|
95
|
+
test/test_key_factory.rb
|
96
|
+
test/transport/hmac/test_md5.rb
|
97
|
+
test/transport/hmac/test_md5_96.rb
|
98
|
+
test/transport/hmac/test_none.rb
|
99
|
+
test/transport/hmac/test_sha1.rb
|
100
|
+
test/transport/hmac/test_sha1_96.rb
|
101
|
+
test/transport/kex/test_diffie_hellman_group1_sha1.rb
|
102
|
+
test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
|
103
|
+
test/transport/test_algorithms.rb
|
104
|
+
test/transport/test_cipher_factory.rb
|
105
|
+
test/transport/test_hmac.rb
|
106
|
+
test/transport/test_identity_cipher.rb
|
107
|
+
test/transport/test_packet_stream.rb
|
108
|
+
test/transport/test_server_version.rb
|
109
|
+
test/transport/test_session.rb
|
110
|
+
test/transport/test_state.rb
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/gempackagetask'
|
4
|
+
require 'fileutils'
|
5
|
+
include FileUtils
|
6
|
+
|
7
|
+
begin
|
8
|
+
require 'hanna/rdoctask'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rake/rdoctask'
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
task :default => :package
|
15
|
+
|
16
|
+
# CONFIG =============================================================
|
17
|
+
|
18
|
+
# Change the following according to your needs
|
19
|
+
README = "README.rdoc"
|
20
|
+
CHANGES = "CHANGELOG.rdoc"
|
21
|
+
THANKS = 'THANKS.rdoc'
|
22
|
+
|
23
|
+
# Files and directories to be deleted when you run "rake clean"
|
24
|
+
CLEAN.include [ 'pkg', '*.gem', '.config', 'doc']
|
25
|
+
|
26
|
+
# Virginia assumes your project and gemspec have the same name
|
27
|
+
name = 'net-ssh'
|
28
|
+
load "#{name}.gemspec"
|
29
|
+
version = @spec.version
|
30
|
+
|
31
|
+
# That's it! The following defaults should allow you to get started
|
32
|
+
# on other things.
|
33
|
+
|
34
|
+
|
35
|
+
# TESTS/SPECS =========================================================
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
# INSTALL =============================================================
|
40
|
+
|
41
|
+
Rake::GemPackageTask.new(@spec) do |p|
|
42
|
+
p.need_tar = true if RUBY_PLATFORM !~ /mswin/
|
43
|
+
end
|
44
|
+
|
45
|
+
task :release => [ :rdoc, :package ]
|
46
|
+
task :install => [ :rdoc, :package ] do
|
47
|
+
sh %{sudo gem install pkg/#{name}-#{version}.gem}
|
48
|
+
end
|
49
|
+
task :uninstall => [ :clean ] do
|
50
|
+
sh %{sudo gem uninstall #{name}}
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
# RUBYFORGE RELEASE / PUBLISH TASKS ==================================
|
55
|
+
|
56
|
+
if @spec.rubyforge_project
|
57
|
+
desc 'Publish website to rubyforge'
|
58
|
+
task 'publish:rdoc' => 'doc/index.html' do
|
59
|
+
sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/ssh/v2/api/"
|
60
|
+
end
|
61
|
+
|
62
|
+
desc 'Public release to rubyforge'
|
63
|
+
task 'publish:gem' => [:package] do |t|
|
64
|
+
sh <<-end
|
65
|
+
rubyforge add_release -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
|
66
|
+
rubyforge add_file -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
# RUBY DOCS TASK ==================================
|
74
|
+
|
75
|
+
Rake::RDocTask.new do |t|
|
76
|
+
t.rdoc_dir = 'doc'
|
77
|
+
t.title = @spec.summary
|
78
|
+
t.options << '--line-numbers' << '-A cattr_accessor=object'
|
79
|
+
t.options << '--charset' << 'utf-8'
|
80
|
+
t.rdoc_files.include(README)
|
81
|
+
t.rdoc_files.include(CHANGES)
|
82
|
+
t.rdoc_files.include(THANKS)
|
83
|
+
t.rdoc_files.include('lib/**/*.rb')
|
84
|
+
end
|
85
|
+
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# Rudyfile
|
2
|
+
#
|
3
|
+
# This configuration is used to test installing
|
4
|
+
# and running net-ssh on a clean machine.
|
5
|
+
#
|
6
|
+
# Usage:
|
7
|
+
#
|
8
|
+
# $ rudy -vv startup
|
9
|
+
# $ rudy -vv testsuite
|
10
|
+
# $ rudy -vv shutdown
|
11
|
+
#
|
12
|
+
# Requires: Rudy 0.9 (http://code.google.com/p/rudy/)
|
13
|
+
#
|
14
|
+
|
15
|
+
defaults do
|
16
|
+
color true
|
17
|
+
environment :test
|
18
|
+
role :netssh
|
19
|
+
end
|
20
|
+
|
21
|
+
machines do
|
22
|
+
region :'us-east-1' do
|
23
|
+
ami 'ami-e348af8a' # Alestic Debian 5.0, 32-bit (US)
|
24
|
+
end
|
25
|
+
env :test do
|
26
|
+
role :netssh do
|
27
|
+
user :root
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
commands do
|
33
|
+
allow :apt_get, "apt-get", :y, :q
|
34
|
+
allow :gem_install, "/usr/bin/gem", "install", :n, '/usr/bin', :y, :V, "--no-rdoc", "--no-ri"
|
35
|
+
allow :gem_sources, "/usr/bin/gem", "sources"
|
36
|
+
allow :gem_uninstall, "/usr/bin/gem", "uninstall", :V
|
37
|
+
allow :update_rubygems
|
38
|
+
allow :rm
|
39
|
+
end
|
40
|
+
|
41
|
+
routines do
|
42
|
+
|
43
|
+
testsuite do
|
44
|
+
before :sysupdate, :installdeps, :install_gem
|
45
|
+
|
46
|
+
remote :root do
|
47
|
+
directory_upload 'test', '/tmp/'
|
48
|
+
cd '/tmp'
|
49
|
+
ruby :I, 'lib/', :I, 'test/', :r, 'rubygems', 'test/test_all.rb'
|
50
|
+
end
|
51
|
+
|
52
|
+
after :install_rubyforge, :install_github
|
53
|
+
end
|
54
|
+
|
55
|
+
install_gem do
|
56
|
+
before :package_gem
|
57
|
+
remote :root do
|
58
|
+
disable_safe_mode
|
59
|
+
file_upload "pkg/net-ssh-*.gem", "/tmp/"
|
60
|
+
gem_install "/tmp/net-ssh-*.gem"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
package_gem do
|
65
|
+
local do
|
66
|
+
rm :r, :f, 'pkg'
|
67
|
+
rake 'package'
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
remove do
|
72
|
+
remote :root do
|
73
|
+
gem_uninstall 'net-ssh'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
installdeps do
|
78
|
+
remote :root do
|
79
|
+
gem_install "rye", "test-unit", "mocha"
|
80
|
+
rye 'authorize-local'
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
sysupdate do
|
85
|
+
remote :root do
|
86
|
+
apt_get "update"
|
87
|
+
apt_get "install", "build-essential", "git-core"
|
88
|
+
apt_get "install", "ruby1.8-dev", "rdoc", "libzlib-ruby", "rubygems"
|
89
|
+
mkdir :p, "/var/lib/gems/1.8/bin" # Doesn't get created, but causes Rubygems to fail
|
90
|
+
gem_install "builder", "session"
|
91
|
+
gem_install 'rubygems-update', "-v=1.3.4" # circular issue with 1.3.5 and hoe
|
92
|
+
update_rubygems
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|