Skip to content

Commit

Permalink
v0.2.2 (coffeescript 1.0 compatibility).
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricemach committed Jan 5, 2011
1 parent c514d9b commit b260bef
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 234 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1 +1,3 @@
.DS_Store
material/
lib/coffeekup.js
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -159,6 +159,10 @@ See [/examples](http://github.com/mauricemach/coffeekup/tree/master/examples) fo

## Change Log:

**v0.2.2** (2011-01-05):

- Updated to CoffeeScript 1.0.0 and node 0.2.6/0.3.3.

**v0.2.1** (2010-11-09):

- Updated to CoffeeScript 0.9.5 and node 0.2.5/0.3.1.
Expand All @@ -175,4 +179,4 @@ See [/examples](http://github.com/mauricemach/coffeekup/tree/master/examples) fo

## Compatibility

Latest version tested with node 0.2.5/0.3.1 and CoffeeScript 0.9.5.
Latest version tested with node 0.2.6/0.3.3 and CoffeeScript 1.0.0.
11 changes: 9 additions & 2 deletions bin/coffeekup.coffee
Expand Up @@ -6,6 +6,13 @@ path = require 'path'
puts = console.log
OptionParser = require('coffee-script/optparse').OptionParser

# On coffee-script@0.9.6, argv looks like [filename],
# On coffee-script@1.0.0, argv looks like ["node", "path/to/coffee", filename]

This comment has been minimized.

Copy link
@michaelficarra

michaelficarra Jan 5, 2011

You're requiring coffeescript >= 1.0.0 in package.json, but you're doing this check anyway?

This comment has been minimized.

Copy link
@mauricemach

mauricemach Jan 5, 2011

Author Owner

I'm "officially" supporting >= 1.0, but if you really really need 0.9.6 for some reason, you can npm activate coffee-script@0.9.6 and at least the command line tool will not choke.

This comment has been minimized.

Copy link
@michaelficarra

michaelficarra Jan 5, 2011

I think that's probably a slippery slope (how far does support go?), but do what you feel is right.

This comment has been minimized.

Copy link
@mauricemach

mauricemach Jan 5, 2011

Author Owner

It certainly is, and I wouldn't go out of my way to support it. But it came in a contribution, and I thought it wouldn't hurt to wait till the next coffeescript version to remove it. But you can be sure I'm itching to turn that into a single line! :)

if process.argv[0] is 'node' and process.argv.length >= 2
argv = process.argv[2..]
else
argv = process.argv[0..]

render = (input_path) ->
fs.readFile input_path, (err, contents) ->
throw err if err
Expand Down Expand Up @@ -36,11 +43,11 @@ switches = [
]

parser = new OptionParser switches, usage
options = parser.parse process.argv
options = parser.parse argv
args = options.arguments
delete options.arguments

puts parser.help() if options.help or process.argv.length is 0
puts parser.help() if options.help or argv.length is 0
puts coffeekup.version if options.version
if options.utils
options.locals ?= {}
Expand Down
4 changes: 2 additions & 2 deletions examples/browser/creme/coffee-script.js

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions lib/coffeekup.coffee
Expand Up @@ -5,7 +5,7 @@ else
coffeekup = exports
coffee = require 'coffee-script'

coffeekup.version = '0.2.1'
coffeekup.version = '0.2.2'

skeleton = (ck_options) ->
ck_options ?= {}
Expand Down Expand Up @@ -101,14 +101,18 @@ skeleton = (ck_options) ->
support = '''
var __slice = Array.prototype.slice;
var __hasProp = Object.prototype.hasOwnProperty;
var __indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {if (this[i] === item) return i;}; return -1;};
var __bind = function(fn, me){return function(){return fn.apply(me, arguments);};};
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
var __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype; child.prototype = new ctor;
child.__super__ = parent.prototype; return child;
ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype;
return child;
};
var __indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {
if (this[i] === item) return i;
}
return -1;
};
'''

Expand Down
220 changes: 0 additions & 220 deletions lib/coffeekup.js

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
@@ -1,16 +1,16 @@
{
"name": "coffeekup",
"description": "Markup as CoffeeScript.",
"version": "0.2.1",
"version": "0.2.2",
"author": "Maurice Machado <maurice@bitbending.com>",
"contributors": [
{"name": "Maurice Machado", "email": "maurice@bitbending.com"},
{"name": "Vladimir Dronnikov", "email": "dronnikov@gmail.com"}
],
"repository": {"type": "git", "url": "http://github.com/mauricemach/coffeekup.git"},
"dependencies": {"coffee-script": ">= 0.9.5"},
"dependencies": {"coffee-script": ">= 1.0.0"},
"keywords": ["template", "view", "coffeescript"],
"bin": {"coffeekup": "./bin/coffeekup.coffee"},
"directories": {"lib": "./lib"},
"engines": {"node": ">= 0.2.5"}
"engines": {"node": ">= 0.2.6"}
}

0 comments on commit b260bef

Please sign in to comment.