mxcl/homebrew — pull request #20564 by wfarr (2013-06-17 20:21:12+00:00)
Title: Use Current symlink instead of hardcoding 1.8 (mavericks-related)

Currently, homebrew hardcodes the use of the actual system ruby to mitigate bad user behavior causing problems. This is absolutely fine.

Right now, though, homebrew hardcodes 1.8 specifically.

This is evidenced in a few spots:

```
/opt/boxen/homebrew[master] (0) » git grep '#!/System/Library/Frameworks/Ruby.framework'
Library/Contributions/cmd/brew-server:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
Library/ENV/4.3/cc:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Library/ENV/4.3/xcrun:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Library/Homebrew/build.rb:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
Library/brew.rb:#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -W0
```

While 1.8.7 _is_ available (for now at least) under Xcode and the CLTs in Mavericks, as far as I understand, it's going to be going away.

Luckily for us, Apple provides a symlink that always points to the current system version at `/System/Library/Frameworks/Ruby.framework/Versions/Current`:

```
/opt/boxen/homebrew[master] (0) » ls -ahl /System/Library/Frameworks/Ruby.framework/Versions/Current
lrwxr-xr-x 1 root wheel 3B Jun 12 14:28 /System/Library/Frameworks/Ruby.framework/Versions/Current -> 2.0
```

I have a Mountain Lion machine sitting next to me confirming this symlink exists under both versions.
This lets homebrew utilize the new default 2.0.0 under Mavericks without breaking existing behavior on older OS X versions.