appium-support
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -5,2 +5,3 @@ "use strict"; | ||
, fs = require('fs') | ||
, os = require('os') | ||
, B = require('bluebird'); | ||
@@ -68,1 +69,13 @@ | ||
}; | ||
exports.localIp = function () { | ||
var ip = _.chain(os.networkInterfaces()) | ||
.values() | ||
.flatten() | ||
.filter(function (val) { | ||
return (val.family === 'IPv4' && val.internal === false); | ||
}) | ||
.pluck('address') | ||
.first().value(); | ||
return ip; | ||
}; |
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"author": "appium", | ||
@@ -10,0 +10,0 @@ "license": "Apache License 2.0", |
@@ -87,2 +87,9 @@ "use strict"; | ||
}); | ||
describe("localIp", function () { | ||
it("should find a local ip address", function () { | ||
var ip = util.localIp(); | ||
ip.should.match(/\d*\.\d*\.\d*\.\d*/); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12416
322