Enable ability to supress newlines in ERB for templates using -%>
This commit is contained in:
parent
992bd13b19
commit
b6719d00d9
|
@ -68,7 +68,7 @@ module Vagrant
|
|||
#
|
||||
# @return [String]
|
||||
def render_string
|
||||
ERB.new(template).result(binding)
|
||||
ERB.new(template, nil, "%<>-").result(binding)
|
||||
end
|
||||
|
||||
# Returns the full path to the template, taking into accoun the gem directory
|
||||
|
|
|
@ -6,8 +6,9 @@ Vagrant::Config.run do |config|
|
|||
# Every Vagrant virtual environment requires a box to build off of.
|
||||
config.vm.box = "<%= default_box %>"
|
||||
|
||||
<% if !default_box_url.nil? %>
|
||||
# The url from where the 'config.vm.box' box will be fetched
|
||||
<% if !default_box_url.nil? -%>
|
||||
# The url from where the 'config.vm.box' box will be fetched if it
|
||||
# doesn't already exist on the user's system
|
||||
config.vm.box_url = "<%= default_box_url %>"
|
||||
<% end %>
|
||||
<% end -%>
|
||||
end
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
Unknown provisioner type: <%= provisioner %>
|
||||
:rootfile_already_exists: |-
|
||||
It looks like this directory is already setup for vagrant! (A <%= Vagrant::Environment::ROOTFILE_NAME %>
|
||||
already exists.)
|
||||
already exists.)
|
||||
:rootfile_not_found: |-
|
||||
A `<%= Vagrant::Environment::ROOTFILE_NAME %>` was not found! This file is required for vagrant to run
|
||||
since it describes the expected environment that vagrant is supposed
|
||||
|
|
|
@ -60,7 +60,7 @@ class TemplateRendererUtilTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
should "simply render the template as a string" do
|
||||
ERB.expects(:new).with(@r.template).returns(@erb)
|
||||
ERB.expects(:new).with(@r.template, nil, "%<>-").returns(@erb)
|
||||
assert_equal @result, @r.render_string
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue