Sha256: 7f1e94da9a286a1599e45a15fd86960f2093ba1127817e3bc393a54bcd768f02

Contents?: true

Size: 370 Bytes

Versions: 2

Compression:

Stored size: 370 Bytes

Contents

module Linner
  class Wrapper
    WRAPPER =
      'this.require.define({"%s":' +
        'function(exports, require, module){' +
        '%s' +
        ";}});\n"

    def self.wrap(name, content)
      WRAPPER % [name, content]
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
linner-0.4.6 lib/linner/wrapper.rb
linner-0.4.5 lib/linner/wrapper.rb