Skip to content

Commit

Permalink
Merge pull request #137 from stevelacy/quotes
Browse files Browse the repository at this point in the history
Normalize example/ and lib/ quote styles
  • Loading branch information
apocas committed May 18, 2015
2 parents df15297 + cb896de commit 229ddec
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 101 deletions.
8 changes: 4 additions & 4 deletions examples/duplexstreams.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ var Docker = require('../lib/docker');
var docker = new Docker();

var createContainer = function(i) {
console.log("creating container " + i);
console.log('creating container ' + i);
return docker.createContainer({
Cmd: '/bin/bash',
Image: 'ubuntu:12.04',
OpenStdin: true,
Tty: true
}, function(err, container) {
console.log("attaching to container " + i);
console.log('attaching to container ' + i);
return container.attach({
stream: true,
stdin: true,
stdout: true
}, function(err, ttyStream) {
return setTimeout(function() {
console.log("ending container " + i + " tty stream");
console.log('ending container ' + i + ' tty stream');
//console.log(ttyStream);
ttyStream.end();
return container.remove({
force: true
}, function() {
return console.log("container " + i + " removed");
return console.log('container ' + i + ' removed');
});
}, 5000);
});
Expand Down
8 changes: 4 additions & 4 deletions examples/exec_running_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ var docker = new Docker({
*/
function runExec(container) {
options = {
"AttachStdout": true,
"AttachStderr": true,
"Tty": false,
Cmd: ["env"]
AttachStdout: true,
AttachStderr: true,
Tty: false,
Cmd: ['env']
};
container.exec(options, function(err, exec) {
if (err) return;
Expand Down
6 changes: 3 additions & 3 deletions examples/external_volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var docker = new Docker({
docker.createContainer({
Image: 'ubuntu',
Cmd: ['/bin/ls', '/stuff'],
"Volumes": {
"/stuff": {}
'Volumes': {
'/stuff': {}
}
}, function(err, container) {
container.attach({
Expand All @@ -20,7 +20,7 @@ docker.createContainer({
stream.pipe(process.stdout);

container.start({
"Binds": ["/home/vagrant:/stuff"]
'Binds': ['/home/vagrant:/stuff']
}, function(err, data) {
console.log(data);
});
Expand Down
4 changes: 2 additions & 2 deletions examples/listContainers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var socket = process.env.DOCKER_SOCKET || '/var/run/docker.sock';
var stats = fs.statSync(socket);

if (!stats.isSocket()) {
throw new Error("Are you sure the docker is running?");
throw new Error('Are you sure the docker is running?');
}

var docker = new Docker({ socketPath: socket });
Expand All @@ -16,4 +16,4 @@ docker.listContainers({all: true}, function(err, containers) {

docker.listContainers({all: false}, function(err, containers) {
console.log('!ALL: ' + containers.length);
});
});
2 changes: 1 addition & 1 deletion examples/run_stdin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var socket = process.env.DOCKER_SOCKET || '/var/run/docker.sock';
var stats = fs.statSync(socket);

if (!stats.isSocket()) {
throw new Error("Are you sure the docker is running?");
throw new Error('Are you sure the docker is running?');
}

var docker = new Docker({ socketPath: socket });
Expand Down
2 changes: 1 addition & 1 deletion examples/timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var socket = process.env.DOCKER_SOCKET || '/var/run/docker.sock';
var stats = fs.statSync(socket);

if (!stats.isSocket()) {
throw new Error("Are you sure the docker is running?");
throw new Error('Are you sure the docker is running?');
}

// you may specify a timeout (in ms) for all operations, allowing to make sure you don't fall into limbo if something happens in docker
Expand Down
2 changes: 1 addition & 1 deletion examples/top.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var socket = process.env.DOCKER_SOCKET || '/var/run/docker.sock';
var stats = fs.statSync(socket);

if (!stats.isSocket()) {
throw new Error("Are you sure the docker is running?");
throw new Error('Are you sure the docker is running?');
}

var docker = new Docker({host: 'http://127.0.0.1', port: 2375});
Expand Down
94 changes: 47 additions & 47 deletions lib/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Container.prototype.inspect = function(callback) {
method: 'GET',
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
}
};

Expand Down Expand Up @@ -69,8 +69,8 @@ Container.prototype.rename = function(opts, callback) {
method: 'POST',
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.rename, opts)
};
Expand All @@ -82,7 +82,7 @@ Container.prototype.rename = function(opts, callback) {

/**
* Top
* @param {Object} Options like "ps_args" (optional)
* @param {Object} Options like 'ps_args' (optional)
* @param {Function} callback Callback
*/
Container.prototype.top = function(opts, callback) {
Expand All @@ -96,8 +96,8 @@ Container.prototype.top = function(opts, callback) {
method: 'GET',
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.top, opts)
};
Expand All @@ -117,8 +117,8 @@ Container.prototype.changes = function(callback) {
method: 'GET',
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
}
};

Expand All @@ -138,8 +138,8 @@ Container.prototype.export = function(callback) {
isStream: true,
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
}
};

Expand All @@ -164,9 +164,9 @@ Container.prototype.start = function(opts, callback) {
method: 'POST',
statusCodes: {
204: true,
304: "container already started",
404: "no such container",
500: "server error"
304: 'container already started',
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.start, opts)
};
Expand All @@ -192,7 +192,7 @@ Container.prototype.pause = function(opts, callback) {
method: 'POST',
statusCodes: {
204: true,
500: "server error"
500: 'server error'
},
options: opts
};
Expand All @@ -218,8 +218,8 @@ Container.prototype.unpause = function(opts, callback) {
method: 'POST',
statusCodes: {
204: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: opts
};
Expand Down Expand Up @@ -248,8 +248,8 @@ Container.prototype.exec = function(opts, callback) {
method: 'POST',
statusCodes: {
201: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.exec, opts)
};
Expand All @@ -262,7 +262,7 @@ Container.prototype.exec = function(opts, callback) {

/**
* Commit
* @param {Object} opts Commit options like "Hostname" (optional)
* @param {Object} opts Commit options like 'Hostname' (optional)
* @param {Function} callback Callback
*/
Container.prototype.commit = function(opts, callback) {
Expand All @@ -278,8 +278,8 @@ Container.prototype.commit = function(opts, callback) {
method: 'POST',
statusCodes: {
201: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.commit, opts)
};
Expand All @@ -291,7 +291,7 @@ Container.prototype.commit = function(opts, callback) {

/**
* Stop
* @param {Object} opts Container stop options, like "t" (optional)
* @param {Object} opts Container stop options, like 't' (optional)
* @param {Function} callback Callback
*/
Container.prototype.stop = function(opts, callback) {
Expand All @@ -305,9 +305,9 @@ Container.prototype.stop = function(opts, callback) {
method: 'POST',
statusCodes: {
204: true,
304: "container already stopped",
404: "no such container",
500: "server error"
304: 'container already stopped',
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.stop, opts)
};
Expand All @@ -319,7 +319,7 @@ Container.prototype.stop = function(opts, callback) {

/**
* Restart
* @param {Object} opts Container restart options, like "t" (optional)
* @param {Object} opts Container restart options, like 't' (optional)
* @param {Function} callback Callback
*/
Container.prototype.restart = function(opts, callback) {
Expand All @@ -333,8 +333,8 @@ Container.prototype.restart = function(opts, callback) {
method: 'POST',
statusCodes: {
204: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.restart, opts)
};
Expand All @@ -346,7 +346,7 @@ Container.prototype.restart = function(opts, callback) {

/**
* Kill
* @param {Object} opts Container kill options, like "signal" (optional)
* @param {Object} opts Container kill options, like 'signal' (optional)
* @param {Function} callback Callback
*/
Container.prototype.kill = function(opts, callback) {
Expand All @@ -360,8 +360,8 @@ Container.prototype.kill = function(opts, callback) {
method: 'POST',
statusCodes: {
204: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.kill, opts)
};
Expand All @@ -386,7 +386,7 @@ Container.prototype.resize = function(opts, callback) {
200: true,
400: 'bad parameter',
404: 'no such container',
500: "server error"
500: 'server error'
}
};

Expand All @@ -397,7 +397,7 @@ Container.prototype.resize = function(opts, callback) {

/**
* Attach
* @param {Object} opts Attach options, like "logs" (optional)
* @param {Object} opts Attach options, like 'logs' (optional)
* @param {Function} callback Callback with stream.
*/
Container.prototype.attach = function(opts, callback) {
Expand All @@ -409,8 +409,8 @@ Container.prototype.attach = function(opts, callback) {
openStdin: opts.stdin,
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
}
};

Expand All @@ -431,7 +431,7 @@ Container.prototype.wait = function(callback) {
200: true,
400: 'bad parameter',
404: 'no such container',
500: "server error"
500: 'server error'
}
};

Expand All @@ -442,7 +442,7 @@ Container.prototype.wait = function(callback) {

/**
* Removes a container
* @param {Object} opts Remove options, like "force" (optional)
* @param {Object} opts Remove options, like 'force' (optional)
* @param {Function} callback Callback
*/
Container.prototype.remove = function(opts, callback) {
Expand All @@ -457,8 +457,8 @@ Container.prototype.remove = function(opts, callback) {
statusCodes: {
204: true,
400: 'bad parameter',
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.remove, opts)
};
Expand All @@ -470,7 +470,7 @@ Container.prototype.remove = function(opts, callback) {

/**
* Copy
* @param {Object} opts Copy options, like "Resource" (optional)
* @param {Object} opts Copy options, like 'Resource' (optional)
* @param {Function} callback Callback with stream.
*/
Container.prototype.copy = function(opts, callback) {
Expand All @@ -480,8 +480,8 @@ Container.prototype.copy = function(opts, callback) {
isStream: true,
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: extend({}, this.defaultOptions.copy, opts)
};
Expand All @@ -504,8 +504,8 @@ Container.prototype.logs = function(opts, callback) {
isStream: true,
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: opts
};
Expand All @@ -528,8 +528,8 @@ Container.prototype.stats = function(callback) {
isStream: true,
statusCodes: {
200: true,
404: "no such container",
500: "server error"
404: 'no such container',
500: 'server error'
},
options: {}
};
Expand Down
Loading

0 comments on commit 229ddec

Please sign in to comment.