any_good 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/any_good.rb +8 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d970099a0791af084958bce26bb59ca96420b26
4
- data.tar.gz: b9815f2897c70e7ca759dc7f17bb0f8c15b5eb9b
3
+ metadata.gz: 0af378cd27783fc6b6514e85e398f5eb19ba057a
4
+ data.tar.gz: 7b4fc488154e59cbb5230e5b58e8ebddb553ee9b
5
5
  SHA512:
6
- metadata.gz: ffda17d3b08aab4562eda6fa9c2e5aa2283c867f84006ee0355be1241f42fa0951274227cb2e3d5dc62de383a57e2abfefc826039485aa71a5dbd3eb6cba9c8b
7
- data.tar.gz: c78b4e6a64d1df24f390988e63b8b48e9324b4e4020d7efb00fd2393e603ef9f1d2bd3aa040e25e9641b3a15795f95df8da885492d42dc283b234f1e8a6ec6a2
6
+ metadata.gz: 3c24701236f05ed7d4fe3a2cc9165b5d13cbb8e98264000763c2611740b3906687476dea67bf73ec65958ff790a31b45e33d4e1b4c3ca7ffe34fd232b37c75a4
7
+ data.tar.gz: 1005d5619cc4e6fd2997cda250adf5686af74a2d917d43f4dadd0f50e413d418232fbae382c2c1fa523899bde705303ce820771b795e72dac7ed09dc5b26bc21
data/lib/any_good.rb CHANGED
@@ -27,8 +27,7 @@ class AnyGood
27
27
  gem_rev_deps: Gems.reverse_dependencies(name)
28
28
  }
29
29
 
30
- repo_id = [data[:gem]['source_code_uri'], data[:gem]['homepage_uri']]
31
- .grep(GITHUB_URI_PATTERN).first&.sub(GITHUB_URI_PATTERN, '')
30
+ repo_id = detect_repo_id(data[:gem]['source_code_uri'], data[:gem]['homepage_uri'])
32
31
 
33
32
  if repo_id
34
33
  data.merge!(
@@ -93,4 +92,11 @@ class AnyGood
93
92
  res == 50 ? '50+' : res
94
93
  }
95
94
  metric('...last closed') { data.closed_issues.first&.fetch(:closed_at) }
95
+
96
+ private
97
+
98
+ def detect_repo_id(*urls)
99
+ repo_url = urls.grep(GITHUB_URI_PATTERN).first or return nil
100
+ Octokit::Repository.from_url(repo_url).slug
101
+ end
96
102
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: any_good
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Shepelev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pastel