From 1f995aacb31cf12451c86ee8b16d83d637e6844e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 05:02:51 +0000 Subject: [PATCH 1/8] Bump actions/setup-go from 4 to 5 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b394e9..906b6b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} From 7fb2d1e968b203b28be6ffeecb71af4500ad5833 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 03:23:13 +0000 Subject: [PATCH 2/8] Bump github.com/essentialkaos/ek/v12 from 12.90.1 to 12.91.0 Bumps [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek) from 12.90.1 to 12.91.0. - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.90.1...v12.91.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 42982f7..1ea4f40 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.1.0 - github.com/essentialkaos/ek/v12 v12.90.1 + github.com/essentialkaos/ek/v12 v12.91.0 github.com/essentialkaos/npck v1.6.1 ) diff --git a/go.sum b/go.sum index d2b838e..5fc46f7 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.1.0 h1:U6dp687UkQwXlZU17Hg2KMxbp3nfZAoZ8duaeUFYvJI= github.com/essentialkaos/depsy v1.1.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.90.1 h1:ID950cnz4xgpqqFzhleP5xaVoLnPwuiykdH3FrogD/E= -github.com/essentialkaos/ek/v12 v12.90.1/go.mod h1:9efMqo1S8EtYhmeelOSTmMQDGC2vRgPkjkKKfvUD2eU= +github.com/essentialkaos/ek/v12 v12.91.0 h1:xgSMRmcOz7qMlkmKdw1YCMsLhkVdUNsS64ns4ACgTjc= +github.com/essentialkaos/ek/v12 v12.91.0/go.mod h1:9efMqo1S8EtYhmeelOSTmMQDGC2vRgPkjkKKfvUD2eU= github.com/essentialkaos/go-linenoise/v3 v3.4.0 h1:g72w8x+/HIwOMBVvNaPYp+wMWVHrYZwzFAF7OfZR5Ts= github.com/essentialkaos/go-linenoise/v3 v3.4.0/go.mod h1:t1kNLY2bSMQCy1JXOefD2BDLs/TTPMtTv3DFNV5uDSI= github.com/essentialkaos/npck v1.6.1 h1:cFhLRRFNbl7tBXQD2+EkzTHy6y7+oxfvwsVgbhaFvUg= From fcb4472de5355ceaf95868c2a72b4068571a8bcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 03:15:04 +0000 Subject: [PATCH 3/8] Bump github.com/essentialkaos/ek/v12 from 12.91.0 to 12.92.0 Bumps [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek) from 12.91.0 to 12.92.0. - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.91.0...v12.92.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1ea4f40..3fa2921 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.1.0 - github.com/essentialkaos/ek/v12 v12.91.0 + github.com/essentialkaos/ek/v12 v12.92.0 github.com/essentialkaos/npck v1.6.1 ) diff --git a/go.sum b/go.sum index 5fc46f7..2f26865 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.1.0 h1:U6dp687UkQwXlZU17Hg2KMxbp3nfZAoZ8duaeUFYvJI= github.com/essentialkaos/depsy v1.1.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.91.0 h1:xgSMRmcOz7qMlkmKdw1YCMsLhkVdUNsS64ns4ACgTjc= -github.com/essentialkaos/ek/v12 v12.91.0/go.mod h1:9efMqo1S8EtYhmeelOSTmMQDGC2vRgPkjkKKfvUD2eU= +github.com/essentialkaos/ek/v12 v12.92.0 h1:3JIkHWNA6MNkJOfqzMWJ8jN9sRM7nRi7URoFRVFHZzI= +github.com/essentialkaos/ek/v12 v12.92.0/go.mod h1:9efMqo1S8EtYhmeelOSTmMQDGC2vRgPkjkKKfvUD2eU= github.com/essentialkaos/go-linenoise/v3 v3.4.0 h1:g72w8x+/HIwOMBVvNaPYp+wMWVHrYZwzFAF7OfZR5Ts= github.com/essentialkaos/go-linenoise/v3 v3.4.0/go.mod h1:t1kNLY2bSMQCy1JXOefD2BDLs/TTPMtTv3DFNV5uDSI= github.com/essentialkaos/npck v1.6.1 h1:cFhLRRFNbl7tBXQD2+EkzTHy6y7+oxfvwsVgbhaFvUg= From db4547eb3487dd4fe6684b07abe62144fddb79df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 04:19:50 +0000 Subject: [PATCH 4/8] Bump github/codeql-action from 2 to 3 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 327a97e..244ec03 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,9 +25,9 @@ jobs: fetch-depth: 2 - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: go - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From 33f070c3ad7b4f389163456b052cfd511ae102b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 04:02:15 +0000 Subject: [PATCH 5/8] Bump github.com/essentialkaos/npck from 1.6.1 to 1.6.2 Bumps [github.com/essentialkaos/npck](https://github.com/essentialkaos/npck) from 1.6.1 to 1.6.2. - [Release notes](https://github.com/essentialkaos/npck/releases) - [Commits](https://github.com/essentialkaos/npck/compare/v1.6.1...v1.6.2) --- updated-dependencies: - dependency-name: github.com/essentialkaos/npck dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 3fa2921..e1f473a 100644 --- a/go.mod +++ b/go.mod @@ -5,12 +5,12 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.1.0 github.com/essentialkaos/ek/v12 v12.92.0 - github.com/essentialkaos/npck v1.6.1 + github.com/essentialkaos/npck v1.6.2 ) require ( github.com/essentialkaos/go-linenoise/v3 v3.4.0 // indirect - github.com/klauspost/compress v1.17.1 // indirect + github.com/klauspost/compress v1.17.4 // indirect golang.org/x/crypto v0.16.0 // indirect golang.org/x/sys v0.15.0 // indirect ) diff --git a/go.sum b/go.sum index 2f26865..6895e63 100644 --- a/go.sum +++ b/go.sum @@ -5,10 +5,10 @@ github.com/essentialkaos/ek/v12 v12.92.0 h1:3JIkHWNA6MNkJOfqzMWJ8jN9sRM7nRi7URoF github.com/essentialkaos/ek/v12 v12.92.0/go.mod h1:9efMqo1S8EtYhmeelOSTmMQDGC2vRgPkjkKKfvUD2eU= github.com/essentialkaos/go-linenoise/v3 v3.4.0 h1:g72w8x+/HIwOMBVvNaPYp+wMWVHrYZwzFAF7OfZR5Ts= github.com/essentialkaos/go-linenoise/v3 v3.4.0/go.mod h1:t1kNLY2bSMQCy1JXOefD2BDLs/TTPMtTv3DFNV5uDSI= -github.com/essentialkaos/npck v1.6.1 h1:cFhLRRFNbl7tBXQD2+EkzTHy6y7+oxfvwsVgbhaFvUg= -github.com/essentialkaos/npck v1.6.1/go.mod h1:Leny9a2R4otIGqZdnrs8swhI9KvwO+Rmmn2zThpPoN4= -github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g= -github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/essentialkaos/npck v1.6.2 h1:OqV74UfA9qoRYbFVsZ+KYH9kY//1nU6uX/HBfAltUQ4= +github.com/essentialkaos/npck v1.6.2/go.mod h1:7ziKy4mdUrSMTihDTZKAaxf6uDH2uAlOzsD3Mj2WTyI= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= From c1c5201a3cc4a16a2addc5e2c6cdbefd04800f6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 03:49:52 +0000 Subject: [PATCH 6/8] Bump github.com/essentialkaos/ek/v12 from 12.92.0 to 12.93.0 Bumps [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek) from 12.92.0 to 12.93.0. - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.92.0...v12.93.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index e1f473a..10ea326 100644 --- a/go.mod +++ b/go.mod @@ -4,13 +4,13 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.1.0 - github.com/essentialkaos/ek/v12 v12.92.0 + github.com/essentialkaos/ek/v12 v12.93.0 github.com/essentialkaos/npck v1.6.2 ) require ( github.com/essentialkaos/go-linenoise/v3 v3.4.0 // indirect github.com/klauspost/compress v1.17.4 // indirect - golang.org/x/crypto v0.16.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/crypto v0.18.0 // indirect + golang.org/x/sys v0.16.0 // indirect ) diff --git a/go.sum b/go.sum index 6895e63..81e5ef5 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.1.0 h1:U6dp687UkQwXlZU17Hg2KMxbp3nfZAoZ8duaeUFYvJI= github.com/essentialkaos/depsy v1.1.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8= -github.com/essentialkaos/ek/v12 v12.92.0 h1:3JIkHWNA6MNkJOfqzMWJ8jN9sRM7nRi7URoFRVFHZzI= -github.com/essentialkaos/ek/v12 v12.92.0/go.mod h1:9efMqo1S8EtYhmeelOSTmMQDGC2vRgPkjkKKfvUD2eU= +github.com/essentialkaos/ek/v12 v12.93.0 h1:5lwuNYgUYjQHy2h57adWt2t1w5L2MxqTPKgHjyH3h6k= +github.com/essentialkaos/ek/v12 v12.93.0/go.mod h1:peB5w8zUkRuDs7m/QG5Z2gMmqzSIs2viAmxzzNFIIoo= github.com/essentialkaos/go-linenoise/v3 v3.4.0 h1:g72w8x+/HIwOMBVvNaPYp+wMWVHrYZwzFAF7OfZR5Ts= github.com/essentialkaos/go-linenoise/v3 v3.4.0/go.mod h1:t1kNLY2bSMQCy1JXOefD2BDLs/TTPMtTv3DFNV5uDSI= github.com/essentialkaos/npck v1.6.2 h1:OqV74UfA9qoRYbFVsZ+KYH9kY//1nU6uX/HBfAltUQ4= @@ -12,7 +12,7 @@ github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6K github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= From 4a5550c4dd6da3f5926ea2b68c1d5eb9803bec6a Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 12 Jan 2024 16:18:36 +0300 Subject: [PATCH 7/8] Improvements --- cli/cli.go | 46 +++++++++++++++++++++------------------- clone/clone.go | 11 +++------- common/eol.json | 1 + common/rbinstall.knf | 3 +++ common/rbinstall.spec | 11 +++++++--- gen/gen.go | 12 +++++------ support/support_linux.go | 1 + 7 files changed, 46 insertions(+), 39 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index cb20c6b..057d0a9 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -41,7 +41,6 @@ import ( "github.com/essentialkaos/ek/v12/system" "github.com/essentialkaos/ek/v12/terminal" "github.com/essentialkaos/ek/v12/terminal/tty" - "github.com/essentialkaos/ek/v12/terminal/window" "github.com/essentialkaos/ek/v12/timeutil" "github.com/essentialkaos/ek/v12/tmp" "github.com/essentialkaos/ek/v12/usage" @@ -67,7 +66,7 @@ import ( // App info const ( APP = "RBInstall" - VER = "3.2.0" + VER = "3.3.0" DESC = "Utility for installing prebuilt Ruby versions to rbenv" ) @@ -106,6 +105,7 @@ const ( RBENV_ALLOW_UNINSTALL = "rbenv:allow-uninstall" RBENV_MAKE_ALIAS = "rbenv:make-alias" GEMS_RUBYGEMS_UPDATE = "gems:rubygems-update" + GEMS_RUBYGEMS_VERSION = "gems:rubygems-version" GEMS_ALLOW_UPDATE = "gems:allow-update" GEMS_NO_DOCUMENT = "gems:no-document" GEMS_SOURCE = "gems:source" @@ -136,11 +136,6 @@ const ( ARCH_ARM = "arm" ) -// RubyGems versions used for old versions of Ruby -const ( - MIN_RUBYGEMS_VERSION_BASE = "2.7.9" -) - // ////////////////////////////////////////////////////////////////////////////////// // var optMap = options.Map{ @@ -1144,7 +1139,7 @@ func runGemCmd(rubyVersion, cmd, gem, gemVersion string) (string, error) { if gemVersion == "" { gemVersion = "latest" - } else { + } else if strings.Count(gemVersion, ".") < 2 { gemVersion += ".x" } @@ -1357,7 +1352,7 @@ func getInstallBullet(installed bool, color string) string { } // printSized render format with given size and print text with give arguments -func printSized(format string, size int, a ...interface{}) { +func printSized(format string, size int, a ...any) { fmtc.Printf(fmtc.Sprintf(format, size), a...) } @@ -1368,7 +1363,7 @@ func printRubyVersion(category, name string) { // configureCategorySizes configure column size for each category func configureCategorySizes(data map[string]index.CategoryData) { - terminalWidth := window.GetWidth() + terminalWidth := tty.GetWidth() if terminalWidth == -1 || terminalWidth > 150 { categorySize[index.CATEGORY_RUBY] = DEFAULT_CATEGORY_SIZE @@ -1477,12 +1472,7 @@ func isVersionInstalled(rubyVersion string) bool { // getVersionFromFile try to read version file and return defined version func getVersionFromFile() (string, error) { - versionFile := fsutil.ProperPath("FRS", - []string{ - ".ruby-version", - ".rbenv-version", - }, - ) + versionFile := fsutil.ProperPath("FRS", []string{".ruby-version", ".rbenv-version"}) if versionFile == "" { return "", fmtc.Errorf("Can't find proper version file") @@ -1506,14 +1496,26 @@ func getVersionFromFile() (string, error) { // getAdvisableRubyGemsVersion returns recommended RubyGems version for // given version of Ruby func getAdvisableRubyGemsVersion(rubyVersion string) string { - v, err := version.Parse(strutil.ReadField(rubyVersion, 0, false, "-")) - minVer, _ := version.Parse("2.3.0") + ver, err := version.Parse(strutil.ReadField(rubyVersion, 0, false, "-")) - if err != nil || v.Less(minVer) { - return MIN_RUBYGEMS_VERSION_BASE + if err != nil { + return "2.3" + } + + v23, _ := version.Parse("2.3.0") + v26, _ := version.Parse("2.6.0") + v30, _ := version.Parse("3.0.0") + + switch { + case ver.Less(v23): + return "2.3" + case ver.Less(v26): + return "3.3" + case ver.Less(v30): + return "3.4" } - return "latest" + return knf.GetS(GEMS_RUBYGEMS_VERSION, "latest") } // getVersionInfo finds info about given version in index @@ -1773,7 +1775,7 @@ func intSignalHandler() { } // printErrorAndExit print error message and exit with non-zero exit code -func printErrorAndExit(f string, a ...interface{}) { +func printErrorAndExit(f string, a ...any) { terminal.Error(f, a...) exit(1) } diff --git a/clone/clone.go b/clone/clone.go index d82b7c7..787e015 100644 --- a/clone/clone.go +++ b/clone/clone.go @@ -43,7 +43,7 @@ import ( // App info const ( APP = "RBInstall Clone" - VER = "3.1.0" + VER = "3.1.1" DESC = "Utility for cloning RBInstall repository" ) @@ -462,17 +462,12 @@ func getCurrentIndexUUID(dir string) string { } // printError prints error message to console -func printError(f string, a ...interface{}) { +func printError(f string, a ...any) { fmtc.Fprintf(os.Stderr, "{r}▲ "+f+"{!}\n", a...) } -// printError prints warning message to console -func printWarn(f string, a ...interface{}) { - fmtc.Fprintf(os.Stderr, "{y}▲ "+f+"{!}\n", a...) -} - // printErrorAndExit print error message and exit with non-zero exit code -func printErrorAndExit(f string, a ...interface{}) { +func printErrorAndExit(f string, a ...any) { fmtc.Fprintf(os.Stderr, "{r}▲ "+f+"{!}\n", a...) fmtc.NewLine() os.Exit(1) diff --git a/common/eol.json b/common/eol.json index 9871f22..4767976 100644 --- a/common/eol.json +++ b/common/eol.json @@ -8,6 +8,7 @@ "2.4": true, "2.5": true, "2.6": true, + "2.7": true, "jruby-1.6": true, "jruby-1.7": true, "jruby-9.0": true, diff --git a/common/rbinstall.knf b/common/rbinstall.knf index 69e09c5..5606e05 100644 --- a/common/rbinstall.knf +++ b/common/rbinstall.knf @@ -37,6 +37,9 @@ # Update rubygems gem rubygems-update: true + # Update rubygems gem to defined version + rubygems-version: latest + # Allow gems update allow-update: true diff --git a/common/rbinstall.spec b/common/rbinstall.spec index b2c7904..ae0a082 100644 --- a/common/rbinstall.spec +++ b/common/rbinstall.spec @@ -10,7 +10,7 @@ Summary: Utility for installing prebuilt Ruby to rbenv Name: rbinstall -Version: 3.2.0 +Version: 3.3.0 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -38,7 +38,7 @@ Utility for installing different prebuilt versions of Ruby to rbenv. %package gen Summary: Utility for generating RBInstall index -Version: 3.2.0 +Version: 3.2.1 Release: 0%{?dist} Group: Development/Tools @@ -50,7 +50,7 @@ Utility for generating RBInstall index. %package clone Summary: Utility for cloning RBInstall repository -Version: 3.1.0 +Version: 3.1.1 Release: 0%{?dist} Group: Development/Tools @@ -118,6 +118,11 @@ rm -rf %{buildroot} ################################################################################ %changelog +* Fri Jan 12 2024 Anton Novojilov - 3.3.0-0 +- [cli] Improved rubygems gem update +- [cli|gen|clone] Code refactoring +- Dependencies update + * Wed Dec 06 2023 Anton Novojilov - 3.2.0-0 - [cli] Added '-P'/'--pager' option to use pager for long output of versions - [cli|gen|clone] Improve verbose version info diff --git a/gen/gen.go b/gen/gen.go index bdc1e46..511aa1c 100644 --- a/gen/gen.go +++ b/gen/gen.go @@ -41,7 +41,7 @@ import ( // App info const ( APP = "RBInstall Gen" - VER = "3.2.0" + VER = "3.2.1" DESC = "Utility for generating RBInstall index" ) @@ -94,8 +94,8 @@ var optMap = options.Map{ OPT_EOL: {Value: "eol.json"}, OPT_ALIAS: {Value: "alias.json"}, OPT_NO_COLOR: {Type: options.BOOL}, - OPT_HELP: {Type: options.BOOL, Alias: "u:usage"}, - OPT_VER: {Type: options.BOOL, Alias: "ver"}, + OPT_HELP: {Type: options.BOOL}, + OPT_VER: {Type: options.BOOL}, OPT_VERB_VER: {Type: options.BOOL}, OPT_COMPLETION: {}, @@ -518,17 +518,17 @@ func fmtVersionName(v string) string { } // printError prints error message to console -func printError(f string, a ...interface{}) { +func printError(f string, a ...any) { fmtc.Fprintf(os.Stderr, "{r}"+f+"{!}\n", a...) } // printError prints warning message to console -func printWarn(f string, a ...interface{}) { +func printWarn(f string, a ...any) { fmtc.Fprintf(os.Stderr, "{y}"+f+"{!}\n", a...) } // printErrorAndExit print error message and exit with non-zero exit code -func printErrorAndExit(f string, a ...interface{}) { +func printErrorAndExit(f string, a ...any) { fmtc.Fprintf(os.Stderr, "{r}"+f+"{!}\n", a...) os.Exit(1) } diff --git a/support/support_linux.go b/support/support_linux.go index 9068a93..a15c78d 100644 --- a/support/support_linux.go +++ b/support/support_linux.go @@ -86,6 +86,7 @@ func collectEnvInfo() Pkgs { getPackageInfo("rbenv"), getPackageInfo("jemalloc"), getPackageInfo("zlib"), + getPackageInfo("gcc"), getPackageInfo( "jre8", "jre11", "jre17", "jdk8", "jdk11", "jdk17", "java-1.8.0-openjdk", "java-11-openjdk", "java-17-openjdk", From f60b97198ffc4893500b7585f252c00a06f413dc Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 12 Jan 2024 16:32:24 +0300 Subject: [PATCH 8/8] [cli] UI improvements --- cli/cli.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/cli.go b/cli/cli.go index 057d0a9..6273ef2 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -746,8 +746,13 @@ func installVersion(rubyVersion string, reinstall bool) { if knf.GetB(GEMS_RUBYGEMS_UPDATE) && strutil.HasPrefixAny(info.Name, "1", "2", "3") { rgVersion := getAdvisableRubyGemsVersion(info.Name) + gemVersion := rgVersion - spinner.Show("Updating RubyGems to %s", rgVersion) + if gemVersion != "latest" && strings.Count(gemVersion, ".") < 2 { + gemVersion += ".x" + } + + spinner.Show("Updating RubyGems to %s", gemVersion) err = updateRubygemsTaskHandler(info.Name, rgVersion) spinner.Done(err == nil)