@vercel/ruby 1.2.8-canary.6 → 1.2.10-canary.1
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.
- package/dist/index.js +24 -3
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -8793,11 +8793,21 @@ const execa_1 = __importDefault(__webpack_require__(4237));
|
|
|
8793
8793
|
const build_utils_1 = __webpack_require__(3445);
|
|
8794
8794
|
const allOptions = [
|
|
8795
8795
|
{ major: 2, minor: 7, range: '2.7.x', runtime: 'ruby2.7' },
|
|
8796
|
-
{
|
|
8796
|
+
{
|
|
8797
|
+
major: 2,
|
|
8798
|
+
minor: 5,
|
|
8799
|
+
range: '2.5.x',
|
|
8800
|
+
runtime: 'ruby2.5',
|
|
8801
|
+
discontinueDate: new Date('2021-11-30'),
|
|
8802
|
+
},
|
|
8797
8803
|
];
|
|
8798
8804
|
function getLatestRubyVersion() {
|
|
8799
8805
|
return allOptions[0];
|
|
8800
8806
|
}
|
|
8807
|
+
function isDiscontinued({ discontinueDate }) {
|
|
8808
|
+
const today = Date.now();
|
|
8809
|
+
return discontinueDate !== undefined && discontinueDate.getTime() <= today;
|
|
8810
|
+
}
|
|
8801
8811
|
function getRubyPath(meta, gemfileContents) {
|
|
8802
8812
|
let selection = getLatestRubyVersion();
|
|
8803
8813
|
if (meta.isDev) {
|
|
@@ -8818,8 +8828,19 @@ function getRubyPath(meta, gemfileContents) {
|
|
|
8818
8828
|
if (!found) {
|
|
8819
8829
|
throw new build_utils_1.NowBuildError({
|
|
8820
8830
|
code: 'RUBY_INVALID_VERSION',
|
|
8821
|
-
message:
|
|
8822
|
-
link: '
|
|
8831
|
+
message: `Found \`Gemfile\` with invalid Ruby version: \`${line}.\``,
|
|
8832
|
+
link: 'http://vercel.link/ruby-version',
|
|
8833
|
+
});
|
|
8834
|
+
}
|
|
8835
|
+
if (isDiscontinued(selection)) {
|
|
8836
|
+
const latest = getLatestRubyVersion();
|
|
8837
|
+
const intro = `Found \`Gemfile\` with discontinued Ruby version: \`${line}.\``;
|
|
8838
|
+
const hint = `Please set \`ruby "~> ${latest.range}"\` in your \`Gemfile\` to use Ruby ${latest.range}.`;
|
|
8839
|
+
const upstream = 'This change is the result of a decision made by an upstream infrastructure provider (AWS).';
|
|
8840
|
+
throw new build_utils_1.NowBuildError({
|
|
8841
|
+
code: 'RUBY_DISCONTINUED_VERSION',
|
|
8842
|
+
link: 'http://vercel.link/ruby-version',
|
|
8843
|
+
message: `${intro} ${hint} ${upstream}`,
|
|
8823
8844
|
});
|
|
8824
8845
|
}
|
|
8825
8846
|
}
|
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": "1.2.
|
|
4
|
+
"version": "1.2.10-canary.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index",
|
|
7
7
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/fs-extra": "8.0.0",
|
|
24
24
|
"@types/semver": "6.0.0",
|
|
25
|
+
"@vercel/build-utils": "2.13.1-canary.0",
|
|
25
26
|
"@vercel/ncc": "0.24.0",
|
|
26
27
|
"execa": "2.0.4",
|
|
27
28
|
"fs-extra": "^7.0.1",
|
|
28
29
|
"semver": "6.1.1",
|
|
29
30
|
"typescript": "4.3.4"
|
|
30
31
|
},
|
|
31
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "9bbb2cdcbd39846f4a7c97c3cf8838eee130eec4"
|
|
32
33
|
}
|