gems_comparator 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73350d48051c6613ec8f8beacca8b57cd3aa7b13a67cf471c42d6c9da344b2ce
4
- data.tar.gz: 056e9853d3f248f3ebe98801c379c97fcdd98a2f1646a20e0265f3298910f167
3
+ metadata.gz: 3b7a44d82e88a67da3fccd06d8f0a92d67b2ea44a553f3fc0dc68752311c38f1
4
+ data.tar.gz: f9b365262db047978efa96dedb6769609994d3d14917a7931d73ec68d9fd2707
5
5
  SHA512:
6
- metadata.gz: d4bd2d6562def761bb753b53e19cf4133ff3b91097840b18197c42d7ac4015ed10647a423720f8c6b01682c0c394ec3103bd78d95780843bd880ce9eeb38de71
7
- data.tar.gz: 3798cf8bac2f9615e629601e7d7e15980ed8690411ddc7a1705e0312bbe7e35fb1ccbfdf35c257f3fa57b2f46caf9636385879ecefafadf10757bfa53dc45220
6
+ metadata.gz: '09def22aa32b2ca11cbca29c7ba01660b0b0883674d37e65333be8f4eebfe0c48b831c4b16f0633e60678af8bb7c11ea3d5612b5db1634e2942bdaf88f1a4fe5'
7
+ data.tar.gz: 3d27b925cd7b20138c91d41404e2bbf1022d783abd99bd0159ae2f86a17a4b4732caad990525571a4f195428925a6085db60f3f08d6c3c784d19a4b50393349b
@@ -24,10 +24,8 @@ module GemsComparator
24
24
  end
25
25
 
26
26
  def github_url
27
- [homepage, source_code_uri, github_url_from_yaml].each do |url|
28
- normalized = normalized_github_url(url)
29
- break normalized if normalized
30
- end
27
+ urls = [homepage, source_code_uri, github_url_from_yaml]
28
+ urls.map(&method(:normalized_github_url)).compact.first
31
29
  end
32
30
 
33
31
  def homepage
@@ -42,7 +40,7 @@ module GemsComparator
42
40
  private
43
41
 
44
42
  def normalized_github_url(url)
45
- return unless url.include?(Octokit.web_endpoint)
43
+ return unless url.include?('github.com')
46
44
 
47
45
  Octokit::Repository.from_url(url).url
48
46
  rescue URI::InvalidURIError, Octokit::InvalidRepository, NoMethodError
@@ -63,8 +61,8 @@ module GemsComparator
63
61
 
64
62
  def spec_path
65
63
  spec_paths = [
66
- "#{Bundler.specs_path}/#{name}-#{before}.gemspec",
67
- "#{Bundler.specs_path}/#{name}-#{after}.gemspec"
64
+ "#{Bundler.specs_path}/#{name}-#{after}.gemspec",
65
+ "#{Bundler.specs_path}/#{name}-#{before}.gemspec"
68
66
  ]
69
67
  spec_paths.find { |path| File.exist?(path) }
70
68
  end
@@ -3,7 +3,7 @@
3
3
  module GemsComparator
4
4
  class GithubRepository
5
5
  def self.repo?(url)
6
- return false unless url.include?(Octokit.web_endpoint)
6
+ return false unless url.include?('github.com')
7
7
 
8
8
  Octokit::Repository.from_url(url)
9
9
  true
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GemsComparator
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gems_comparator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sinsoku