Fix operator spacing.

This commit is contained in:
Markus Reiter 2017-05-30 00:47:07 +02:00
parent f9e8d84301
commit d34ba7395b
28 changed files with 101 additions and 103 deletions

View File

@ -1,8 +1,6 @@
AllCops: AllCops:
TargetRubyVersion: 2.0 TargetRubyVersion: 2.0
Exclude: Exclude:
- '**/Rakefile'
- '**/.*'
- '**/Casks/**/*' - '**/Casks/**/*'
- '**/vendor/**/*' - '**/vendor/**/*'

View File

@ -25,7 +25,7 @@ module Homebrew
end end
# Does the target version exist? # Does the target version exist?
unless (rack+version).directory? unless (rack/version).directory?
onoe "#{name} does not have a version \"#{version}\" in the Cellar." onoe "#{name} does not have a version \"#{version}\" in the Cellar."
versions = rack.subdirs.map { |d| Keg.new(d).version } versions = rack.subdirs.map { |d| Keg.new(d).version }
@ -41,7 +41,7 @@ module Homebrew
keg.unlink keg.unlink
end end
keg = Keg.new(rack+version) keg = Keg.new(rack/version)
# Link new version, if not keg-only # Link new version, if not keg-only
if keg_only?(rack) if keg_only?(rack)

View File

@ -24,9 +24,9 @@ module Homebrew
if ["mate", "subl"].include?(editor) if ["mate", "subl"].include?(editor)
# If the user is using TextMate or Sublime Text, # If the user is using TextMate or Sublime Text,
# give a nice project view instead. # give a nice project view instead.
exec_editor HOMEBREW_REPOSITORY+"bin/brew", exec_editor HOMEBREW_REPOSITORY/"bin/brew",
HOMEBREW_REPOSITORY+"README.md", HOMEBREW_REPOSITORY/"README.md",
HOMEBREW_REPOSITORY+".gitignore", HOMEBREW_REPOSITORY/".gitignore",
*library_folders *library_folders
else else
exec_editor HOMEBREW_REPOSITORY exec_editor HOMEBREW_REPOSITORY

View File

@ -470,7 +470,7 @@ module Homebrew
return if $seen_prefix_sbin return if $seen_prefix_sbin
# Don't complain about sbin not being in the path if it doesn't exist # Don't complain about sbin not being in the path if it doesn't exist
sbin = (HOMEBREW_PREFIX+"sbin") sbin = HOMEBREW_PREFIX/"sbin"
return unless sbin.directory? && !sbin.children.empty? return unless sbin.directory? && !sbin.children.empty?
<<-EOS.undent <<-EOS.undent

View File

@ -698,7 +698,7 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
end end
def repo_valid? def repo_valid?
cached_location.join(".svn").directory? (cached_location/".svn").directory?
end end
def clone_repo def clone_repo
@ -711,7 +711,7 @@ class SubversionDownloadStrategy < VCSDownloadStrategy
fetch_repo cached_location, @url, main_revision, true fetch_repo cached_location, @url, main_revision, true
externals do |external_name, external_url| externals do |external_name, external_url|
fetch_repo cached_location+external_name, external_url, @ref[external_name], true fetch_repo cached_location/external_name, external_url, @ref[external_name], true
end end
else else
fetch_repo cached_location, @url fetch_repo cached_location, @url
@ -737,7 +737,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
def stage def stage
super super
cp_r File.join(cached_location, "."), Dir.pwd, preserve: true cp_r cached_location/".", Dir.pwd, preserve: true
end end
def source_modified_time def source_modified_time
@ -781,7 +781,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
end end
def git_dir def git_dir
cached_location.join(".git") cached_location/".git"
end end
def ref? def ref?
@ -797,7 +797,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
end end
def submodules? def submodules?
cached_location.join(".gitmodules").exist? (cached_location/".gitmodules").exist?
end end
def clone_args def clone_args
@ -977,7 +977,7 @@ class CVSDownloadStrategy < VCSDownloadStrategy
end end
def stage def stage
cp_r File.join(cached_location, "."), Dir.pwd, preserve: true cp_r cached_location/".", Dir.pwd, preserve: true
end end
private private
@ -987,7 +987,7 @@ class CVSDownloadStrategy < VCSDownloadStrategy
end end
def repo_valid? def repo_valid?
cached_location.join("CVS").directory? (cached_location/"CVS").directory?
end end
def clone_repo def clone_repo
@ -1045,7 +1045,7 @@ class MercurialDownloadStrategy < VCSDownloadStrategy
end end
def repo_valid? def repo_valid?
cached_location.join(".hg").directory? (cached_location/".hg").directory?
end end
def clone_repo def clone_repo
@ -1066,7 +1066,7 @@ class BazaarDownloadStrategy < VCSDownloadStrategy
def stage def stage
# The export command doesn't work on checkouts # The export command doesn't work on checkouts
# See https://bugs.launchpad.net/bzr/+bug/897511 # See https://bugs.launchpad.net/bzr/+bug/897511
cp_r File.join(cached_location, "."), Dir.pwd, preserve: true cp_r cached_location/".", Dir.pwd, preserve: true
rm_r ".bzr" rm_r ".bzr"
end end
@ -1085,7 +1085,7 @@ class BazaarDownloadStrategy < VCSDownloadStrategy
end end
def repo_valid? def repo_valid?
cached_location.join(".bzr").directory? (cached_location/".bzr").directory?
end end
def clone_repo def clone_repo

View File

@ -246,7 +246,7 @@ class Pathname
rmdir rmdir
true true
rescue Errno::ENOTEMPTY rescue Errno::ENOTEMPTY
if (ds_store = self+".DS_Store").exist? && children.length == 1 if (ds_store = join(".DS_Store")).exist? && children.length == 1
ds_store.unlink ds_store.unlink
retry retry
else else
@ -343,7 +343,7 @@ class Pathname
# @private # @private
def resolved_path def resolved_path
symlink? ? dirname+readlink : self symlink? ? dirname.join(readlink) : self
end end
# @private # @private
@ -353,7 +353,7 @@ class Pathname
# The link target contains NUL bytes # The link target contains NUL bytes
false false
else else
(dirname+link).exist? dirname.join(link).exist?
end end
# @private # @private
@ -367,7 +367,7 @@ class Pathname
if !other.respond_to?(:to_str) && !other.respond_to?(:to_path) if !other.respond_to?(:to_str) && !other.respond_to?(:to_path)
odeprecated "Pathname#/ with #{other.class}", "a String or a Pathname" odeprecated "Pathname#/ with #{other.class}", "a String or a Pathname"
end end
self + other.to_s join(other.to_s)
end end
end end
@ -403,7 +403,7 @@ class Pathname
mkpath mkpath
targets.each do |target| targets.each do |target|
target = Pathname.new(target) # allow pathnames or strings target = Pathname.new(target) # allow pathnames or strings
(self+target.basename).write <<-EOS.undent join(target.basename).write <<-EOS.undent
#!/bin/bash #!/bin/bash
exec "#{target}" "$@" exec "#{target}" "$@"
EOS EOS
@ -427,7 +427,7 @@ class Pathname
Pathname.glob("#{self}/*") do |file| Pathname.glob("#{self}/*") do |file|
next if file.directory? next if file.directory?
dst.install(file) dst.install(file)
new_file = dst+file.basename new_file = dst.join(file.basename)
file.write_env_script(new_file, env) file.write_env_script(new_file, env)
end end
end end
@ -435,7 +435,7 @@ class Pathname
# Writes an exec script that invokes a java jar # Writes an exec script that invokes a java jar
def write_jar_script(target_jar, script_name, java_opts = "") def write_jar_script(target_jar, script_name, java_opts = "")
mkpath mkpath
(self+script_name).write <<-EOS.undent join(script_name).write <<-EOS.undent
#!/bin/bash #!/bin/bash
exec java #{java_opts} -jar #{target_jar} "$@" exec java #{java_opts} -jar #{target_jar} "$@"
EOS EOS

View File

@ -621,14 +621,14 @@ class Formula
# No `make install` available? # No `make install` available?
# <pre>bin.install "binary1"</pre> # <pre>bin.install "binary1"</pre>
def bin def bin
prefix+"bin" prefix/"bin"
end end
# The directory where the formula's documentation should be installed. # The directory where the formula's documentation should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def doc def doc
share+"doc"+name share/"doc"/name
end end
# The directory where the formula's headers should be installed. # The directory where the formula's headers should be installed.
@ -638,14 +638,14 @@ class Formula
# No `make install` available? # No `make install` available?
# <pre>include.install "example.h"</pre> # <pre>include.install "example.h"</pre>
def include def include
prefix+"include" prefix/"include"
end end
# The directory where the formula's info files should be installed. # The directory where the formula's info files should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def info def info
share+"info" share/"info"
end end
# The directory where the formula's libraries should be installed. # The directory where the formula's libraries should be installed.
@ -655,7 +655,7 @@ class Formula
# No `make install` available? # No `make install` available?
# <pre>lib.install "example.dylib"</pre> # <pre>lib.install "example.dylib"</pre>
def lib def lib
prefix+"lib" prefix/"lib"
end end
# The directory where the formula's binaries should be installed. # The directory where the formula's binaries should be installed.
@ -664,7 +664,7 @@ class Formula
# symlinked into HOMEBREW_PREFIX from one of the other directories and # symlinked into HOMEBREW_PREFIX from one of the other directories and
# instead manually create symlinks or wrapper scripts into e.g. {#bin}. # instead manually create symlinks or wrapper scripts into e.g. {#bin}.
def libexec def libexec
prefix+"libexec" prefix/"libexec"
end end
# The root directory where the formula's manual pages should be installed. # The root directory where the formula's manual pages should be installed.
@ -673,7 +673,7 @@ class Formula
# Often one of the more specific `man` functions should be used instead # Often one of the more specific `man` functions should be used instead
# e.g. {#man1} # e.g. {#man1}
def man def man
share+"man" share/"man"
end end
# The directory where the formula's man1 pages should be installed. # The directory where the formula's man1 pages should be installed.
@ -683,14 +683,14 @@ class Formula
# No `make install` available? # No `make install` available?
# <pre>man1.install "example.1"</pre> # <pre>man1.install "example.1"</pre>
def man1 def man1
man+"man1" man/"man1"
end end
# The directory where the formula's man2 pages should be installed. # The directory where the formula's man2 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def man2 def man2
man+"man2" man/"man2"
end end
# The directory where the formula's man3 pages should be installed. # The directory where the formula's man3 pages should be installed.
@ -700,42 +700,42 @@ class Formula
# No `make install` available? # No `make install` available?
# <pre>man3.install "man.3"</pre> # <pre>man3.install "man.3"</pre>
def man3 def man3
man+"man3" man/"man3"
end end
# The directory where the formula's man4 pages should be installed. # The directory where the formula's man4 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def man4 def man4
man+"man4" man/"man4"
end end
# The directory where the formula's man5 pages should be installed. # The directory where the formula's man5 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def man5 def man5
man+"man5" man/"man5"
end end
# The directory where the formula's man6 pages should be installed. # The directory where the formula's man6 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def man6 def man6
man+"man6" man/"man6"
end end
# The directory where the formula's man7 pages should be installed. # The directory where the formula's man7 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def man7 def man7
man+"man7" man/"man7"
end end
# The directory where the formula's man8 pages should be installed. # The directory where the formula's man8 pages should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def man8 def man8
man+"man8" man/"man8"
end end
# The directory where the formula's `sbin` binaries should be installed. # The directory where the formula's `sbin` binaries should be installed.
@ -743,7 +743,7 @@ class Formula
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
# Generally we try to migrate these to {#bin} instead. # Generally we try to migrate these to {#bin} instead.
def sbin def sbin
prefix+"sbin" prefix/"sbin"
end end
# The directory where the formula's shared files should be installed. # The directory where the formula's shared files should be installed.
@ -762,7 +762,7 @@ class Formula
# Install `./example_code/simple/ones` to share/demos/examples # Install `./example_code/simple/ones` to share/demos/examples
# <pre>(share/"demos").install "example_code/simple/ones" => "examples"</pre> # <pre>(share/"demos").install "example_code/simple/ones" => "examples"</pre>
def share def share
prefix+"share" prefix/"share"
end end
# The directory where the formula's shared files should be installed, # The directory where the formula's shared files should be installed,
@ -773,7 +773,7 @@ class Formula
# No `make install` available? # No `make install` available?
# <pre>pkgshare.install "examples"</pre> # <pre>pkgshare.install "examples"</pre>
def pkgshare def pkgshare
prefix+"share"+name prefix/"share"/name
end end
# The directory where Emacs Lisp files should be installed, with the # The directory where Emacs Lisp files should be installed, with the
@ -782,7 +782,7 @@ class Formula
# Install an Emacs mode included with a software package: # Install an Emacs mode included with a software package:
# <pre>elisp.install "contrib/emacs/example-mode.el"</pre> # <pre>elisp.install "contrib/emacs/example-mode.el"</pre>
def elisp def elisp
prefix+"share/emacs/site-lisp"+name prefix/"share/emacs/site-lisp"/name
end end
# The directory where the formula's Frameworks should be installed. # The directory where the formula's Frameworks should be installed.
@ -790,7 +790,7 @@ class Formula
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
# This is not symlinked into `HOMEBREW_PREFIX`. # This is not symlinked into `HOMEBREW_PREFIX`.
def frameworks def frameworks
prefix+"Frameworks" prefix/"Frameworks"
end end
# The directory where the formula's kernel extensions should be installed. # The directory where the formula's kernel extensions should be installed.
@ -798,7 +798,7 @@ class Formula
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
# This is not symlinked into `HOMEBREW_PREFIX`. # This is not symlinked into `HOMEBREW_PREFIX`.
def kext_prefix def kext_prefix
prefix+"Library/Extensions" prefix/"Library/Extensions"
end end
# The directory where the formula's configuration files should be installed. # The directory where the formula's configuration files should be installed.
@ -807,14 +807,14 @@ class Formula
# This directory is not inside the `HOMEBREW_CELLAR` so it is persisted # This directory is not inside the `HOMEBREW_CELLAR` so it is persisted
# across upgrades. # across upgrades.
def etc def etc
(HOMEBREW_PREFIX+"etc").extend(InstallRenamed) (HOMEBREW_PREFIX/"etc").extend(InstallRenamed)
end end
# The directory where the formula's variable files should be installed. # The directory where the formula's variable files should be installed.
# This directory is not inside the `HOMEBREW_CELLAR` so it is persisted # This directory is not inside the `HOMEBREW_CELLAR` so it is persisted
# across upgrades. # across upgrades.
def var def var
HOMEBREW_PREFIX+"var" HOMEBREW_PREFIX/"var"
end end
# The directory where the formula's ZSH function files should be # The directory where the formula's ZSH function files should be
@ -822,7 +822,7 @@ class Formula
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def zsh_function def zsh_function
share+"zsh/site-functions" share/"zsh/site-functions"
end end
# The directory where the formula's fish function files should be # The directory where the formula's fish function files should be
@ -830,7 +830,7 @@ class Formula
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def fish_function def fish_function
share+"fish/vendor_functions.d" share/"fish/vendor_functions.d"
end end
# The directory where the formula's Bash completion files should be # The directory where the formula's Bash completion files should be
@ -838,7 +838,7 @@ class Formula
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def bash_completion def bash_completion
prefix+"etc/bash_completion.d" prefix/"etc/bash_completion.d"
end end
# The directory where the formula's ZSH completion files should be # The directory where the formula's ZSH completion files should be
@ -846,7 +846,7 @@ class Formula
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def zsh_completion def zsh_completion
share+"zsh/site-functions" share/"zsh/site-functions"
end end
# The directory where the formula's fish completion files should be # The directory where the formula's fish completion files should be
@ -854,7 +854,7 @@ class Formula
# This is symlinked into `HOMEBREW_PREFIX` after installation or with # This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only. # `brew link` for formulae that are not keg-only.
def fish_completion def fish_completion
share+"fish/vendor_completions.d" share/"fish/vendor_completions.d"
end end
# The directory used for as the prefix for {#etc} and {#var} files on # The directory used for as the prefix for {#etc} and {#var} files on
@ -862,7 +862,7 @@ class Formula
# there after pouring a bottle. # there after pouring a bottle.
# @private # @private
def bottle_prefix def bottle_prefix
prefix+".bottle" prefix/".bottle"
end end
# The directory where the formula's installation or test logs will be written. # The directory where the formula's installation or test logs will be written.
@ -951,39 +951,39 @@ class Formula
end end
def opt_bin def opt_bin
opt_prefix+"bin" opt_prefix/"bin"
end end
def opt_include def opt_include
opt_prefix+"include" opt_prefix/"include"
end end
def opt_lib def opt_lib
opt_prefix+"lib" opt_prefix/"lib"
end end
def opt_libexec def opt_libexec
opt_prefix+"libexec" opt_prefix/"libexec"
end end
def opt_sbin def opt_sbin
opt_prefix+"sbin" opt_prefix/"sbin"
end end
def opt_share def opt_share
opt_prefix+"share" opt_prefix/"share"
end end
def opt_pkgshare def opt_pkgshare
opt_prefix+"share"+name opt_prefix/"share"/name
end end
def opt_elisp def opt_elisp
opt_prefix+"share/emacs/site-lisp"+name opt_prefix/"share/emacs/site-lisp"/name
end end
def opt_frameworks def opt_frameworks
opt_prefix+"Frameworks" opt_prefix/"Frameworks"
end end
# Indicates that this formula supports bottles. (Not necessarily that one # Indicates that this formula supports bottles. (Not necessarily that one

View File

@ -20,7 +20,7 @@ module FormulaCellarChecks
def check_manpages def check_manpages
# Check for man pages that aren't in share/man # Check for man pages that aren't in share/man
return unless (formula.prefix+"man").directory? return unless (formula.prefix/"man").directory?
<<-EOS.undent <<-EOS.undent
A top-level "man" directory was found A top-level "man" directory was found
@ -31,7 +31,7 @@ module FormulaCellarChecks
def check_infopages def check_infopages
# Check for info pages that aren't in share/info # Check for info pages that aren't in share/info
return unless (formula.prefix+"info").directory? return unless (formula.prefix/"info").directory?
<<-EOS.undent <<-EOS.undent
A top-level "info" directory was found A top-level "info" directory was found

View File

@ -568,7 +568,7 @@ class Keg
# symlinks the contents of path+relative_dir recursively into #{HOMEBREW_PREFIX}/relative_dir # symlinks the contents of path+relative_dir recursively into #{HOMEBREW_PREFIX}/relative_dir
def link_dir(relative_dir, mode) def link_dir(relative_dir, mode)
root = path+relative_dir root = path/relative_dir
return unless root.exist? return unless root.exist?
root.find do |src| root.find do |src|
next if src == root next if src == root