diff --git a/LICENSE.txt b/LICENSE.txt index dcbdf6e..e8b885f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2023 Cédric Félizard +Copyright (c) 2015-2024 Cédric Félizard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bootstrap_ruby_3.3.sh b/bootstrap_ruby_3.3.sh new file mode 100755 index 0000000..3a0fb64 --- /dev/null +++ b/bootstrap_ruby_3.3.sh @@ -0,0 +1,51 @@ +#!/bin/bash -e + +# Download, configure and install Ruby and Bundler +# https://github.com/infertux/ruby-bootstrap + +VERSION="3.3.0" +SHA256="96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d" + +[ "$1" = "--force" ] && FORCE=1 || FORCE="" + +set -u + +[ $UID -eq 0 ] || { echo "Root required"; exit 1; } + +# Install Ruby and Bundler if they are missing or the force flag is set +if [ -n "$FORCE" ] || ! command -v ruby >/dev/null; then + # wget: to fetch Ruby and pretty useful anyway + # gcc & make: to compile Ruby + # various libs: libraries for Ruby + + if [ -f /etc/debian_version ]; then + apt-get update + apt-get install -y wget gcc make libffi-dev libreadline-dev libssl-dev libyaml-dev zlib1g-dev + elif [ -f /etc/redhat-release ]; then + yum install -y wget gcc make openssl-devel readline-devel zlib-devel + fi + + cd /tmp + wget https://cache.ruby-lang.org/pub/ruby/${VERSION%.*}/ruby-${VERSION}.tar.gz + echo "${SHA256} ruby-${VERSION}.tar.gz" | sha256sum -c - + tar --no-same-owner -xf ruby-${VERSION}.tar.gz + + pushd ruby-${VERSION} + ./configure --disable-install-doc + cpus=$(grep -c processor /proc/cpuinfo) + make -j "$cpus" + make install + popd + + rm -rf ruby-${VERSION}.tar.gz ruby-${VERSION} + + ln -sfv /usr/local/bin/ruby /bin/ruby + ln -sfv /usr/local/bin/gem /bin/gem + ln -sfv /usr/local/bin/bundle /bin/bundle + + ruby -v + gem -v + bundle -v +fi + +echo "All good to go, happy Rubying!" diff --git a/bootstrap_ruby_stable.sh b/bootstrap_ruby_stable.sh index 35f2000..3a0fb64 100755 --- a/bootstrap_ruby_stable.sh +++ b/bootstrap_ruby_stable.sh @@ -3,8 +3,8 @@ # Download, configure and install Ruby and Bundler # https://github.com/infertux/ruby-bootstrap -VERSION="3.2.2" -SHA256="96c57558871a6748de5bc9f274e93f4b5aad06cd8f37befa0e8d94e7b8a423bc" +VERSION="3.3.0" +SHA256="96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d" [ "$1" = "--force" ] && FORCE=1 || FORCE=""