react-native-macos/template
David Angulo cb7f1b1f0b Read `.ruby-version` file in `Gemfile` (#35410)
Summary:
When updating the Ruby version, 2 files are always needed to be updated (`.ruby-version` and `Gemfile`). When not in sync it can lead to an error like `Your Ruby version is 2.7.6, but your Gemfile specified 2.7.5`.

This lessens the files that need to be updated when upgrading the Ruby version and makes it in sync always. It makes the `.ruby-version` the source of truth.

### Example 1:

<img width="481" alt="Screenshot 2022-11-20 at 13 56 08" src="https://user-images.githubusercontent.com/36528176/202888191-450ab6d0-32a4-4d37-ad82-0beb2b22fa82.png">

When upgrading from `0.70.0` to `0.71.0-rc.0`. 2 files needs to be updated when it could have been just 1.

Source: https://react-native-community.github.io/upgrade-helper/?from=0.70.0&to=0.71.0-rc.0

### Example 2:

21c8837c12 updates 4 files (`.ruby-version`, `Gemfile`, `template/Gemfile`, `template/_ruby-version`) when it could have been just 2.

### Other Sources:
* https://andycroll.com/ruby/read-ruby-version-in-your-gemfile/
* https://render.com/docs/ruby-version (Heroku alternative)
* https://stackoverflow.com/a/35823132/9375533

## Changelog

[General] [Changed] - Read `.ruby-version` file in `Gemfile`

Pull Request resolved: https://github.com/facebook/react-native/pull/35410

Test Plan: Only `.ruby-version` and `template/_ruby-version` needs to be updated when upgrading Ruby version.

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D41429147

Pulled By: rshest

fbshipit-source-id: 9e541a1d84aed5dca1e6f465c61bb0ba15574211
2022-11-21 05:59:19 -08:00
..
__tests__ Use TypeScript by default for new applications (#35165) 2022-11-02 21:40:58 -07:00
_bundle Introduce Gemfile, ruby-version (#32303) 2021-10-01 21:22:26 -07:00
android Void the Maven coordinates for react-native and hermes-engine (#35379) 2022-11-18 04:46:16 -08:00
ios Fix: Avoid path in the template import (#35394) 2022-11-21 03:55:21 -08:00
App.tsx fix(template): reference App.tsx vs App.js in template text (#35377) 2022-11-18 15:56:58 -08:00
Gemfile Read `.ruby-version` file in `Gemfile` (#35410) 2022-11-21 05:59:19 -08:00
_eslintrc.js Use TypeScript by default for new applications (#35165) 2022-11-02 21:40:58 -07:00
_gitignore Add .metro-health-check to .gitignore 2022-10-14 06:51:52 -07:00
_node-version Added files for node version in reactive native project (#34171) 2022-07-11 06:20:58 -07:00
_prettierrc.js JS: Upgrade to Prettier v2.4.1 [1/n] 2021-11-02 22:14:16 -07:00
_ruby-version Bump Circle CI macOS container to Xcode 14.0.1, Ruby to 2.7.6, CocoaPods 1.11.3 (#34884) 2022-10-11 18:27:25 -07:00
_watchmanconfig Move react-native template 2018-12-07 07:49:19 -08:00
app.json Move react-native template 2018-12-07 07:49:19 -08:00
babel.config.js Revert the change to add babel-plugin-codegen 2021-12-15 16:53:01 -08:00
index.js Exclude RN templates from internal linters 2019-02-11 15:42:17 -08:00
metro.config.js Change default metro.config.js to utilize inline requires (#29770) 2020-08-26 11:30:59 -07:00
package.json Fixup template devDependencies (#35372) 2022-11-16 18:47:42 -08:00
tsconfig.json Use TypeScript by default for new applications (#35165) 2022-11-02 21:40:58 -07:00