Skip to content

Commit

Permalink
Bundler: Remove redundant functions
Browse files Browse the repository at this point in the history
Closes oss-review-toolkit#3309.

Signed-off-by: Korbinian Singhammer <external.Korbinian.Singhammer2@bosch.io>
  • Loading branch information
Korbinian Singhammer authored and Korbinian Singhammer committed Jan 20, 2021
1 parent b12a21d commit a53b056
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions analyzer/src/main/kotlin/managers/Bundler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,6 @@ class Bundler(
gemSpecs[gemspecFile.nameWithoutExtension]
} ?: GemSpec(workingDir.name, "", "", sortedSetOf(), "", emptySet(), VcsInfo.EMPTY, RemoteArtifact.EMPTY)

private fun getGemspec(gemName: String, workingDir: File): GemSpec {
val spec = run(
"exec", "gem", "specification", gemName,
workingDir = workingDir,
environment = mapOf("BUNDLE_PATH" to "vendor/bundle")
).stdout

return GemSpec.createFromYaml(spec)
}

private fun getPackageFromGemspec(gemSpec: GemSpec): Package {
val gemId = Identifier("Gem", "", gemSpec.name, gemSpec.version)

Expand All @@ -260,14 +250,6 @@ class Bundler(
private fun getGemspecFile(workingDir: File) =
workingDir.walk().maxDepth(1).filter { it.isFile && it.extension == "gemspec" }.firstOrNull()

private fun installDependencies(workingDir: File) {
requireLockfile(workingDir) { workingDir.resolve("Gemfile.lock").isFile }

// Work around "--path" being deprecated since Bundler 2.1 and avoid tampering with the ".bundle/config" file at
// all by using the "BUNDLER_PATH" environment variable to specify where to install the Gems to.
run("install", workingDir = workingDir, environment = mapOf("BUNDLE_PATH" to "vendor/bundle"))
}

private fun queryRubygems(name: String, version: String, retryCount: Int = 3): GemSpec? {
// See http://guides.rubygems.org/rubygems-org-api-v2/.
val request = Request.Builder()
Expand Down

0 comments on commit a53b056

Please sign in to comment.