Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #42 from andrerod/dev
Browse files Browse the repository at this point in the history
Fixing issue #2 and #33
  • Loading branch information
Andre Rodrigues committed Jan 26, 2012
2 parents 8e5ae70 + 268422e commit ef0946d
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 14 deletions.
1 change: 1 addition & 0 deletions examples/blobuploader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"express": ">= 2.4.7"
, "ejs": ">= 0.4.3"
, "formidable": ">= 1.0.6"
, "azure": ">= 0.5.1"
}
}
8 changes: 7 additions & 1 deletion examples/blobuploader/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var express = require('express');
var formidable = require('formidable');
var azure = require('./../../lib/azure');
var helpers = require('./helpers.js');

var app = module.exports = express.createServer();
Expand Down
8 changes: 7 additions & 1 deletion examples/blog/blog.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
var azure = require('./../../lib/azure');
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var ServiceClient = azure.ServiceClient;
var TableQuery = azure.TableQuery;
var uuid = require('node-uuid');
Expand Down
1 change: 1 addition & 0 deletions examples/blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
, "stylus": ">= 0.0.1"
, "ejs": ">= 0.4.3"
, "node-uuid": ">= 1.2.0"
, "azure": ">= 0.5.1"
}
}
9 changes: 7 additions & 2 deletions examples/samples/blobuploaddownloadsample.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
* 3. Demonstrate making requests using AccessConditions.
*/

var azure = require('../../lib/azure');
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var BlobConstants = azure.Constants.BlobConstants;
var ServiceClient = azure.ServiceClient;
var CloudBlobClient = azure.CloudBlobClient;

var util = require('util');
var path = require('path');
var fs = require('fs');

var container = 'updownsample';
Expand Down
8 changes: 7 additions & 1 deletion examples/samples/continuationsample.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
*
*/

var azure = require('../../lib/azure');
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var BlobConstants = azure.Constants.BlobConstants;
var ServiceClient = azure.ServiceClient;
var CloudBlobClient = azure.CloudBlobClient;
Expand Down
8 changes: 7 additions & 1 deletion examples/samples/leaseblobsample.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
*
*/

var azure = require('../../lib/azure');
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var BlobConstants = azure.Constants.BlobConstants;
var ServiceClient = azure.ServiceClient;
var CloudBlobClient = azure.CloudBlobClient;
Expand Down
8 changes: 7 additions & 1 deletion examples/samples/retrypolicysample.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
* sent if users immediately recreate a container after delete it.
*/

var azure = require('../../lib/azure');
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var BlobConstants = azure.Constants.BlobConstants;
var ServiceClient = azure.ServiceClient;
var CloudBlobClient = azure.CloudBlobClient;
Expand Down
8 changes: 7 additions & 1 deletion examples/samples/sassample.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@
* c. Use both shared access signatures to read that blob (Expect a failure from the "Read" permission shared access signature since it has already expired.).
*/

var azure = require('../../lib/azure');
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var BlobConstants = azure.Constants.BlobConstants;
var ServiceClient = azure.ServiceClient;
var CloudBlobClient = azure.CloudBlobClient;
Expand Down
8 changes: 7 additions & 1 deletion examples/samples/snapshotsample.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
* 8. List all snapshots for this blob.
*/

var azure = require('../../lib/azure');
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var BlobConstants = azure.Constants.BlobConstants;
var ServiceClient = azure.ServiceClient;
var CloudBlobClient = azure.CloudBlobClient;
Expand Down
9 changes: 8 additions & 1 deletion examples/tasklist/home.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
var TableQuery = require('./../../lib/azure').TableQuery;
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var TableQuery = azure.TableQuery;

module.exports = Home;
var uuid = require('node-uuid');
Expand Down
1 change: 1 addition & 0 deletions examples/tasklist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
, "ejs": ">= 0.4.3"
, "jade": ">= 0.18.0"
, "node-uuid": "> = 1.2.0"
, "azure": ">= 0.5.1"
}
}
8 changes: 7 additions & 1 deletion examples/tasklist/server.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// Module dependencies.
var path = require('path');
if (path.existsSync('./../../lib/azure.js')) {
azure = require('./../../lib/azure');
} else {
azure = require('azure');
}

var express = require('express');
var uuid = require('node-uuid');
var Home = require('./home');
var azure = require('./../../lib/azure');
var ServiceClient = azure.ServiceClient;

var app = module.exports = express.createServer();
Expand Down
3 changes: 2 additions & 1 deletion lib/services/serviceclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ ServiceClient.isEmulated = function (host) {
return true;
}

return process.env[ServiceClient.EnvironmentVariables.EMULATED] ? true : false;
return (!azureutil.isNull(process.env[ServiceClient.EnvironmentVariables.EMULATED]) &&
process.env[ServiceClient.EnvironmentVariables.EMULATED] !== 'false');
};

// Other functions
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"mime": ">= 1.2.4"
},
"devDependencies": {
"nodeunit": ">= 0.6.4",
"jshint": ">= 0.5.2"
"nodeunit": ">= 0.6.4"
},
"homepage": "http://github.com/WindowsAzure/azure-sdk-for-node",
"repository": {
Expand Down

0 comments on commit ef0946d

Please sign in to comment.