-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
001eb2a
commit fec0a69
Showing
14 changed files
with
56 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.DS_Store | ||
material/ | ||
lib/coffeekup.js | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git* | ||
material/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env node | ||
|
||
var path = require('path') | ||
var fs = require('fs') | ||
var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib') | ||
|
||
require(lib + '/cli').run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
{ | ||
"name": "coffeekup", | ||
"description": "Markup as CoffeeScript.", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"author": "Maurice Machado <[email protected]>", | ||
"contributors": [ | ||
{"name": "Maurice Machado", "email": "[email protected]"}, | ||
{"name": "Vladimir Dronnikov", "email": "[email protected]"} | ||
], | ||
"repository": {"type": "git", "url": "http://github.com/mauricemach/coffeekup.git"}, | ||
"dependencies": {"coffee-script": ">= 1.0.0"}, | ||
"dependencies": {"coffee-script": ">= 1.0.1"}, | ||
"keywords": ["template", "view", "coffeescript"], | ||
"bin": {"coffeekup": "./bin/coffeekup.coffee"}, | ||
"main": "./index", | ||
"directories": {"lib": "./lib"}, | ||
"main": "./lib/index", | ||
"engines": {"node": ">= 0.2.6"} | ||
"bin": "./bin/coffeekup", | ||
"main": "./lib/coffeekup", | ||
"engines": {"node": ">= 0.4.1"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
#!/usr/bin/env coffee | ||
|
||
coffeekup = require 'coffeekup' | ||
coffeekup = require './coffeekup' | ||
fs = require 'fs' | ||
path = require 'path' | ||
puts = console.log | ||
{OptionParser} = require 'coffee-script/lib/optparse' | ||
|
||
# On [email protected], argv looks like [filename], | ||
# On [email protected], argv looks like ["node", "path/to/coffee", filename] | ||
if process.argv[0] is 'node' and process.argv.length >= 2 | ||
argv = process.argv[2..] | ||
else | ||
argv = process.argv[0..] | ||
argv = process.argv[2..] | ||
options = null | ||
|
||
render = (input_path, output_directory) -> | ||
fs.readFile input_path, (err, contents) -> | ||
|
@@ -47,24 +41,25 @@ switches = [ | |
['-h', '--help', 'display this help message'] | ||
] | ||
|
||
parser = new OptionParser switches, usage | ||
options = parser.parse argv | ||
args = options.arguments | ||
delete options.arguments | ||
@run = -> | ||
parser = new OptionParser switches, usage | ||
options = parser.parse argv | ||
args = options.arguments | ||
delete options.arguments | ||
|
||
puts parser.help() if options.help or argv.length is 0 | ||
puts coffeekup.version if options.version | ||
if options.utils | ||
options.locals ?= {} | ||
options.locals.render = (file) -> | ||
contents = fs.readFileSync file | ||
coffeekup.render String(contents), options | ||
puts parser.help() if options.help or argv.length is 0 | ||
puts coffeekup.version if options.version | ||
if options.utils | ||
options.locals ?= {} | ||
options.locals.render = (file) -> | ||
contents = fs.readFileSync file | ||
coffeekup.render String(contents), options | ||
|
||
if args.length > 0 | ||
file = args[0] | ||
if args.length > 0 | ||
file = args[0] | ||
|
||
if options.watch | ||
fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) -> | ||
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime() | ||
render file, options.output | ||
else render file, options.output | ||
if options.watch | ||
fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) -> | ||
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime() | ||
render file, options.output | ||
else render file, options.output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters