atk_toolbox 0.0.138 → 0.0.139
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atk/console.rb +9 -5
- data/lib/atk_toolbox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcedfdb8a7b4ede18ef2127c4135e27a3337ed00864a77d625d1eb3c68ceb1a2
|
4
|
+
data.tar.gz: 5dc0b7c8e472e3676f6b2cd8ff7f54ab5b3b605dd201e0df652cddbb52bcd783
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca328d42404ad2727e719398884103b2e1c3c75a54035fa3a2df5c08afc2406c6b7f1330ab745560bd2234f9ff0c4e17d6efea72fbf4a9a49be4d24f08246945
|
7
|
+
data.tar.gz: f66f3b58e7fc3980b0a9e2feda8ab066c4a13cf59393e16bbe39a6cd735afeedab2afb98ecd8fadfddbb9d41cef017835af633a9917486ab3c6931450b11c29a
|
data/lib/atk/console.rb
CHANGED
@@ -110,7 +110,7 @@ Console = Class.new do
|
|
110
110
|
#
|
111
111
|
# returns the command object, ignores errors
|
112
112
|
#
|
113
|
-
def run!(command)
|
113
|
+
def run!(command, **keyword_arguments)
|
114
114
|
if command.is_a?(String)
|
115
115
|
# by default return a string with stderr included
|
116
116
|
begin
|
@@ -118,7 +118,9 @@ Console = Class.new do
|
|
118
118
|
Process.wait(command_info.pid)
|
119
119
|
process_info = $?
|
120
120
|
result = CommandResult.new(command_info, process_info)
|
121
|
-
|
121
|
+
if keyword_arguments[:silent] != true
|
122
|
+
puts result.read
|
123
|
+
end
|
122
124
|
rescue
|
123
125
|
process_info = $?
|
124
126
|
result = CommandResult.new(nil, process_info)
|
@@ -137,7 +139,7 @@ Console = Class.new do
|
|
137
139
|
#
|
138
140
|
# returns true if successful, false/nil on error
|
139
141
|
#
|
140
|
-
def run?(command)
|
142
|
+
def run?(command, **keyword_arguments)
|
141
143
|
if command.is_a?(String)
|
142
144
|
return system(command)
|
143
145
|
else
|
@@ -153,7 +155,7 @@ Console = Class.new do
|
|
153
155
|
#
|
154
156
|
# returns process info if successful, raises error if command failed
|
155
157
|
#
|
156
|
-
def run(command)
|
158
|
+
def run(command, **keyword_arguments)
|
157
159
|
if command.is_a?(String)
|
158
160
|
# by default return a string with stderr included
|
159
161
|
begin
|
@@ -161,7 +163,9 @@ Console = Class.new do
|
|
161
163
|
Process.wait(command_info.pid)
|
162
164
|
process_info = $?
|
163
165
|
result = CommandResult.new(command_info, process_info)
|
164
|
-
|
166
|
+
if keyword_arguments[:silent] != true
|
167
|
+
puts result.read
|
168
|
+
end
|
165
169
|
rescue
|
166
170
|
process_info = $?
|
167
171
|
result = CommandResult.new(nil, process_info)
|
data/lib/atk_toolbox/version.rb
CHANGED