kitchen-vagrant 2.2.0 → 2.2.1

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
  SHA256:
3
- metadata.gz: 5f38360fb2e76468a3b8fec2cc9605529a3627fb6887fc0054db601ef2b14c1b
4
- data.tar.gz: 8697570d8be74b4e5f674707be02a1aa45b21acd2836b033075e0bea0667bf76
3
+ metadata.gz: 4abf5224b64f63f370ce34d71838b1aa1706a70a2a8f7285219388a977eb2bdf
4
+ data.tar.gz: 91b8de7ff382f07694a1df7d7714237e77be14be7b4faa854b509e97dc31fc31
5
5
  SHA512:
6
- metadata.gz: 2742d9a6cf27c11dd986ff5054c9c389c94637b7cfc50bb677ca43411e8b3d336d3adce1bf50be6a20ab524f41c8cfa24237b2591d265a0b46843adaffb429e0
7
- data.tar.gz: 02cab0d3a12310cf6da7efdfc62011a621b9daa991430fc1efce6041ebbc40d18d4c5c661562eac4d055db020c0bc06f308b98bb089daf17fd579fe222d454ad
6
+ metadata.gz: 3b42b779d8c9726c89ef893e2ae4289775ae488eb26d2ff52d3a909e3efd97296db770801908a41beb73df703a9e065dae8836b82ce0fab7fc4dc9eb968ba02d
7
+ data.tar.gz: 4656b6f370e4c2233ad1c0fb8ab933599829599348fab18461f8ab487df9e180b040267e3fcd01124453b7c223f84792e276b7f8140ecf4e8c03377d62e79eb7
@@ -80,6 +80,8 @@ module Kitchen
80
80
 
81
81
  default_config :synced_folders, []
82
82
 
83
+ default_config :env, []
84
+
83
85
  default_config :use_cached_chef_client, false
84
86
 
85
87
  default_config :vagrant_binary, "vagrant"
@@ -336,6 +338,25 @@ module Kitchen
336
338
  .gsub("{{vagrant_root}}", vagrant_root)
337
339
  end
338
340
 
341
+ # Formats synced folder options for use in the Vagrantfile.
342
+ # Accepts either a Hash (converts to Ruby hash syntax) or a String (returns as-is).
343
+ # Supports SMB options like smb_username, smb_password, etc.
344
+ #
345
+ # @param options [Hash, String, nil] synced folder options
346
+ # @return [String] formatted options string for Vagrantfile
347
+ # @api private
348
+ def format_synced_folder_options(options)
349
+ return "nil" if options.nil?
350
+ return options if options.is_a?(String)
351
+
352
+ # Convert Hash to Ruby hash literal syntax
353
+ if options.is_a?(Hash)
354
+ options.map { |k, v| "#{k}: #{v.inspect}" }.join(", ")
355
+ else
356
+ options.to_s
357
+ end
358
+ end
359
+
339
360
  # Replaces an `%{instance_name}` tokens in the synced folder items.
340
361
  #
341
362
  # @api private
@@ -348,7 +369,7 @@ module Kitchen
348
369
  config[:kitchen_root]
349
370
  ),
350
371
  destination.gsub("%{instance_name}", instance.name),
351
- options || "nil",
372
+ format_synced_folder_options(options),
352
373
  ]
353
374
  end
354
375
  add_extra_synced_folders!
@@ -20,6 +20,6 @@ module Kitchen
20
20
  module Driver
21
21
 
22
22
  # Version string for Vagrant Kitchen driver
23
- VAGRANT_VERSION = "2.2.0".freeze
23
+ VAGRANT_VERSION = "2.2.1".freeze
24
24
  end
25
25
  end
@@ -253,4 +253,14 @@ Vagrant.configure("2") do |c|
253
253
  <% end %>
254
254
  <% end %>
255
255
  end
256
+
257
+ <% if config[:env] && !config[:env].empty? %>
258
+ # Set environment variables
259
+ <% config[:env].each do |env_var| %>
260
+ c.vm.provision "shell", inline: <<-SHELL
261
+ echo 'export <%= env_var.gsub("'", "'\\\\''") %>' >> /etc/profile.d/kitchen.sh
262
+ SHELL
263
+ <% end %>
264
+ c.vm.provision "shell", inline: "chmod +x /etc/profile.d/kitchen.sh", run: "once"
265
+ <% end %>
256
266
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-09 00:00:00.000000000 Z
11
+ date: 2026-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1.4'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '4'
22
+ version: '5'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '1.4'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '4'
32
+ version: '5'
33
33
  description: Kitchen::Driver::Vagrant - A HashiCorp Vagrant Driver for Test Kitchen.
34
34
  email:
35
35
  - fnichol@nichol.ca