specinfra 2.15.2 → 2.16.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 354af2a8aa1e981ffd779d664fb7042cfd97450b
4
- data.tar.gz: 3e445974bb46e3e4b2b51553a7b4126108512e24
3
+ metadata.gz: 99ea82b3a9db40daa6c614e81c6bd12435804308
4
+ data.tar.gz: 46729b659476d950ce3119f97b1c9b0ad1bafb1a
5
5
  SHA512:
6
- metadata.gz: 9484d8e78232770711a7428bac0e8036c62edcc71eb17d5c1f07a35c55532e9a07d6c0f296089b33e4aa866c1dc927dd6c8291634fed3de50f9d885494dcd063
7
- data.tar.gz: 098ac81c37baaf7092238823910a23e0c5f15d42d4d1139a45b3103530bc7a396b83ad424953581525f18f20f66a1a51ae9d1afdc734b74fb96d6c016255b9a2
6
+ metadata.gz: dc6b49468e7cb92a3a24e614a9138cbf6f86ed56112e1c8aed913989463457649af73b9bfa1db57ede536f9631e869e5ed901c87f45091600c70831c58b8b401
7
+ data.tar.gz: 7c24d74099d82c1bfc350f8fab9cef0e7d4ce54b3855dadcac9cf1f3c22c769702c537b20f75067a9f6500c92bd83424e2ab99d5a5f0b1d37072671dc5ad20bf
@@ -12,7 +12,9 @@ module Specinfra::Backend
12
12
  if image = Specinfra.configuration.docker_image
13
13
  @images = []
14
14
  @base_image = ::Docker::Image.get(image)
15
- create_and_start_container
15
+
16
+ env = Specinfra.configuration.env || {}
17
+ create_and_start_container(env)
16
18
  ObjectSpace.define_finalizer(self, proc { cleanup_container })
17
19
  elsif container = Specinfra.configuration.docker_container
18
20
  @container = ::Docker::Container.get(container)
@@ -47,7 +49,7 @@ module Specinfra::Backend
47
49
 
48
50
  private
49
51
 
50
- def create_and_start_container
52
+ def create_and_start_container(env)
51
53
  opts = { 'Image' => current_image.id }
52
54
 
53
55
  if current_image.json["Config"]["Cmd"].nil?
@@ -55,7 +57,11 @@ module Specinfra::Backend
55
57
  end
56
58
 
57
59
  if path = Specinfra.configuration.path
58
- (opts['Env'] ||= {})['PATH'] = path
60
+ (opts['Env'] ||= []) << "PATH=#{path}"
61
+ end
62
+
63
+ if env
64
+ opts['Env'] = (opts['Env'] || []) + env.map { |k,v| [k,v].join('=') }
59
65
  end
60
66
 
61
67
  @container = ::Docker::Container.create(opts)
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.15.2"
2
+ VERSION = "2.16.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.2
4
+ version: 2.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita