Add Homebrew.install_gem_setup_path! function.
This uses the logic from tests.rb in man.rb too so that this can be shared in a few places.
This commit is contained in:
parent
81986ee7a7
commit
9e8103cf38
@ -13,7 +13,7 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
|
||||
which("ronn") || odie("You need to \"gem install ronn\" and put it in your path.")
|
||||
Homebrew.install_gem_setup_path! "ronn"
|
||||
|
||||
if ARGV.include?("--server") || ARGV.include?("-s")
|
||||
puts "Man page test server: http://localhost:1207/"
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
module Homebrew
|
||||
def tests
|
||||
(HOMEBREW_LIBRARY/'Homebrew/test').cd do
|
||||
ENV['TESTOPTS'] = '-v' if ARGV.verbose?
|
||||
quiet_system("gem", "list", "--installed", "bundler") || \
|
||||
system("gem", "install", "--no-ri", "--no-rdoc",
|
||||
"--user-install", "bundler")
|
||||
require 'rubygems'
|
||||
ENV["PATH"] = "#{Gem.user_dir}/bin:#{ENV["PATH"]}"
|
||||
(HOMEBREW_LIBRARY/"Homebrew/test").cd do
|
||||
ENV["TESTOPTS"] = "-v" if ARGV.verbose?
|
||||
Homebrew.install_gem_setup_path! "bundler"
|
||||
quiet_system("bundle", "check") || \
|
||||
system("bundle", "install", "--path", "vendor/bundle")
|
||||
system "bundle", "exec", "rake", "test"
|
||||
|
||||
@ -119,6 +119,14 @@ module Homebrew
|
||||
def self.git_last_commit
|
||||
HOMEBREW_REPOSITORY.cd { `git show -s --format="%cr" HEAD 2>/dev/null`.chuzzle }
|
||||
end
|
||||
|
||||
def self.install_gem_setup_path! gem
|
||||
return if quiet_system "gem", "list", "--installed", gem
|
||||
system "gem", "install", "--no-ri", "--no-rdoc",
|
||||
"--user-install", gem
|
||||
require "rubygems"
|
||||
ENV["PATH"] = "#{Gem.user_dir}/bin:#{ENV["PATH"]}"
|
||||
end
|
||||
end
|
||||
|
||||
def with_system_path
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user