diff --git a/lib/storage-policy.js b/lib/storage-policy.js old mode 100644 new mode 100755 index f7a1c3e..093d040 --- a/lib/storage-policy.js +++ b/lib/storage-policy.js @@ -101,7 +101,7 @@ Slingshot.StoragePolicy = function () { stringify: function (encoding) { /* global Buffer: false */ - return Buffer(JSON.stringify(policy), "utf-8") + return new Buffer.from(JSON.stringify(policy), "utf-8") .toString(encoding || "base64"); } }); diff --git a/package.js b/package.js old mode 100644 new mode 100755 index 1fdec4e..350e5cc --- a/package.js +++ b/package.js @@ -5,20 +5,20 @@ Package.describe({ git: "https://github.com/CulturalMe/meteor-slingshot" }); -Package.on_use(function (api) { +Package.onUse(function (api) { api.versionsFrom('METEOR@1.0'); api.use(["underscore", "check"]); api.use(["tracker", "reactive-var"], "client"); - api.add_files([ + api.addFiles([ "lib/restrictions.js", "lib/validators.js" ]); - api.add_files("lib/upload.js", "client"); + api.addFiles("lib/upload.js", "client"); - api.add_files([ + api.addFiles([ "lib/directive.js", "lib/storage-policy.js", "services/aws-s3.js", @@ -29,7 +29,7 @@ Package.on_use(function (api) { api.export("Slingshot"); }); -Package.on_test(function (api) { +Package.onTest(function (api) { api.use(["tinytest", "underscore", "edgee:slingshot"]); - api.add_files("test/aws-s3.js", "server"); + api.addFiles("test/aws-s3.js", "server"); }); diff --git a/services/aws-s3.js b/services/aws-s3.js old mode 100644 new mode 100755 index fd17f19..fd1e745 --- a/services/aws-s3.js +++ b/services/aws-s3.js @@ -230,6 +230,6 @@ function hmac256(key, data, encoding) { /* global Buffer: false */ return crypto .createHmac("sha256", key) - .update(new Buffer(data, "utf-8")) + .update(new Buffer.from(data, "utf-8")) .digest(encoding); } diff --git a/services/rackspace.js b/services/rackspace.js old mode 100644 new mode 100755 index 460e8d3..8bd2ebe --- a/services/rackspace.js +++ b/services/rackspace.js @@ -106,7 +106,7 @@ Slingshot.RackspaceFiles = { return Npm.require("crypto") .createHmac("sha1", secretkey) - .update(new Buffer(policy, "utf-8")) + .update(new Buffer.from(policy, "utf-8")) .digest("hex"); }