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
Showing
10 changed files
with
161 additions
and
104 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,15 +1,2 @@ | ||
node_modules | ||
lib-cov | ||
*.seed | ||
*.log | ||
*.csv | ||
*.dat | ||
*.out | ||
*.pid | ||
*.gz | ||
|
||
pids | ||
logs | ||
results | ||
|
||
npm-debug.log | ||
/node_modules/ | ||
npm-debug.log |
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,21 @@ | ||
{ | ||
"node": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 4, | ||
"latedef": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"quotmark": "single", | ||
"regexp": true, | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"white": true | ||
} |
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,4 @@ | ||
language: node_js | ||
node_js: | ||
- '0.8' | ||
- '0.10' |
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,35 +1,38 @@ | ||
replit | ||
====== | ||
|
||
sometimes you need a repl (inspired by http://defunkt.io/repl/) | ||
|
||
## DESCRIPTION | ||
`replit` wraps a non-interactive shell command in an interactive read-eval-print-loop (repl) prompt. | ||
Each line you type into the prompt is executed as arguments to command. | ||
Anything written to standard output or standard error by the command is displayed. | ||
|
||
## Status | ||
|
||
WIP | ||
|
||
## Installation | ||
|
||
``` | ||
$ npm install -g Hypercubed/replit | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
Usage: replit.js [options] <cmd> | ||
Options: | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
``` | ||
|
||
# License | ||
|
||
MIT | ||
|
||
replit [![Build Status](https://secure.travis-ci.org/Hypercubed/replit.png?branch=master)](https://travis-ci.org/Hypercubed/replit) [![NPM version](https://badge.fury.io/js/replit.png)](http://badge.fury.io/js/replit) | ||
============= | ||
|
||
sometimes you need a repl (inspired by http://defunkt.io/repl/) | ||
|
||
# Description | ||
`replit` wraps a non-interactive shell command in an interactive read-eval-print-loop (repl) prompt. | ||
Each line you type into the prompt is executed as arguments to command. | ||
Anything written to standard output or standard error by the command is displayed. | ||
|
||
## Status | ||
WIP | ||
|
||
# Installation | ||
|
||
``` | ||
$ npm install -g Hypercubed/replit | ||
``` | ||
|
||
# Usage | ||
|
||
``` | ||
Usage: replit.js [options] <cmd> | ||
Options: | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
``` | ||
|
||
# License | ||
|
||
Copyright (c) 2013 Jayson Harshbarger | ||
[MIT License](http://en.wikipedia.org/wiki/MIT_License) | ||
|
||
# Acknowledgments | ||
|
||
Built using [generator-commader](https://github.com/Hypercubed/generator-commander), inspired by [http://defunkt.io/repl/](http://defunkt.io/repl/). |
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,32 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
|
||
var program = require('commander'); | ||
|
||
// | ||
var repl = require('../lib/replit.js').repl; | ||
|
||
require('autocmdr/lib/logger')(program); | ||
require('autocmdr/lib/package')(program); | ||
|
||
program | ||
.usage('[options] <cmd>') | ||
.option('-p, --pmt <prompt>', 'set readline prompt') | ||
.parse(process.argv); | ||
|
||
if (program.args.length < 1 ) { | ||
program.log.error('No command specified. See \''+program._name+' --help\'.'); | ||
program.outputHelp(); | ||
process.exit(1); | ||
} | ||
|
||
var cmd = program.args.join(' '); | ||
|
||
var options = {}; | ||
options.prompt = program.pmt || cmd+'> '; | ||
options.debug = program.debug || false; | ||
options.name = program.name || 'replit'; | ||
|
||
repl(cmd, options); | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
'use strict'; | ||
|
||
var assert = require("assert"); | ||
var exec = require('child_process').exec; | ||
var path = require('path'); | ||
|
||
describe('replit bin', function(){ | ||
var cmd = 'node '+path.join(__dirname, '../bin/replit')+' '; | ||
console.log(cmd); | ||
|
||
it('--help should run without errors', function(done) { | ||
exec(cmd+'--help', function (error, stdout, stderr) { | ||
assert(!error); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('--version should run without errors', function(done) { | ||
exec(cmd+'--version', function (error, stdout, stderr) { | ||
assert(!error); | ||
done(); | ||
}); | ||
}); | ||
|
||
it('should return error on missing command', function(done) { | ||
this.timeout(4000); | ||
|
||
exec(cmd, function (error, stdout, stderr) { | ||
assert(error); | ||
assert.equal(error.code,1); | ||
done(); | ||
}); | ||
|
||
}); | ||
|
||
}); |