Skip to content

Commit

Permalink
refactor(bundler): Simplify the description fallback logic
Browse files Browse the repository at this point in the history
Turns out that `info` is a synthetic field that itself implements a
fallback from `description` to `summary`, see [1]. This is a fixup for
7193af3.

[1]: https://github.com/rubygems/rubygems.org/blob/e7faec5ad1b43162368b77e0f4add8f6bd932cbb/app/models/version.rb#L255-L257

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Jul 2, 2024
1 parent 1e765df commit 51d0bec
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions plugins/package-managers/bundler/src/main/kotlin/Bundler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -453,17 +453,13 @@ internal data class GemSpec(
RemoteArtifact.EMPTY
}

val description = sequenceOf(node["description"], node["summary"], node["info"]).mapNotNull { text ->
text?.textValue()?.takeIf { it.isNotEmpty() }
}.firstOrNull()

return GemSpec(
node["name"].textValue(),
node["version"].textValue(),
node["homepage_uri"].textValueOrEmpty(),
node["authors"].textValueOrEmpty().split(',').mapToSetOfNotEmptyStrings(),
node["licenses"]?.toList().mapToSetOfNotEmptyStrings(),
description.orEmpty(),
node["info"].textValueOrEmpty(),
runtimeDependencies.orEmpty(),
vcs,
artifact
Expand Down

0 comments on commit 51d0bec

Please sign in to comment.