Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update gh-lookup for optional token

  • Loading branch information...
commit 615ac7e8726707b57452440b415aac14733d8ec6 1 parent 2e68d9c
@tj authored
View
8 node_modules/gh-lookup/node_modules/gh-releases/index.js
@@ -18,7 +18,6 @@ var assert = require('assert');
module.exports = function(opts, fn){
assert(opts, 'config required');
- assert(opts.token, 'github token required');
assert(opts.repo, 'github repo required');
tags(opts, fn);
};
@@ -33,13 +32,12 @@ function tags(pkg, fn) {
var opts = {
url: url,
- headers: {
- 'User-Agent': 'npm',
- 'Authorization': 'Bearer ' + pkg.token
- },
+ headers: { 'User-Agent': 'npm' },
json: true
};
+ if (pkg.token) opts.headers.Authorization = 'Bearer ' + pkg.token;
+
request(opts, function(err, res, body){
if (err) throw err;
fn(null, body);
View
10 node_modules/gh-lookup/node_modules/gh-releases/package.json
@@ -1,6 +1,6 @@
{
"name": "gh-releases",
- "version": "0.2.0",
+ "version": "0.3.0",
"repository": {
"type": "git",
"url": "git://github.com/segmentio/gh-releases"
@@ -24,10 +24,6 @@
"url": "https://github.com/segmentio/gh-releases/issues"
},
"homepage": "https://github.com/segmentio/gh-releases",
- "_id": "gh-releases@0.2.0",
- "dist": {
- "shasum": "67f3fe952f8c36a5b01255dafe4cab87c3458778"
- },
- "_from": "gh-releases@0.2.0",
- "_resolved": "https://registry.npmjs.org/gh-releases/-/gh-releases-0.2.0.tgz"
+ "_id": "gh-releases@0.3.0",
+ "_from": "gh-releases@0.3.0"
}
View
17 node_modules/gh-lookup/node_modules/gh-releases/test/index.js
@@ -2,10 +2,9 @@
var releases = require('..');
describe('releases(opts, fn)', function(){
- it('should respond with releases', function(done){
+ it('should respond with private releases', function(done){
releases({
- user: process.env.USER,
- pass: process.env.PASS,
+ token: process.env.TOKEN,
repo: 'segmentio/accounts'
}, function(err, releases){
if (err) return done(err);
@@ -15,4 +14,16 @@ describe('releases(opts, fn)', function(){
done();
});
})
+
+ it('should respond with public releases', function(done){
+ releases({
+ repo: 'visionmedia/debug'
+ }, function(err, releases){
+ if (err) return done(err);
+ releases.should.not.be.empty;
+ releases[0].should.have.property('name');
+ releases[0].should.have.property('commit');
+ done();
+ });
+ })
})
View
12 node_modules/gh-lookup/package.json
@@ -1,6 +1,6 @@
{
"name": "gh-lookup",
- "version": "0.3.0",
+ "version": "0.4.0",
"repository": {
"type": "git",
"url": "git://github.com/segmentio/gh-lookup"
@@ -11,7 +11,7 @@
"api"
],
"dependencies": {
- "gh-releases": "0.2.0",
+ "gh-releases": "0.3.0",
"semver": "~2.2.1"
},
"devDependencies": {
@@ -25,10 +25,6 @@
"url": "https://github.com/segmentio/gh-lookup/issues"
},
"homepage": "https://github.com/segmentio/gh-lookup",
- "_id": "gh-lookup@0.3.0",
- "dist": {
- "shasum": "9b66004d2eee4d1d50c200af56e8108986c7a9e4"
- },
- "_from": "gh-lookup@0.3.0",
- "_resolved": "https://registry.npmjs.org/gh-lookup/-/gh-lookup-0.3.0.tgz"
+ "_id": "gh-lookup@0.4.0",
+ "_from": "gh-lookup@0.4.0"
}
View
32 node_modules/sha/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS
@@ -0,0 +1,32 @@
+var Transform = require('../transform');
+var inherits = require('util').inherits;
+
+// subclass
+function MyStream () {
+ Transform.call(this, {
+ lowWaterMark: 0,
+ encoding: 'utf8'
+ });
+}
+inherits(MyStream, Transform);
+
+MyStream.prototype._transform = function (chunk, outputFn, callback) {
+ outputFn(new Buffer(String(chunk).toUpperCase()));
+ callback();
+};
+
+// use it!
+var s = new MyStream();
+process.stdin.resume();
+process.stdin.pipe(s).pipe(process.stdout);
+if (process.stdin.setRawMode)
+ process.stdin.setRawMode(true);
+process.stdin.on('data', function (c) {
+ c = c.toString();
+ if (c === '\u0003' || c === '\u0004') {
+ process.stdin.pause();
+ s.end();
+ }
+ if (c === '\r')
+ process.stdout.write('\n');
+});
View
15 node_modules/sha/node_modules/readable-stream/examples/typer-fsr.js
@@ -0,0 +1,15 @@
+var fs = require('fs');
+var FSReadable = require('../fs.js');
+var rst = new FSReadable(__filename);
+
+rst.on('end', function() {
+ process.stdin.pause();
+});
+
+process.stdin.setRawMode(true);
+process.stdin.on('data', function() {
+ var c = rst.read(3);
+ if (!c) return;
+ process.stdout.write(c);
+});
+process.stdin.resume();
View
17 node_modules/sha/node_modules/readable-stream/examples/typer.js
@@ -0,0 +1,17 @@
+var fs = require('fs');
+var fst = fs.createReadStream(__filename);
+var Readable = require('../readable.js');
+var rst = new Readable();
+rst.wrap(fst);
+
+rst.on('end', function() {
+ process.stdin.pause();
+});
+
+process.stdin.setRawMode(true);
+process.stdin.on('data', function() {
+ var c = rst.read(3);
+ if (!c) return setTimeout(process.exit, 500)
+ process.stdout.write(c);
+});
+process.stdin.resume();
View
2  package.json
@@ -83,7 +83,7 @@
"columnify": "0.1.2",
"printf": "~0.1.2",
"chalk": "~0.4.0",
- "gh-lookup": "~0.3.0"
+ "gh-lookup": "~0.4.0"
},
"bundleDependencies": [
"semver",
Please sign in to comment.
Something went wrong with that request. Please try again.