ztk 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. data/README.md +6 -9
  2. data/Rakefile +1 -1
  3. data/lib/ztk.rb +1 -1
  4. data/lib/ztk/background.rb +1 -1
  5. data/lib/ztk/base.rb +1 -1
  6. data/lib/ztk/benchmark.rb +1 -1
  7. data/lib/ztk/command.rb +1 -1
  8. data/lib/ztk/config.rb +1 -1
  9. data/lib/ztk/dsl.rb +1 -1
  10. data/lib/ztk/dsl/base.rb +1 -1
  11. data/lib/ztk/dsl/core.rb +1 -1
  12. data/lib/ztk/dsl/core/actions.rb +1 -1
  13. data/lib/ztk/dsl/core/actions/find.rb +1 -1
  14. data/lib/ztk/dsl/core/actions/timestamps.rb +1 -1
  15. data/lib/ztk/dsl/core/attributes.rb +1 -1
  16. data/lib/ztk/dsl/core/dataset.rb +1 -1
  17. data/lib/ztk/dsl/core/io.rb +1 -1
  18. data/lib/ztk/dsl/core/relations.rb +1 -1
  19. data/lib/ztk/dsl/core/relations/belongs_to.rb +1 -1
  20. data/lib/ztk/dsl/core/relations/has_many.rb +1 -1
  21. data/lib/ztk/logger.rb +1 -1
  22. data/lib/ztk/parallel.rb +1 -1
  23. data/lib/ztk/report.rb +1 -1
  24. data/lib/ztk/rescue_retry.rb +1 -1
  25. data/lib/ztk/spinner.rb +1 -1
  26. data/lib/ztk/ssh.rb +3 -1
  27. data/lib/ztk/tcp_socket_check.rb +1 -1
  28. data/lib/ztk/template.rb +1 -1
  29. data/lib/ztk/ui.rb +2 -2
  30. data/lib/ztk/version.rb +2 -2
  31. data/spec/spec_helper.rb +1 -1
  32. data/spec/ztk/background_spec.rb +1 -1
  33. data/spec/ztk/base_spec.rb +1 -1
  34. data/spec/ztk/benchmark_spec.rb +1 -1
  35. data/spec/ztk/command_spec.rb +1 -1
  36. data/spec/ztk/config_spec.rb +1 -1
  37. data/spec/ztk/dsl_spec.rb +1 -1
  38. data/spec/ztk/logger_spec.rb +1 -1
  39. data/spec/ztk/parallel_spec.rb +1 -1
  40. data/spec/ztk/rescue_retry_spec.rb +1 -1
  41. data/spec/ztk/spinner_spec.rb +1 -1
  42. data/spec/ztk/ssh_spec.rb +103 -5
  43. data/spec/ztk/tcp_socket_check_spec.rb +1 -1
  44. data/spec/ztk/template_spec.rb +1 -1
  45. data/spec/ztk/ui_spec.rb +1 -1
  46. data/spec/ztk/version_spec.rb +1 -1
  47. metadata +3 -3
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- [![Build Status](https://secure.travis-ci.org/jovelabs/ztk.png)](http://travis-ci.org/jovelabs/ztk) [![Dependency Status](https://gemnasium.com/jovelabs/ztk.png)](https://gemnasium.com/jovelabs/ztk)
1
+ [![Build Status](https://secure.travis-ci.org/zpatten/ztk.png)](http://travis-ci.org/zpatten/ztk)
2
+ [![Dependency Status](https://gemnasium.com/zpatten/ztk.png)](https://gemnasium.com/zpatten/ztk)
2
3
 
3
4
  # ZTK
4
5
 
@@ -8,26 +9,22 @@ Zachary's (DevOp) Tool Kit is a general purpose utility gem, featuring a collect
8
9
 
9
10
  Source:
10
11
 
11
- * https://github.com/jovelabs/ztk
12
+ * https://github.com/zpatten/ztk
12
13
 
13
14
  Issues:
14
15
 
15
- * https://github.com/jovelabs/ztk/issues
16
+ * https://github.com/zpatten/ztk/issues
16
17
 
17
18
  Documentation:
18
19
 
19
- * http://jovelabs.github.com/ztk/
20
-
21
- Wiki:
22
-
23
- * https://github.com/jovelabs/ztk/wiki
20
+ * http://zpatten.github.com/ztk/
24
21
 
25
22
  # LICENSE
26
23
 
27
24
  ZTK - Zachary's (DevOp) Tool Kit
28
25
 
29
26
  * Author: Zachary Patten <zachary@jovelabs.net>
30
- * Copyright: Copyright (c) Jove Labs
27
+ * Copyright: Copyright (c) Zachary Patten
31
28
  * License: Apache License, Version 2.0
32
29
 
33
30
  Licensed under the Apache License, Version 2.0 (the "License");
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
data/lib/ztk.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, VersIOn 2.0
6
6
  #
7
7
  # Licensed under the Apache License, VersIOn 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, VersIOn 2.0
6
6
  #
7
7
  # Licensed under the Apache License, VersIOn 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -398,6 +398,7 @@ module ZTK
398
398
  command << [ "-o", "ServerAliveInterval=60" ]
399
399
  command << [ "-i", config.keys ] if config.keys
400
400
  command << [ "-p", config.port ] if config.port
401
+ command << [ "-t" ] if config.request_pty
401
402
  command << [ "-o", "ProxyCommand=\"#{proxy_command}\"" ] if config.proxy_host_name
402
403
  command << "#{config.user}@#{config.host_name}"
403
404
  command = command.flatten.compact.join(" ")
@@ -419,6 +420,7 @@ module ZTK
419
420
  command << [ "-o", "ServerAliveInterval=60" ]
420
421
  command << [ "-i", config.proxy_keys ] if config.proxy_keys
421
422
  command << [ "-p", config.proxy_port ] if config.proxy_port
423
+ command << [ "-t" ] if config.request_pty
422
424
  command << "#{config.proxy_user}@#{config.proxy_host_name}"
423
425
  command << "nc %h %p"
424
426
  command = command.flatten.compact.join(" ")
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, VersIOn 2.0
6
6
  #
7
7
  # Licensed under the Apache License, VersIOn 2.0 (the "License");
@@ -28,7 +28,7 @@ module ZTK
28
28
  class UIError < Error; end
29
29
 
30
30
  # ZTK UI Class
31
- #
31
+ #
32
32
  # This class encapsulates a STDOUT, STDERR, STDIN
33
33
  # and logging device.
34
34
  #
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,6 +21,6 @@
21
21
  module ZTK
22
22
 
23
23
  # ZTK Version String
24
- VERSION = "1.0.5"
24
+ VERSION = "1.0.6"
25
25
 
26
26
  end
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -125,7 +125,7 @@ describe ZTK::SSH do
125
125
 
126
126
  describe "stdout" do
127
127
 
128
- it "should capture STDOUT and send it to the appropriate pipe" do
128
+ it "should capture STDOUT (with PTY) and send it to the STDOUT pipe" do
129
129
  subject.config do |config|
130
130
  config.ui = $ui
131
131
 
@@ -146,11 +146,34 @@ describe ZTK::SSH do
146
146
  $ui.stdin.read.match(data).should be nil
147
147
  end
148
148
 
149
+ it "should capture STDOUT (without PTY) and send it to the STDOUT pipe" do
150
+ subject.config do |config|
151
+ config.ui = $ui
152
+
153
+ config.user = ENV["USER"]
154
+ config.host_name = "127.0.0.1"
155
+
156
+ config.request_pty = false
157
+ end
158
+ data = "Hello World @ #{Time.now.utc}"
159
+
160
+ subject.exec(%Q{echo "#{data}" -f >&1})
161
+
162
+ $ui.stdout.rewind
163
+ $ui.stdout.read.match(data).should_not be nil
164
+
165
+ $ui.stderr.rewind
166
+ $ui.stderr.read.match(data).should be nil
167
+
168
+ $ui.stdin.rewind
169
+ $ui.stdin.read.match(data).should be nil
170
+ end
171
+
149
172
  end
150
173
 
151
174
  describe "stderr" do
152
175
 
153
- it "should capture STDERR and send it to the appropriate pipe" do
176
+ it "should capture STDERR (with PTY) and send it to the STDOUT pipe" do
154
177
  subject.config do |config|
155
178
  config.ui = $ui
156
179
 
@@ -161,6 +184,29 @@ describe ZTK::SSH do
161
184
 
162
185
  subject.exec(%Q{echo "#{data}" -f >&2})
163
186
 
187
+ $ui.stdout.rewind
188
+ $ui.stdout.read.match(data).should_not be nil
189
+
190
+ $ui.stderr.rewind
191
+ $ui.stderr.read.match(data).should be nil
192
+
193
+ $ui.stdin.rewind
194
+ $ui.stdin.read.match(data).should be nil
195
+ end
196
+
197
+ it "should capture STDERR (without PTY) and send it to the STDERR pipe" do
198
+ subject.config do |config|
199
+ config.ui = $ui
200
+
201
+ config.user = ENV["USER"]
202
+ config.host_name = "127.0.0.1"
203
+
204
+ config.request_pty = false
205
+ end
206
+ data = "Hello World @ #{Time.now.utc}"
207
+
208
+ subject.exec(%Q{echo "#{data}" -f >&2})
209
+
164
210
  $ui.stdout.rewind
165
211
  $ui.stdout.read.match(data).should be nil
166
212
 
@@ -170,6 +216,7 @@ describe ZTK::SSH do
170
216
  $ui.stdin.rewind
171
217
  $ui.stdin.read.match(data).should be nil
172
218
  end
219
+
173
220
  end
174
221
 
175
222
  end
@@ -338,7 +385,30 @@ describe ZTK::SSH do
338
385
 
339
386
  describe "stdout" do
340
387
 
341
- it "should capture STDOUT and send it to the appropriate pipe" do
388
+ it "should capture STDOUT (with PTY) and send it to the STDOUT pipe" do
389
+ subject.config do |config|
390
+ config.ui = $ui
391
+
392
+ config.user = ENV["USER"]
393
+ config.host_name = "127.0.0.1"
394
+ config.proxy_user = ENV["USER"]
395
+ config.proxy_host_name = "127.0.0.1"
396
+ end
397
+ data = "Hello World @ #{Time.now.utc}"
398
+
399
+ subject.exec(%Q{echo "#{data}" -f >&1})
400
+
401
+ $ui.stdout.rewind
402
+ $ui.stdout.read.match(data).should_not be nil
403
+
404
+ $ui.stderr.rewind
405
+ $ui.stderr.read.match(data).should be nil
406
+
407
+ $ui.stdin.rewind
408
+ $ui.stdin.read.match(data).should be nil
409
+ end
410
+
411
+ it "should capture STDOUT (without PTY) and send it to the STDOUT pipe" do
342
412
  subject.config do |config|
343
413
  config.ui = $ui
344
414
 
@@ -346,6 +416,8 @@ describe ZTK::SSH do
346
416
  config.host_name = "127.0.0.1"
347
417
  config.proxy_user = ENV["USER"]
348
418
  config.proxy_host_name = "127.0.0.1"
419
+
420
+ config.request_pty = false
349
421
  end
350
422
  data = "Hello World @ #{Time.now.utc}"
351
423
 
@@ -365,7 +437,7 @@ describe ZTK::SSH do
365
437
 
366
438
  describe "stderr" do
367
439
 
368
- it "should capture STDERR and send it to the appropriate pipe" do
440
+ it "should capture STDERR (with PTY) and send it to the STDOUT pipe" do
369
441
  subject.config do |config|
370
442
  config.ui = $ui
371
443
 
@@ -378,6 +450,31 @@ describe ZTK::SSH do
378
450
 
379
451
  subject.exec(%Q{echo "#{data}" -f >&2})
380
452
 
453
+ $ui.stdout.rewind
454
+ $ui.stdout.read.match(data).should_not be nil
455
+
456
+ $ui.stderr.rewind
457
+ $ui.stderr.read.match(data).should be nil
458
+
459
+ $ui.stdin.rewind
460
+ $ui.stdin.read.match(data).should be nil
461
+ end
462
+
463
+ it "should capture STDERR (without PTY) and send it to the STDERR pipe" do
464
+ subject.config do |config|
465
+ config.ui = $ui
466
+
467
+ config.user = ENV["USER"]
468
+ config.host_name = "127.0.0.1"
469
+ config.proxy_user = ENV["USER"]
470
+ config.proxy_host_name = "127.0.0.1"
471
+
472
+ config.request_pty = false
473
+ end
474
+ data = "Hello World @ #{Time.now.utc}"
475
+
476
+ subject.exec(%Q{echo "#{data}" -f >&2})
477
+
381
478
  $ui.stdout.rewind
382
479
  $ui.stdout.read.match(data).should be nil
383
480
 
@@ -387,6 +484,7 @@ describe ZTK::SSH do
387
484
  $ui.stdin.rewind
388
485
  $ui.stdin.read.match(data).should be nil
389
486
  end
487
+
390
488
  end
391
489
 
392
490
  end
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,7 +1,7 @@
1
1
  ################################################################################
2
2
  #
3
3
  # Author: Zachary Patten <zachary@jovelabs.net>
4
- # Copyright: Copyright (c) Jove Labs
4
+ # Copyright: Copyright (c) Zachary Patten
5
5
  # License: Apache License, Version 2.0
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License");
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ztk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -250,7 +250,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
250
  version: '0'
251
251
  segments:
252
252
  - 0
253
- hash: -3842660974707417697
253
+ hash: 2228894920883556406
254
254
  required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  none: false
256
256
  requirements:
@@ -259,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  version: '0'
260
260
  segments:
261
261
  - 0
262
- hash: -3842660974707417697
262
+ hash: 2228894920883556406
263
263
  requirements: []
264
264
  rubyforge_project:
265
265
  rubygems_version: 1.8.24