Skip to content

Commit

Permalink
replaced sys with util
Browse files Browse the repository at this point in the history
fixed tests, now using mocked servers
  • Loading branch information
Pascal Opitz authored and Pascal Opitz committed Jun 24, 2012
1 parent cebe162 commit d661330
Show file tree
Hide file tree
Showing 36 changed files with 1,109 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -104,7 +104,7 @@ Please make sure beanstalkd is running on the default settings.


To run all tests: To run all tests:


find tests/ | grep .js | xargs -n1 node npm test




## CREDIT ## CREDIT
Expand Down
9 changes: 5 additions & 4 deletions lib/beanstalk_client.js
@@ -1,7 +1,7 @@
// Includes // Includes
var events = require('events'), var events = require('events'),
net = require('net'), net = require('net'),
sys = require('sys'); util = require('util');


// ##yaml wrapper // ##yaml wrapper
// because yaml doesn't like beanstalk // because yaml doesn't like beanstalk
Expand All @@ -16,7 +16,7 @@ var yaml = new function() {
.replace(/(\w)\-(\w)/mgi, '$1_$2') // replace minuses in hash names .replace(/(\w)\-(\w)/mgi, '$1_$2') // replace minuses in hash names
.replace(/\n([\w\d_-]+)\:\ ([\.\,\w\d_-]+)/mig, '\n $1: \'$2\'') // format hashes .replace(/\n([\w\d_-]+)\:\ ([\.\,\w\d_-]+)/mig, '\n $1: \'$2\'') // format hashes
; ;

try { try {
return require('yaml').eval(corrected); return require('yaml').eval(corrected);
} catch(e) { } catch(e) {
Expand Down Expand Up @@ -60,7 +60,7 @@ BeanstalkJob.create = function(data) {
function BeanstalkCommand() { function BeanstalkCommand() {
events.EventEmitter.call(this); events.EventEmitter.call(this);
}; };
sys.inherits(BeanstalkCommand, events.EventEmitter); util.inherits(BeanstalkCommand, events.EventEmitter);


BeanstalkCommand.prototype.onSuccess = function(callback) { BeanstalkCommand.prototype.onSuccess = function(callback) {
this.addListener('command_done', function(data) { this.addListener('command_done', function(data) {
Expand Down Expand Up @@ -114,7 +114,7 @@ function BeanstalkClient() {
this.conn; this.conn;
this.default_priority = 10; this.default_priority = 10;
}; };
sys.inherits(BeanstalkClient, events.EventEmitter); util.inherits(BeanstalkClient, events.EventEmitter);


// Singleton like method that returns an instance // Singleton like method that returns an instance
BeanstalkClient.prototype.Instance = function(server) { BeanstalkClient.prototype.Instance = function(server) {
Expand Down Expand Up @@ -188,6 +188,7 @@ BeanstalkClient.prototype.command = function(obj) {
// disconnects a client // disconnects a client
BeanstalkClient.prototype.disconnect = function() { BeanstalkClient.prototype.disconnect = function() {
this.conn.end(); this.conn.end();
this.conn.destroy();
this.conn = null; this.conn = null;
}; };


Expand Down
3 changes: 3 additions & 0 deletions node_modules/yaml/.gitmodules

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions node_modules/yaml/History.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions node_modules/yaml/Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions node_modules/yaml/Readme.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/yaml/examples/boolean.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions node_modules/yaml/examples/config.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions node_modules/yaml/examples/dates.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions node_modules/yaml/examples/hash.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions node_modules/yaml/examples/list.nested.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions node_modules/yaml/examples/list.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions node_modules/yaml/examples/null.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/yaml/examples/run.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d661330

Please sign in to comment.