diff --git a/spec/stdlib/onig-reg-exp-spec.coffee b/spec/stdlib/onig-reg-exp-spec.coffee index 0b65ab120..14955c317 100644 --- a/spec/stdlib/onig-reg-exp-spec.coffee +++ b/spec/stdlib/onig-reg-exp-spec.coffee @@ -1,3 +1,5 @@ +OnigRegExp = require 'onig-reg-exp' + describe "OnigRegExp", -> describe ".search(string, index)", -> it "returns an array of the match and all capture groups", -> diff --git a/src/app/language-mode.coffee b/src/app/language-mode.coffee index 57be42c86..bfc6cb108 100644 --- a/src/app/language-mode.coffee +++ b/src/app/language-mode.coffee @@ -1,6 +1,7 @@ Range = require 'range' _ = require 'underscore' require 'underscore-extensions' +OnigRegExp = require 'onig-reg-exp' module.exports = class LanguageMode diff --git a/src/app/text-mate-grammar.coffee b/src/app/text-mate-grammar.coffee index 1bd96d996..bd7931aef 100644 --- a/src/app/text-mate-grammar.coffee +++ b/src/app/text-mate-grammar.coffee @@ -2,6 +2,8 @@ _ = require 'underscore' fs = require 'fs' plist = require 'plist' Token = require 'token' +OnigRegExp = require 'onig-reg-exp' +OnigScanner = require 'onig-scanner' module.exports = class TextMateGrammar diff --git a/src/app/window.coffee b/src/app/window.coffee index 6dc55ba93..d990b28a4 100644 --- a/src/app/window.coffee +++ b/src/app/window.coffee @@ -11,8 +11,6 @@ Pasteboard = require 'pasteboard' require 'jquery-extensions' require 'underscore-extensions' require 'space-pen-extensions' -require 'onig-reg-exp' -require 'onig-scanner' windowAdditions = rootViewParentSelector: 'body' diff --git a/src/stdlib/onig-reg-exp.coffee b/src/stdlib/onig-reg-exp.coffee index 21cb58cdd..93883da20 100644 --- a/src/stdlib/onig-reg-exp.coffee +++ b/src/stdlib/onig-reg-exp.coffee @@ -1,4 +1,5 @@ -class window.OnigRegExp +module.exports = +class OnigRegExp constructor: (source) -> regexp = $onigRegExp.buildOnigRegExp(source); regexp.constructor = OnigRegExp diff --git a/src/stdlib/onig-scanner.coffee b/src/stdlib/onig-scanner.coffee index 1eaf6629f..fb26939ec 100644 --- a/src/stdlib/onig-scanner.coffee +++ b/src/stdlib/onig-scanner.coffee @@ -1,4 +1,5 @@ -class window.OnigScanner +module.exports = +class OnigScanner constructor: (sources) -> scanner = $onigScanner.buildScanner(sources) scanner.constructor = OnigScanner