docker_core 0.0.36 → 0.0.39

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 +43 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd55c6918dc257c2505498aa7df47baa69323551f0fc044bfb1f7b5550e5fff1
4
- data.tar.gz: 96e1e4a3c8c855d4c11f79da51edb8ec0530ff1d08f2df904ae6dc1560d5bd1b
3
+ metadata.gz: f60a31f88b84a626d5cb8ae4d6006e14cb47a8b8b7b6583e7c9d6ad845f7a626
4
+ data.tar.gz: 78bd3e82dd1e50913d836e5ac69da7089cb731c17fb99bad0309de18fa80fa35
5
5
  SHA512:
6
- metadata.gz: dc8cfe3b768718901c057f780a0ee73425c24ddb6cff24046ce123a0079e428c962ac6c0372209558f191a442e077c5c12e558f2505860613e7de650a90fd6ee
7
- data.tar.gz: 07d546f99ec45bf205a6721e3ac457f44cd86e62702fa48acdf83f5bd9a34ecfac5aaea66b14ad329679632db894d93fe61ec08b07ab2fab27dedd8567bac337
6
+ metadata.gz: e409a3067d073d5cf8f70f1f12fb0ce4e720126c3824f7f7bd880f357e8e58b58d5e43f8c6ba014bf5722a8ac149fe4340541fc4ec7ad70cd4d16a5717d6ebdf
7
+ data.tar.gz: 7bc3c5234e7974a3cdf82374b0510489bbc4df98425d1726dec93c014f137f78a0ff5443c2b56d476a200d48f4f451a092c303125433735468d769057ffd2579
data/lib/docker_core.rb CHANGED
@@ -113,13 +113,47 @@ module DockerCore
113
113
  return File.expand_path('~/.swarm')
114
114
  end
115
115
 
116
- # def self.profile_path
117
- # return File.realpath('profile.sh', self.deploy_path)
118
- # end
119
- #
120
- # def self.runner_path
121
- # return File.realpath('runner.rb', self.deploy_path)
122
- # end
116
+ def self.profile_path
117
+ return File.realpath('profile.sh', self.deploy_path)
118
+ end
119
+
120
+ def self.runner_path
121
+ return File.realpath('runner.rb', self.deploy_path)
122
+ end
123
+
124
+ # @see https://github.com/moby/moby/issues/31564
125
+ # @see https://www.geeksforgeeks.org/how-to-validate-a-domain-name-using-regular-expression
126
+ # @param [String] name
127
+ # @param [Boolean] echo
128
+ def self.check_name(name, echo: false)
129
+ color = Color::YELLOW
130
+ name = "#{name}"
131
+ items = name.chars
132
+
133
+ if items.empty? || 63 < items.length
134
+ if echo
135
+ Color.echo("'#{name}' should be between 1 and 63 characters long", color)
136
+ end
137
+
138
+ return false
139
+ end
140
+
141
+ if [items.first, items.last].include?('-')
142
+ if echo
143
+ Color.echo("'#{name}' should not start or end with a hyphen(-)", color)
144
+ end
145
+
146
+ return false
147
+ end
148
+
149
+ test = name.match?(/^[a-zA-Z0-9-]+$/)
150
+
151
+ if false == test && echo
152
+ Color.echo("'#{name}' should be a-z or A-Z or 0-9 and hyphen (-)", color)
153
+ end
154
+
155
+ return test
156
+ end
123
157
 
124
158
  # @param [String] swarm
125
159
  def self.write_swarm(swarm = '')
@@ -583,8 +617,8 @@ module DockerCore
583
617
 
584
618
  Process.run('deluser', USER, throw: false)
585
619
  Process.run('delgroup', GROUP, throw: false)
586
- Process.run('addgroup', { system: true, gid: gid }, GROUP, throw: false)
587
- Process.run('adduser', { system: true, 'disabled-password': true, 'no-create-home': true, ingroup: GROUP, gecos: USER, shell: '/bin/bash', uid: uid }, USER, throw: false)
620
+ Process.run('addgroup', { system: true, gid: gid }, GROUP)
621
+ Process.run('adduser', { system: true, 'disabled-password': true, 'no-create-home': true, ingroup: GROUP, gecos: USER, shell: '/bin/bash', uid: uid }, USER)
588
622
  end
589
623
 
590
624
  # @param [String] stdout
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.36
4
+ version: 0.0.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - agrozyme
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-12 00:00:00.000000000 Z
11
+ date: 2022-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fileutils