Browse files

added dependency on underscore and removed extend function

  • Loading branch information...
1 parent 6b4f63b commit e841121c46869244f5a45081d29a859d256ad312 @khoomeister committed Jun 5, 2011
Showing with 11 additions and 21 deletions.
  1. +2 −0 README.md
  2. +3 −11 lib/coffee-css.js
  3. +3 −2 package.json
  4. +3 −8 src/coffee-css.coffee
View
2 README.md
@@ -1,5 +1,7 @@
# coffee-css
More CSS for CoffeeScript
+See test scripts for details on how to use it.
+
## Thanks
* https://github.com/aeosynth/ccss
View
14 lib/coffee-css.js
@@ -1,7 +1,8 @@
(function() {
- var coffee, extend, fs, getDefaultMixins, util, vm;
+ var coffee, fs, getDefaultMixins, util, vm, _;
coffee = require('coffee-script');
fs = require('fs');
+ _ = require('underscore');
util = require('util');
vm = require('vm');
exports.compileFile = function(options) {
@@ -15,7 +16,7 @@
if (typeof options === 'string') {
fileName = options;
} else {
- extend(settings, options);
+ _.extend(settings, options);
fileName = settings.fileName;
}
return fs.readFile(fileName, function(err, data) {
@@ -69,7 +70,6 @@
compileCssList(cssObject);
return outputList.join('\n');
};
- exports.extend = extend;
exports.getDefaultMixins = getDefaultMixins;
getDefaultMixins = function() {
return {
@@ -82,12 +82,4 @@
}
};
};
- extend = function(object, properties) {
- var key, value;
- for (key in properties) {
- value = properties[key];
- object[key] = value;
- }
- return object;
- };
}).call(this);
View
5 package.json
@@ -2,7 +2,7 @@
"name": "coffee-css",
"description": "More CSS for CoffeeScript",
"author": "khoomeister",
- "version": "0.0.2",
+ "version": "0.0.3",
"licenses": [{
"type": "MIT",
"url": "https://github.com/aeosynth/ccss/raw/master/LICENSE"
@@ -12,6 +12,7 @@
"node": ">=0.4.5"
},
"dependencies": {
- "coffee-script": ">=1.0.0"
+ "coffee-script": ">=1.0.0",
+ "underscore": ">=1.1.6"
}
}
View
11 src/coffee-css.coffee
@@ -1,6 +1,7 @@
# requires
coffee = require 'coffee-script'
fs = require 'fs'
+_ = require 'underscore'
util = require 'util'
vm = require 'vm'
@@ -15,7 +16,7 @@ exports.compileFile = (options) ->
if typeof options is 'string'
fileName = options
else
- extend settings, options
+ _.extend settings, options
fileName = settings.fileName
fs.readFile fileName, (err, data) ->
@@ -60,17 +61,11 @@ exports.compileObject = (cssObject, mixins) ->
compileCssList cssObject
outputList.join '\n'
-exports.extend = extend
-
exports.getDefaultMixins = getDefaultMixins
# privates
getDefaultMixins = ->
boxShadowAll: (value) ->
WebkitBoxShadow: value
MozBoxShadow: value
- boxShadow: value
-
-extend = (object, properties) ->
- object[key] = value for key, value of properties
- object
+ boxShadow: value

0 comments on commit e841121

Please sign in to comment.