Skip to content
Browse files

Merge branch 'v0.3.0-compatibility' of https://github.com/TooTallNate…

…/wheat into TooTallNate-v0.3.0-compatibility
  • Loading branch information...
2 parents a185316 + 8006e18 commit a9e20b0ba2823ce45c90ed0b429a473b02a7e90f Tim Caswell committed Feb 22, 2011
Showing with 5 additions and 6 deletions.
  1. +2 −2 lib/wheat/data.js
  2. +3 −4 lib/wheat/tools.js
View
4 lib/wheat/data.js
@@ -1,7 +1,7 @@
var Git = require('git-fs'),
Path = require('path'),
Step = require('step'),
- sys = require('sys'),
+ util = require(process.binding('natives').util ? 'util' : 'sys'),
Script = process.binding('evals').Script,
QueryString = require('querystring');
@@ -78,7 +78,7 @@ function sandbox(snippet) {
},
dir: function fakeP(data) {
arguments.forEach(function (data) {
- snippet.output += sys.inspect(data) + "\n";
+ snippet.output += util.inspect(data) + "\n";
});
}
} };
View
7 lib/wheat/tools.js
@@ -1,5 +1,4 @@
-var Sys = require('sys'),
- Step = require('step'),
+var Step = require('step'),
Haml = require('haml'),
Markdown = require('./markdown'),
MD5 = require('./md5'),
@@ -36,7 +35,7 @@ var aMonths = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun",
var aDays = new Array( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
var Helpers = {
- inspect: Sys.inspect,
+ inspect: require(process.binding('natives').util ? 'util' : 'sys').inspect,
intro: function intro(markdown) {
var html = Markdown.encode(markdown);
return html.substr(0, html.indexOf("<h2"));
@@ -117,7 +116,7 @@ var Helpers = {
// Convert UTF8 strings to binary buffers for faster loading
function stringToBuffer(string) {
var buffer = new Buffer(Buffer.byteLength(string));
- buffer.utf8Write(string);
+ buffer.write(string, 'utf8');
return buffer;
};

0 comments on commit a9e20b0

Please sign in to comment.
Something went wrong with that request. Please try again.