Permalink
Browse files

exposed view class so it can be used with the module

  • Loading branch information...
malgorithms committed Dec 20, 2012
1 parent dafb7ed commit 936f6db28b58059f6fd0bf7eb4dc7d312c3bc9b9
Showing with 20 additions and 17 deletions.
  1. +1 −0 index.coffee
  2. +2 −0 index.js
  3. +2 −2 lib/command_line.js
  4. +6 −6 lib/view.js
  5. +1 −1 package.json
  6. +2 −2 src/command_line.coffee
  7. +6 −6 src/view.coffee
View
@@ -3,6 +3,7 @@
{view} = require('./lib/view')
exports.engine = engine
+exports.view = view
e = new engine { verbose: false, prettyPrintErrors: true }
exports.expressEngine = e
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,7 +1,7 @@
{
"name": "toffee",
"description": "A NodeJs, Express 3.x, Express 2.x, and browser-side templating language based on CoffeeScript with slicker tokens and syntax. Built with love at OkCupid.",
- "version": "0.0.56",
+ "version": "0.0.57",
"directories": {
"lib": "./lib"
},
View
@@ -65,9 +65,9 @@ compile = (start_path, full_path) ->
browserMode: true
minimize: program.minimize? and program.minimize
if program.coffee
- output = v._toCoffee()
+ output = v.toCoffee()
else
- output = v._toJavaScript()
+ output = v.toJavaScript()
if v.error
process.stderr.write v.error.getPrettyPrintText()
process.exit 1
View
@@ -180,9 +180,9 @@ class view
@_toTokenObj()
v = @
setTimeout ->
- v._toCoffee()
+ v.toCoffee()
setTimeout ->
- v._toJavaScript()
+ v.toJavaScript()
setTimeout ->
v._toScriptObj()
v._log "Done async prep of #{if v.fileName? then v.fileName else 'unknown'}. Calling back."
@@ -257,16 +257,16 @@ class view
_toScriptObj: ->
if not @scriptObj?
- txt = @_toJavaScript()
+ txt = @toJavaScript()
if not @error
d = Date.now()
@scriptObj = vm.createScript txt
@_log "#{@fileName} compiled to scriptObj in #{Date.now()-d}ms"
@scriptObj
- _toJavaScript: ->
+ toJavaScript: ->
if not @javaScript?
- c = @_toCoffee()
+ c = @toCoffee()
if not @error
d = Date.now()
try
@@ -279,7 +279,7 @@ class view
@_log "#{@fileName} compiled to JavaScript in #{Date.now()-d}ms"
@javaScript
- _toCoffee: ->
+ toCoffee: ->
if not @coffeeScript?
tobj = @_toTokenObj()
if not @error

0 comments on commit 936f6db

Please sign in to comment.