lock_diff 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -2
- data/README.md +3 -7
- data/lib/lock_diff.rb +1 -0
- data/lib/lock_diff/changelog.rb +15 -0
- data/lib/lock_diff/diff_info.rb +8 -18
- data/lib/lock_diff/formatter/github_markdown.rb +6 -5
- data/lib/lock_diff/github/changelog_url_finder.rb +4 -4
- data/lib/lock_diff/version.rb +1 -1
- data/lock_diff.gemspec +2 -2
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b72b0103bb0456640f9f87ce36c6aab414b9448d7f362e931a43b32968975fe7
|
4
|
+
data.tar.gz: bc757035ce6f1abb73351ffe667903f6d07c7cd61197e307db410412060f8b23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03d27cc09817e1695418a4acb7efab5cddd6208a7a73362237292dd827b2507397251ef2d78331bd40db6bbf16a052549476eb2577a7ba12c9ab1351941bbe10
|
7
|
+
data.tar.gz: bce05c0eb4ce1df1595cd0e7c88111c9c25b0412a84ca769ac3f5997c451a6abbaa1a50ac29c25424f66c420249cbcb83fbea69adf06fed7c3c550d818067739
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
# LockDiff
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/lock_diff.svg)](https://badge.fury.io/rb/lock_diff)
|
4
|
-
[![GitHub tag](https://img.shields.io/github/tag/vividmuimui/lock_diff.svg)](https://github.com/vividmuimui/lock_diff/tags)
|
5
4
|
[![Build Status](https://travis-ci.org/vividmuimui/lock_diff.svg?branch=master)](https://travis-ci.org/vividmuimui/lock_diff)
|
6
5
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d05b439bc5064e30ad84ecfa8e57b448)](https://www.codacy.com/app/vividmuimui/lock_diff?utm_source=github.com&utm_medium=referral&utm_content=vividmuimui/lock_diff&utm_campaign=badger)
|
7
|
-
[![Dependency Status](https://gemnasium.com/badges/github.com/vividmuimui/lock_diff.svg)](https://gemnasium.com/github.com/vividmuimui/lock_diff)
|
8
6
|
[![Code Climate](https://codeclimate.com/github/vividmuimui/lock_diff/badges/gpa.svg)](https://codeclimate.com/github/vividmuimui/lock_diff)
|
9
|
-
[![Issue Count](https://codeclimate.com/github/vividmuimui/lock_diff/badges/issue_count.svg)](https://codeclimate.com/github/vividmuimui/lock_diff)
|
10
|
-
[![ghit.me](https://ghit.me/badge.svg?repo=vividmuimui/lock_diff)](https://ghit.me/repo/vividmuimui/lock_diff)
|
11
7
|
|
12
8
|
This gem detects changes to your package manager (e.g. Gemfile) and generates a Markdown-formatted diff including:
|
13
9
|
|
@@ -109,7 +105,7 @@ TODO:
|
|
109
105
|
|
110
106
|
## Contributing
|
111
107
|
|
112
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
108
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/vividmuimui/lock_diff. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
113
109
|
|
114
110
|
## License
|
115
111
|
|
@@ -117,7 +113,7 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
117
113
|
|
118
114
|
### Original
|
119
115
|
|
120
|
-
Most source code in this
|
116
|
+
Most of the source code in this repository is by https://github.com/kyanny/compare_linker.
|
121
117
|
|
122
118
|
```
|
123
119
|
Copyright (c) 2014 Kensuke Nagae
|
@@ -147,4 +143,4 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
147
143
|
|
148
144
|
## Code of Conduct
|
149
145
|
|
150
|
-
Everyone interacting in the LockDiff project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
146
|
+
Everyone interacting in the LockDiff project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/vividmuimui/lock_diff/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/lock_diff.rb
CHANGED
data/lib/lock_diff/diff_info.rb
CHANGED
@@ -57,28 +57,18 @@ module LockDiff
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
61
|
-
|
62
|
-
ref =
|
63
|
-
case status
|
64
|
-
when UPGRADE, NEW
|
65
|
-
@new_package.ref
|
66
|
-
when DOWNGRADE, DELETE
|
67
|
-
nil # default branch(master)
|
68
|
-
end
|
60
|
+
def changelogs
|
61
|
+
return nil if [DOWNGRADE, DELETE].include?(status)
|
69
62
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
63
|
+
Github::ChangelogUrlFinder.new(
|
64
|
+
repository: package.repository,
|
65
|
+
repository_url: package.repository_url,
|
66
|
+
ref: @new_package.ref
|
67
|
+
).call.map do |url|
|
68
|
+
Changelog.new(url)
|
75
69
|
end
|
76
70
|
end
|
77
71
|
|
78
|
-
def changelog_name
|
79
|
-
File.basename(changelog_url)
|
80
|
-
end
|
81
|
-
|
82
72
|
def commits_url
|
83
73
|
return unless package.repository_url
|
84
74
|
old_ref = @old_package.ref
|
@@ -41,7 +41,7 @@ module LockDiff
|
|
41
41
|
text << repository
|
42
42
|
text << status
|
43
43
|
text << commits_text
|
44
|
-
text <<
|
44
|
+
text << changelogs
|
45
45
|
"| #{text.join(' | ')} |"
|
46
46
|
end
|
47
47
|
|
@@ -77,15 +77,16 @@ module LockDiff
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
def
|
81
|
-
if diff_info.
|
82
|
-
|
80
|
+
def changelogs
|
81
|
+
if diff_info.changelogs
|
82
|
+
diff_info.changelogs.map do |changelog|
|
83
|
+
"[#{changelog.name}](#{changelog.url})"
|
84
|
+
end.join(" ")
|
83
85
|
else
|
84
86
|
""
|
85
87
|
end
|
86
88
|
end
|
87
89
|
end
|
88
|
-
|
89
90
|
end
|
90
91
|
end
|
91
92
|
end
|
@@ -17,18 +17,18 @@ module LockDiff
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def call
|
20
|
-
|
20
|
+
change_log_urls.push(find_release_url).compact
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
-
def
|
25
|
+
def change_log_urls
|
26
26
|
Github.client.contents(@repository, ref: @ref).
|
27
27
|
select(&:file?).
|
28
|
-
|
28
|
+
select do |content|
|
29
29
|
name = content.name.downcase.delete('_')
|
30
30
|
CHANGE_LOG_CANDIDATES.any? { |candidate| name.start_with? candidate }
|
31
|
-
|
31
|
+
end&.map(&:html_url)
|
32
32
|
end
|
33
33
|
|
34
34
|
def find_release_url
|
data/lib/lock_diff/version.rb
CHANGED
data/lock_diff.gemspec
CHANGED
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_dependency "octokit", "~> 4.0"
|
27
27
|
spec.add_dependency "httpclient"
|
28
28
|
|
29
|
-
spec.add_development_dependency "bundler", "
|
30
|
-
spec.add_development_dependency "rake", "
|
29
|
+
spec.add_development_dependency "bundler", "> 1.15"
|
30
|
+
spec.add_development_dependency "rake", ">= 13"
|
31
31
|
spec.add_development_dependency "rspec", "~> 3.0"
|
32
32
|
spec.add_development_dependency "pry"
|
33
33
|
spec.add_development_dependency "pry-byebug"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lock_diff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vividmuimui
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -42,30 +42,30 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.15'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.15'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '13'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '13'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- exe/lock_diff
|
146
146
|
- exe/lock_diff_for_tachikoma
|
147
147
|
- lib/lock_diff.rb
|
148
|
+
- lib/lock_diff/changelog.rb
|
148
149
|
- lib/lock_diff/cli/option_parser.rb
|
149
150
|
- lib/lock_diff/diff_info.rb
|
150
151
|
- lib/lock_diff/formatter/github_markdown.rb
|
@@ -185,8 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
186
|
- !ruby/object:Gem::Version
|
186
187
|
version: '0'
|
187
188
|
requirements: []
|
188
|
-
|
189
|
-
rubygems_version: 2.6.14.1
|
189
|
+
rubygems_version: 3.0.3
|
190
190
|
signing_key:
|
191
191
|
specification_version: 4
|
192
192
|
summary: This gem detects changes to your package manager (e.g. Gemfile) and generates
|