Skip to content

Commit

Permalink
Merge pull request #636 from Martii/Issue-426
Browse files Browse the repository at this point in the history
Add branch and tree to About route

Auto-merge
  • Loading branch information
Martii committed May 30, 2015
2 parents 2096d0d + e95d824 commit fc36084
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Repository | Reference | Recent Version
[node][nodeGHUrl] | [Documentation][nodeDOCUrl] | [![node][nodeVersionImage]][nodeDLUrl] [CHANGELOG][nodeGHReleasesUrl]
[npm][npmGHUrl] | [Documentation][npmDOCUrl] | [![npm][npmNPMVersionImage]][npmNPMUrl] [CHANGELOG][npmGHReleasesUrl]
[bundler][bundlerGHUrl] | [Documentation][bundlerDOCUrl] | [![GEM version][bundlerGEMVersionImage]][bundlerGEMUrl]
[jitsu][jitsuGHUrl] | [Documentation][jitsuDOCUrl] | [![npm][jitsuNPMVersionImage]][jitsuNPMUrl] ![build status][jitsuTravisBuildStatusImage] [CHANGELOG][jitsuGHReleasesUrl]

### Contributing

Expand Down Expand Up @@ -37,6 +36,7 @@ Repository | Reference | Recent Version
[fakes3][fakes3GHUrl] | [Documentation][fakes3DOCUrl] | [![GEM version][fakes3GEMVersionImage]][fakes3GEMUrl]
[font-awesome][font-awesomeGHUrl] | [Documentation][font-awesomeDOCUrl] | [![NPM version][font-awesomeNPMVersionImage]][font-awesomeNPMUrl]
[formidable][formidableGHUrl] | [Documentation][formidableDOCUrl] | [![NPM version][formidableNPMVersionImage]][formidableNPMUrl]
[git-rev][git-revGHUrl] | [Documentation][git-revDOCUrl] | [![NPM version][git-revNPMVersionImage]][git-revNPMUrl]
[github][githubGHUrl] | [Documentation][githubDOCUrl] | [![NPM version][githubNPMVersionImage]][githubNPMUrl]
[highlight.js][highlight.jsGHUrl] | [Documentation][highlight.jsDOCUrl] | [![NPM version][highlight.jsNPMVersionImage]][highlight.jsNPMUrl]
[jquery][jQueryGHUrl] | [Documentation][jQueryDOCUrl] | [![NPM version][jQueryNPMVersionImage]][jQueryNPMUrl]
Expand Down Expand Up @@ -108,13 +108,6 @@ Outdated dependencies list can also be achieved with `$ npm --depth 0 outdated`
[npmGHUrl]: https://github.com/npm/npm/
[npmDOCUrl]: https://github.com/npm/npm/blob/master/README.md

[jitsuNPMUrl]: https://www.npmjs.com/package/jitsu
[jitsuNPMVersionImage]: http://img.shields.io/npm/v/jitsu.svg
[jitsuGHReleasesUrl]: https://github.com/nodejitsu/jitsu/releases
[jitsuGHUrl]: https://github.com/nodejitsu/jitsu
[jitsuDOCUrl]: https://github.com/nodejitsu/jitsu/blob/master/README.md
[jitsuTravisBuildStatusImage]: https://img.shields.io/travis/nodejitsu/jitsu.svg

[davidImageViaShields]: http://img.shields.io/david/openuserjs/openuserjs.org.svg?style=flat
[davidReport]: https://david-dm.org/OpenUserJS/OpenUserJS.org

Expand Down Expand Up @@ -208,6 +201,11 @@ Outdated dependencies list can also be achieved with `$ npm --depth 0 outdated`
[githubNPMUrl]: https://www.npmjs.com/package/github
[githubNPMVersionImage]: https://img.shields.io/npm/v/github.svg?style=flat

[git-revGHUrl]: https://github.com/tblobaum/git-rev
[git-revDOCUrl]: https://github.com/tblobaum/git-rev/blob/master/README.md
[git-revNPMUrl]: https://www.npmjs.com/package/git-rev
[git-revNPMVersionImage]: https://img.shields.io/npm/v/git-rev.svg?style=flat

[highlight.jsGHUrl]: https://github.com/isagalaev/highlight.js
[highlight.jsDOCUrl]: http://highlightjs.readthedocs.org
[highlight.jsNPMUrl]: https://www.npmjs.com/package/highlight.js
Expand Down
29 changes: 28 additions & 1 deletion controllers/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ var pkg = require('../package.json');

var fs = require('fs');
var async = require('async');
var git = require('git-rev');

var renderMd = require('../libs/markdown').renderMd;
var statusCodePage = require('../libs/templateHelpers').statusCodePage;
var pageMetadata = require('../libs/templateHelpers').pageMetadata;
Expand Down Expand Up @@ -115,7 +117,32 @@ exports.view = function (aReq, aRes, aNext) {

options.pkg = {};
options.pkg.name = pkg.name;
options.pkg.version = pkg.version;
options.pkg.version = pkg.version.replace(/\+.*$/, '');

options.git = {};
//--- Tasks
tasks.push(function (aCallback) {
async.waterfall([

// Read git short hash HEAD for current tree
function (aCallback) {
git.short(function (aStr) {
options.git.short = aStr;

aCallback(null);
});
},

// Read git branch name of current tree
function (aCallback) {
git.branch(function (aStr) {
options.git.branch = aStr;

aCallback(null);
});
}
], aCallback);
});
}

//---
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"express-session": "1.11.2",
"font-awesome": "4.3.0",
"formidable": "1.0.17",
"git-rev": "0.2.1",
"github": "0.2.4",
"highlight.js": "8.6.0",
"jquery": "2.1.4",
Expand Down Expand Up @@ -65,7 +66,7 @@
"postinstall": "node dev/init.js"
},
"engines": {
"node": ">=0.10.32 <0.11.0 || >=0.12.0 <=0.12.2",
"node": ">=0.10.32 <0.11.0 || >=0.12.0 <=0.12.4",
"npm": ">=1.4.28"
},
"private": true
Expand Down
2 changes: 1 addition & 1 deletion views/pages/documentPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2 class="page-heading">
<div class="panel panel-default">
<div class="panel-body">
<h3><a name="welcome"></a>Welcome<a class="anchor" href="#welcome"><em class="fa fa-link"></em></a></h3>
<p>Welcome to {{#pkg.name}}{{pkg.name}} <em>(OUJS)</em>{{#pkg.version}} v{{pkg.version}}{{/pkg.version}}{{/pkg.name}}{{#process.version}} using Node {{process.version}}{{/process.version}}{{#lastRestart}} last restarted on {{lastRestart}}{{/lastRestart}}.</p>
<p>Welcome to {{#pkg.name}}{{pkg.name}} <em>(OUJS)</em>{{#git.branch}} <a href="https://github.com/OpenUserJS/OpenUserJS.org/tree/{{git.branch}}">{{git.branch}}</a>{{/git.branch}}{{#pkg.version}} v{{pkg.version}}{{/pkg.version}}{{#git.short}}+<a href="https://github.com/OpenUserJS/OpenUserJS.org/tree/{{git.short}}">{{git.short}}</a>{{/git.short}}{{/pkg.name}}{{#process.version}} using Node {{process.version}}{{/process.version}}{{#lastRestart}} last restarted on {{lastRestart}}{{/lastRestart}}.</p>
<h3><a name="mission"></a>Mission<a class="anchor" href="#mission"><em class="fa fa-link"></em></a></h3>
<p>User scripts are best described as lightweight site-specific browser extensions, written entirely in JavaScript and containing a specially formatted block of metadata that tells a User script engine, such as Greasemonkey, on what site to run the script. The script can do anything that originally JavaScript running on a website can do, such as modify the appearance or functionality of the site on the client-side. Some User scripts employ special API functions &ndash; provided by the User script engine &ndash; to do things that normal client-side JavaScript cannot, like cross-domain xmlhttpRequests. People who write User scripts <em>(script authors)</em> want a place to publish them where other users can download scripts for installation. And users want a place to find scripts that will be useful for them. There existed a de facto user script repository called userscripts.org. The site had many users and contained thousands of User scripts. Unfortunately userscripts.org has been in a state of flux and has been currently offline. Many active User script developers have expressed an interest in improving the site, but it remains closed source. Several members have shown interest in contributing to a competing open source User script repository and that is how the idea for OpenUserJS was born.</p>
<p>OpenUserJS.org is built mostly in the native tongue of what User scripts are written with. This has the extreme advantage of being able to contribute directly to the project without being hindered by alternate computer programming languages that may or may not be compatible. It makes paramount sense to have a site built with JavaScript and not some possibly unfamiliar and alternate computer syntax with no relation to JavaScript. <strong>This allows OpenUserJS to be at the top of its class</strong>. Developers, or collaborators as it is sometimes referred to, are also highly encouraged to use all the tools available in the development environment. This includes a private database to test things before they are implemented as well as the standard open-source philosophy granted with our repository at GitHub. All of the tools made openly available are a great set of places to share findings through testing and other forms of collaboration from bug fixes to having meta discussions regarding adding or changing new features and general usage.</p>
Expand Down

0 comments on commit fc36084

Please sign in to comment.