docker_core 0.0.47 → 0.0.49

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 +13 -19
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3080db9eab10fdab069b70839778865f52dc1715ca454306e039b8e87385f175
4
- data.tar.gz: ca4cab43ff86bb144920a27c704bd0d32ec4fd0e7b252df8ad95f26e47dd9b60
3
+ metadata.gz: '091c0653e6c3e0f2092ec6e23859963f64e84e47a4c145b6324d637c33d6dee9'
4
+ data.tar.gz: ed043df57bb9b5d68abdb3909bb40683d276bed953950260ed4ae474cdba7b89
5
5
  SHA512:
6
- metadata.gz: 3791716df3065ef2925ac2d3f8d2c9a76284b8a8cac8eafd1778d4b54dc728f622c065c787d7dfdebc377e8c81ee145bcf66f170738f5175ee6410dfe832ec45
7
- data.tar.gz: 7deefec9530da38d4e741a28b5005e8cd7d0e90c4667862d4cc63e4bbd5106f78962c81b0ad3460c0aa09bbc29359013f5da25cdf608a7bacf66309d7dddd38b
6
+ metadata.gz: 1b51538e23314b1c8527b6e91e3b6d41e0310139335379134364b669d237f40db3a7e0e204a970135df0a3d693b0bf923d189370d405f2e640f057970a0c5df1
7
+ data.tar.gz: 6c92451e4960b171d3dc5d5e7559bc405a893529de5a01a6c6784d4087bea6b7c8432af18887e10545c865346fd03aa78f6ce59e55ae04056f54ea03b459d1ea
data/lib/docker_core.rb CHANGED
@@ -320,7 +320,7 @@ module DockerCore
320
320
  end
321
321
  end
322
322
 
323
- module Process
323
+ module System
324
324
  # @param [Numeric] second
325
325
  def self.wait(second = 0)
326
326
  if second.is_a?(Numeric)
@@ -389,27 +389,21 @@ module DockerCore
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
@@ -433,7 +427,7 @@ module DockerCore
433
427
 
434
428
  # @param [String] unit
435
429
  def self.is_active_unit(unit)
436
- return 'active' == Process.capture("systemctl is-active #{unit}").downcase
430
+ return 'active' == System.capture("systemctl is-active #{unit}").downcase
437
431
  end
438
432
 
439
433
  # @param [Array<String>] arguments
@@ -627,10 +621,10 @@ module DockerCore
627
621
  uid = ENV.fetch('DOCKER_CORE_UID', uid)
628
622
  gid = ENV.fetch('DOCKER_CORE_GID', gid)
629
623
 
630
- Process.run('deluser', USER, throw: false)
631
- Process.run('delgroup', GROUP, throw: false)
632
- Process.run('addgroup', { system: true, gid: gid }, GROUP)
633
- Process.run('adduser', { system: true, 'disabled-password': true, 'no-create-home': true, ingroup: GROUP, gecos: USER, shell: '/bin/bash', uid: uid }, USER)
624
+ System.run('deluser', USER, throw: false)
625
+ System.run('delgroup', GROUP, throw: false)
626
+ System.run('addgroup', { system: true, gid: gid }, GROUP)
627
+ System.run('adduser', { system: true, 'disabled-password': true, 'no-create-home': true, ingroup: GROUP, gecos: USER, shell: '/bin/bash', uid: uid }, USER)
634
628
  end
635
629
 
636
630
  # @param [String] stdout
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.47
4
+ version: 0.0.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - agrozyme