Skip to content

Added badges for Is it maintained, codecov and coveralls #726

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

Merged
merged 4 commits into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions app/components/badge-codecov.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Ember from 'ember';

export default Ember.Component.extend({
tagName: 'span',
classNames: ['badge'],
repository: Ember.computed.alias('badge.attributes.repository'),
branch: Ember.computed('badge.attributes.branch', function() {
return this.get('badge.attributes.branch') || 'master';
}),
service: Ember.computed('badge.attributes.service', function() {
return this.get('badge.attributes.service') || 'github';
}),
text: Ember.computed('branch', function() {
return `CodeCov coverage status for the ${ this.get('branch') } branch`;
})
});
16 changes: 16 additions & 0 deletions app/components/badge-coveralls.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Ember from 'ember';

export default Ember.Component.extend({
tagName: 'span',
classNames: ['badge'],
repository: Ember.computed.alias('badge.attributes.repository'),
branch: Ember.computed('badge.attributes.branch', function() {
return this.get('badge.attributes.branch') || 'master';
}),
service: Ember.computed('badge.attributes.service', function() {
return this.get('badge.attributes.service') || 'github';
}),
text: Ember.computed('branch', function() {
return `Coveralls coverage status for the ${ this.get('branch') } branch`;
})
});
10 changes: 10 additions & 0 deletions app/components/badge-is-it-maintained-issue-resolution.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Ember from 'ember';

export default Ember.Component.extend({
tagName: 'span',
classNames: ['badge'],
repository: Ember.computed.alias('badge.attributes.repository'),
text: Ember.computed('badge', function() {
return `Is It Maintained average time to resolve an issue`;
})
});
10 changes: 10 additions & 0 deletions app/components/badge-is-it-maintained-open-issues.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Ember from 'ember';

export default Ember.Component.extend({
tagName: 'span',
classNames: ['badge'],
repository: Ember.computed.alias('badge.attributes.repository'),
text: Ember.computed('badge', function() {
return `Is It Maintained percentage of issues still open`;
})
});
6 changes: 6 additions & 0 deletions app/templates/components/badge-codecov.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<a href="https://codecov.io/{{ service }}/{{ repository }}?branch={{ branch }}">
<img
src="https://codecov.io/{{ service }}/{{ repository }}/coverage.svg?branch={{ branch }}"
alt="{{ text }}"
title="{{ text }}" />
</a>
6 changes: 6 additions & 0 deletions app/templates/components/badge-coveralls.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<a href="https://coveralls.io/{{ service }}/{{ repository }}?branch={{ branch }}">
<img
src="https://coveralls.io/repos/{{ service }}/{{ repository }}/badge.svg?branch={{ branch }}"
alt="{{ text }}"
title="{{ text }}" />
</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<a href="https://isitmaintained.com/project/{{ repository }}">
<img
src="https://isitmaintained.com/badge/resolution/{{ repository }}.svg"
alt="{{ text }}"
title="{{ text }}" />
</a>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<a href="https://isitmaintained.com/project/{{ repository }}">
<img
src="https://isitmaintained.com/badge/open/{{ repository }}.svg"
alt="{{ text }}"
title="{{ text }}" />
</a>
26 changes: 26 additions & 0 deletions mirage/fixtures/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,32 @@ export default {
"repository": "huonw/external_mixin"
},
"badge_type": "gitlab"
},
{
"attributes": {
"repository": "huonw/external_mixin"
},
"badge_type": "is-it-maintained-issue-resolution"
},
{
"attributes": {
"repository": "huonw/external_mixin"
},
"badge_type": "is-it-maintained-open-issues"
},
{
"attributes": {
"branch": "master",
"repository": "huonw/external_mixin"
},
"badge_type": "codecov"
},
{
"attributes": {
"branch": "master",
"repository": "huonw/external_mixin"
},
"badge_type": "coveralls"
}
],
"versions": null
Expand Down
20 changes: 20 additions & 0 deletions src/badge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ pub enum Badge {
GitLab {
repository: String, branch: Option<String>,
},
#[serde(rename = "is-it-maintained-issue-resolution")]
IsItMaintainedIssueResolution {
repository: String,
},
#[serde(rename = "is-it-maintained-open-issues")]
IsItMaintainedOpenIssues {
repository: String,
},
#[serde(rename = "codecov")]
Codecov {
repository: String, branch: Option<String>, service: Option<String>,
},
#[serde(rename = "coveralls")]
Coveralls {
repository: String, branch: Option<String>, service: Option<String>,
},
}

#[derive(RustcEncodable, RustcDecodable, PartialEq, Debug, Deserialize)]
Expand Down Expand Up @@ -50,6 +66,10 @@ impl Badge {
Badge::TravisCi {..} => "travis-ci",
Badge::Appveyor {..} => "appveyor",
Badge::GitLab{..} => "gitlab",
Badge::IsItMaintainedIssueResolution{..} => "is-it-maintained-issue-resolution",
Badge::IsItMaintainedOpenIssues{..} => "is-it-maintained-open-issues",
Badge::Codecov{..} => "codecov",
Badge::Coveralls{..} => "coveralls",
}
}

Expand Down
Loading