Skip to content

Commit b3fc7eb

Browse files
committed
Added: CHANGELOG file, Gulp.js support and Tests for AngularJS versions 1.2.x, 1.3.x, 1.4.x
1 parent 4d4bd98 commit b3fc7eb

File tree

17 files changed

+425
-14
lines changed

17 files changed

+425
-14
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ tmp/
99
/nbproject
1010
.idea
1111
.grunt
12-
/bower_components
12+
bower_components

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
language: node_js
22
node_js:
3-
- 0.10
3+
- 0.12
44
before_install:
55
- npm install -g bower
66
before_script:
77
- export DISPLAY=:99.0
88
- sh -e /etc/init.d/xvfb start
99
- sleep 1
1010
script:
11-
- ./node_modules/karma/bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=PhantomJS
11+
- ./node_modules/.bin/gulp test-all-versions

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changelog
2+
3+
All notable changes to `angular-wurfl-image-tailor` will be documented in this file
4+
5+
## 0.9.2 - 2015-02-26
6+
7+
### Added
8+
- $observe expression on 'ngSrc'
9+
- CHANGELOG file
10+
- Gulp.js support
11+
- Tests for AngularJS versions 1.2.x, 1.3.x, 1.4.x
12+
13+
## 0.9.1 - 2015-01-19
14+
15+
### Added
16+
- ngSrc directive support
17+
18+
### Changed
19+
- copyright info
20+
21+
## 0.9.0 - 2014-06-20
22+
23+
### Added
24+
- Initial release

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,16 @@ Check the [WURFL Image Tailor Documentation](http://wurfl.io/documentation/wit-d
6161
* Run: `npm start`
6262
* Browse: `http://localhost:8000/demo/index.html`
6363

64+
## Testing
65+
66+
``` bash
67+
$ npm test
68+
```
69+
6470
## Authors
6571

6672
- [Luca Corbo](https://github.com/lucor)[view contributions](https://github.com//WURFL/angular-wurfl-image-tailor/commits?author=lucor)
73+
- [All Contributors](../../contributors)
6774

6875
## License
6976

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-wurfl-image-tailor",
33
"description": "An AngularJS directive for WURFL Image Tailor (WIT)",
4-
"version": "0.9.1",
4+
"version": "0.9.2",
55
"main": "./src/angular-wurfl-image-tailor.js",
66
"authors": [
77
"Luca Corbo (https://github.com/lucor)"
@@ -15,9 +15,9 @@
1515
"tests"
1616
],
1717
"dependencies": {
18-
"angular": "~1.2.0"
18+
"angular": "^1.2.0"
1919
},
2020
"devDependencies": {
21-
"angular-mocks": "~1.2.0"
21+
"angular-mocks": "^1.2.0"
2222
}
2323
}

gulpfile.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
var gulp = require('gulp');
2+
var karma = require('karma').server;
3+
var bower = require('gulp-bower');
4+
5+
require('./test/angular-1.2/gulpfile');
6+
require('./test/angular-1.3/gulpfile');
7+
require('./test/angular-1.4/gulpfile');
8+
9+
/**
10+
* Run tests for all angular versions
11+
*/
12+
gulp.task('test-all-versions', ['test-1.2', 'test-1.3', 'test-1.4'], function (done) {
13+
});
14+
15+
/**
16+
* Run test once and exit
17+
*/
18+
gulp.task('test', function (done) {
19+
karma.start({
20+
configFile: __dirname + '/karma.conf.js',
21+
singleRun: true
22+
}, done);
23+
});
24+
25+
/**
26+
* Watch for file changes and re-run tests on each change
27+
*/
28+
gulp.task('tdd', function (done) {
29+
karma.start({
30+
configFile: __dirname + '/karma.conf.js'
31+
}, done);
32+
});
33+
34+
gulp.task('default', ['tdd']);

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-wurfl-image-tailor",
3-
"version": "0.9.1",
3+
"version": "0.9.2",
44
"description": "An AngularJS directive for WURFL Image Tailor (WIT)",
55
"author": "Luca Corbo (https://github.com/lucor)",
66
"maintainers": [
@@ -26,20 +26,21 @@
2626
],
2727
"devDependencies": {
2828
"chai": "^1.9.1",
29+
"gulp": "^3.8.11",
30+
"gulp-bower": "0.0.10",
31+
"gulp-karma": "0.0.4",
2932
"http-server": "^0.6.1",
30-
"karma": "~0.12",
33+
"karma": "^0.12",
3134
"karma-chai": "^0.1.0",
3235
"karma-mocha": "^0.1.4",
3336
"karma-phantomjs-launcher": "^0.1.4"
3437
},
3538
"scripts": {
3639
"postinstall": "bower install",
37-
3840
"prestart": "npm install",
3941
"start": "http-server -p 8000",
40-
4142
"pretest": "npm install",
42-
"test": "./node_modules/karma/bin/karma start karma.conf.js",
43-
"test-single-run": "./node_modules/karma/bin/karma start karma.conf.js --single-run"
43+
"test": "./node_modules/.bin/gulp",
44+
"test-single-run": "./node_modules/.bin/gulp test"
4445
}
4546
}

src/angular-wurfl-image-tailor.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* angular-wurfl-image-tailor v0.9.1
2+
* angular-wurfl-image-tailor v0.9.2
33
* Authors: Luca Corbo (https://github.com/lucor)
44
* (c) 2014 - 2015 ScientiaMobile, Inc.
55
* License: MIT
@@ -35,7 +35,10 @@ angular.module('angular-wurfl-image-tailor', [])
3535
link: function (scope, element, attributes) {
3636
var srcAName = attributes['ngSrc'] ? 'ngSrc' : 'src';
3737

38-
if(!attributes[srcAName]) return;
38+
if(!attributes[srcAName]) {
39+
scope.wit_link = '';
40+
return;
41+
}
3942

4043
attributes.$observe(srcAName, function (src) {
4144
var wit_link_pieces = [witUrls.get()];

test/angular-1.2/bower.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "angular-wurfl-image-tailor",
3+
"description": "An AngularJS directive for WURFL Image Tailor (WIT)",
4+
"authors": [
5+
"Luca Corbo (https://github.com/lucor)"
6+
],
7+
"license": "MIT",
8+
"ignore": [
9+
"**/.*",
10+
"node_modules",
11+
"bower_components",
12+
"test",
13+
"tests"
14+
],
15+
"dependencies": {
16+
"angular": "~1.2.0"
17+
},
18+
"devDependencies": {
19+
"angular-mocks": "~1.2.0"
20+
}
21+
}

test/angular-1.2/gulpfile.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
var gulp = require('gulp');
2+
var karma = require('karma').server;
3+
var bower = require('gulp-bower');
4+
5+
/**
6+
* Install dependencies for angular-1.2.x
7+
*/
8+
gulp.task('bower-1.2', function() {
9+
return bower({ directory: './bower_components', cwd: './test/angular-1.2' })
10+
});
11+
12+
/**
13+
* Run tests for angular-1.2.x
14+
*/
15+
gulp.task('test-1.2', ['bower-1.2'], function (done) {
16+
karma.start({
17+
configFile: __dirname + '/karma.conf.js',
18+
singleRun: true,
19+
noAutoWatch: true,
20+
reporters: 'dots',
21+
browsers: ['PhantomJS']
22+
}, done);
23+
});

0 commit comments

Comments
 (0)