Merge pull request #911 from MikeMcQuaid/language-rubocop
Fix Library/Homebrew/language RuboCop warnings
This commit is contained in:
commit
a70f8b9c30
@ -72,7 +72,7 @@ module Language
|
|||||||
end
|
end
|
||||||
|
|
||||||
def install_cabal_package(*args)
|
def install_cabal_package(*args)
|
||||||
options = if args[-1].kind_of?(Hash) then args.pop else {} end
|
options = args[-1].is_a?(Hash) ? args.pop : {}
|
||||||
|
|
||||||
cabal_sandbox do
|
cabal_sandbox do
|
||||||
cabal_install_tools(*options[:using]) if options[:using]
|
cabal_install_tools(*options[:using]) if options[:using]
|
||||||
|
|||||||
@ -21,7 +21,7 @@ module Language
|
|||||||
setup_npm_environment
|
setup_npm_environment
|
||||||
# tell npm to not install .brew_home by adding it to the .npmignore file
|
# tell npm to not install .brew_home by adding it to the .npmignore file
|
||||||
# (or creating a new one if no .npmignore file already exists)
|
# (or creating a new one if no .npmignore file already exists)
|
||||||
open(".npmignore", "a") { |f| f.write( "\n.brew_home\n") }
|
open(".npmignore", "a") { |f| f.write("\n.brew_home\n") }
|
||||||
# npm install args for global style module format installed into libexec
|
# npm install args for global style module format installed into libexec
|
||||||
["--verbose", "--global", "--prefix=#{libexec}", "."]
|
["--verbose", "--global", "--prefix=#{libexec}", "."]
|
||||||
end
|
end
|
||||||
|
|||||||
@ -187,14 +187,13 @@ module Language
|
|||||||
# Robustify symlinks to survive python3 patch upgrades
|
# Robustify symlinks to survive python3 patch upgrades
|
||||||
@venv_root.find do |f|
|
@venv_root.find do |f|
|
||||||
next unless f.symlink?
|
next unless f.symlink?
|
||||||
if (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR
|
next unless (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR
|
||||||
python = rp.include?("python3") ? "python3" : "python"
|
python = rp.include?("python3") ? "python3" : "python"
|
||||||
new_target = rp.sub %r{#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix
|
new_target = rp.sub %r{#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix
|
||||||
f.unlink
|
f.unlink
|
||||||
f.make_symlink new_target
|
f.make_symlink new_target
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Installs packages represented by `targets` into the virtualenv.
|
# Installs packages represented by `targets` into the virtualenv.
|
||||||
# @param targets [String, Pathname, Resource,
|
# @param targets [String, Pathname, Resource,
|
||||||
|
|||||||
@ -1,2 +1,2 @@
|
|||||||
PYTHON_VIRTUALENV_URL = "https://files.pythonhosted.org/packages/5c/79/5dae7494b9f5ed061cff9a8ab8d6e1f02db352f3facf907d9eb614fb80e9/virtualenv-15.0.2.tar.gz"
|
PYTHON_VIRTUALENV_URL = "https://files.pythonhosted.org/packages/5c/79/5dae7494b9f5ed061cff9a8ab8d6e1f02db352f3facf907d9eb614fb80e9/virtualenv-15.0.2.tar.gz".freeze
|
||||||
PYTHON_VIRTUALENV_SHA256 = "fab40f32d9ad298fba04a260f3073505a16d52539a84843cf8c8369d4fd17167"
|
PYTHON_VIRTUALENV_SHA256 = "fab40f32d9ad298fba04a260f3073505a16d52539a84843cf8c8369d4fd17167".freeze
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user