Skip to content

Commit

Permalink
Bundler: Stop implementing the CommandLineTool interface
Browse files Browse the repository at this point in the history
No command line tool is called from this class anymore.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
  • Loading branch information
sschuberth committed Oct 26, 2021
1 parent c8d25fd commit ca562ad
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions analyzer/src/main/kotlin/managers/Bundler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ package org.ossreviewtoolkit.analyzer.managers
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.module.kotlin.readValue

import com.vdurmont.semver4j.Requirement

import java.io.ByteArrayOutputStream
import java.io.File
import java.io.IOException
Expand Down Expand Up @@ -57,7 +55,6 @@ import org.ossreviewtoolkit.model.config.AnalyzerConfiguration
import org.ossreviewtoolkit.model.config.RepositoryConfiguration
import org.ossreviewtoolkit.model.createAndLogIssue
import org.ossreviewtoolkit.model.yamlMapper
import org.ossreviewtoolkit.utils.CommandLineTool
import org.ossreviewtoolkit.utils.HttpDownloadError
import org.ossreviewtoolkit.utils.OkHttpClientHelper
import org.ossreviewtoolkit.utils.Os
Expand Down Expand Up @@ -96,7 +93,7 @@ class Bundler(
analysisRoot: File,
analyzerConfig: AnalyzerConfiguration,
repoConfig: RepositoryConfiguration
) : PackageManager(name, analysisRoot, analyzerConfig, repoConfig), CommandLineTool {
) : PackageManager(name, analysisRoot, analyzerConfig, repoConfig) {
class Factory : AbstractPackageManagerFactory<Bundler>("Bundler") {
override val globsForDefinitionFiles = listOf("Gemfile")

Expand All @@ -107,16 +104,7 @@ class Bundler(
) = Bundler(managerName, analysisRoot, analyzerConfig, repoConfig)
}

override fun command(workingDir: File?) = "ruby"

override fun transformVersion(output: String) = output.removePrefix("ruby ").substringBefore("p")
override fun getVersionRequirement(): Requirement = Requirement.buildIvy("[2.5.1,)")

override fun beforeResolution(definitionFiles: List<File>) {
// We do not actually depend on any features specific to a version of Bundler, but we still want to stick to
// fixed versions to be sure to get consistent results.
checkVersion(analyzerConfig.ignoreToolVersions)

// Install the Gems the helper scripts depend on.
val requiredGems = listOf("bundler")

Expand Down

0 comments on commit ca562ad

Please sign in to comment.