fix erb processing for good
This commit is contained in:
parent
b3274c7e34
commit
1b97fa6078
@ -35,6 +35,7 @@ Feature: Gemfiles
|
||||
Scenario: Simple env
|
||||
Given I have the file "Gemfile.erb" with the content:
|
||||
"""
|
||||
gem 'test'
|
||||
<% env :local do %>
|
||||
gem 'test'
|
||||
<% end %>
|
||||
@ -44,7 +45,9 @@ Feature: Gemfiles
|
||||
"""
|
||||
# generated by penchant, environment: local
|
||||
gem 'test'
|
||||
gem 'test'
|
||||
"""
|
||||
|
||||
Scenario: Use placeholder expansion
|
||||
Given I have the file "Gemfile.erb" with the content:
|
||||
"""
|
||||
|
@ -1,6 +1,5 @@
|
||||
@fakefs
|
||||
Feature: Gemfiles
|
||||
@wip
|
||||
Scenario: Process a pure Ruby gemfile
|
||||
Given I have the file "Gemfile.penchant" with the content:
|
||||
"""
|
||||
|
@ -2,6 +2,8 @@ Then /^the file "(.*?)" should have the following stripped content:$/ do |file,
|
||||
test_lines = string.lines.to_a
|
||||
|
||||
File.read(file).lines.collect(&:strip).reject(&:empty?).to_a.each do |line|
|
||||
raise StandardError.new if test_lines.empty?
|
||||
|
||||
line.strip.should == test_lines.shift.strip
|
||||
end
|
||||
end
|
||||
|
@ -183,6 +183,7 @@ module Penchant
|
||||
def env(check, template = {}, &block)
|
||||
if check.to_s == @environment.to_s
|
||||
original_erbout = @_erbout.dup
|
||||
@_erbout = ''
|
||||
|
||||
output = instance_eval(&block).lines.to_a
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
module Penchant
|
||||
VERSION = "0.2.3"
|
||||
VERSION = "0.2.4"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user