lib/testlab/providers/vagrant.rb in testlab-0.0.3 vs lib/testlab/providers/vagrant.rb in testlab-0.0.4
- old
+ new
@@ -190,10 +190,18 @@
:box_url => self.box_url
}
vagrantfile_template = File.join(TestLab::Provider.template_dir, "vagrant", "Vagrantfile.erb")
vagrantfile = File.join(@config[:repo], "Vagrantfile")
- IO.write(vagrantfile, ZTK::Template.render(vagrantfile_template, context))
+
+ # UGLY; but it makes it run under 1.9.2
+ if RUBY_VERSION < "1.9.3"
+ File.open(vagrantfile, 'w') do |file|
+ file.puts(ZTK::Template.render(vagrantfile_template, context))
+ end
+ else
+ IO.write(vagrantfile, ZTK::Template.render(vagrantfile_template, context))
+ end
end
################################################################################