Skip to content

Commit

Permalink
Merge e770d57 into a07bef9
Browse files Browse the repository at this point in the history
  • Loading branch information
yutopp committed Sep 13, 2014
2 parents a07bef9 + e770d57 commit e4e572a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/typescript/rails/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ def replace_relative_references(ts_path, source)

# Why don't we just use gsub? Because it display odd behavior with File.join on Ruby 2.0
# So we go the long way around.
output = ''
source.each_line do |l|
output = (source.each_line.map do |l|
if l.starts_with?('///') && !(m = %r!^///\s*<reference\s+path="([^"]+)"\s*/>\s*!.match(l)).nil?
l = l.sub(m.captures[0], File.join(escaped_dir, m.captures[0]))
end
output = output + l + $/
end
next l
end).join

output
end
Expand Down

0 comments on commit e4e572a

Please sign in to comment.