Install specific Rubocop version.

Closes Homebrew/homebrew#39620.
This commit is contained in:
Mike McQuaid 2015-05-14 16:05:00 +01:00
parent 7d88c110f6
commit 0a2dd832b9
2 changed files with 7 additions and 4 deletions

View File

@ -6,7 +6,7 @@ module Homebrew
ARGV.formulae.map(&:path)
end
Homebrew.install_gem_setup_path! "rubocop"
Homebrew.install_gem_setup_path! "rubocop", "0.31.0"
args = [
"--format", "simple", "--config",

View File

@ -121,13 +121,16 @@ module Homebrew
HOMEBREW_REPOSITORY.cd { `git show -s --format="%cr" HEAD 2>/dev/null`.chuzzle }
end
def self.install_gem_setup_path! gem, executable=gem
def self.install_gem_setup_path! gem, version=nil, executable=gem
require "rubygems"
ENV["PATH"] = "#{Gem.user_dir}/bin:#{ENV["PATH"]}"
unless quiet_system "gem", "list", "--installed", gem
args = [gem]
args << "-v" << version if version
unless quiet_system "gem", "list", "--installed", *args
safe_system "gem", "install", "--no-ri", "--no-rdoc",
"--user-install", gem
"--user-install", *args
end
unless which executable