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.
- checksums.yaml +4 -4
- data/lib/docker_core.rb +10 -9
- 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: 9e24b7a9fd2ff938ceda59f6846768c1e414dd54b9b99ee22d8384a3044d1978
|
4
|
+
data.tar.gz: 4b15e835e7b275c3b8dbbb5e82db512870a07d551f3064f7f0ce2a8e9606e625
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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]
|
111
|
+
# @param [Boolean] exception
|
112
112
|
# @param [Boolean] strip
|
113
113
|
# @param [Boolean] verbose
|
114
|
-
def self.capture(*arguments, substitute: 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
|
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]
|
133
|
-
def self.run(*arguments, substitute: false,
|
134
|
-
|
135
|
-
|
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,
|
356
|
-
Process.run('delgroup', GROUP,
|
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
|