Skip to content

Commit

Permalink
Ruby 3 compatibility for network configuration
Browse files Browse the repository at this point in the history
The final Vagrant file should be compatible with Ruby 2.7 and 3,
so it should look like that:

```diff
- c.vm.network(:forwarded_port, {:guest=>443, :host=>2443})
+ c.vm.network(:forwarded_port, :guest=>443, :host=>2443)
```

Fixes test-kitchen#476
  • Loading branch information
PowerKiKi committed Jun 15, 2022
1 parent 22a971b commit ef8b79e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/Vagrantfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Vagrant.configure("2") do |c|
<% end %>
<% Array(config[:network]).each do |opts| %>
c.vm.network(:<%= opts[0] %>, <%= opts[1..-1].join(", ") %>)
c.vm.network(:<%= opts[0] %>, <%= opts[1].to_s.delete_prefix('{').delete_suffix('}') %>)
<% end %>

c.vm.synced_folder ".", "/vagrant", disabled: true
Expand Down

0 comments on commit ef8b79e

Please sign in to comment.