freedom-for-node
Advanced tools
Comparing version 0.2.11 to 0.2.12
@@ -59,3 +59,3 @@ /*jslint node:true*/ | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-jasmine-node'); | ||
grunt.loadNpmTasks('grunt-jasmine-node2'); | ||
grunt.loadNpmTasks('grunt-npm'); | ||
@@ -62,0 +62,0 @@ grunt.loadNpmTasks('grunt-bump'); |
@@ -26,2 +26,8 @@ /*jslint node:true, sloppy:true */ | ||
}, | ||
setInterval: function (cb, time) { | ||
setInterval(cb, time); | ||
}, | ||
clearInterval: function (id) { | ||
clearInterval(id); | ||
}, | ||
// postMessage - sending messages out of the module. | ||
@@ -28,0 +34,0 @@ postMessage: function (msg) { |
{ | ||
"name": "freedom-for-node", | ||
"description": "Embracing a distributed web", | ||
"version": "0.2.11", | ||
"version": "0.2.12", | ||
"homepage": "http://freedomjs.org", | ||
@@ -21,3 +21,3 @@ "bugs": { | ||
"grunt-bump": "0.0.15", | ||
"grunt-jasmine-node": "^0.2.1", | ||
"grunt-jasmine-node2": "^0.4.0", | ||
"grunt-npm": "0.0.2", | ||
@@ -27,3 +27,3 @@ "grunt-prompt": "^1.2.1" | ||
"scripts": { | ||
"test": "grunt test" | ||
"test": "grunt test --verbose" | ||
}, | ||
@@ -33,3 +33,3 @@ "dependencies": { | ||
"es6-promise": "^2.0.0", | ||
"freedom": "~0.6.18", | ||
"freedom": "~0.6.19", | ||
"glob": "~4.3.1", | ||
@@ -47,4 +47,4 @@ "grunt-contrib-jshint": "^0.10.0", | ||
"peerDependencies": { | ||
"freedom": "~0.6.18" | ||
"freedom": "~0.6.19" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
/*jslint sloppy:true,node:true,nomen:true */ | ||
/*jslint node:true,nomen:true */ | ||
@@ -8,2 +8,3 @@ /** | ||
var Storage_node = function (cap, dispatch) { | ||
'use strict'; | ||
this.store = require('json-store')(__dirname + '/../freedomjs-database.json'); | ||
@@ -14,5 +15,10 @@ this.dispatchEvents = dispatch; | ||
Storage_node.prototype.get = function (key, continuation) { | ||
'use strict'; | ||
try { | ||
var val = this.store.get(key); | ||
continuation(val); | ||
if (typeof val !== 'undefined') { | ||
continuation(val); | ||
} else { | ||
continuation(null); | ||
} | ||
} catch (e) { | ||
@@ -24,2 +30,3 @@ continuation(null); | ||
Storage_node.prototype.keys = function (continuation) { | ||
'use strict'; | ||
var dict = this.store.get(); | ||
@@ -30,2 +37,3 @@ continuation(Object.keys(dict)); | ||
Storage_node.prototype.set = function (key, value, continuation) { | ||
'use strict'; | ||
var old = this.store.get(key); | ||
@@ -37,2 +45,3 @@ this.store.set(key, value); | ||
Storage_node.prototype.remove = function (key, continuation) { | ||
'use strict'; | ||
var old = this.store.get(key); | ||
@@ -44,2 +53,3 @@ this.store.del(key); | ||
Storage_node.prototype.clear = function (continuation) { | ||
'use strict'; | ||
this.store.Store = {}; | ||
@@ -46,0 +56,0 @@ this.store.save(); |
@@ -136,6 +136,6 @@ /*globals require, console, Uint8Array */ | ||
} | ||
try { | ||
this.state = TcpSocket_node.state.CONNECTING; | ||
this.connection = this.net.connect(port, hostname); | ||
this.state = TcpSocket_node.state.CONNECTING; | ||
this.callback = cb; | ||
@@ -182,5 +182,3 @@ this.attachListeners(); | ||
return; | ||
} | ||
if (this.state === TcpSocket_node.state.CONNECTED) { | ||
} else if (this.state === TcpSocket_node.state.CONNECTED) { | ||
console.warn('Socket Error: ' + error); | ||
@@ -193,2 +191,8 @@ this.dispatchEvent('onDisconnect', { | ||
this.state = TcpSocket_node.state.CLOSED; | ||
return; | ||
} else { | ||
console.warn('Socket Error: ' + error); | ||
delete this.connection; | ||
this.state = TcpSocket_node.state.CLOSED; | ||
return; | ||
} | ||
@@ -270,3 +274,3 @@ }; | ||
TcpSocket_node.unbound[id] = connection; | ||
this.dispatchEvent('onConnection', { | ||
@@ -273,0 +277,0 @@ 'socket': id, |
@@ -19,18 +19,15 @@ var testUtil = require('freedom/spec/util'); | ||
describe("integration-single: social.loopback.json", | ||
require('freedom/spec/providers/social/social.single.integration.src').bind(this, | ||
"/providers/social/loopback/social.loopback.json", setup)); | ||
describe("integration-single: social.ws.json", | ||
require('freedom/spec/providers/social/social.single.integration.src').bind(this, | ||
"/providers/social/websocket-server/social.ws.json", setup)); | ||
describe("integration-double: social.ws.json", | ||
require('freedom/spec/providers/social/social.double.integration.src').bind(this, | ||
"/providers/social/websocket-server/social.ws.json", setup)); | ||
// Social | ||
describe("integration-single: social.loopback.json", require("freedom/spec/providers/social/social.single.integration.src") | ||
.bind(this, require("../index").freedom, "../node_modules/freedom/providers/social/loopback/social.loopback.json"), {}); | ||
describe("integration-single: social.ws.json", require("freedom/spec/providers/social/social.single.integration.src") | ||
.bind(this, require("../index").freedom, "../node_modules/freedom/providers/social/websocket-server/social.ws.json", {})); | ||
describe("integration-double: social.ws.json", require("freedom/spec/providers/social/social.double.integration.src") | ||
.bind(this, require("../index").freedom, "../node_modules/freedom/providers/social/websocket-server/social.ws.json", {})); | ||
describe("integration: storage.isolated.json", | ||
require('freedom/spec/providers/storage/storage.integration.src').bind(this, | ||
"/providers/storage/isolated/storage.isolated.json", setup)); | ||
describe("integration: storage.shared.json", | ||
require('freedom/spec/providers/storage/storage.integration.src').bind(this, | ||
"/providers/storage/shared/storage.shared.json", setup, false)); | ||
// Storage | ||
describe("integration: storage.isolated.json", require("freedom/spec/providers/storage/storage.integration.src") | ||
.bind(this, require("../index").freedom, "../node_modules/freedom/providers/storage/isolated/storage.isolated.json", {}, false)); | ||
describe("integration: storage.shared.json", require("freedom/spec/providers/storage/storage.integration.src") | ||
.bind(this, require("../index").freedom, "../node_modules/freedom/providers/storage/shared/storage.shared.json", {}, false)); | ||
@@ -37,0 +34,0 @@ describe("integration: core.tcpsocket", |
Sorry, the diff of this file is not supported yet
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
45264
1006
Updatedfreedom@~0.6.19