From c96a8640af76ef750786a37832142fb4c7d34377 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 23 Jan 2022 12:11:04 +0100 Subject: [PATCH] Make version files pure-data JSON files --- CONTRIBUTING.md | 4 +- README.md | 4 +- dist/index.js | 131 +++---------------- generate-windows-versions.rb | 4 +- ruby-builder-versions.js | 36 ----- ruby-builder-versions.json | 32 +++++ ruby-builder.js | 2 +- versions-strings-for-builder.rb | 5 +- windows-versions.js => windows-versions.json | 2 +- windows.js | 2 +- 10 files changed, 64 insertions(+), 158 deletions(-) delete mode 100644 ruby-builder-versions.js create mode 100644 ruby-builder-versions.json rename windows-versions.js => windows-versions.json (99%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c8bf9f..4738704 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,4 +22,6 @@ $ cp pre-commit .git/hooks/pre-commit ## Adding a new Ruby version -Add the new version in `ruby-builder-versions.js`, then follow the steps above in [Regenerating dist/index.js](#regenerating-distindexjs) to update `dist/index.js`. Finally, update the "Supported Versions" section of the README if needed. +Add the new version in `ruby-builder-versions.json`, +then follow the steps above in [Regenerating dist/index.js](#regenerating-distindexjs) to update `dist/index.js`. +Finally, update the "Supported Versions" section of the README if needed. diff --git a/README.md b/README.md index 5a8b2ec..7e68131 100644 --- a/README.md +++ b/README.md @@ -50,8 +50,8 @@ and on Windows by [RubyInstaller2](https://github.com/oneclick/rubyinstaller2). `jruby-head` is generated by [jruby-dev-builder](https://github.com/ruby/jruby-dev-builder), `truffleruby-head` is generated by [truffleruby-dev-builder](https://github.com/ruby/truffleruby-dev-builder) and `truffleruby+graalvm` is generated by [graalvm-ce-dev-builds](https://github.com/graalvm/graalvm-ce-dev-builds). -The full list of available Ruby versions can be seen in [ruby-builder-versions.js](ruby-builder-versions.js) -for Ubuntu and macOS and in [windows-versions.js](windows-versions.js) for Windows. +The full list of available Ruby versions can be seen in [ruby-builder-versions.json](ruby-builder-versions.json) +for Ubuntu and macOS and in [windows-versions.json](windows-versions.json) for Windows. ## Usage diff --git a/dist/index.js b/dist/index.js index 2f38272..a2216fc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -58779,54 +58779,6 @@ module.exports = v4; }).call(this); -/***/ }), - -/***/ 2679: -/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => { - -"use strict"; -__nccwpck_require__.r(__webpack_exports__); -/* harmony export */ __nccwpck_require__.d(__webpack_exports__, { -/* harmony export */ "getVersions": () => (/* binding */ getVersions) -/* harmony export */ }); -function getVersions(platform) { - const versions = { - "ruby": [ - "1.9.3-p551", - "2.0.0-p648", - "2.1.9", - "2.2.10", - "2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8", - "2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10", - "2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.8", "2.5.9", - "2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9", - "2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5", - "3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3", - "3.1.0-preview1", "3.1.0", - "head", "debug" - ], - "jruby": [ - "9.1.17.0", - "9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0", "9.2.18.0", "9.2.19.0", "9.2.20.0", "9.2.20.1", - "9.3.0.0", "9.3.1.0", "9.3.2.0", - "head" - ], - "truffleruby": [ - "19.3.0", "19.3.1", - "20.0.0", "20.1.0", "20.2.0", "20.3.0", - "21.0.0", "21.1.0", "21.2.0", "21.2.0.1", "21.3.0", - "head" - ], - "truffleruby+graalvm": [ - "21.2.0", "21.3.0", - "head" - ] - } - - return versions -} - - /***/ }), /***/ 9974: @@ -58845,7 +58797,7 @@ const exec = __nccwpck_require__(1514) const io = __nccwpck_require__(7436) const tc = __nccwpck_require__(7784) const common = __nccwpck_require__(4717) -const rubyBuilderVersions = __nccwpck_require__(2679) +const rubyBuilderVersions = __nccwpck_require__(9256) const builderReleaseTag = 'toolcache' const releasesURL = 'https://github.com/ruby/ruby-builder/releases' @@ -58853,7 +58805,7 @@ const releasesURL = 'https://github.com/ruby/ruby-builder/releases' const windows = common.windows function getAvailableVersions(platform, engine) { - return rubyBuilderVersions.getVersions(platform)[engine] + return rubyBuilderVersions[engine] } async function install(platform, engine, version) { @@ -58995,67 +58947,6 @@ async function rubygemsUpdate(rubygemsVersionInput, rubyPrefix) { } -/***/ }), - -/***/ 7223: -/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => { - -"use strict"; -/* harmony export */ __nccwpck_require__.d(__webpack_exports__, { -/* harmony export */ "d": () => (/* binding */ versions) -/* harmony export */ }); -const versions = { - "2.0.0": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.0.0-p648/ruby-2.0.0-p648-x64-mingw32.7z", - "2.1.9": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.1.9/ruby-2.1.9-x64-mingw32.7z", - "2.2.6": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.2.6/ruby-2.2.6-x64-mingw32.7z", - "2.3.0": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.0/ruby-2.3.0-x64-mingw32.7z", - "2.3.1": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.1/ruby-2.3.1-x64-mingw32.7z", - "2.3.3": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.3/ruby-2.3.3-x64-mingw32.7z", - "2.4.1": "https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-2/rubyinstaller-2.4.1-2-x64.7z", - "2.4.2": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.2-2/rubyinstaller-2.4.2-2-x64.7z", - "2.4.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.3-2/rubyinstaller-2.4.3-2-x64.7z", - "2.4.4": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.4-2/rubyinstaller-2.4.4-2-x64.7z", - "2.4.5": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.5-1/rubyinstaller-2.4.5-1-x64.7z", - "2.4.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.6-1/rubyinstaller-2.4.6-1-x64.7z", - "2.4.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.7-1/rubyinstaller-2.4.7-1-x64.7z", - "2.4.9": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.9-1/rubyinstaller-2.4.9-1-x64.7z", - "2.4.10": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.10-1/rubyinstaller-2.4.10-1-x64.7z", - "2.5.0": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.0-2/rubyinstaller-2.5.0-2-x64.7z", - "2.5.1": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.1-2/rubyinstaller-2.5.1-2-x64.7z", - "2.5.3": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.3-1/rubyinstaller-2.5.3-1-x64.7z", - "2.5.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.5-1/rubyinstaller-2.5.5-1-x64.7z", - "2.5.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.6-1/rubyinstaller-2.5.6-1-x64.7z", - "2.5.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.7-1/rubyinstaller-2.5.7-1-x64.7z", - "2.5.8": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.8-2/rubyinstaller-2.5.8-2-x64.7z", - "2.5.9": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.9-1/rubyinstaller-2.5.9-1-x64.7z", - "2.6.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.0-1/rubyinstaller-2.6.0-1-x64.7z", - "2.6.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.1-1/rubyinstaller-2.6.1-1-x64.7z", - "2.6.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.2-1/rubyinstaller-2.6.2-1-x64.7z", - "2.6.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x64.7z", - "2.6.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-2.6.4-1-x64.7z", - "2.6.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.5-1/rubyinstaller-2.6.5-1-x64.7z", - "2.6.6": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.6-2/rubyinstaller-2.6.6-2-x64.7z", - "2.6.7": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.7-1/rubyinstaller-2.6.7-1-x64.7z", - "2.6.8": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.8-1/rubyinstaller-2.6.8-1-x64.7z", - "2.6.9": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.9-1/rubyinstaller-2.6.9-1-x64.7z", - "2.7.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z", - "2.7.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.1-1/rubyinstaller-2.7.1-1-x64.7z", - "2.7.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.2-1/rubyinstaller-2.7.2-1-x64.7z", - "2.7.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.3-1/rubyinstaller-2.7.3-1-x64.7z", - "2.7.4": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.4-1/rubyinstaller-2.7.4-1-x64.7z", - "2.7.5": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.5-1/rubyinstaller-2.7.5-1-x64.7z", - "3.0.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.0-1/rubyinstaller-3.0.0-1-x64.7z", - "3.0.1": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z", - "3.0.2": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z", - "3.0.3": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.3-1/rubyinstaller-3.0.3-1-x64.7z", - "3.1.0": "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.0-1/rubyinstaller-3.1.0-1-x64.7z", - "head": "https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z", - "mingw": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z", - "mswin": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z", - "ucrt": "https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z" -} - - /***/ }), /***/ 3216: @@ -59080,7 +58971,7 @@ const exec = __nccwpck_require__(1514) const io = __nccwpck_require__(7436) const tc = __nccwpck_require__(7784) const common = __nccwpck_require__(4717) -const rubyInstallerVersions = __nccwpck_require__(7223)/* .versions */ .d +const rubyInstallerVersions = __nccwpck_require__(1387) const drive = common.drive @@ -59368,6 +59259,22 @@ module.exports = JSON.parse('["ac","com.ac","edu.ac","gov.ac","net.ac","mil.ac", /***/ }), +/***/ 9256: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"ruby":["1.9.3-p551","2.0.0-p648","2.1.9","2.2.10","2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.4.9","2.4.10","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9","2.6.0","2.6.1","2.6.2","2.6.3","2.6.4","2.6.5","2.6.6","2.6.7","2.6.8","2.6.9","2.7.0","2.7.1","2.7.2","2.7.3","2.7.4","2.7.5","3.0.0-preview1","3.0.0-preview2","3.0.0-rc1","3.0.0","3.0.1","3.0.2","3.0.3","3.1.0-preview1","3.1.0","head","debug"],"jruby":["9.1.17.0","9.2.9.0","9.2.10.0","9.2.11.0","9.2.11.1","9.2.12.0","9.2.13.0","9.2.14.0","9.2.15.0","9.2.16.0","9.2.17.0","9.2.18.0","9.2.19.0","9.2.20.0","9.2.20.1","9.3.0.0","9.3.1.0","9.3.2.0","head"],"truffleruby":["19.3.0","19.3.1","20.0.0","20.1.0","20.2.0","20.3.0","21.0.0","21.1.0","21.2.0","21.2.0.1","21.3.0","head"],"truffleruby+graalvm":["21.2.0","21.3.0","head"]}'); + +/***/ }), + +/***/ 1387: +/***/ ((module) => { + +"use strict"; +module.exports = JSON.parse('{"2.0.0":"https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.0.0-p648/ruby-2.0.0-p648-x64-mingw32.7z","2.1.9":"https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.1.9/ruby-2.1.9-x64-mingw32.7z","2.2.6":"https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.2.6/ruby-2.2.6-x64-mingw32.7z","2.3.0":"https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.0/ruby-2.3.0-x64-mingw32.7z","2.3.1":"https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.1/ruby-2.3.1-x64-mingw32.7z","2.3.3":"https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.3.3/ruby-2.3.3-x64-mingw32.7z","2.4.1":"https://github.com/oneclick/rubyinstaller2/releases/download/2.4.1-2/rubyinstaller-2.4.1-2-x64.7z","2.4.2":"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.2-2/rubyinstaller-2.4.2-2-x64.7z","2.4.3":"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.3-2/rubyinstaller-2.4.3-2-x64.7z","2.4.4":"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.4-2/rubyinstaller-2.4.4-2-x64.7z","2.4.5":"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.4.5-1/rubyinstaller-2.4.5-1-x64.7z","2.4.6":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.6-1/rubyinstaller-2.4.6-1-x64.7z","2.4.7":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.7-1/rubyinstaller-2.4.7-1-x64.7z","2.4.9":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.9-1/rubyinstaller-2.4.9-1-x64.7z","2.4.10":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.10-1/rubyinstaller-2.4.10-1-x64.7z","2.5.0":"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.0-2/rubyinstaller-2.5.0-2-x64.7z","2.5.1":"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.1-2/rubyinstaller-2.5.1-2-x64.7z","2.5.3":"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.3-1/rubyinstaller-2.5.3-1-x64.7z","2.5.5":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.5-1/rubyinstaller-2.5.5-1-x64.7z","2.5.6":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.6-1/rubyinstaller-2.5.6-1-x64.7z","2.5.7":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.7-1/rubyinstaller-2.5.7-1-x64.7z","2.5.8":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.8-2/rubyinstaller-2.5.8-2-x64.7z","2.5.9":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.5.9-1/rubyinstaller-2.5.9-1-x64.7z","2.6.0":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.0-1/rubyinstaller-2.6.0-1-x64.7z","2.6.1":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.1-1/rubyinstaller-2.6.1-1-x64.7z","2.6.2":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.2-1/rubyinstaller-2.6.2-1-x64.7z","2.6.3":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.3-1/rubyinstaller-2.6.3-1-x64.7z","2.6.4":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.4-1/rubyinstaller-2.6.4-1-x64.7z","2.6.5":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.5-1/rubyinstaller-2.6.5-1-x64.7z","2.6.6":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.6-2/rubyinstaller-2.6.6-2-x64.7z","2.6.7":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.7-1/rubyinstaller-2.6.7-1-x64.7z","2.6.8":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.8-1/rubyinstaller-2.6.8-1-x64.7z","2.6.9":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.6.9-1/rubyinstaller-2.6.9-1-x64.7z","2.7.0":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.0-1/rubyinstaller-2.7.0-1-x64.7z","2.7.1":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.1-1/rubyinstaller-2.7.1-1-x64.7z","2.7.2":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.2-1/rubyinstaller-2.7.2-1-x64.7z","2.7.3":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.3-1/rubyinstaller-2.7.3-1-x64.7z","2.7.4":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.4-1/rubyinstaller-2.7.4-1-x64.7z","2.7.5":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.5-1/rubyinstaller-2.7.5-1-x64.7z","3.0.0":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.0-1/rubyinstaller-3.0.0-1-x64.7z","3.0.1":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.1-1/rubyinstaller-3.0.1-1-x64.7z","3.0.2":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.2-1/rubyinstaller-3.0.2-1-x64.7z","3.0.3":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.0.3-1/rubyinstaller-3.0.3-1-x64.7z","3.1.0":"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.0-1/rubyinstaller-3.1.0-1-x64.7z","head":"https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.7z","mingw":"https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mingw.7z","mswin":"https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z","ucrt":"https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z"}'); + +/***/ }), + /***/ 2357: /***/ ((module) => { diff --git a/generate-windows-versions.rb b/generate-windows-versions.rb index 3bafd12..80abc03 100644 --- a/generate-windows-versions.rb +++ b/generate-windows-versions.rb @@ -30,5 +30,5 @@ versions['mingw'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/rub versions['mswin'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-mswin.7z' versions['ucrt'] = 'https://github.com/MSP-Greg/ruby-loco/releases/download/ruby-master/ruby-ucrt.7z' -js = "export const versions = #{JSON.pretty_generate(versions)}\n" -File.binwrite 'windows-versions.js', js +File.binwrite 'windows-versions.json', "#{JSON.pretty_generate(versions)}\n" + diff --git a/ruby-builder-versions.js b/ruby-builder-versions.js deleted file mode 100644 index f74764d..0000000 --- a/ruby-builder-versions.js +++ /dev/null @@ -1,36 +0,0 @@ -export function getVersions(platform) { - const versions = { - "ruby": [ - "1.9.3-p551", - "2.0.0-p648", - "2.1.9", - "2.2.10", - "2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8", - "2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10", - "2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.8", "2.5.9", - "2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9", - "2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5", - "3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3", - "3.1.0-preview1", "3.1.0", - "head", "debug" - ], - "jruby": [ - "9.1.17.0", - "9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0", "9.2.18.0", "9.2.19.0", "9.2.20.0", "9.2.20.1", - "9.3.0.0", "9.3.1.0", "9.3.2.0", - "head" - ], - "truffleruby": [ - "19.3.0", "19.3.1", - "20.0.0", "20.1.0", "20.2.0", "20.3.0", - "21.0.0", "21.1.0", "21.2.0", "21.2.0.1", "21.3.0", - "head" - ], - "truffleruby+graalvm": [ - "21.2.0", "21.3.0", - "head" - ] - } - - return versions -} diff --git a/ruby-builder-versions.json b/ruby-builder-versions.json new file mode 100644 index 0000000..ca6ab3e --- /dev/null +++ b/ruby-builder-versions.json @@ -0,0 +1,32 @@ +{ + "ruby": [ + "1.9.3-p551", + "2.0.0-p648", + "2.1.9", + "2.2.10", + "2.3.0", "2.3.1", "2.3.2", "2.3.3", "2.3.4", "2.3.5", "2.3.6", "2.3.7", "2.3.8", + "2.4.0", "2.4.1", "2.4.2", "2.4.3", "2.4.4", "2.4.5", "2.4.6", "2.4.7", "2.4.9", "2.4.10", + "2.5.0", "2.5.1", "2.5.2", "2.5.3", "2.5.4", "2.5.5", "2.5.6", "2.5.7", "2.5.8", "2.5.9", + "2.6.0", "2.6.1", "2.6.2", "2.6.3", "2.6.4", "2.6.5", "2.6.6", "2.6.7", "2.6.8", "2.6.9", + "2.7.0", "2.7.1", "2.7.2", "2.7.3", "2.7.4", "2.7.5", + "3.0.0-preview1", "3.0.0-preview2", "3.0.0-rc1", "3.0.0", "3.0.1", "3.0.2", "3.0.3", + "3.1.0-preview1", "3.1.0", + "head", "debug" + ], + "jruby": [ + "9.1.17.0", + "9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1", "9.2.12.0", "9.2.13.0", "9.2.14.0", "9.2.15.0", "9.2.16.0", "9.2.17.0", "9.2.18.0", "9.2.19.0", "9.2.20.0", "9.2.20.1", + "9.3.0.0", "9.3.1.0", "9.3.2.0", + "head" + ], + "truffleruby": [ + "19.3.0", "19.3.1", + "20.0.0", "20.1.0", "20.2.0", "20.3.0", + "21.0.0", "21.1.0", "21.2.0", "21.2.0.1", "21.3.0", + "head" + ], + "truffleruby+graalvm": [ + "21.2.0", "21.3.0", + "head" + ] +} diff --git a/ruby-builder.js b/ruby-builder.js index ed8dedb..942cb1e 100644 --- a/ruby-builder.js +++ b/ruby-builder.js @@ -13,7 +13,7 @@ const releasesURL = 'https://github.com/ruby/ruby-builder/releases' const windows = common.windows export function getAvailableVersions(platform, engine) { - return rubyBuilderVersions.getVersions(platform)[engine] + return rubyBuilderVersions[engine] } export async function install(platform, engine, version) { diff --git a/versions-strings-for-builder.rb b/versions-strings-for-builder.rb index 65d2a75..72762ce 100644 --- a/versions-strings-for-builder.rb +++ b/versions-strings-for-builder.rb @@ -1,5 +1,6 @@ -hash = File.read('ruby-builder-versions.js')[/\bversions = {[^}]+}/] -versions = eval hash +require 'json' +hash = File.read('ruby-builder-versions.json') +versions = JSON.load(hash).transform_keys(&:to_sym) by_minor = versions[:ruby].group_by { |v| v[/^\d\.\d/] } diff --git a/windows-versions.js b/windows-versions.json similarity index 99% rename from windows-versions.js rename to windows-versions.json index d2011ea..13acbdb 100644 --- a/windows-versions.js +++ b/windows-versions.json @@ -1,4 +1,4 @@ -export const versions = { +{ "2.0.0": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.0.0-p648/ruby-2.0.0-p648-x64-mingw32.7z", "2.1.9": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.1.9/ruby-2.1.9-x64-mingw32.7z", "2.2.6": "https://github.com/oneclick/rubyinstaller/releases/download/ruby-2.2.6/ruby-2.2.6-x64-mingw32.7z", diff --git a/windows.js b/windows.js index 0226109..be2cd3b 100644 --- a/windows.js +++ b/windows.js @@ -9,7 +9,7 @@ const exec = require('@actions/exec') const io = require('@actions/io') const tc = require('@actions/tool-cache') const common = require('./common') -const rubyInstallerVersions = require('./windows-versions').versions +const rubyInstallerVersions = require('./windows-versions.json') const drive = common.drive