Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5 from tim-smart/bug/node-v0.10

Use NODE_MODULE to create node_gd binding
  • Loading branch information...
commit 1fb580c5526ede7076ecab605548935d7f06982d 2 parents 2101297 + 920cc45
@mikesmullin authored
View
2  binding.gyp
@@ -1,7 +1,7 @@
{
"targets": [
{
- "target_name": "node-gd",
+ "target_name": "node_gd",
"sources": ["cpp/node-gd.cpp"],
"libraries": ["-lgd"],
"conditions": [
View
6 coffee/node-gd.coffee
@@ -43,12 +43,12 @@ fs = require 'fs'
# not sure what dif. is between Release and default
# but its not consistent across node installations
-if fs.existsSync(lib = __dirname+'/../build/Release/node-gd.node')
+if fs.existsSync(lib = __dirname+'/../build/Release/node_gd.node')
gd_bindings = require lib
-else if fs.existsSync(lib = __dirname+'/../build/default/node-gd.node')
+else if fs.existsSync(lib = __dirname+'/../build/default/node_gd.node')
gd_bindings = require lib
else
- throw 'unable to locate node-gd.node within build directory'
+ throw 'unable to locate node_gd.node within build directory'
for p of gd_bindings
if typeof gd_bindings[p] isnt 'undefined'
View
10 cpp/node-gd.cpp
@@ -1486,8 +1486,12 @@ class Gd
Persistent<FunctionTemplate> Gd::Image::constructor_template;
extern "C"
-void init (Handle<Object> target)
{
- HandleScope scope;
- Gd::Init(target);
+ void init (Handle<Object> target)
+ {
+ HandleScope scope;
+ Gd::Init(target);
+ }
+
+ NODE_MODULE(node_gd, init);
}
View
10 js/node-gd.js
@@ -1,9 +1,10 @@
-// Generated by CoffeeScript 1.4.0
+// Generated by CoffeeScript 1.6.2
var format, formats, fs, gd_bindings, lib, open_func, p, save_func, util, v;
open_func = function(format, len) {
return function() {
var args, callback, filename;
+
args = Array.prototype.slice.call(arguments);
filename = args.shift();
callback = args[len - 1];
@@ -25,6 +26,7 @@ save_func = function(format, len) {
format = format.toLowerCase();
return function() {
var args, callback, data, filename;
+
args = Array.prototype.slice.call(arguments);
filename = args.shift();
callback = args[len - 1];
@@ -40,12 +42,12 @@ util = require('util');
fs = require('fs');
-if (fs.existsSync(lib = __dirname + '/../build/Release/node-gd.node')) {
+if (fs.existsSync(lib = __dirname + '/../build/Release/node_gd.node')) {
gd_bindings = require(lib);
-} else if (fs.existsSync(lib = __dirname + '/../build/default/node-gd.node')) {
+} else if (fs.existsSync(lib = __dirname + '/../build/default/node_gd.node')) {
gd_bindings = require(lib);
} else {
- throw 'unable to locate node-gd.node within build directory';
+ throw 'unable to locate node_gd.node within build directory';
}
for (p in gd_bindings) {
Please sign in to comment.
Something went wrong with that request. Please try again.