Skip to content

Commit 9463a4d

Browse files
authored
fix: generate Ruby Bundler config in new projects (#2465)
1 parent d6003bc commit 9463a4d

File tree

6 files changed

+19
-2
lines changed

6 files changed

+19
-2
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require:
1+
plugins:
22
- rubocop-minitest
33

44
AllCops:

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ DEPENDENCIES
6464
xcodeproj
6565

6666
BUNDLED WITH
67-
2.5.14
67+
2.6.8

example/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*.xcworkspace/
44
*.zip
55
.DS_Store
6+
.bundle/*
7+
!.bundle/config
68
.gradle/
79
.idea/
810
.vs/

scripts/configure.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
import {
3030
appManifest,
3131
buildGradle,
32+
bundleConfig,
3233
gradleProperties,
3334
podfile,
3435
serialize,
@@ -305,6 +306,7 @@ export const getConfig = (() => {
305306
: {
306307
"App.js": copyFrom(templateDir, "App.js"),
307308
}),
309+
".bundle/config": bundleConfig(),
308310
Gemfile: copyFrom(templateDir, "Gemfile"),
309311
"app.json": appManifest(name),
310312
"index.js": copyFrom(templateDir, "index.js"),

scripts/template.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ export function buildGradle() {
9797
);
9898
}
9999

100+
/**
101+
* Returns `.bundle/config`.
102+
*
103+
* @note We don't use a checked in file because of
104+
* https://github.com/ruby/setup-ruby/discussions/576.
105+
*
106+
* @returns {string}
107+
*/
108+
export function bundleConfig() {
109+
return join('BUNDLE_PATH: ".bundle"', "BUNDLE_FORCE_RUBY_PLATFORM: 1");
110+
}
111+
100112
/**
101113
* @param {number} targetVersion Target React Native version
102114
* @returns {string}

test/configure/getConfig.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ describe("getConfig()", () => {
4545
const config = getConfig(params, "common");
4646

4747
deepEqual(Object.keys(config.files).sort(), [
48+
".bundle/config",
4849
".gitignore",
4950
".watchmanconfig",
5051
"App.tsx",

0 commit comments

Comments
 (0)