Skip to content
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

feat: ruby version check for RN CLI Doctor #1818

Merged
merged 6 commits into from
Feb 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli-doctor/src/tools/envinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function getEnvironmentInfo(
System: ['OS', 'CPU', 'Memory', 'Shell'],
Binaries: ['Node', 'Yarn', 'npm', 'Watchman'],
IDEs: ['Xcode', 'Android Studio', 'Visual Studio'],
Managers: ['CocoaPods'],
Managers: ['CocoaPods', 'RubyGems'],
Languages: ['Java'],
SDKs: ['iOS SDK', 'Android SDK', 'Windows SDK'],
npmPackages: packages,
Expand Down
2 changes: 2 additions & 0 deletions packages/cli-doctor/src/tools/healthchecks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import nodeJS from './nodeJS';
import {yarn, npm} from './packageManagers';
import jdk from './jdk';
import watchman from './watchman';
import ruby from './ruby';
import androidHomeEnvVariable from './androidHomeEnvVariable';
import androidStudio from './androidStudio';
import androidSDK from './androidSDK';
Expand Down Expand Up @@ -37,6 +38,7 @@ export const getHealthchecks = ({contributor}: Options): Healthchecks => {
label: 'Common',
healthchecks: [
nodeJS,
ruby,
yarn,
npm,
...(process.platform === 'darwin' ? [watchman] : []),
Expand Down
24 changes: 24 additions & 0 deletions packages/cli-doctor/src/tools/healthchecks/ruby.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import versionRanges from '../versionRanges';
import {doesSoftwareNeedToBeFixed} from '../checkInstallation';
import {HealthCheckInterface} from '../../types';

export default {
label: 'Ruby',
isRequired: false,
getDiagnostics: async ({Managers}) => ({
needsToBeFixed: doesSoftwareNeedToBeFixed({
version: Managers.RubyGems.version,
versionRange: versionRanges.RUBY,
}),
version: Managers.RubyGems.version,
versionRange: versionRanges.RUBY,
}),
runAutomaticFix: async ({loader, logManualInstallation}) => {
loader.fail();

logManualInstallation({
healthcheck: 'Ruby',
url: 'https://www.ruby-lang.org/en/downloads/',
arushikesarwani94 marked this conversation as resolved.
Show resolved Hide resolved
});
},
} as HealthCheckInterface;
1 change: 1 addition & 0 deletions packages/cli-doctor/src/tools/versionRanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export default {
NODE_JS: '>= 14',
YARN: '>= 1.10.x',
NPM: '>= 4.x',
RUBY: '>= 2.6.x',
arushikesarwani94 marked this conversation as resolved.
Show resolved Hide resolved
JAVA: '>= 11',
// Android
ANDROID_SDK: '>= 31.x',
Expand Down
1 change: 1 addition & 0 deletions packages/cli-doctor/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type EnvironmentInfo = {
};
Managers: {
CocoaPods: AvailableInformation;
RubyGems: AvailableInformation;
};
SDKs: {
'iOS SDK': {
Expand Down