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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51ca564b33773a01fe5be9b298e96315cde1ed3e
4
- data.tar.gz: a06cdc4c142a5288d7a5ecd074f7bee5447faf81
3
+ metadata.gz: 1ffcb35889c09b22bd18672e20c7907578b5fe2d
4
+ data.tar.gz: fe154a23ec45528f19325612c305edd860586eac
5
5
  SHA512:
6
- metadata.gz: 51056d978d69eac78b67ebbe33e43c74a9d600d64a6491e4baa00f60bbaebf9ae479252c023591c3327a094d2b10f0ed216b9bd5ed8a322c67ed59ffa1780347
7
- data.tar.gz: ee5d5e3ed09ae25e53e055a4c8df335aa5c8f86f0c57cc0741f43186ae5fb0acddecda0fd7c7639af975440c7279f49254167685908898838469f127fef9c03b
6
+ metadata.gz: 2dddf6ae46fb045aeaec2868e86952334980d608068f3028cd00627a84cd0b03a1e5ca9ba907370f250f1d44bc8d642805cb5ede26f78ea8e2e513ff6eba3630
7
+ data.tar.gz: 8393414493d0e7754c05acc1b27f6d1cae0f210ac60258ef94265dc496a2be86873f21ffa0648809f8f8f247d445ba56be7cbbcb5873f1ce6b5726674d6bd7fa
@@ -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
 
@@ -142,7 +142,7 @@ module Docker
142
142
 
143
143
  # --
144
144
 
145
- def tmpdir(*args, root: nil)
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: nil)
154
+ def tmpfile(*args, root: Template.tmpdir)
155
155
  args.unshift(user, name, tag)
156
156
  Pathutil.tmpfile(
157
157
  args, nil, root
@@ -4,6 +4,6 @@
4
4
 
5
5
  module Docker
6
6
  module Template
7
- VERSION = "0.11.0"
7
+ VERSION = "0.12.0"
8
8
  end
9
9
  end
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.11.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-07 00:00:00.000000000 Z
11
+ date: 2017-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor