dependabot-common 0.119.5 → 0.119.6

This diff has not been reviewed by any users.
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: ac20c5d159264edb3113a4e495d02e6c32f5e6aadb5cda883587aeabae475dde
4
- data.tar.gz: d5086bb6a7669add859859632b19b2d4e8ddddc9d637f63a2fb101bcb30d92ef
3
+ metadata.gz: ce4dd778f67c7a4f612edfbe2f1ef0bae78566f7c50a46212f0244745cf07da1
4
+ data.tar.gz: 46f644e4de54337eb399265827d754e6ba82477603e046f42c6d79924b32cb86
5
5
  SHA512:
6
- metadata.gz: 5c1cfdfdba4439500593adc35ca3bca20f32d55c0cf4e7436f09caa1b443cca135eee7607ef8c7dc7e5d385b66556d8f1698b80568f2e6068888faa8a76acc79
7
- data.tar.gz: bb518e222b1fd04d0bccd69951ac5d7b58220ef1ed6ed8c7ad29825138f39632b4f605ec314776b14bce59e51025048cdd965aebf33445a9e0419f32b399d2d2
6
+ metadata.gz: 73958fe712b9b38885ec5591114943367adec8cdb77af7efd9a7069261512b2b50b77d7c578335bf87e5f89bef934102c099dd1ec4353ecd075e0924a56d74d8
7
+ data.tar.gz: 54e51527b3f98b0e2b722b1c2617344d4601fde8272986b02c60edc8e9b1525ccb1ea093efb18a02c259279f75cf3e7ce41d9d6e01641ccc3b675335c930026b
@@ -323,10 +323,30 @@ module Dependabot
323
323
  ).to_s
324
324
  end
325
325
 
326
+ def changelog_url(dependency)
327
+ metadata_finder(dependency).changelog_url
328
+ end
329
+
330
+ def commits_url(dependency)
331
+ metadata_finder(dependency).commits_url
332
+ end
333
+
334
+ def homepage_url(dependency)
335
+ metadata_finder(dependency).homepage_url
336
+ end
337
+
338
+ def releases_url(dependency)
339
+ metadata_finder(dependency).releases_url
340
+ end
341
+
326
342
  def source_url(dependency)
327
343
  metadata_finder(dependency).source_url
328
344
  end
329
345
 
346
+ def upgrade_url(dependency)
347
+ metadata_finder(dependency).upgrade_guide_url
348
+ end
349
+
330
350
  def metadata_finder(dependency)
331
351
  @metadata_finder ||= {}
332
352
  @metadata_finder[dependency.name] ||=
@@ -65,16 +65,7 @@ module Dependabot
65
65
 
66
66
  msg = "*Sourced from [#{dependency.display_name}'s releases]"\
67
67
  "(#{releases_url}).*\n\n"
68
- msg +=
69
- begin
70
- release_note_lines = releases_text.split("\n").first(50)
71
- release_note_lines =
72
- release_note_lines.map { |line| "> #{line}\n" }
73
- if release_note_lines.count == 50
74
- release_note_lines << truncated_line
75
- end
76
- release_note_lines.join
77
- end
68
+ msg += quote_and_truncate(releases_text)
78
69
  msg = link_issues(text: msg)
79
70
  msg = fix_relative_links(
80
71
  text: msg,
@@ -92,13 +83,7 @@ module Dependabot
92
83
  msg = "*Sourced from "\
93
84
  "[#{dependency.display_name}'s changelog]"\
94
85
  "(#{changelog_url}).*\n\n"
95
- msg +=
96
- begin
97
- changelog_lines = changelog_text.split("\n").first(50)
98
- changelog_lines = changelog_lines.map { |line| "> #{line}\n" }
99
- changelog_lines << truncated_line if changelog_lines.count == 50
100
- changelog_lines.join
101
- end
86
+ msg += quote_and_truncate(changelog_text)
102
87
  msg = link_issues(text: msg)
103
88
  msg = fix_relative_links(text: msg, base_url: changelog_url)
104
89
  msg = sanitize_template_tags(msg)
@@ -113,13 +98,7 @@ module Dependabot
113
98
  msg = "*Sourced from "\
114
99
  "[#{dependency.display_name}'s upgrade guide]"\
115
100
  "(#{upgrade_guide_url}).*\n\n"
116
- msg +=
117
- begin
118
- upgrade_lines = upgrade_guide_text.split("\n").first(50)
119
- upgrade_lines = upgrade_lines.map { |line| "> #{line}\n" }
120
- upgrade_lines << truncated_line if upgrade_lines.count == 50
121
- upgrade_lines.join
122
- end
101
+ msg += quote_and_truncate(upgrade_guide_text)
123
102
  msg = link_issues(text: msg)
124
103
  msg = fix_relative_links(text: msg, base_url: upgrade_guide_url)
125
104
  msg = sanitize_template_tags(msg)
@@ -245,6 +224,14 @@ module Dependabot
245
224
  end
246
225
  end
247
226
 
227
+ def quote_and_truncate(text, limit: 50)
228
+ lines = text.split("\n")
229
+ lines.first(limit).tap do |limited_lines|
230
+ limited_lines.map! { |line| "> #{line}\n" }
231
+ limited_lines << truncated_line if lines.count > limit
232
+ end.join
233
+ end
234
+
248
235
  def truncated_line
249
236
  # Tables can spill out of truncated details, so we close them
250
237
  "></tr></table> \n ... (truncated)\n"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.119.5"
4
+ VERSION = "0.119.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.119.5
4
+ version: 0.119.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot