24 Commits

Author SHA1 Message Date
Emre Erhan
cad7f98527
Clean up variable names
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-01-31 15:17:32 -08:00
emreerhan
a1102f253c Remove checks to variable that is not set anywhere 2020-01-30 15:48:41 -08:00
emreerhan
027cc68534 Add condition to check if ruby version is < 2.7 2020-01-30 15:01:26 -08:00
Mike McQuaid
e9aba2efb6
Require and provide portable Ruby 2.6.3. 2019-10-10 15:53:16 +01:00
Mike McQuaid
86f43f79ee
Enable/fix optional Ruby frozen string literal usage
Combined with https://github.com/Homebrew/homebrew-test-bot/pull/247
this will test Homebrew's use of frozen strings in CI. After this we
will then enable it for Homebrew developers and eventually all Homebrew
users.
2019-04-19 10:30:41 +09:00
Mike McQuaid
9e7b98d3e2
Don't check system Ruby is new enough when unnecessary.
We know this is the case in macOS >=10.13.3 so save a Ruby process call.
2019-04-18 21:42:28 +09:00
Mike McQuaid
ef2e297d3b
Disable RubyGems by default.
This speeds up all Ruby invocations where we don't need RubyGems by
around 10%. Where we do need RubyGems: include it manually.
2019-04-18 17:45:03 +09:00
Mike McQuaid
d33c225e47
utils/ruby: don't remove cleanup bundler.
We're sharing this directory now.
2019-02-22 15:59:14 +00:00
Mike McQuaid
a11fe57cd2
cache_store: handle corrupt DBM database.
When the DBM database cannot be read by the current version of Ruby's
DBM library (due to corruption or another incompatibility) it segfaults
or freezes which takes down the entire Homebrew Ruby process.

This isn't desirable so instead perform a shell out with the Homebrew
Ruby to see if it can read the DBM database before we try to use the
information. If this hangs or crashes: silently delete the database and
recreate it.
2018-09-20 10:57:27 +01:00
Mike McQuaid
f2d823445e ruby.sh: remove linkage cache on upgrade.
This may not be compatible between portable ruby versions and between
portable and system ruby versions.

Fixes #4485.
2018-07-18 14:09:43 +01:00
Mike McQuaid
9b86ff6214 ruby.sh: cleanup gems on portable Ruby installation.
This avoids `brew style` and friends from getting upset when they
attempt to use the native gem extensions from a previous portable Ruby
or a system Ruby.

ABI? What's that?
2018-07-13 14:37:12 +01:00
Mike McQuaid
e1eb7dd3e3 Use Ruby 2.3.7
Fixes #4459.
2018-07-13 08:22:33 +01:00
Buck Evan
0a2e649f00 type -P is more portable than which
Migrated from https://github.com/Linuxbrew/brew/pull/621
2018-03-18 16:51:22 -07:00
Mike McQuaid
78933b3ee9 ruby.sh: fix version check.
- Rather than checking for the absence of a failure check for an actual success in the check
- Fix the check to work on Ruby 1.9 (where `RUBY_VERSION.to_s.dup` is required to avoid modifying a frozen string).
2018-01-26 21:47:33 +00:00
Shaun Jackman
7a0488e803 setup-ruby-path: Ensure that Ruby is installed
Fix the error:
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.sh: line 372:
exec: : not found
2017-10-17 15:14:58 -07:00
Mike McQuaid
598ea0cdec portable-ruby: fix installation on Leopard.
Download it insecurely there and require `rubygems` for `Gem::Version`.
2017-09-25 15:46:58 +01:00
Mike McQuaid
aa665b9458 portable-ruby: improve installation messaging.
- Use “Pouring” to be more consistent with our normal messaging.
- Don’t be silent by default.
2017-09-22 15:54:29 +01:00
Mike McQuaid
b2b413165f Upgrade vendored Ruby to 2.3.3.
Use this version whenever 2.3.3 isn't installed. Also, remove the Linux
portable Ruby for now until it's built to be the same version.
2017-09-21 14:27:17 +01:00
Mike McQuaid
3f9cce0a03 Use new "macOS" naming where appropriate.
Not quite a mass replacement as I've used OS X and Mac OS X where
describing specific older versions and added compatibility methods
for things in the DSL.
2016-09-18 19:57:19 +01:00
Mike McQuaid
4eaa40ae1f Enable vendored Ruby 2.0. 2016-08-10 20:06:14 +01:00
Mike McQuaid
5a2eaf9a12 ruby.sh: allow forcing the usage of the vendored Ruby. 2016-07-12 08:51:36 +01:00
Mike McQuaid
b418fe94c8 ruby.sh: fix original setup ruby path name. 2016-07-12 08:51:36 +01:00
Xu Cheng
dff6bfde9a
ruby.sh: add test flag 2016-07-11 21:12:57 +08:00
Xu Cheng
534bf08ec3
brew.sh: new HOMEBREW_RUBY_PATH resolution logic
* Use vendor Ruby if it's present
* Install vendor Ruby for system without Ruby 2.x
2016-07-11 21:12:56 +08:00