aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/rbenv-gem-rehash.rb
blob: 3a4c2531bd6a0f7c851a868da1b15c86dd20e681 (plain)
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
class RbenvGemRehash < Formula
  homepage "https://github.com/sstephenson/rbenv-gem-rehash"
  url "https://github.com/sstephenson/rbenv-gem-rehash/archive/v1.0.0.tar.gz"
  sha1 "40962ef5cda77ff46c0d0a3f262076b58088dd57"

  depends_on "rbenv"

  # Fixes issues with Homebrew-managed git-etc alpha.
  patch do
    url "https://github.com/sstephenson/rbenv-gem-rehash/commit/0756890cfd9c7bbbdde38560fe81626a0c5769bd.diff"
    sha1 "17877b728eda6eaddc199bcd5935fcea757a1c63"
  end

  def install
    prefix.install Dir["*"]
  end

  def caveats; <<-EOS.undent
    If the GEM_PATH environment variable is undefined, rbenv-gem-rehash must
    first execute the gem env gempath command to retrieve RubyGems' default path
    so that it can can append to the path rather than override it. This can take
    a while--from a few hundred milliseconds on MRI to several seconds on
    JRuby--so the default path for the current Ruby version is cached to the
    filesystem the first time it is retrieved.
    EOS
  end

  test do
    assert shell_output("rbenv hooks exec").include?("gem-rehash.bash")
  end
end