any_good 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/any_good.rb +7 -5
- data/lib/any_good/meters.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d970099a0791af084958bce26bb59ca96420b26
|
4
|
+
data.tar.gz: b9815f2897c70e7ca759dc7f17bb0f8c15b5eb9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffda17d3b08aab4562eda6fa9c2e5aa2283c867f84006ee0355be1241f42fa0951274227cb2e3d5dc62de383a57e2abfefc826039485aa71a5dbd3eb6cba9c8b
|
7
|
+
data.tar.gz: c78b4e6a64d1df24f390988e63b8b48e9324b4e4020d7efb00fd2393e603ef9f1d2bd3aa040e25e9641b3a15795f95df8da885492d42dc283b234f1e8a6ec6a2
|
data/lib/any_good.rb
CHANGED
@@ -18,6 +18,8 @@ class AnyGood
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
GITHUB_URI_PATTERN = %r{^https?://(www\.)?github\.com/}
|
22
|
+
|
21
23
|
def fetch
|
22
24
|
data = {
|
23
25
|
gem: Gems.info(name),
|
@@ -26,7 +28,7 @@ class AnyGood
|
|
26
28
|
}
|
27
29
|
|
28
30
|
repo_id = [data[:gem]['source_code_uri'], data[:gem]['homepage_uri']]
|
29
|
-
.grep(
|
31
|
+
.grep(GITHUB_URI_PATTERN).first&.sub(GITHUB_URI_PATTERN, '')
|
30
32
|
|
31
33
|
if repo_id
|
32
34
|
data.merge!(
|
@@ -65,14 +67,14 @@ class AnyGood
|
|
65
67
|
now = Time.now
|
66
68
|
|
67
69
|
metric('Downloads', thresholds: [5_000, 10_000]) { data.gem['downloads'] }
|
68
|
-
metric('Latest version', thresholds: [T.
|
70
|
+
metric('Latest version', thresholds: [T.year.decrease(now), T.month.decrease(now, 2)]) {
|
69
71
|
Time.parse(data.gem_versions.first['created_at'])
|
70
72
|
}
|
71
73
|
metric('Used by', thresholds: [10, 100]) { data.gem_rev_deps.count }
|
72
74
|
|
73
75
|
metric('Stars', thresholds: [100, 500]) { data.repo[:stargazers_count] }
|
74
76
|
metric('Forks', thresholds: [5, 20]) { data.repo[:forks_count] }
|
75
|
-
metric('Last commit', thresholds: [T.month.decrease(now), T.month.decrease(now
|
77
|
+
metric('Last commit', thresholds: [T.month.decrease(now, 4), T.month.decrease(now)]) {
|
76
78
|
data.last_commit.dig(:commit, :committer, :date)
|
77
79
|
}
|
78
80
|
|
@@ -80,10 +82,10 @@ class AnyGood
|
|
80
82
|
res = data.open_issues.count
|
81
83
|
res == 50 ? '50+' : res
|
82
84
|
}
|
83
|
-
metric('...without reaction', thresholds: [-
|
85
|
+
metric('...without reaction', thresholds: [-20, -4]) {
|
84
86
|
data.open_issues.reject { |i| i[:labels].any? || i[:comments] > 0 }.count
|
85
87
|
}
|
86
|
-
metric('...last reaction', thresholds: [T.
|
88
|
+
metric('...last reaction', thresholds: [T.month.decrease(now), T.week.decrease(now)]) {
|
87
89
|
data.open_issues.detect { |i| i[:labels].any? || i[:comments] > 0 }&.fetch(:updated_at)
|
88
90
|
}
|
89
91
|
metric('Closed issues') {
|
data/lib/any_good/meters.rb
CHANGED