docker_core 0.0.21 → 0.0.22

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 +10 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 275fb150858e7ab66ce56d30261f078e4298b38ef3c4e341c460c8e9fa13ec9b
4
- data.tar.gz: dd21636922cc634f306a4573fb829ba329b51b8ac42a89c03bb94e651e8c1619
3
+ metadata.gz: 9e24b7a9fd2ff938ceda59f6846768c1e414dd54b9b99ee22d8384a3044d1978
4
+ data.tar.gz: 4b15e835e7b275c3b8dbbb5e82db512870a07d551f3064f7f0ce2a8e9606e625
5
5
  SHA512:
6
- metadata.gz: cd9098dc3a100fffa7ba45cd9ea6b3fb78310769205c1d600fa8476307f6568a07e0894276975727be8ac05ca66c3f132db4d7d621139ef2db43f24d35b2f555
7
- data.tar.gz: f2fb926a87426831461558903c764f256b553609d713e8bf9dfb2951f92d4c25b3bf4bc7945dade12eb3470bcee85475fd4585796784b9e3075a92a39b554ea0
6
+ metadata.gz: 4b35e8577e6893fd84518b7eeaa8bb364684b3d632806b1c33ad0a884a3ac3457e2dbbc3c5697355a1785722f11f0b8d6076d62185b5d56a0c0f8438bbf6201d
7
+ data.tar.gz: 2b73c1c304b64e38ffb065c948a5856753c7b33100b436816f9da02219ca1f6c73931b1db2b021ac40044572085e1f5b38a537c781555ff868ddbe7b3e0302c0
data/lib/docker_core.rb CHANGED
@@ -108,10 +108,10 @@ module DockerCore
108
108
 
109
109
  # @param [Array] arguments
110
110
  # @param [Boolean] substitute
111
- # @param [Boolean] force
111
+ # @param [Boolean] exception
112
112
  # @param [Boolean] strip
113
113
  # @param [Boolean] verbose
114
- def self.capture(*arguments, substitute: false, force: false, strip: true, verbose: false)
114
+ def self.capture(*arguments, substitute: false, exception: false, strip: true, verbose: false)
115
115
  begin
116
116
  command = self.command(*arguments, substitute: substitute)
117
117
 
@@ -122,17 +122,18 @@ module DockerCore
122
122
  data = `#{command}`
123
123
  return strip ? "#{data}".strip : data
124
124
  rescue
125
- raise unless force
125
+ raise unless exception
126
126
  return ''
127
127
  end
128
128
  end
129
129
 
130
130
  # @param [Array] arguments
131
131
  # @param [Boolean] substitute
132
- # @param [Boolean] force
133
- def self.run(*arguments, substitute: false, force: false)
134
- data = self.capture(*arguments, substitute: substitute, force: force, strip: false, verbose: true)
135
- print(data)
132
+ # @param [Boolean] exception
133
+ def self.run(*arguments, substitute: false, exception: true)
134
+ command = self.command(*arguments, substitute: substitute)
135
+ Color.echo("+ #{command}", Color::GREEN)
136
+ return system(command, exception: exception)
136
137
  end
137
138
 
138
139
  # @param [Array] arguments
@@ -352,8 +353,8 @@ module DockerCore
352
353
  def self.update_user(uid: 500, gid: 500)
353
354
  uid = ENV.fetch('DOCKER_CORE_UID', uid)
354
355
  gid = ENV.fetch('DOCKER_CORE_GID', gid)
355
- Process.run('deluser', USER, force: true)
356
- Process.run('delgroup', GROUP, force: true)
356
+ Process.run('deluser', USER, exception: false)
357
+ Process.run('delgroup', GROUP, exception: false)
357
358
  Process.run('addgroup', { system: true, gid: gid }, GROUP)
358
359
  Process.run('adduser', { system: true, 'disabled-password': true, 'no-create-home': true, ingroup: GROUP, gecos: USER, shell: '/bin/bash', uid: uid }, USER)
359
360
  end
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.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - agrozyme