Class: Linner::Wrapper::Module

Inherits:
Object
  • Object
show all
Defined in:
lib/linner/wrapper.rb

Class Method Summary collapse

Class Method Details

.definitionObject



10
11
12
# File 'lib/linner/wrapper.rb', line 10

def self.definition
  File.read(File.join File.dirname(__FILE__), "../../vendor", "require_definition.js")
end

.wrap(name, content) ⇒ Object



4
5
6
7
8
# File 'lib/linner/wrapper.rb', line 4

def self.wrap(name, content)
<<-WRAPPER
this.require.define({"#{name}":function(exports, require, module){#{content};}});
WRAPPER
end