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

Commit

Permalink
Add a JShint config and some contributing notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenv committed Mar 4, 2013
1 parent 2964cd1 commit 739b554
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.*.swp
node_modules
17 changes: 17 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"node": true,
"es5": true,
"esnext": true,
"bitwise": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"undef": true,
"strict": false,
"trailing": true,
"smarttabs": true
}
24 changes: 24 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict';

module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'lib/*.js',
],
options: {
jshintrc: '.jshintrc',
}
}
});

// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');

// By default, lint and run all tests.
grunt.registerTask('default', ['jshint']);

};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2011-2012 by Ruben Vermeersch <ruben@savanne.be>
Copyright (C) 2011-2013 by Ruben Vermeersch <ruben@savanne.be>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,29 @@

This makes it possible to run the script stand-alone in development, yet use systemd when started through systemd.

## Contributing

A jshint file is included to check code style.

Before submitting a pull request, please check your code. For convenience, I've also added a grunt file.

Install the dev dependencies:

npm install --dev

Install the grunt cli if you haven't already done so:

npm -g install grunt-cli

Run it:

grunt

## License

(The MIT License)

Copyright (C) 2011-2012 by Ruben Vermeersch <ruben@savanne.be>
Copyright (C) 2011-2013 by Ruben Vermeersch <ruben@savanne.be>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions lib/systemd.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var oldListen = Server.listen;
Server.listen = function () {
var self = this;

if (arguments.length == 1 && arguments[0] == 'systemd') {
if (!process.env.LISTEN_FDS || process.env.LISTEN_FDS != 1) {
if (arguments.length === 1 && arguments[0] === 'systemd') {
if (!process.env.LISTEN_FDS || process.env.LISTEN_FDS !== 1) {
throw('No or too many file descriptors received.');
}

Expand All @@ -18,4 +18,4 @@ Server.listen = function () {
} else {
oldListen.apply(self, arguments);
}
}
};
45 changes: 27 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
{
"name" : "systemd",
"version" : "0.2.2",
"main" : "./lib/systemd.js",
"description" : "systemd socket activation support for Node.js",
"keywords" : ["systemd"],
"url" : "http://github.com/rubenv/node-systemd",
"repositories" : [
{
"type" : "git",
"url" : "git://github.com/rubenv/node-systemd.git"
}
],
"author" : "Ruben Vermeersch <ruben@savanne.be>",
"contributors" : [],
"licenses" : ["MIT"],
"dependencies" : [],
"engines" : { "node": ">=0.6.11 <0.9.0" }
"name": "systemd",
"version": "0.2.2",
"main": "./lib/systemd.js",
"description": "systemd socket activation support for Node.js",
"keywords": [
"systemd"
],
"url": "http://github.com/rubenv/node-systemd",
"repositories": [
{
"type": "git",
"url": "git://github.com/rubenv/node-systemd.git"
}
],
"author": "Ruben Vermeersch <ruben@savanne.be>",
"contributors": [],
"licenses": [
"MIT"
],
"dependencies": [],
"engines": {
"node": ">=0.6.11 <0.9.0"
},
"devDependencies": {
"grunt": "~0.4.0",
"grunt-contrib-jshint": "~0.2.0"
}
}

0 comments on commit 739b554

Please sign in to comment.