diff options
| author | Xu Cheng | 2015-02-03 20:08:28 +0800 | 
|---|---|---|
| committer | Mike McQuaid | 2015-02-03 16:20:42 +0000 | 
| commit | a1274f07faaefe4762831cc6903194a18e022c55 (patch) | |
| tree | 15dc6d1cb59137f85aa0e61c7a64b358c5de41ba | |
| parent | 9b9c6e954776ff2fe079841a643d577843d85100 (diff) | |
| download | homebrew-a1274f07faaefe4762831cc6903194a18e022c55.tar.bz2 | |
modernize and add test for rbenv and its family
Closes #36496.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
| -rw-r--r-- | Library/Formula/rbenv-aliases.rb | 18 | ||||
| -rw-r--r-- | Library/Formula/rbenv-binstubs.rb | 6 | ||||
| -rw-r--r-- | Library/Formula/rbenv-bundle-exec.rb | 6 | ||||
| -rw-r--r-- | Library/Formula/rbenv-bundler-ruby-version.rb | 4 | ||||
| -rw-r--r-- | Library/Formula/rbenv-bundler.rb | 18 | ||||
| -rw-r--r-- | Library/Formula/rbenv-communal-gems.rb | 16 | ||||
| -rw-r--r-- | Library/Formula/rbenv-ctags.rb | 20 | ||||
| -rw-r--r-- | Library/Formula/rbenv-default-gems.rb | 20 | ||||
| -rw-r--r-- | Library/Formula/rbenv-gem-rehash.rb | 16 | ||||
| -rw-r--r-- | Library/Formula/rbenv-gemset.rb | 18 | ||||
| -rw-r--r-- | Library/Formula/rbenv-readline.rb | 22 | ||||
| -rw-r--r-- | Library/Formula/rbenv-use.rb | 18 | ||||
| -rw-r--r-- | Library/Formula/rbenv-vars.rb | 18 | ||||
| -rw-r--r-- | Library/Formula/rbenv-whatis.rb | 16 | ||||
| -rw-r--r-- | Library/Formula/rbenv.rb | 18 | 
15 files changed, 130 insertions, 104 deletions
| diff --git a/Library/Formula/rbenv-aliases.rb b/Library/Formula/rbenv-aliases.rb index 1a19f3eba..bce7684c9 100644 --- a/Library/Formula/rbenv-aliases.rb +++ b/Library/Formula/rbenv-aliases.rb @@ -1,15 +1,17 @@ -require 'formula' -  class RbenvAliases < Formula -  homepage 'https://github.com/tpope/rbenv-aliases' -  url 'https://github.com/tpope/rbenv-aliases/archive/v1.0.1.tar.gz' -  sha1 '7fcfe5ea3011c5f9e00ad41d85bebc2d19869b61' +  homepage "https://github.com/tpope/rbenv-aliases" +  url "https://github.com/tpope/rbenv-aliases/archive/v1.0.1.tar.gz" +  sha1 "7fcfe5ea3011c5f9e00ad41d85bebc2d19869b61" -  head 'https://github.com/tpope/rbenv-aliases.git' +  head "https://github.com/tpope/rbenv-aliases.git" -  depends_on 'rbenv' +  depends_on "rbenv"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    assert shell_output("rbenv hooks install").include? "autoalias.bash"    end  end diff --git a/Library/Formula/rbenv-binstubs.rb b/Library/Formula/rbenv-binstubs.rb index 5f34fe945..273fca314 100644 --- a/Library/Formula/rbenv-binstubs.rb +++ b/Library/Formula/rbenv-binstubs.rb @@ -1,5 +1,3 @@ -require "formula" -  class RbenvBinstubs < Formula    homepage "https://github.com/ianheggie/rbenv-binstubs"    url "https://github.com/ianheggie/rbenv-binstubs/archive/v1.4.tar.gz" @@ -12,4 +10,8 @@ class RbenvBinstubs < Formula    def install      prefix.install Dir["*"]    end + +  test do +    assert shell_output("rbenv hooks exec").include? "rbenv-binstubs.bash" +  end  end diff --git a/Library/Formula/rbenv-bundle-exec.rb b/Library/Formula/rbenv-bundle-exec.rb index 866bf9b7c..4eace6b59 100644 --- a/Library/Formula/rbenv-bundle-exec.rb +++ b/Library/Formula/rbenv-bundle-exec.rb @@ -1,5 +1,3 @@ -require "formula" -  class RbenvBundleExec < Formula    homepage "https://github.com/maljub01/rbenv-bundle-exec"    url "https://github.com/maljub01/rbenv-bundle-exec/archive/v1.0.0.tar.gz" @@ -12,4 +10,8 @@ class RbenvBundleExec < Formula    def install      prefix.install Dir["*"]    end + +  test do +    assert shell_output("rbenv hooks exec").include? "bundle-exec.bash" +  end  end diff --git a/Library/Formula/rbenv-bundler-ruby-version.rb b/Library/Formula/rbenv-bundler-ruby-version.rb index a71c5fcf4..bf00b04ab 100644 --- a/Library/Formula/rbenv-bundler-ruby-version.rb +++ b/Library/Formula/rbenv-bundler-ruby-version.rb @@ -1,5 +1,3 @@ -require "formula" -  class RbenvBundlerRubyVersion < Formula    homepage "https://github.com/aripollak/rbenv-bundler-ruby-version"    url "https://github.com/aripollak/rbenv-bundler-ruby-version/archive/v0.1.tar.gz" @@ -15,6 +13,6 @@ class RbenvBundlerRubyVersion < Formula    test do      (testpath/"Gemfile").write("ruby \"2.1.5\"") -    system "rbenv bundler-ruby-version" +    system "rbenv", "bundler-ruby-version"    end  end diff --git a/Library/Formula/rbenv-bundler.rb b/Library/Formula/rbenv-bundler.rb index c5ed9a98c..dfddca31c 100644 --- a/Library/Formula/rbenv-bundler.rb +++ b/Library/Formula/rbenv-bundler.rb @@ -1,14 +1,16 @@ -require 'formula' -  class RbenvBundler < Formula -  homepage 'https://github.com/carsomyr/rbenv-bundler' -  url 'https://github.com/carsomyr/rbenv-bundler/archive/0.99.tar.gz' -  sha1 '21dd20ee363d8b8c0807e659ffa2d572c67848b5' -  head 'https://github.com/carsomyr/rbenv-bundler.git' +  homepage "https://github.com/carsomyr/rbenv-bundler" +  url "https://github.com/carsomyr/rbenv-bundler/archive/0.99.tar.gz" +  sha1 "21dd20ee363d8b8c0807e659ffa2d572c67848b5" +  head "https://github.com/carsomyr/rbenv-bundler.git" -  depends_on 'rbenv' +  depends_on "rbenv"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    assert shell_output("rbenv hooks exec").include? "bundler.bash"    end  end diff --git a/Library/Formula/rbenv-communal-gems.rb b/Library/Formula/rbenv-communal-gems.rb index dc33939bf..5f62403df 100644 --- a/Library/Formula/rbenv-communal-gems.rb +++ b/Library/Formula/rbenv-communal-gems.rb @@ -1,13 +1,15 @@ -require 'formula' -  class RbenvCommunalGems < Formula -  homepage 'https://github.com/tpope/rbenv-communal-gems' -  url 'https://github.com/tpope/rbenv-communal-gems/archive/v1.0.1.tar.gz' -  sha1 '39360238e89f2d723409c3de2a4132f561de7bb9' +  homepage "https://github.com/tpope/rbenv-communal-gems" +  url "https://github.com/tpope/rbenv-communal-gems/archive/v1.0.1.tar.gz" +  sha1 "39360238e89f2d723409c3de2a4132f561de7bb9" -  depends_on 'rbenv' +  depends_on "rbenv"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    assert shell_output("rbenv hooks install").include? "communal-gems.bash"    end  end diff --git a/Library/Formula/rbenv-ctags.rb b/Library/Formula/rbenv-ctags.rb index 20550f98e..2e914f46a 100644 --- a/Library/Formula/rbenv-ctags.rb +++ b/Library/Formula/rbenv-ctags.rb @@ -1,16 +1,18 @@ -require 'formula' -  class RbenvCtags < Formula -  homepage 'https://github.com/tpope/rbenv-ctags' -  url 'https://github.com/tpope/rbenv-ctags/archive/v1.0.1.tar.gz' -  sha1 '551ce03a0f6709dd2209c2bd319344f521769420' +  homepage "https://github.com/tpope/rbenv-ctags" +  url "https://github.com/tpope/rbenv-ctags/archive/v1.0.1.tar.gz" +  sha1 "551ce03a0f6709dd2209c2bd319344f521769420" -  head 'https://github.com/tpope/rbenv-ctags.git' +  head "https://github.com/tpope/rbenv-ctags.git" -  depends_on 'rbenv' -  depends_on 'ctags' +  depends_on "rbenv" +  depends_on "ctags"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    assert shell_output("rbenv hooks install").include? "ctags.bash"    end  end diff --git a/Library/Formula/rbenv-default-gems.rb b/Library/Formula/rbenv-default-gems.rb index 6fd86236a..3a9bfd91c 100644 --- a/Library/Formula/rbenv-default-gems.rb +++ b/Library/Formula/rbenv-default-gems.rb @@ -1,14 +1,12 @@ -require 'formula' -  class RbenvDefaultGems < Formula -  homepage 'https://github.com/sstephenson/rbenv-default-gems' -  url 'https://github.com/sstephenson/rbenv-default-gems/archive/v1.0.0.tar.gz' -  sha1 'e79c7073909e24e866df49cf9eb3f18aa8872842' +  homepage "https://github.com/sstephenson/rbenv-default-gems" +  url "https://github.com/sstephenson/rbenv-default-gems/archive/v1.0.0.tar.gz" +  sha1 "e79c7073909e24e866df49cf9eb3f18aa8872842" -  head 'https://github.com/sstephenson/rbenv-default-gems.git' +  head "https://github.com/sstephenson/rbenv-default-gems.git" -  depends_on 'rbenv' -  depends_on 'ruby-build' +  depends_on "rbenv" +  depends_on "ruby-build"    # Upstream patch: https://github.com/sstephenson/rbenv-default-gems/pull/3    patch do @@ -17,6 +15,10 @@ class RbenvDefaultGems < Formula    end    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    assert shell_output("rbenv hooks install").include? "default-gems.bash"    end  end diff --git a/Library/Formula/rbenv-gem-rehash.rb b/Library/Formula/rbenv-gem-rehash.rb index 249629624..3a4c2531b 100644 --- a/Library/Formula/rbenv-gem-rehash.rb +++ b/Library/Formula/rbenv-gem-rehash.rb @@ -1,11 +1,9 @@ -require 'formula' -  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' +  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' +  depends_on "rbenv"    # Fixes issues with Homebrew-managed git-etc alpha.    patch do @@ -14,7 +12,7 @@ class RbenvGemRehash < Formula    end    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"]    end    def caveats; <<-EOS.undent @@ -26,4 +24,8 @@ class RbenvGemRehash < Formula      filesystem the first time it is retrieved.      EOS    end + +  test do +    assert shell_output("rbenv hooks exec").include?("gem-rehash.bash") +  end  end diff --git a/Library/Formula/rbenv-gemset.rb b/Library/Formula/rbenv-gemset.rb index c78475974..bfd460845 100644 --- a/Library/Formula/rbenv-gemset.rb +++ b/Library/Formula/rbenv-gemset.rb @@ -1,15 +1,17 @@ -require 'formula' -  class RbenvGemset < Formula -  homepage 'https://github.com/jf/rbenv-gemset' -  url 'https://github.com/jf/rbenv-gemset/archive/v0.5.8.tar.gz' -  sha1 'bd06efff2fcfaeb47bd32dc1658e4aae5d8a0619' +  homepage "https://github.com/jf/rbenv-gemset" +  url "https://github.com/jf/rbenv-gemset/archive/v0.5.8.tar.gz" +  sha1 "bd06efff2fcfaeb47bd32dc1658e4aae5d8a0619" -  head 'https://github.com/jf/rbenv-gemset.git' +  head "https://github.com/jf/rbenv-gemset.git" -  depends_on 'rbenv' +  depends_on "rbenv"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    assert shell_output("rbenv hooks exec").include? "gemset.bash"    end  end diff --git a/Library/Formula/rbenv-readline.rb b/Library/Formula/rbenv-readline.rb index 307198441..7cf3f5982 100644 --- a/Library/Formula/rbenv-readline.rb +++ b/Library/Formula/rbenv-readline.rb @@ -1,17 +1,19 @@ -require 'formula' -  class RbenvReadline < Formula -  homepage 'https://github.com/tpope/rbenv-readline' -  url 'https://github.com/tpope/rbenv-readline/archive/v1.0.0.tar.gz' -  sha1 '2b9484548bb9ea6a72757a0ff750e48b74b9e1f7' +  homepage "https://github.com/tpope/rbenv-readline" +  url "https://github.com/tpope/rbenv-readline/archive/v1.0.0.tar.gz" +  sha1 "2b9484548bb9ea6a72757a0ff750e48b74b9e1f7" -  head 'https://github.com/tpope/rbenv-readline.git' +  head "https://github.com/tpope/rbenv-readline.git" -  depends_on 'rbenv' -  depends_on 'ruby-build' -  depends_on 'readline' +  depends_on "rbenv" +  depends_on "ruby-build" +  depends_on "readline"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    assert shell_output("rbenv hooks install").include? "readline-brew.bash"    end  end diff --git a/Library/Formula/rbenv-use.rb b/Library/Formula/rbenv-use.rb index 3af898abb..7c6c502fd 100644 --- a/Library/Formula/rbenv-use.rb +++ b/Library/Formula/rbenv-use.rb @@ -1,14 +1,16 @@ -require 'formula' -  class RbenvUse < Formula -  homepage 'https://github.com/rkh/rbenv-use' -  url 'https://github.com/rkh/rbenv-use/archive/v1.0.0.tar.gz' -  sha1 '39beb889704bc51213665fd994417ab0668c5f83' +  homepage "https://github.com/rkh/rbenv-use" +  url "https://github.com/rkh/rbenv-use/archive/v1.0.0.tar.gz" +  sha1 "39beb889704bc51213665fd994417ab0668c5f83" -  depends_on 'rbenv' -  depends_on 'rbenv-whatis' +  depends_on "rbenv" +  depends_on "rbenv-whatis"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    shell_output("eval \"$(rbenv init -)\" && rbenv use system")    end  end diff --git a/Library/Formula/rbenv-vars.rb b/Library/Formula/rbenv-vars.rb index 8863e4ae0..9b9d4ae92 100644 --- a/Library/Formula/rbenv-vars.rb +++ b/Library/Formula/rbenv-vars.rb @@ -1,15 +1,17 @@ -require 'formula' -  class RbenvVars < Formula -  homepage 'https://github.com/sstephenson/rbenv-vars' -  url 'https://github.com/sstephenson/rbenv-vars/archive/v1.2.0.tar.gz' -  sha1 '8953cecac154fac96dc1e68b54d66a4c8b569e08' +  homepage "https://github.com/sstephenson/rbenv-vars" +  url "https://github.com/sstephenson/rbenv-vars/archive/v1.2.0.tar.gz" +  sha1 "8953cecac154fac96dc1e68b54d66a4c8b569e08" -  head 'https://github.com/sstephenson/rbenv-vars.git' +  head "https://github.com/sstephenson/rbenv-vars.git" -  depends_on 'rbenv' +  depends_on "rbenv"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    assert shell_output("rbenv hooks exec").include? "rbenv-vars.bash"    end  end diff --git a/Library/Formula/rbenv-whatis.rb b/Library/Formula/rbenv-whatis.rb index a2b965926..b27d50d3c 100644 --- a/Library/Formula/rbenv-whatis.rb +++ b/Library/Formula/rbenv-whatis.rb @@ -1,13 +1,15 @@ -require 'formula' -  class RbenvWhatis < Formula -  homepage 'https://github.com/rkh/rbenv-whatis' -  url 'https://github.com/rkh/rbenv-whatis/archive/v1.0.0.tar.gz' -  sha1 '8c802d8e2bba66d0c87c62c9d0b887beb52b1de4' +  homepage "https://github.com/rkh/rbenv-whatis" +  url "https://github.com/rkh/rbenv-whatis/archive/v1.0.0.tar.gz" +  sha1 "8c802d8e2bba66d0c87c62c9d0b887beb52b1de4" -  depends_on 'rbenv' +  depends_on "rbenv"    def install -    prefix.install Dir['*'] +    prefix.install Dir["*"] +  end + +  test do +    system "rbenv", "whatis", "2.0"    end  end diff --git a/Library/Formula/rbenv.rb b/Library/Formula/rbenv.rb index b19bbd76f..cc84a7e85 100644 --- a/Library/Formula/rbenv.rb +++ b/Library/Formula/rbenv.rb @@ -1,15 +1,13 @@ -require 'formula' -  class Rbenv < Formula -  homepage 'https://github.com/sstephenson/rbenv' -  url 'https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz' -  sha1 '825ceec55805b8bb80a6d6003fd3cef824d7ff14' +  homepage "https://github.com/sstephenson/rbenv" +  url "https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz" +  sha1 "825ceec55805b8bb80a6d6003fd3cef824d7ff14" -  head 'https://github.com/sstephenson/rbenv.git' +  head "https://github.com/sstephenson/rbenv.git"    def install -    inreplace 'libexec/rbenv', '/usr/local', HOMEBREW_PREFIX -    prefix.install Dir['*'] +    inreplace "libexec/rbenv", "/usr/local", HOMEBREW_PREFIX +    prefix.install Dir["*"]    end    def caveats; <<-EOS.undent @@ -20,4 +18,8 @@ class Rbenv < Formula        if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi      EOS    end + +  test do +    shell_output("eval \"$(#{bin}/rbenv init -)\" && rbenv versions") +  end  end | 
