Method: Node::Compiler#inject_entrance

Defined in:
lib/node/compiler.rb

#inject_entranceObject



105
106
107
108
109
110
111
112
113
# File 'lib/node/compiler.rb', line 105

def inject_entrance
  target = File.expand_path('./lib/enclose_io_entrance.js', @vendor_node)
  path = mempath @entrance
  File.open(target, "w") { |f| f.puts %Q`module.exports = "#{path}";` }
  # remove shebang
  lines = File.read(@entrance).lines
  lines[0] = "// #{lines[0]}" if '#!' == lines[0][0..1]
  File.open(copypath(@entrance), "w") { |f| f.print lines.join }
end