docker_core 0.0.46 → 0.0.48

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/docker_core.rb +14 -20
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc5a7c7bdeaa972ac897b276fb9c4e10ba07b2e1755c26eba29532422263a239
4
- data.tar.gz: 2b75168f138dbccc48ae406a1c84f3d7229c129e27be4becc6a75ad4ab0f8cbf
3
+ metadata.gz: dbdb1ce3da5303a7ab1182c8b340756c9f847c3c7b120a85bb57baa314fa8e1d
4
+ data.tar.gz: a1e34024c6a29dff0de13505a239cfe7def44b81297e505aff554b14e520a9e9
5
5
  SHA512:
6
- metadata.gz: 46c4d4ba31cceacc0628e1df50c6f33f8369923fe8067c6d221d97570ad186237db2f697568638a7eb9dfaa0f5063b6a1f65bf055ea1948378f466ac89317dc8
7
- data.tar.gz: 686fc5414199f20b15dba0012581c2d17f56a9c9029ed1d3ce49e331833a3d3dbd23b77445a9c69df0661c2f783e0c7754aca504c80a1122416e32f96452c70c
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.sleep(second = 0)
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] sleep
353
+ # @param [Numeric] wait
354
354
  # @param [Boolean] strip
355
355
  # @param [Boolean] echo
356
- def self.capture(*arguments, sudo: SUDO, throw: false, sleep: 0, strip: true, echo: 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.sleep(sleep)
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] sleep
377
+ # @param [Numeric] wait
378
378
  # @param [Boolean] echo
379
- def self.run(*arguments, sudo: SUDO, throw: true, sleep: 0, echo: 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.sleep(sleep)
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
- def self.execute(*arguments, sudo: SUDO, echo: true)
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
- exec(command)
401
- end
402
-
403
- # @param [Array] arguments
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.46
4
+ version: 0.0.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - agrozyme