Skip to content

Commit 815c041

Browse files
Merge pull request #726 from nisargthakkar/newBadgesAdd
Added badges for Is it maintained, codecov and coveralls
2 parents 7ab2b1b + 4274a18 commit 815c041

12 files changed

+350
-4
lines changed

app/components/badge-codecov.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Ember from 'ember';
2+
3+
export default Ember.Component.extend({
4+
tagName: 'span',
5+
classNames: ['badge'],
6+
repository: Ember.computed.alias('badge.attributes.repository'),
7+
branch: Ember.computed('badge.attributes.branch', function() {
8+
return this.get('badge.attributes.branch') || 'master';
9+
}),
10+
service: Ember.computed('badge.attributes.service', function() {
11+
return this.get('badge.attributes.service') || 'github';
12+
}),
13+
text: Ember.computed('branch', function() {
14+
return `CodeCov coverage status for the ${ this.get('branch') } branch`;
15+
})
16+
});

app/components/badge-coveralls.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Ember from 'ember';
2+
3+
export default Ember.Component.extend({
4+
tagName: 'span',
5+
classNames: ['badge'],
6+
repository: Ember.computed.alias('badge.attributes.repository'),
7+
branch: Ember.computed('badge.attributes.branch', function() {
8+
return this.get('badge.attributes.branch') || 'master';
9+
}),
10+
service: Ember.computed('badge.attributes.service', function() {
11+
return this.get('badge.attributes.service') || 'github';
12+
}),
13+
text: Ember.computed('branch', function() {
14+
return `Coveralls coverage status for the ${ this.get('branch') } branch`;
15+
})
16+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Ember from 'ember';
2+
3+
export default Ember.Component.extend({
4+
tagName: 'span',
5+
classNames: ['badge'],
6+
repository: Ember.computed.alias('badge.attributes.repository'),
7+
text: Ember.computed('badge', function() {
8+
return `Is It Maintained average time to resolve an issue`;
9+
})
10+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Ember from 'ember';
2+
3+
export default Ember.Component.extend({
4+
tagName: 'span',
5+
classNames: ['badge'],
6+
repository: Ember.computed.alias('badge.attributes.repository'),
7+
text: Ember.computed('badge', function() {
8+
return `Is It Maintained percentage of issues still open`;
9+
})
10+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<a href="https://codecov.io/{{ service }}/{{ repository }}?branch={{ branch }}">
2+
<img
3+
src="https://codecov.io/{{ service }}/{{ repository }}/coverage.svg?branch={{ branch }}"
4+
alt="{{ text }}"
5+
title="{{ text }}" />
6+
</a>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<a href="https://coveralls.io/{{ service }}/{{ repository }}?branch={{ branch }}">
2+
<img
3+
src="https://coveralls.io/repos/{{ service }}/{{ repository }}/badge.svg?branch={{ branch }}"
4+
alt="{{ text }}"
5+
title="{{ text }}" />
6+
</a>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<a href="https://isitmaintained.com/project/{{ repository }}">
2+
<img
3+
src="https://isitmaintained.com/badge/resolution/{{ repository }}.svg"
4+
alt="{{ text }}"
5+
title="{{ text }}" />
6+
</a>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<a href="https://isitmaintained.com/project/{{ repository }}">
2+
<img
3+
src="https://isitmaintained.com/badge/open/{{ repository }}.svg"
4+
alt="{{ text }}"
5+
title="{{ text }}" />
6+
</a>

mirage/fixtures/search.js

+26
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,32 @@ export default {
4040
"repository": "huonw/external_mixin"
4141
},
4242
"badge_type": "gitlab"
43+
},
44+
{
45+
"attributes": {
46+
"repository": "huonw/external_mixin"
47+
},
48+
"badge_type": "is-it-maintained-issue-resolution"
49+
},
50+
{
51+
"attributes": {
52+
"repository": "huonw/external_mixin"
53+
},
54+
"badge_type": "is-it-maintained-open-issues"
55+
},
56+
{
57+
"attributes": {
58+
"branch": "master",
59+
"repository": "huonw/external_mixin"
60+
},
61+
"badge_type": "codecov"
62+
},
63+
{
64+
"attributes": {
65+
"branch": "master",
66+
"repository": "huonw/external_mixin"
67+
},
68+
"badge_type": "coveralls"
4369
}
4470
],
4571
"versions": null

src/badge.rs

+20
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ pub enum Badge {
2222
GitLab {
2323
repository: String, branch: Option<String>,
2424
},
25+
#[serde(rename = "is-it-maintained-issue-resolution")]
26+
IsItMaintainedIssueResolution {
27+
repository: String,
28+
},
29+
#[serde(rename = "is-it-maintained-open-issues")]
30+
IsItMaintainedOpenIssues {
31+
repository: String,
32+
},
33+
#[serde(rename = "codecov")]
34+
Codecov {
35+
repository: String, branch: Option<String>, service: Option<String>,
36+
},
37+
#[serde(rename = "coveralls")]
38+
Coveralls {
39+
repository: String, branch: Option<String>, service: Option<String>,
40+
},
2541
}
2642

2743
#[derive(RustcEncodable, RustcDecodable, PartialEq, Debug, Deserialize)]
@@ -50,6 +66,10 @@ impl Badge {
5066
Badge::TravisCi {..} => "travis-ci",
5167
Badge::Appveyor {..} => "appveyor",
5268
Badge::GitLab{..} => "gitlab",
69+
Badge::IsItMaintainedIssueResolution{..} => "is-it-maintained-issue-resolution",
70+
Badge::IsItMaintainedOpenIssues{..} => "is-it-maintained-open-issues",
71+
Badge::Codecov{..} => "codecov",
72+
Badge::Coveralls{..} => "coveralls",
5373
}
5474
}
5575

0 commit comments

Comments
 (0)