Skip to content

Commit

Permalink
Resolves #2 and #3
Browse files Browse the repository at this point in the history
  • Loading branch information
ClickerMonkey committed May 31, 2016
1 parent 228cdd9 commit 3c87464
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 25 deletions.
20 changes: 20 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"bitwise": false,
"curly": true,
"eqeqeq": true,
"esversion": 5,
"freeze": true,
"funcscope": true,
"loopfunc": false,
"maxdepth": 5,
"noarg": true,
"nocomma": true,
"nonbsp": true,
"nonew": true,
"notypeof": true,
"predef": [ "MY_GLOBAL" ],
"shadow": true,
"singleGroups": false,
"undef": true,
"unused": false
}
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "4.0"
before_script:
- npm install -g gulp
18 changes: 17 additions & 1 deletion Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ var sourcemaps = require('gulp-sourcemaps');
var plugins = require('gulp-load-plugins')();
var gutil = require('gulp-util');
var shell = require('gulp-shell');
var size = require('gulp-check-filesize');
var jshint = require('gulp-jshint');

var build = {
filename: 'rekord-pubsub.js',
minified: 'rekord-pubsub.min.js',
output: './build/',
include: [
'./src/rekord-pubsub.js'
'./src/pubsub.js'
]
};

Expand All @@ -24,6 +26,7 @@ var executeMinifiedBuild = function(props)
.pipe( plugins.concat( props.minified ) )
.pipe( plugins.uglify().on('error', gutil.log) )
.pipe( sourcemaps.write('.') )
.pipe( size({enableGzip: true}) )
.pipe( gulp.dest( props.output ) )
;
};
Expand All @@ -35,11 +38,24 @@ var executeBuild = function(props)
return gulp
.src( props.include )
.pipe( plugins.concat( props.filename ) )
.pipe( size({enableGzip: true}) )
.pipe( gulp.dest( props.output ) )
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'))
;
};
};

gulp.task('lint', function() {
return gulp
.src(build.output + build.filename)
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'))
;
});

gulp.task( 'js:min', executeMinifiedBuild( build ) );
gulp.task( 'js', executeBuild( build ) );
gulp.task( 'default', ['js:min', 'js']);
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ The easiest way to install is by using bower via `bower install rekord-pubsub`.

**Dependencies**

This project is dependent on [pubsubjs](https://github.com/ClickerMonkey/pubsub.js) which can be separately installed via `bower install clickermonkey-pubsubjs`.
This project is dependent on [pubsubjs](https://github.com/ClickerMonkey/pubsub.js).
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rekord-pubsub",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://github.com/Rekord/rekord-pubsub",
"authors": [
"Philip Diffenderfer <pdiffenderfer@gmail.com>"
Expand All @@ -25,6 +25,7 @@
"tests"
],
"dependencies": {
"clickermonkey-pubsubjs": "*"
"clickermonkey-pubsubjs": "*",
"rekord": "^1.2.0"
}
}
15 changes: 7 additions & 8 deletions build/rekord-pubsub.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

Rekord.live = (function()
(function(global, Rekord, PubSub)
{
var OP_SAVE = 1;
var OP_REMOVE = 2;
Expand All @@ -15,9 +14,9 @@ Rekord.live = (function()
{
if ( !database.pubsub || !database.channel || !database.token )
{
return {
save: Rekord.noop,
remove: Rekord.noop
return {
save: Rekord.noop,
remove: Rekord.noop
};
}

Expand Down Expand Up @@ -74,8 +73,8 @@ Rekord.live = (function()
}

};
};
}

return LiveFactory;
Rekord.setLive( LiveFactory, true );

})();
})( this, this.Rekord, this.PubSub );
2 changes: 1 addition & 1 deletion build/rekord-pubsub.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/rekord-pubsub.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
{
"name": "rekord-pubsub",
"version": "1.0.0",
"version": "1.0.1",
"description": "A rekord binding to pubsub - implementing Rekord.live",
"author": "Philip Diffenderfer",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/Rekord/rekord-pubsub.git"
},
"scripts": {
"test": "gulp js"
},
"devDependencies": {
"gulp": "^3.8.10",
"gulp-check-filesize": "^2.0.1",
"gulp-concat": "^2.4.3",
"gulp-load-plugins": "^0.8.0",
"gulp-shell": "^0.2.11",
"gulp-uglify": "^1.0.2",
"gulp-watch": "^3.0.0",
"gulp-jshint": "^2.0.1",
"gulp-load-plugins": "^1.2.4",
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.3.0",
"gulp-util": "^3.0.4"
"gulp-uglify": "^1.0.2",
"gulp-util": "^3.0.4",
"gulp-watch": "^4.3.6",
"jshint": "^2.9.2"
},
"dependencies": {
"rekord": "^1.2.0"
}
}
9 changes: 4 additions & 5 deletions src/neurosync-pubsub.js → src/pubsub.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

Rekord.setLive((function()
(function(global, Rekord, PubSub)
{
var OP_SAVE = 1;
var OP_REMOVE = 2;
Expand Down Expand Up @@ -74,8 +73,8 @@ Rekord.setLive((function()
}

};
};
}

return LiveFactory;
Rekord.setLive( LiveFactory, true );

})(), true );
})( this, this.Rekord, this.PubSub );

0 comments on commit 3c87464

Please sign in to comment.