Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add "getRepositoryUrl" in order to support repository package.json property as object #204

Merged
merged 11 commits into from
Mar 11, 2016
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@ language: node_js
matrix:
include:
- node_js: "0.10"
env: TEST_COMMAND=test-with-sauce
env: SAUCE=true
- node_js: "0.12"
env: TEST_COMMAND=test
- node_js: "iojs"
env: TEST_COMMAND=test
- node_js: "4"
env: TEST_COMMAND=test
- node_js: "5"
env: TEST_COMMAND=test

before_script:
- npm install -g grunt-cli

script: grunt $TEST_COMMAND
script:
- grunt test
- "[ $SAUCE == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || grunt sauce"

notifications:
email: false

env:
global:
- SAUCE=false
- secure: OUooygPgokU2pa5FmVKb5tEQ+NjrUS7vr2al2MYqQDi7VOViOkKiP+1TMKDaPEo3+H3BQlsRd/HxItSCucg5Wy+45pMsTnYgR0Lsp2zmcuHmY67EPOM3B6bdCyPtB5VokrpO3O+uBTtMPAKS/sQq62gKV5Xq/K1t5CQ31EgfCd4=
- secure: P/+5dvk3zwkDnUmNCEX8fgNkLAQ5s6j+dR4h3Zn5UJBBUKSZaz1QbfEX+uZ5Rn4l4aRGdvG2PGStySiS/MHmPKhWJfMMEkSFjERLUF07U2gLSkn1UOQeh0zBWIb5TehwIuuTNPmOoSE/7xgmXwF83Dq8ALjDCmo6VrtoZes9E2g=
1 change: 0 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = function(grunt){
grunt.registerTask('test-local', ['jshint:all', 'mochaTest:unit', 'mochaTest:acceptance', 'karma:local']);
grunt.registerTask('test-local-silent', ['jshint:all', 'mochaTest:silent', 'karma:local']);
grunt.registerTask('test', ['jshint:all', 'mochaTest:unit', 'mochaTest:acceptance']);
grunt.registerTask('test-with-sauce', ['test', 'sauce']);
grunt.registerTask('git-stage', [
'gitadd:versionFiles',
'gitcommit:version',
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ Contributors:
* [@char1e5](https://github.com/char1e5)
* [@federicomaffei](https://github.com/federicomaffei)
* [@jankowiakmaria](https://github.com/jankowiakmaria)
* [@mattiaerre](https://github.com/mattiaerre)
* [@pbazydlo](https://github.com/pbazydlo)
* [@stevejhiggs](https://github.com/stevejhiggs)
* [@todd](https://github.com/todd)
Expand Down
14 changes: 13 additions & 1 deletion registry/routes/component-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@ module.exports = function(repository){
return param.example;
});
}


component.getRepositoryUrl = function() {
if (_.isObject(this.repository)) {
if (this.repository.url) {
return this.repository.url;
}
}
if (_.isString(this.repository)) {
return this.repository;
}
return null;
};

return res.render('component-info', {
component: component,
dependencies: _.keys(component.dependencies),
Expand Down
2 changes: 1 addition & 1 deletion registry/views/component-info.jade
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ block content
span(class='component-state-' + component.oc.state.toLowerCase())= component.oc.state

h3 Component Info
+property('Repository', component.repository || 'not available', !!component.repository)
+property('Repository', component.getRepositoryUrl() || 'not available', !!component.getRepositoryUrl())
+property('Author', component.author || 'not available')
+property('Publish date', new Date(component.oc.date) || 'not available')
+property('Publish agent', ('OC CLI ' + component.oc.version) || 'not available')
Expand Down