File: update_rubygems_and_install_bundler

package info (click to toggle)
ruby-rspec-rails 7.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,796 kB
  • sloc: ruby: 11,068; sh: 198; makefile: 6
file content (32 lines) | stat: -rwxr-xr-x 650 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# This file is manually managed unlike the rest of core rspec gems because it is independent.

set -e

function is_ruby_3_plus {
  if ruby -e "exit(RUBY_VERSION.to_f >= 3.0)"; then
    return 0
  else
    return 1
  fi
}

function is_ruby_3_1_plus {
  if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then
    return 0
  else
    return 1
  fi
}


if is_ruby_3_1_plus; then
  gem update --no-document --system
  gem install --no-document bundler
elif is_ruby_3_plus; then
  gem update --no-document --system '3.5.23'
  gem install --no-document bundler
else
  gem update --no-document --system '3.4.22'
  gem install --no-document bundler
fi