From de5db449e27dfe614b1ad6973fdb99d024e2b954 Mon Sep 17 00:00:00 2001 From: Or Sagie Date: Tue, 18 Aug 2020 13:55:37 +0300 Subject: [PATCH] chore: remove unused gemfile detection --- .../plugins/rubygems/inspectors/gemfile.ts | 21 ++++++------------- .../plugins/rubygems/inspectors/gemspec.ts | 6 ------ .../rubygems/inspectors/try-get-spec.ts | 1 - 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/lib/plugins/rubygems/inspectors/gemfile.ts b/src/lib/plugins/rubygems/inspectors/gemfile.ts index 9d687572c5b..3e1cb26582d 100644 --- a/src/lib/plugins/rubygems/inspectors/gemfile.ts +++ b/src/lib/plugins/rubygems/inspectors/gemfile.ts @@ -1,5 +1,5 @@ import * as path from 'path'; -import { Files, tryGetSpec } from './try-get-spec'; +import { tryGetSpec } from './try-get-spec'; import { Spec } from './index'; const pattern = /^Gemfile(\.lock)*$/; @@ -11,7 +11,6 @@ export function canHandle(file: string): boolean { export async function gatherSpecs(root: string, target: string): Promise { const targetName = path.basename(target); const targetDir = path.dirname(target); - const files: Files = {}; const gemfileLock = await tryGetSpec( root, @@ -19,23 +18,15 @@ export async function gatherSpecs(root: string, target: string): Promise { ); if (gemfileLock) { - files.gemfileLock = gemfileLock; + return { + packageName: path.basename(root), + targetFile: path.join(targetDir, targetName), + files: { gemfileLock }, + }; } else { throw new Error( "Missing Gemfile.lock file: we can't test " + 'without dependencies.\nPlease run `bundle install` first.', ); } - - const gemfile = await tryGetSpec(root, path.join(targetDir, 'Gemfile')); - - if (gemfile) { - files.gemfile = gemfile; - } - - return { - packageName: path.basename(root), - targetFile: path.join(targetDir, targetName), - files, - }; } diff --git a/src/lib/plugins/rubygems/inspectors/gemspec.ts b/src/lib/plugins/rubygems/inspectors/gemspec.ts index 9d3f1c89e8c..05189cb56fe 100644 --- a/src/lib/plugins/rubygems/inspectors/gemspec.ts +++ b/src/lib/plugins/rubygems/inspectors/gemspec.ts @@ -30,12 +30,6 @@ export async function gatherSpecs(root: string, target: string): Promise { files.gemfileLock = gemfileLock; } - const gemfile = await tryGetSpec(root, path.join(targetDir, 'Gemfile')); - - if (gemfile) { - files.gemfile = gemfile; - } - return { packageName: path.basename(root), targetFile: path.join(targetDir, targetName), diff --git a/src/lib/plugins/rubygems/inspectors/try-get-spec.ts b/src/lib/plugins/rubygems/inspectors/try-get-spec.ts index 68288ec269d..f2c566fd9bd 100644 --- a/src/lib/plugins/rubygems/inspectors/try-get-spec.ts +++ b/src/lib/plugins/rubygems/inspectors/try-get-spec.ts @@ -8,7 +8,6 @@ interface File { export interface Files { gemfileLock?: File; - gemfile?: File; gemspec?: File; }