Skip to content

Commit

Permalink
new node.js code base, first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aboynejames committed Jul 23, 2012
0 parents commit b9aa319
Show file tree
Hide file tree
Showing 12 changed files with 341 additions and 0 deletions.
Empty file added .gitignore
Empty file.
48 changes: 48 additions & 0 deletions READ.md
@@ -0,0 +1,48 @@
LifestyleLinking
==========

Welcome to the LifestyleLinking.net open source project for data mining yourself and connecting to all other life. A personal network application for an individual to harness all their indentity data authored online and to get that data working at all times to retrieve information.

Current Stage
------------------
Third wave rebuild of the core ideas using node.js. First stage have working UI buit and identity information from delicious.com fed in and displayed back.

The project home is located at <http://www.lifestylelinking.net/>

Wireframing UI located at <https://moqups.com/aboynejames/pzJN9Wyt/>


### Example ###

Coming soon.


Downloads
---------

The latest version of LifestyleLinking can be downloaded from GitHub.

Links
-----

* Source Code: <http://github.com/aboynejames/lifestylelinking>
* Issue Tracker: <http://github.com/aboynejames/lifestylelinking/issues>

Requirements
------------

* Node.js 0.60


Features
--------

* Gain access to existing identity silos on the web
* Display tag cloud of important words to an indivdual
* Perform LifestyleLinking


More Examples
-------------

* coming soon.
129 changes: 129 additions & 0 deletions build.xml
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>

<project name="name-of-project" default="build">
<target name="build"
depends="prepare,lint,phploc,pdepend,phpmd-ci,phpcs-ci,phpcpd,phpunit,phpcb"/>

<target name="build-parallel"
depends="prepare,lint,tools-parallel,phpunit,phpcb"/>

<target name="tools-parallel" description="Run tools in parallel">
<parallel threadCount="2">
<sequential>
<antcall target="pdepend"/>
<antcall target="phpmd-ci"/>
</sequential>
<antcall target="phpcpd"/>
<antcall target="phpcs-ci"/>
<antcall target="phploc"/>
</parallel>
</target>

<target name="clean" description="Cleanup build artifacts">
<delete dir="${basedir}/build/api"/>
<delete dir="${basedir}/build/code-browser"/>
<delete dir="${basedir}/build/coverage"/>
<delete dir="${basedir}/build/logs"/>
<delete dir="${basedir}/build/pdepend"/>
</target>

<target name="prepare" depends="clean" description="Prepare for build">
<mkdir dir="${basedir}/build/api"/>
<mkdir dir="${basedir}/build/code-browser"/>
<mkdir dir="${basedir}/build/coverage"/>
<mkdir dir="${basedir}/build/logs"/>
<mkdir dir="${basedir}/build/pdepend"/>
</target>

<target name="lint" description="Perform syntax check of sourcecode files">
<apply executable="php" failonerror="true">
<arg value="-l" />

<fileset dir="${basedir}/src">
<include name="**/*.php" />
<modified />
</fileset>

<fileset dir="${basedir}/tests">
<include name="**/*.php" />
<modified />
</fileset>
</apply>
</target>

<target name="phploc" description="Measure project size using PHPLOC">
<exec executable="phploc">
<arg value="--log-csv" />
<arg value="${basedir}/build/logs/phploc.csv" />
<arg path="${basedir}/src" />
</exec>
</target>

<target name="pdepend" description="Calculate software metrics using PHP_Depend">
<exec executable="pdepend">
<arg value="--jdepend-xml=${basedir}/build/logs/jdepend.xml" />
<arg value="--jdepend-chart=${basedir}/build/pdepend/dependencies.svg" />
<arg value="--overview-pyramid=${basedir}/build/pdepend/overview-pyramid.svg" />
<arg path="${basedir}/src" />
</exec>
</target>

<target name="phpmd"
description="Perform project mess detection using PHPMD and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpmd">
<arg path="${basedir}/src" />
<arg value="text" />
<arg value="${basedir}/build/phpmd.xml" />
</exec>
</target>

<target name="phpmd-ci" description="Perform project mess detection using PHPMD creating a log file for the continuous integration server">
<exec executable="phpmd">
<arg path="${basedir}/src" />
<arg value="xml" />
<arg value="${basedir}/build/phpmd.xml" />
<arg value="--reportfile" />
<arg value="${basedir}/build/logs/pmd.xml" />
</exec>
</target>

<target name="phpcs"
description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
<exec executable="phpcs">
<arg value="--standard=${basedir}/build/phpcs.xml" />
<arg path="${basedir}/src" />
</exec>
</target>

<target name="phpcs-ci" description="Find coding standard violations using PHP_CodeSniffer creating a log file for the continuous integration server">
<exec executable="phpcs" output="/dev/null">
<arg value="--report=checkstyle" />
<arg value="--report-file=${basedir}/build/logs/checkstyle.xml" />
<arg value="--standard=${basedir}/build/phpcs.xml" />
<arg path="${basedir}/src" />
</exec>
</target>

<target name="phpcpd" description="Find duplicate code using PHPCPD">
<exec executable="phpcpd">
<arg value="--log-pmd" />
<arg value="${basedir}/build/logs/pmd-cpd.xml" />
<arg path="${basedir}/src" />
</exec>
</target>

<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="true"/>
</target>

<target name="phpcb" description="Aggregate tool output with PHP_CodeBrowser">
<exec executable="phpcb">
<arg value="--log" />
<arg path="${basedir}/build/logs" />
<arg value="--source" />
<arg path="${basedir}/src" />
<arg value="--output" />
<arg path="${basedir}/build/code-browser" />
</exec>
</target>
</project>
1 change: 1 addition & 0 deletions buildproperties.xml
@@ -0,0 +1 @@
source=\${basedir}/src
19 changes: 19 additions & 0 deletions phpunit.xml.dist
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
syntaxCheck="false">

<testsuites>
<testsuite name="php-demo">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="build/coverage" title="php-demo"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>

9 changes: 9 additions & 0 deletions spec/buster.js
@@ -0,0 +1,9 @@
var config = module.exports;

config["Backbone unit specs"] = {
rootPath: "../",
environment: "browser",
specs: [
"spec/**/*-spec.js"
]
};
39 changes: 39 additions & 0 deletions spec/ll-model-spec.js
@@ -0,0 +1,39 @@
// An example of a spec where the individual Backbone unit is the
// subject under test.

buster.spec.expose();

describe("Snippet.Model", function() {
describe("when saved", function() {
beforeEach(function() {
this.server = sinon.fakeServer.create();
/*
this.attrs = {
title: "My Snippet",
content: "My Snippet content"
};
this.subject = new Snippet.Model();
this.subject.save(this.attrs);
*/
});

afterEach(function() {
this.server.restore();
});

it("makes a request to the root", function() {
console.log(this.server);
expect(this.server.requests[0].url)
.toEqual("/");
});

it("submits the correct body", function() {
var body = JSON.parse(this.server.requests[0].requestBody);
expect(body.title)
.toEqual(this.attrs.title);
expect(body.content)
.toEqual(this.attrs.content);
});
});
});
Empty file added src/index.js
Empty file.
12 changes: 12 additions & 0 deletions src/view/llhomepage.html
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>LifestyleLinking - open source project</title>
</head>

<body>


</body>
</html>
17 changes: 17 additions & 0 deletions test/LLBDDuserstory.txt
@@ -0,0 +1,17 @@
1. Display a blank html page but complete with HTML header title 'LifestyleLinking - open source project.

Given the url http://localhost:8866/ is visited

When the page is displayed

Then the page title should be 'LifestyleLinking - open source project.

2. On a webpage select a from of indentity (initiall delicious), sign into that account and display back a tagcloud of their top 50 words. Then the user will drag one of those words to the LLFlow area of the display to be presented with content (blog posts).

Given I have not selected an identity

When I select and login to an identity

Then I should see a tag cloud to represent my delicous identity

Then I should drag a word to the LLflow area box and content blog post will be presented.
49 changes: 49 additions & 0 deletions test/start-test.js
@@ -0,0 +1,49 @@
/*
* check the start index.html webpage has been displayed
*/

var casper = require("casper").create();

casper.on("http.status.200", function(resource) {
this.echo(resource.url + " is OK", "INFO");
});

casper.on("http.status.301", function(resource) {
this.echo(resource.url + " is permanently redirected", "PARAMETER");
});

casper.on("http.status.302", function(resource) {
this.echo(resource.url + " is temporarily redirected", "PARAMETER");
});

casper.on("http.status.404", function(resource) {
this.echo(resource.url + " is not found", "COMMENT");
});

casper.on("http.status.500", function(resource) {
this.echo(resource.url + " is in error", "ERROR");
});

/*
var links = [
"http://localhost:8899/index.html"
];
*/
var link = "http://localhost:8899/";


casper.start();

/*
casper.each(links, function(self, link) {
self.thenOpen(link, function() {
this.echo(link + " testing for this page");
});
});
*/

casper.thenOpen(link, function() {
this.echo(link + " testing for this page");
});

casper.run();
18 changes: 18 additions & 0 deletions test/view-homepage-test.js
@@ -0,0 +1,18 @@
/*
* check the homepage index.html webpage has been displayed
*/

var casper = require("casper").create();

var baseUrl = "http://localhost:8866";

casper.test.comment("Scenario: A user can view the home page");

casper.start(baseUrl, function() {
this.test.assertHttpStatus(200, "Response is a success");
this.test.assertTitle("LifestyleLinking", "Title is as expected");
});

casper.run(function() {
this.test.done();
});

0 comments on commit b9aa319

Please sign in to comment.