Skip to content

Commit ce25205

Browse files
committed
Merge pull request #15 from yutopp/remove_duplication_of_newlines
remove duplication of newlines
2 parents a07bef9 + e770d57 commit ce25205

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/typescript/rails/compiler.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ def replace_relative_references(ts_path, source)
1717

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

2827
output
2928
end

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy