vx-lib-shell 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2b7d6fc28b5070948dd75094444b620d57f1163
4
- data.tar.gz: 5987143de05073b0b25008041dc9896994cdf87a
3
+ metadata.gz: 27f612c2f59db1e3c839b0dccdcda2645f6e1951
4
+ data.tar.gz: b8b502a842f3b63ebeebaddae975ed22971f0926
5
5
  SHA512:
6
- metadata.gz: fd2eca44bf45eb1a9814f8e55861b1fec627c8c28fc71fae42e6792a63d39109a5b73723c8fecc79a18989d70ca384d15fd77495e955057e299849b4919316ef
7
- data.tar.gz: d249cb474a35de4a6a80ed9e5fe329c1f83dcc88bee6006da656ebc32385351b907cda5545d4672326e0a645f148a187ea3b48f16173225d1b510e9434fdd22d
6
+ metadata.gz: 793d8b2c9dd5a51fc2f48d5b9edd8262bf33d44ec734a99412e9d10bb3f302c23cf44fac99b8f766de2c0f12bfaeb68c5e08bd4dd3600a74227c4c47cafda8a0
7
+ data.tar.gz: 031508da2a8a1a854a9b2cd0a872b55879212b6ade6dfcee7ac9b4b0ef4f60566a73182f91cf5132799a4eb72efc63d2e0e3684ce44d54b37811253b408fe550
@@ -9,7 +9,7 @@ module Vx
9
9
  class Process
10
10
 
11
11
  def exec(*args, &block)
12
- options = args.last.is_a?(Hash) ? args.pop : {}
12
+ options = args.last.is_a?(Hash) ? args.pop.dup : {}
13
13
  command = args.first
14
14
  home = options[:home] || "$HOME"
15
15
 
@@ -14,7 +14,7 @@ module Vx
14
14
  end
15
15
 
16
16
  def exec(*args, &block)
17
- options = args.last.is_a?(Hash) ? args.pop : {}
17
+ options = args.last.is_a?(Hash) ? args.pop.dup : {}
18
18
  command = args.first
19
19
  home = options[:home] || "$HOME"
20
20
 
@@ -1,7 +1,7 @@
1
1
  module Vx
2
2
  module Lib
3
3
  module Shell
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
@@ -75,6 +75,15 @@ describe Vx::Lib::Shell::Process do
75
75
  expect(code).to eq(-2)
76
76
  end
77
77
 
78
+ it "dont modify options" do
79
+ options = {read_timeout: 100}
80
+ code = run("echo 1", options)
81
+ expect(code).to eq 0
82
+ code = run("echo 1", options)
83
+ expect(code).to eq 0
84
+ expect(options).to eq(read_timeout: 100)
85
+ end
86
+
78
87
  def run(*args, &block)
79
88
  @proxy ||= ShellTest.new
80
89
  timeout do
data/spec/lib/ssh_spec.rb CHANGED
@@ -87,6 +87,15 @@ describe Vx::Lib::Shell::SSH, ssh: true do
87
87
  expect(code).to eq(-4)
88
88
  end
89
89
 
90
+ it "dont modify options" do
91
+ options = {read_timeout: 100}
92
+ code = run_ssh("echo 1", options)
93
+ expect(code).to eq(0)
94
+ code = run_ssh("echo 1", options)
95
+ expect(code).to eq(0)
96
+ expect(options).to eq(read_timeout: 100)
97
+ end
98
+
90
99
  def open_ssh(&block)
91
100
  described_class.open(host, user, password: pass, paranoid: false, verbose: 2, port: port, &block)
92
101
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vx-lib-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2014-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh