danger-gem_changes 0.0.4 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -1
- data/README.md +6 -6
- data/lib/gem_changes/summary_table.rb +33 -20
- data/lib/gem_changes/version.rb +1 -1
- data/spec/fixtures/summary_table.markdown +7 -0
- data/spec/gem_changes_spec.rb +5 -11
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3391e9592f6b4fbac7f4d3e17a3b0acc207020da5ebe9427f2f440f26cb3d2ab
|
4
|
+
data.tar.gz: 95c5d5e123ce639e16181fb3c3bd81cc8a1147475fb6bf354d3a3fc5528ff04f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a11521f18156c2040ef794065ebb68d1b5b99d67c77ad0cdb8965f8bc02501ed386092f141a05308128a8a3836184e862468652cb955540a6473118c6f0335
|
7
|
+
data.tar.gz: 23ac060a030371ec40cebd8076b6a94adf4b45f14f16597bc6b8dd39aa46e5ac272ed56268bc4d94a97c3d96af4930d49fe54e3d892a6a73752ff6af9a00f6ee
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
danger-gem_changes (0.0.
|
4
|
+
danger-gem_changes (0.0.5)
|
5
5
|
danger-plugin-api (~> 1.0)
|
6
6
|
nokogiri (~> 1.0)
|
7
7
|
|
@@ -80,11 +80,15 @@ GEM
|
|
80
80
|
rb-inotify (~> 0.9, >= 0.9.10)
|
81
81
|
lumberjack (1.2.10)
|
82
82
|
method_source (1.1.0)
|
83
|
+
mini_portile2 (2.8.6)
|
83
84
|
nap (1.1.0)
|
84
85
|
nenv (0.3.0)
|
85
86
|
net-http (0.4.1)
|
86
87
|
uri
|
87
88
|
no_proxy_fix (0.1.2)
|
89
|
+
nokogiri (1.16.4)
|
90
|
+
mini_portile2 (~> 2.8.2)
|
91
|
+
racc (~> 1.4)
|
88
92
|
nokogiri (1.16.4-arm64-darwin)
|
89
93
|
racc (~> 1.4)
|
90
94
|
notiffany (0.1.3)
|
data/README.md
CHANGED
@@ -22,12 +22,12 @@ gem_changes.summarize_changes
|
|
22
22
|
```
|
23
23
|
|
24
24
|
> ### Gemfile.lock Changes
|
25
|
-
> | Gem | Source | Changelog | Change | Level |
|
26
|
-
> |
|
27
|
-
> | [rubocop-factory_bot](https://rubygems.org/gems/rubocop-factory_bot) | [Source](https://github.com/rubocop/rubocop-factory_bot) | [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md) | [
|
28
|
-
> | [rubocop-performance](https://rubygems.org/gems/rubocop-performance) | [Source](https://github.com/rubocop/rubocop-performance) | [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) | Added
|
29
|
-
> | [rubocop-rake](https://rubygems.org/gems/rubocop-rake) | [Source](https://github.com/rubocop/rubocop-rake) | [Changelog](https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md) | [
|
30
|
-
> | [rubocop-rspec](https://rubygems.org/gems/rubocop-rspec) | [Source](https://github.com/rubocop/rubocop-rspec) | [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) | Removed
|
25
|
+
> | Gem | Source | Changelog | Change | Version | Level |
|
26
|
+
> | :-: | :----: | :-------: | :----: | :-----: | :---: |
|
27
|
+
> | [rubocop-factory_bot](https://rubygems.org/gems/rubocop-factory_bot) | [Source](https://github.com/rubocop/rubocop-factory_bot) | [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md) | Downgraded | [2.25.1 ➘ 2.25.0](https://github.com/rubocop/rubocop-factory_bot/compare/v2.25.0...v2.25.1) | Patch |
|
28
|
+
> | [rubocop-performance](https://rubygems.org/gems/rubocop-performance) | [Source](https://github.com/rubocop/rubocop-performance) | [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) | Added | 1.21.0 | |
|
29
|
+
> | [rubocop-rake](https://rubygems.org/gems/rubocop-rake) | [Source](https://github.com/rubocop/rubocop-rake) | [Changelog](https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md) | Upgraded | [0.5.0 ➚ 0.6.0](https://github.com/rubocop/rubocop-rake/compare/v0.5.0...v0.6.0) | Minor |
|
30
|
+
> | [rubocop-rspec](https://rubygems.org/gems/rubocop-rspec) | [Source](https://github.com/rubocop/rubocop-rspec) | [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) | Removed | 2.29.2 | |
|
31
31
|
|
32
32
|
### Changes DSL
|
33
33
|
|
@@ -11,8 +11,8 @@ module GemChanges
|
|
11
11
|
def markdown
|
12
12
|
string = ""
|
13
13
|
|
14
|
-
string += "| Gem | Source | Changelog | Change | Level |\n"
|
15
|
-
string += "|
|
14
|
+
string += "| Gem | Source | Changelog | Change | Version | Level |\n"
|
15
|
+
string += "| :-: | :----: | :-------: | :----: | :-----: | :---: |\n"
|
16
16
|
|
17
17
|
rows = changes.map { |change| Row.new(change:) }
|
18
18
|
|
@@ -36,7 +36,8 @@ module GemChanges
|
|
36
36
|
rubygems_link,
|
37
37
|
source_link,
|
38
38
|
changelog_link,
|
39
|
-
|
39
|
+
change_description,
|
40
|
+
compare_link,
|
40
41
|
level
|
41
42
|
].join(" | ")
|
42
43
|
|
@@ -67,8 +68,20 @@ module GemChanges
|
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
70
|
-
def
|
71
|
-
|
71
|
+
def change_description
|
72
|
+
if change.addition?
|
73
|
+
"Added"
|
74
|
+
elsif change.removal?
|
75
|
+
"Removed"
|
76
|
+
elsif change.upgrade?
|
77
|
+
"Upgraded"
|
78
|
+
elsif change.downgrade?
|
79
|
+
"Downgraded"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
def compare_link
|
84
|
+
text = compare_text
|
72
85
|
link = compare_uri
|
73
86
|
|
74
87
|
if link
|
@@ -78,25 +91,15 @@ module GemChanges
|
|
78
91
|
end
|
79
92
|
end
|
80
93
|
|
81
|
-
def
|
82
|
-
if change.major?
|
83
|
-
"Major"
|
84
|
-
elsif change.minor?
|
85
|
-
"Minor"
|
86
|
-
elsif change.patch?
|
87
|
-
"Patch"
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
def change_text
|
94
|
+
def compare_text
|
92
95
|
if change.addition?
|
93
|
-
|
96
|
+
change.to
|
94
97
|
elsif change.removal?
|
95
|
-
|
98
|
+
change.from
|
96
99
|
elsif change.upgrade?
|
97
|
-
"
|
100
|
+
"#{change.from} ➚ #{change.to}"
|
98
101
|
elsif change.downgrade?
|
99
|
-
"
|
102
|
+
"#{change.from} ➘ #{change.to}"
|
100
103
|
else
|
101
104
|
fail "Unknown change type"
|
102
105
|
end
|
@@ -109,6 +112,16 @@ module GemChanges
|
|
109
112
|
|
110
113
|
"#{gem.source_code_uri}/compare/v#{from}...v#{to}"
|
111
114
|
end
|
115
|
+
|
116
|
+
def level
|
117
|
+
if change.major?
|
118
|
+
"Major"
|
119
|
+
elsif change.minor?
|
120
|
+
"Minor"
|
121
|
+
elsif change.patch?
|
122
|
+
"Patch"
|
123
|
+
end
|
124
|
+
end
|
112
125
|
end
|
113
126
|
end
|
114
127
|
end
|
data/lib/gem_changes/version.rb
CHANGED
@@ -0,0 +1,7 @@
|
|
1
|
+
### Gemfile.lock Changes
|
2
|
+
| Gem | Source | Changelog | Change | Version | Level |
|
3
|
+
| :-: | :----: | :-------: | :----: | :-----: | :---: |
|
4
|
+
| [rubocop-factory_bot](https://rubygems.org/gems/rubocop-factory_bot) | [Source](https://github.com/rubocop/rubocop-factory_bot) | [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md) | Downgraded | [2.25.1 ➘ 2.25.0](https://github.com/rubocop/rubocop-factory_bot/compare/v2.25.0...v2.25.1) | Patch |
|
5
|
+
| [rubocop-performance](https://rubygems.org/gems/rubocop-performance) | [Source](https://github.com/rubocop/rubocop-performance) | [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) | Added | 1.21.0 | |
|
6
|
+
| [rubocop-rake](https://rubygems.org/gems/rubocop-rake) | [Source](https://github.com/rubocop/rubocop-rake) | [Changelog](https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md) | Upgraded | [0.5.0 ➚ 0.6.0](https://github.com/rubocop/rubocop-rake/compare/v0.5.0...v0.6.0) | Minor |
|
7
|
+
| [rubocop-rspec](https://rubygems.org/gems/rubocop-rspec) | [Source](https://github.com/rubocop/rubocop-rspec) | [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) | Removed | 2.29.2 | |
|
data/spec/gem_changes_spec.rb
CHANGED
@@ -90,17 +90,11 @@ module Danger
|
|
90
90
|
it "can generate a markdown table" do
|
91
91
|
@my_plugin.summarize_changes
|
92
92
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
| --- | ------ | --------- | ------ | ----- |
|
99
|
-
| [rubocop-factory_bot](https://rubygems.org/gems/rubocop-factory_bot) | [Source](https://github.com/rubocop/rubocop-factory_bot) | [Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md) | [v2.25.0 <- v2.25.1](https://github.com/rubocop/rubocop-factory_bot/compare/v2.25.0...v2.25.1) | Patch |
|
100
|
-
| [rubocop-performance](https://rubygems.org/gems/rubocop-performance) | [Source](https://github.com/rubocop/rubocop-performance) | [Changelog](https://github.com/rubocop/rubocop-performance/blob/master/CHANGELOG.md) | Added at 1.21.0 | |
|
101
|
-
| [rubocop-rake](https://rubygems.org/gems/rubocop-rake) | [Source](https://github.com/rubocop/rubocop-rake) | [Changelog](https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md) | [v0.5.0 -> v0.6.0](https://github.com/rubocop/rubocop-rake/compare/v0.5.0...v0.6.0) | Minor |
|
102
|
-
| [rubocop-rspec](https://rubygems.org/gems/rubocop-rspec) | [Source](https://github.com/rubocop/rubocop-rspec) | [Changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md) | Removed at 2.29.2 | |
|
103
|
-
MARKDOWN
|
93
|
+
actual = @dangerfile.status_report[:markdowns].last.message
|
94
|
+
|
95
|
+
expected = File.read("spec/fixtures/summary_table.markdown")
|
96
|
+
|
97
|
+
expect(actual).to eq(expected)
|
104
98
|
end
|
105
99
|
end
|
106
100
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-gem_changes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John DeSilva
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- lib/gem_changes/summary_table.rb
|
63
63
|
- lib/gem_changes/version.rb
|
64
64
|
- spec/fixtures/Gemfile.lock.patch
|
65
|
+
- spec/fixtures/summary_table.markdown
|
65
66
|
- spec/gem_changes/change_spec.rb
|
66
67
|
- spec/gem_changes_spec.rb
|
67
68
|
- spec/spec_helper.rb
|