-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix combination of rubygems and --all-projects #2333
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import * as path from 'path'; | ||
import { tryGetSpec } from './try-get-spec'; | ||
import { Spec } from './index'; | ||
import * as types from '../../types'; | ||
|
||
/* Supported example patterns: | ||
* Gemfile | ||
|
@@ -18,7 +19,11 @@ export function canHandle(file: string): boolean { | |
return !!file && gemfileOrLockfilePattern.test(path.basename(file)); | ||
} | ||
|
||
export async function gatherSpecs(root: string, target: string): Promise<Spec> { | ||
export async function gatherSpecs( | ||
root: string, | ||
target: string, | ||
options: types.Options, | ||
): Promise<Spec> { | ||
const { dir, name } = path.parse(target); | ||
const isGemfileLock = gemfileLockPattern.test(target); | ||
// if the target is a Gemfile we treat is as the lockfile | ||
|
@@ -28,8 +33,11 @@ export async function gatherSpecs(root: string, target: string): Promise<Spec> { | |
); | ||
|
||
if (gemfileLock) { | ||
const basePackageName = path.basename(root); | ||
return { | ||
packageName: path.basename(root), | ||
packageName: options.allSubProjects | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because the name of the package here is the actual name of the project, and the project name is a part of the identifier, we only want to change this in the problematic area we're facing of 2 or more projects with the '--all-projects` flag. |
||
? path.join(basePackageName, dir) | ||
: basePackageName, | ||
targetFile: path.join(dir, name), | ||
files: { gemfileLock }, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already send the options when we run
inspect
, but never used it here.All changes in this file is just to propagate
options
to the plugin