@vercel/ruby 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +11 -10
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -6110,17 +6110,17 @@ var require_jsonfile = __commonJS({
6110
6110
  }
6111
6111
  function stringify(obj, options) {
6112
6112
  var spaces;
6113
- var EOL = "\n";
6113
+ var EOL2 = "\n";
6114
6114
  if (typeof options === "object" && options !== null) {
6115
6115
  if (options.spaces) {
6116
6116
  spaces = options.spaces;
6117
6117
  }
6118
6118
  if (options.EOL) {
6119
- EOL = options.EOL;
6119
+ EOL2 = options.EOL;
6120
6120
  }
6121
6121
  }
6122
6122
  var str = JSON.stringify(obj, options ? options.replacer : null, spaces);
6123
- return str.replace(/\n/g, EOL) + EOL;
6123
+ return str.replace(/\n/g, EOL2) + EOL2;
6124
6124
  }
6125
6125
  function writeFile2(file, obj, options, callback) {
6126
6126
  if (callback == null) {
@@ -7659,6 +7659,7 @@ __export(src_exports, {
7659
7659
  version: () => version
7660
7660
  });
7661
7661
  module.exports = __toCommonJS(src_exports);
7662
+ var import_os = require("os");
7662
7663
  var import_path2 = require("path");
7663
7664
  var import_execa2 = __toESM(require_execa());
7664
7665
  var import_fs_extra = __toESM(require_lib());
@@ -7671,6 +7672,7 @@ var import_execa = __toESM(require_execa());
7671
7672
  var import_build_utils = require("@vercel/build-utils");
7672
7673
  function getOptions() {
7673
7674
  const options = [
7675
+ { major: 3, minor: 2, range: "3.2.x", runtime: "ruby3.2" },
7674
7676
  {
7675
7677
  major: 2,
7676
7678
  minor: 7,
@@ -7686,12 +7688,6 @@ function getOptions() {
7686
7688
  discontinueDate: /* @__PURE__ */ new Date("2021-11-30")
7687
7689
  }
7688
7690
  ];
7689
- if (process.env.VERCEL_ALLOW_RUBY32 === "1") {
7690
- return [
7691
- { major: 3, minor: 2, range: "3.2.x", runtime: "ruby3.2" },
7692
- ...options
7693
- ];
7694
- }
7695
7691
  return options;
7696
7692
  }
7697
7693
  function getLatestRubyVersion() {
@@ -7819,6 +7815,7 @@ async function bundleInstall(bundlePath, bundleDir, gemfilePath, runtime) {
7819
7815
  });
7820
7816
  if (runtime === "ruby3.2") {
7821
7817
  const result2 = await (0, import_execa2.default)("bundler", ["add", "webrick"], {
7818
+ cwd: (0, import_path2.dirname)(gemfilePath),
7822
7819
  stdio: "pipe",
7823
7820
  env: bundlerEnv,
7824
7821
  reject: false
@@ -7855,11 +7852,15 @@ async function build({
7855
7852
  await (0, import_build_utils2.download)(files, workPath, meta);
7856
7853
  const entrypointFsDirname = (0, import_path2.join)(workPath, (0, import_path2.dirname)(entrypoint));
7857
7854
  const gemfileName = "Gemfile";
7858
- const gemfilePath = await (0, import_build_utils2.walkParentDirs)({
7855
+ let gemfilePath = await (0, import_build_utils2.walkParentDirs)({
7859
7856
  base: workPath,
7860
7857
  start: entrypointFsDirname,
7861
7858
  filename: gemfileName
7862
7859
  });
7860
+ if (!gemfilePath) {
7861
+ gemfilePath = (0, import_path2.join)(entrypointFsDirname, gemfileName);
7862
+ await (0, import_fs_extra.writeFile)(gemfilePath, `source "https://rubygems.org"${import_os.EOL}`);
7863
+ }
7863
7864
  const gemfileContents = gemfilePath ? await (0, import_fs_extra.readFile)(gemfilePath, "utf8") : "";
7864
7865
  const { gemHome, bundlerPath, vendorPath, runtime } = await installBundler(
7865
7866
  meta,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/ruby",
3
3
  "author": "Nathan Cahill <nathan@nathancahill.com>",
4
- "version": "2.0.3",
4
+ "version": "2.0.4",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index",
7
7
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
@@ -17,7 +17,7 @@
17
17
  "devDependencies": {
18
18
  "@types/fs-extra": "8.0.0",
19
19
  "@types/semver": "6.0.0",
20
- "@vercel/build-utils": "7.2.5",
20
+ "@vercel/build-utils": "7.3.0",
21
21
  "execa": "2.0.4",
22
22
  "fs-extra": "^7.0.1",
23
23
  "jest-junit": "16.0.0",