danger-gem_changes 0.0.4 → 0.0.5

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: 1aa4a02bac66b8ac99978fed97167df34e24c05c66dc0268a65cda27dcb79cc7
4
- data.tar.gz: 931055c624a1b1b4eb9b4d359ea61256f070cf164f2100c639e4b6c234559dbd
3
+ metadata.gz: 1a1b559abd29ece1800694f42e76a86d23d76902ad050b077fd2b0fd65835d3d
4
+ data.tar.gz: 0a97f435483472da2d0ddc1967f327b642d9a8d9bb74dec0d1ac812f5bfe21c1
5
5
  SHA512:
6
- metadata.gz: 5378d77c339d86a046df91fe6df74f08e9ef9c8c81bad05abce7493634f368be087f4f6fb25a7dfec3576802229d605bbd1b492a8efc07a2ff2f5e0474ae033f
7
- data.tar.gz: 15a6335a13ea154405a70e1654e971cbd919dd940228cf019fc7e4f680d9a51a4ccc2b3eb8f398eed87f09b30fd01c39392a142582df6956432016e0f6317ecb
6
+ metadata.gz: fb6de489fbed7d6df7f3be17148e0eb8c3b0081c12b624cc128bb24e93f7633131b470072d417c875f5d4bb84868de49824f3df66dc8c1f34a9229411dd4b006
7
+ data.tar.gz: 854c978b2c48d5322d2b6be3ac30ed543fa25e4ef2b8b9ae81893bc47ec69c83ab3019604f844a6c7331cf6166ab8526f0f9c5e691f4eb786a4dd8013da5ecf1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-gem_changes (0.0.4)
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) | [v2.25.0 <- v2.25.1](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 at 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) | [v0.5.0 -> v0.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 at 2.29.2 | |
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.0 <- 2.25.1](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 += "| --- | ------ | --------- | ------ | ----- |\n"
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
- change_link,
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 change_link
71
- text = change_text
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 level
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
- "Added at #{change.to}"
96
+ change.to
94
97
  elsif change.removal?
95
- "Removed at #{change.from}"
98
+ change.from
96
99
  elsif change.upgrade?
97
- "v#{change.from} -> v#{change.to}"
100
+ "#{change.from} -> #{change.to}"
98
101
  elsif change.downgrade?
99
- "v#{change.to} <- v#{change.from}"
102
+ "#{change.to} <- #{change.from}"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GemChanges
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
@@ -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.0 <- 2.25.1](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 | |
@@ -90,17 +90,11 @@ module Danger
90
90
  it "can generate a markdown table" do
91
91
  @my_plugin.summarize_changes
92
92
 
93
- markdown = @dangerfile.status_report[:markdowns].last.message
94
-
95
- expect(markdown).to eq(<<~MARKDOWN)
96
- ### Gemfile.lock Changes
97
- | Gem | Source | Changelog | Change | Level |
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
4
+ version: 0.0.5
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