compare_linker 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/README.md +2 -2
- data/compare_linker.gemspec +4 -5
- data/lib/compare_linker.rb +31 -27
- data/lib/compare_linker/version.rb +1 -1
- data/spec/factories/gem_info.rb +1 -1
- data/spec/spec_helper.rb +3 -3
- metadata +8 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a66e1f77f2336333a3fec1904453bed0c8e006981bce6cb3c07261e32d8f264a
|
4
|
+
data.tar.gz: c840aa131e2ced1492a3c8ba2b3c468b19ed7914f1ba79de1ad71b338244f347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5f77468a540e60074128207a50a4880fa763b2a4b870d91a07e207750585e9af92c82dba8242a412bb1f6ba1ca050ef2285ef05a45af547e80de9e7be4094fe
|
7
|
+
data.tar.gz: fd762ab40117f3c14411b43456b29eee15ee7dfa2effddb95a16bde412bf8f84f163baa3dc5a61580e8655944ca77ba94e0893fe7e6eb2486cc265732b469ea6
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# Compare Linker
|
2
2
|
|
3
|
-
[![Travis Status](https://img.shields.io/travis/masutaka/compare_linker.svg?style=flat-square)][travisci]
|
3
|
+
[![Travis Status](https://img.shields.io/travis/masutaka/compare_linker.svg?logo=travis&style=flat-square)][travisci]
|
4
4
|
[![License](https://img.shields.io/github/license/masutaka/compare_linker.svg?style=flat-square)][license]
|
5
|
-
[![Gem](https://img.shields.io/gem/v/compare_linker.svg?style=flat-square)][gem-link]
|
5
|
+
[![Gem](https://img.shields.io/gem/v/compare_linker.svg?logo=ruby&style=flat-square)][gem-link]
|
6
6
|
|
7
7
|
[travisci]: https://travis-ci.org/masutaka/compare_linker
|
8
8
|
[license]: https://github.com/masutaka/compare_linker/blob/master/LICENSE.txt
|
data/compare_linker.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'compare_linker/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "compare_linker"
|
8
8
|
spec.version = CompareLinker::VERSION
|
9
|
-
spec.authors = ["Kensuke Nagae"]
|
10
|
-
spec.email = ["kyanny@gmail.com"]
|
9
|
+
spec.authors = ["Takashi Masuda", "Kensuke Nagae"]
|
10
|
+
spec.email = ["masutaka.net@gmail.com", "kyanny@gmail.com"]
|
11
11
|
spec.description = %q{Create GitHub's compare view URLs for pull request from diff of Gemfile.lock}
|
12
12
|
spec.summary = %q{Create GitHub's compare view URLs for pull request}
|
13
13
|
spec.homepage = "https://github.com/masutaka/compare_linker"
|
@@ -21,9 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_dependency "octokit"
|
22
22
|
spec.add_dependency "httpclient"
|
23
23
|
|
24
|
-
spec.add_development_dependency "
|
25
|
-
spec.add_development_dependency "
|
26
|
-
spec.add_development_dependency "factory_girl"
|
24
|
+
spec.add_development_dependency "bundler", ">= 1.3"
|
25
|
+
spec.add_development_dependency "factory_bot"
|
27
26
|
spec.add_development_dependency "rake"
|
28
27
|
spec.add_development_dependency "rspec"
|
29
28
|
end
|
data/lib/compare_linker.rb
CHANGED
@@ -26,37 +26,41 @@ class CompareLinker
|
|
26
26
|
old_lockfile = fetcher.fetch(repo_full_name, pull_request.base.sha)
|
27
27
|
new_lockfile = fetcher.fetch(repo_full_name, pull_request.head.sha)
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
29
|
+
make_compare_links_from_lockfiles(old_lockfile, new_lockfile)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def make_compare_links_from_lockfiles(old_lockfile, new_lockfile)
|
34
|
+
comparator = LockfileComparator.new
|
35
|
+
comparator.compare(old_lockfile, new_lockfile)
|
36
|
+
@compare_links = comparator.updated_gems.map { |gem_name, gem_info|
|
37
|
+
if gem_info[:owner].nil?
|
38
|
+
finder = GithubLinkFinder.new(octokit, gem_dictionary)
|
39
|
+
finder.find(gem_name)
|
40
|
+
gem_info[:homepage_uri] = finder.homepage_uri
|
41
|
+
if finder.repo_owner.nil?
|
42
|
+
formatter.format(gem_info)
|
43
|
+
else
|
44
|
+
gem_info[:repo_owner] = finder.repo_owner
|
45
|
+
gem_info[:repo_name] = finder.repo_name
|
41
46
|
|
42
|
-
|
43
|
-
|
44
|
-
|
47
|
+
tag_finder = GithubTagFinder.new(octokit, gem_name, finder.repo_full_name)
|
48
|
+
old_tag = tag_finder.find(gem_info[:old_ver])
|
49
|
+
new_tag = tag_finder.find(gem_info[:new_ver])
|
45
50
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
end
|
51
|
+
if old_tag && new_tag
|
52
|
+
gem_info[:old_tag] = old_tag.name
|
53
|
+
gem_info[:new_tag] = new_tag.name
|
54
|
+
formatter.format(gem_info)
|
55
|
+
else
|
56
|
+
formatter.format(gem_info)
|
53
57
|
end
|
54
|
-
else
|
55
|
-
formatter.format(gem_info)
|
56
58
|
end
|
57
|
-
|
58
|
-
|
59
|
-
|
59
|
+
else
|
60
|
+
formatter.format(gem_info)
|
61
|
+
end
|
62
|
+
}
|
63
|
+
@compare_links
|
60
64
|
end
|
61
65
|
|
62
66
|
def add_comment(repo_full_name, pr_number, compare_links)
|
data/spec/factories/gem_info.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'compare_linker'
|
2
|
-
require '
|
2
|
+
require 'factory_bot'
|
3
3
|
require 'rspec'
|
4
4
|
|
5
5
|
Dir["#{__dir__}/support/**/*.rb"].each do |f|
|
@@ -7,10 +7,10 @@ Dir["#{__dir__}/support/**/*.rb"].each do |f|
|
|
7
7
|
end
|
8
8
|
|
9
9
|
RSpec.configure do |config|
|
10
|
-
config.include
|
10
|
+
config.include FactoryBot::Syntax::Methods
|
11
11
|
config.include LoadFixtureHelper
|
12
12
|
|
13
13
|
config.before(:suite) do
|
14
|
-
|
14
|
+
FactoryBot.find_definitions
|
15
15
|
end
|
16
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compare_linker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Takashi Masuda
|
7
8
|
- Kensuke Nagae
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2019-03-03 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: octokit
|
@@ -38,36 +39,22 @@ dependencies:
|
|
38
39
|
- - ">="
|
39
40
|
- !ruby/object:Gem::Version
|
40
41
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: activesupport
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '4'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '4'
|
55
42
|
- !ruby/object:Gem::Dependency
|
56
43
|
name: bundler
|
57
44
|
requirement: !ruby/object:Gem::Requirement
|
58
45
|
requirements:
|
59
|
-
- - "
|
46
|
+
- - ">="
|
60
47
|
- !ruby/object:Gem::Version
|
61
48
|
version: '1.3'
|
62
49
|
type: :development
|
63
50
|
prerelease: false
|
64
51
|
version_requirements: !ruby/object:Gem::Requirement
|
65
52
|
requirements:
|
66
|
-
- - "
|
53
|
+
- - ">="
|
67
54
|
- !ruby/object:Gem::Version
|
68
55
|
version: '1.3'
|
69
56
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
57
|
+
name: factory_bot
|
71
58
|
requirement: !ruby/object:Gem::Requirement
|
72
59
|
requirements:
|
73
60
|
- - ">="
|
@@ -110,6 +97,7 @@ dependencies:
|
|
110
97
|
version: '0'
|
111
98
|
description: Create GitHub's compare view URLs for pull request from diff of Gemfile.lock
|
112
99
|
email:
|
100
|
+
- masutaka.net@gmail.com
|
113
101
|
- kyanny@gmail.com
|
114
102
|
executables: []
|
115
103
|
extensions: []
|
@@ -167,8 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
155
|
- !ruby/object:Gem::Version
|
168
156
|
version: '0'
|
169
157
|
requirements: []
|
170
|
-
|
171
|
-
rubygems_version: 2.7.6
|
158
|
+
rubygems_version: 3.0.1
|
172
159
|
signing_key:
|
173
160
|
specification_version: 4
|
174
161
|
summary: Create GitHub's compare view URLs for pull request
|