5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/referral/ensures_working_ruby.rb', line 5
def call
major, minor = RUBY_VERSION.split(".").map(&:to_i)
unless major >= 3 || (major == 2 && minor >= 6)
warn " Error: referral must be run with Ruby 2.6 or later, but this is \#{RUBY_VERSION}.\n You can often analyze older Ruby code by running this CLI with a newer\n Ruby than the code being inspected.\n\n Tools like rbenv may help you manage this issue. If you install\n referral into a supported Ruby, you can specify that it be run with\n an environment variable, even if the current directory is locked\n to an older version of Ruby. Just specify the Ruby you want to use:\n\n RBENV_VERSION=2.6.3 referral\n\n ERROR\n raise Referral::Error.new(\n \"Unsupported Ruby version (expected 2.6.0 or later, was \#{RUBY_VERSION}\"\n )\n end\nend\n".gsub(/^ {10}/, "")
|