kommando 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/examples/shell.rb +7 -0
- data/lib/kommando.rb +17 -2
- data/lib/kommando/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d3521e56231b4dc2100fce519d440157005c3f7
|
4
|
+
data.tar.gz: 382b63f80f81059847e56cb51a0fcc62366ee2f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c5673c728d2a97ac292e4a03918bf8d2a65eb0a4f6f47d1c53fdbf658775de5d5f41063d8cb595483961ed001d4c59bb769c0c6943f7c26196c6cd1fbc4e229
|
7
|
+
data.tar.gz: 33b3dbbce80ba81ce23c1a4777b4233540582c06958347f1605ee1064a4585cfd76afcbcf97f09b8c94aad0276b8c515428658a26e21e52370589ab9b098fe5a
|
data/CHANGELOG.md
CHANGED
data/examples/shell.rb
ADDED
data/lib/kommando.rb
CHANGED
@@ -31,6 +31,8 @@ class Kommando
|
|
31
31
|
|
32
32
|
@thread = nil
|
33
33
|
@pid = nil
|
34
|
+
|
35
|
+
@shell = false
|
34
36
|
end
|
35
37
|
|
36
38
|
def run_async
|
@@ -48,7 +50,16 @@ class Kommando
|
|
48
50
|
return false if @executed
|
49
51
|
@executed = true
|
50
52
|
|
51
|
-
command, *args = @cmd.
|
53
|
+
command, *args = if @cmd.start_with? "$"
|
54
|
+
@shell = true
|
55
|
+
trash, line = @cmd.split "$"
|
56
|
+
line.lstrip!
|
57
|
+
["bash", "-c", line]
|
58
|
+
else
|
59
|
+
#command, *args = @cmd.split " "
|
60
|
+
@cmd.split " "
|
61
|
+
end
|
62
|
+
|
52
63
|
begin
|
53
64
|
PTY.spawn(command, *args) do |stdout, stdin, pid|
|
54
65
|
if @retry && stdout.eof?
|
@@ -132,7 +143,11 @@ class Kommando
|
|
132
143
|
end
|
133
144
|
|
134
145
|
def out
|
135
|
-
@
|
146
|
+
if @shell
|
147
|
+
@stdout.to_s.strip
|
148
|
+
else
|
149
|
+
@stdout.to_s
|
150
|
+
end
|
136
151
|
end
|
137
152
|
|
138
153
|
def code
|
data/lib/kommando/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kommando
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matti Paksula
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- examples/kill.rb
|
110
110
|
- examples/live_output.rb
|
111
111
|
- examples/ping.rb
|
112
|
+
- examples/shell.rb
|
112
113
|
- examples/stdout_to_file.rb
|
113
114
|
- examples/timeout.rb
|
114
115
|
- examples/uptime.rb
|