docker_core 0.0.46 → 0.0.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docker_core.rb +14 -20
- 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: dbdb1ce3da5303a7ab1182c8b340756c9f847c3c7b120a85bb57baa314fa8e1d
|
4
|
+
data.tar.gz: a1e34024c6a29dff0de13505a239cfe7def44b81297e505aff554b14e520a9e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 070edfeb7ddf10ac4b33ba2b5f0202f4c620459a2ee7474be41f3baaed047a1439219009902deab0bba4153af0f190d2f517e5f781a6774e2fe79f93d7e26094
|
7
|
+
data.tar.gz: a98e9e13ce85dbbc58e3afb0b08117194bf34df82ff69710b4b97abfb902d733a74931c38a65d257bd647d3d1410d50a129d2dfccd0f2acd34855c6851f64138
|
data/lib/docker_core.rb
CHANGED
@@ -322,7 +322,7 @@ module DockerCore
|
|
322
322
|
|
323
323
|
module Process
|
324
324
|
# @param [Numeric] second
|
325
|
-
def self.
|
325
|
+
def self.wait(second = 0)
|
326
326
|
if second.is_a?(Numeric)
|
327
327
|
if 0 > second
|
328
328
|
return sleep
|
@@ -350,10 +350,10 @@ module DockerCore
|
|
350
350
|
# @param [Array] arguments
|
351
351
|
# @param [Boolean, String] sudo
|
352
352
|
# @param [Boolean] throw
|
353
|
-
# @param [Numeric]
|
353
|
+
# @param [Numeric] wait
|
354
354
|
# @param [Boolean] strip
|
355
355
|
# @param [Boolean] echo
|
356
|
-
def self.capture(*arguments, sudo: SUDO, throw: false,
|
356
|
+
def self.capture(*arguments, sudo: SUDO, throw: false, wait: 0, strip: true, echo: false)
|
357
357
|
begin
|
358
358
|
command = self.command(*arguments, sudo: sudo)
|
359
359
|
|
@@ -363,7 +363,7 @@ module DockerCore
|
|
363
363
|
|
364
364
|
data = `#{command}`
|
365
365
|
result = strip ? "#{data}".strip : data
|
366
|
-
self.
|
366
|
+
self.wait(wait)
|
367
367
|
return result
|
368
368
|
rescue
|
369
369
|
raise unless throw
|
@@ -374,9 +374,9 @@ module DockerCore
|
|
374
374
|
# @param [Array] arguments
|
375
375
|
# @param [Boolean, String] sudo
|
376
376
|
# @param [Boolean] throw
|
377
|
-
# @param [Numeric]
|
377
|
+
# @param [Numeric] wait
|
378
378
|
# @param [Boolean] echo
|
379
|
-
def self.run(*arguments, sudo: SUDO, throw: true,
|
379
|
+
def self.run(*arguments, sudo: SUDO, throw: true, wait: 0, echo: true)
|
380
380
|
command = self.command(*arguments, sudo: sudo)
|
381
381
|
|
382
382
|
if echo
|
@@ -384,32 +384,26 @@ module DockerCore
|
|
384
384
|
end
|
385
385
|
|
386
386
|
result = system(command, exception: throw)
|
387
|
-
self.
|
387
|
+
self.wait(wait)
|
388
388
|
return result
|
389
389
|
end
|
390
390
|
|
391
391
|
# @param [Array] arguments
|
392
|
+
# @param [Boolean] background
|
392
393
|
# @param [Boolean, String] sudo
|
393
|
-
|
394
|
+
# @param [Boolean] echo
|
395
|
+
def self.execute(*arguments, background: false, sudo: SUDO, echo: true)
|
394
396
|
command = self.command(*arguments, sudo: sudo)
|
395
397
|
|
396
398
|
if echo
|
397
399
|
Color.echo("= #{command}", Color::CYAN)
|
398
400
|
end
|
399
401
|
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
# @param [Boolean, String] sudo
|
405
|
-
def self.spawn(*arguments, sudo: SUDO, echo: true)
|
406
|
-
command = self.command(*arguments, sudo: sudo)
|
407
|
-
|
408
|
-
if echo
|
409
|
-
Color.echo("= #{command}", Color::CYAN)
|
402
|
+
if background
|
403
|
+
return spawn(command)
|
404
|
+
else
|
405
|
+
return exec(command)
|
410
406
|
end
|
411
|
-
|
412
|
-
return spawn(command)
|
413
407
|
end
|
414
408
|
|
415
409
|
# @param [String] title
|