docker-template 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docker/template.rb +22 -0
- data/lib/docker/template/repo.rb +2 -2
- data/lib/docker/template/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ffcb35889c09b22bd18672e20c7907578b5fe2d
|
4
|
+
data.tar.gz: fe154a23ec45528f19325612c305edd860586eac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dddf6ae46fb045aeaec2868e86952334980d608068f3028cd00627a84cd0b03a1e5ca9ba907370f250f1d44bc8d642805cb5ede26f78ea8e2e513ff6eba3630
|
7
|
+
data.tar.gz: 8393414493d0e7754c05acc1b27f6d1cae0f210ac60258ef94265dc496a2be86873f21ffa0648809f8f8f247d445ba56be7cbbcb5873f1ce6b5726674d6bd7fa
|
data/lib/docker/template.rb
CHANGED
@@ -86,6 +86,28 @@ module Docker
|
|
86
86
|
$stderr.puts "You can install it with `gem install #{what}'"
|
87
87
|
abort "Hope you install it so you can report back."
|
88
88
|
end
|
89
|
+
|
90
|
+
# --
|
91
|
+
|
92
|
+
def tmpdir
|
93
|
+
if ENV["DOCKER_TEMPLATE_TMPDIR"]
|
94
|
+
# Don't destroy a user created directory.
|
95
|
+
return Pathutil.new(ENV["DOCKER_TEMPLATE_TMPDIR"]).tap(
|
96
|
+
&:mkdir_p
|
97
|
+
)
|
98
|
+
else
|
99
|
+
dir = root.join("tmp")
|
100
|
+
|
101
|
+
if !dir.exist?
|
102
|
+
# Make the directory and then throw it out at exit.
|
103
|
+
dir.mkdir_p; ObjectSpace.define_finalizer(dir, proc do
|
104
|
+
dir.rm_rf
|
105
|
+
end)
|
106
|
+
end
|
107
|
+
|
108
|
+
dir
|
109
|
+
end
|
110
|
+
end
|
89
111
|
end
|
90
112
|
end
|
91
113
|
|
data/lib/docker/template/repo.rb
CHANGED
@@ -142,7 +142,7 @@ module Docker
|
|
142
142
|
|
143
143
|
# --
|
144
144
|
|
145
|
-
def tmpdir(*args, root:
|
145
|
+
def tmpdir(*args, root: Template.tmpdir)
|
146
146
|
args.unshift(user, name, tag)
|
147
147
|
Pathutil.tmpdir(
|
148
148
|
args, nil, root
|
@@ -151,7 +151,7 @@ module Docker
|
|
151
151
|
|
152
152
|
# --
|
153
153
|
|
154
|
-
def tmpfile(*args, root:
|
154
|
+
def tmpfile(*args, root: Template.tmpdir)
|
155
155
|
args.unshift(user, name, tag)
|
156
156
|
Pathutil.tmpfile(
|
157
157
|
args, nil, root
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker-template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordon Bedwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|