Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added error handling to library ometa function

  • Loading branch information...
commit 303e9eb094efc843841f709a66dc108c4a604bc4 1 parent 5ba91cb
@bmavity authored
View
0  src/input.scss → examples/input.scss
File renamed without changes
View
9 examples/tester.js
@@ -0,0 +1,9 @@
+var sys = require('sys'),
+ fs = require('fs'),
+ scss = require('../src');
+
+fs.readFile('input.scss', function(err, scssFile) {
+ scss.parse(scssFile.toString(), function(err, css) {
+ sys.puts(css);
+ });
+});
View
4 src/index.js
@@ -5,7 +5,7 @@ var sys = require('sys'),
var getParser = function(callback) {
if(!createdParser) {
- fs.readFile('scss.ometa', function(err, contents) {
+ fs.readFile(__dirname + '/scss.ometa', function(err, contents) {
if(err) {
callback(err);
} else {
@@ -34,7 +34,7 @@ var parse = function(scssFile, callback) {
});
}
});
-});
+};
module.exports.parse = parse;
View
12 src/results.css
@@ -1,12 +0,0 @@
-div {
- height: #d3e115;
-}
- div .error {
- background: #234567;
- color: green;
- }
-
-a:hover {
- color: #234567;
-}
-
View
13 src/tester.js
@@ -1,13 +0,0 @@
-var sys = require('sys'),
- fs = require('fs'),
- ometa = require('../lib/ometa');
-
-fs.readFile('scss.ometa', function(err, contents) {
- ometa.createParser(contents.toString(), function(err, parser) {
- fs.readFile('input.scss', function(err, scssFile) {
- parser.parse(scssFile.toString(), function(err, css) {
- fs.writeFile('results.css', css.toString().replace(/\\n/g, '\n'));
- });
- });
- });
-});
Please sign in to comment.
Something went wrong with that request. Please try again.