Permalink
Browse files

merging

  • Loading branch information...
1 parent f9ef5cf commit 112693103596ef93019ade93dc05e0d236663f9f @jeffsu committed Sep 7, 2012
View
@@ -1,3 +1,7 @@
+### 0.6.12
+
+ * fixing bad merge
+
### 0.6.11
* allowing trailing foreach statements
@@ -8,6 +12,9 @@
hello
END
```
+### 0.6.10
+
+ * adding mochi filter for jade ($m.setupJade(jade))
### 0.6.9
View
@@ -1 +1 @@
-0.6.11
+0.6.12
@@ -0,0 +1 @@
+node_modules
View
@@ -0,0 +1,40 @@
+
+/**
+ * Module dependencies.
+ */
+
+var mochiscript = require('mochiscript');
+
+var express = require('express')
+ , routes = require('./routes')
+ , http = require('http')
+ , path = require('path');
+
+var app = express();
+
+app.configure(function(){
+ app.set('port', process.env.PORT || 3000);
+ app.set('views', __dirname + '/views');
+ app.set('view engine', 'jade');
+ app.use(express.favicon());
+ app.use(express.logger('dev'));
+ app.use(express.bodyParser());
+ app.use(express.methodOverride());
+ app.use(app.router);
+ app.use(express.static(path.join(__dirname, 'public')));
+});
+
+app.configure('development', function(){
+ app.use(express.errorHandler());
+ app.use(mochiscript.middleware({ src: "views" }));
+});
+
+app.configure('production', function() {
+ app.use(mochiscript.middleware({ src: "views", dest: path.join(__dirname, 'public') }));
+});
+
+app.get('/', routes.index);
+
+http.createServer(app).listen(app.get('port'), function(){
+ console.log("Express server listening on port " + app.get('port'));
+});
@@ -0,0 +1,13 @@
+{
+ "name": "application-name",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "start": "node app"
+ },
+ "dependencies": {
+ "mochiscript": "0.6.12",
+ "express": "3.0.0rc2",
+ "jade": "*"
+ }
+}
@@ -0,0 +1,8 @@
+body {
+ padding: 50px;
+ font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
+}
+
+a {
+ color: #00B7FF;
+}
@@ -0,0 +1,8 @@
+
+/*
+ * GET home page.
+ */
+
+exports.index = function(req, res){
+ res.render('index', { title: 'Express' });
+};
@@ -0,0 +1,5 @@
+extends layout
+
+block content
+ h1= title
+ p Welcome to #{title}
@@ -0,0 +1,7 @@
+doctype 5
+html
+ head
+ title= title
+ link(rel='stylesheet', href='/stylesheets/style.css')
+ body
+ block content
@@ -0,0 +1,3 @@
+class Hello {
+
+}
@@ -1,3 +1,3 @@
module Mochiscript
- VERSION = "0.6.11"
+ VERSION = "0.6.12"
end
@@ -27,6 +27,18 @@ var JS2 = $m;
}
}
};
+
+ $m.setupJade = function(jade) {
+ jade.filters.mochi = function (block) {
+ var code = $m.parse(block);
+ var str =
+ '<script language="JavaScript">//<![CDATA[\\n' +
+ code.replace(/\n/g, '\\n') +
+ '\\n//]]></script>';
+ return str;
+ };
+ };
+
$m.registerCompiler = function (compiler) {
console.warn("Deprecated use of $m.registerCompiler.");
compiler.compilers['mochiscript'] = $m.connectCompilerOptions;
@@ -3,7 +3,7 @@
"description": "Javascript Dessert",
"keywords": [ "javascript", "language", "mochiscript", "compiler" ],
"author": "Jeff Su",
- "version": "0.6.11",
+ "version": "0.6.12",
"licenses": [ { "type": "MIT" }],
"engines": { "node": ">=0.4.0" },
"directories": { "lib": "./lib/mochiscript" },
@@ -27,6 +27,18 @@ var JS2 = $m;
}
}
};
+
+ $m.setupJade = function(jade) {
+ jade.filters.mochi = function (block) {
+ var code = $m.parse(block);
+ var str =
+ '<script language="JavaScript">//<![CDATA[\\n' +
+ code.replace(/\n/g, '\\n') +
+ '\\n//]]></script>';
+ return str;
+ };
+ };
+
$m.registerCompiler = function (compiler) {
console.warn("Deprecated use of $m.registerCompiler.");
compiler.compilers['mochiscript'] = $m.connectCompilerOptions;

0 comments on commit 1126931

Please sign in to comment.