markushedvall / node-plantuml

A Node.js module and CLI for running PlantUML
MIT License
193 stars 53 forks source link

Support nodejs 0.10.x #2

Closed pingchen closed 9 years ago

pingchen commented 9 years ago

First let me say thank you for the nice library you wrote. It saves me a lot of time and works really well to create server-side UML images.

However we are running nodejs 0.10.30 and we got an error: util.isFunction is not defined.

/home/ping/projects/app/app/node_modules/node-plantuml/lib/node-plantuml.js:67
  if (util.isFunction(input)) {
           ^
TypeError: Object #<Object> has no method 'isFunction'
    at arrangeArguments (/home/ping/projects/app/node_modules/node-plantuml/lib/node-plantuml.js:67:12)

I added the following code in node-plantuml.js and tested it in node 0.10.30 and 0.11.16 and 0.12.7 and they seems to be all working.

var util = require('util')
if (!util.isFunction) {
  util.isFunction = function isFunction(arg) {
     return typeof arg === 'function';
  };
}

Do you mind to include this patches in the next release so that the library will run under 0.10.x as well.

markushedvall commented 9 years ago

Thanks for reporting this and I'm glad to hear you are enjoying the library.

I'll definitely be fixing this. A fix will be released today or tomorrow.

markushedvall commented 9 years ago

This issue should be fixed in the latest release 0.4.1. I also added some regression testing for 0.10.x so that node-plantuml can keep supporting it in future releases.

Please tell me if you are still experiencing any problems.