Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix operator spacing." #2715

Merged
merged 1 commit into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Library/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
AllCops:
TargetRubyVersion: 2.0
Exclude:
- '**/Rakefile'
- '**/.*'
- '**/Casks/**/*'
- '**/vendor/**/*'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.appcask_checkpoint(cask_tokens, calculate)
if checkpoint.nil?
onoe "Could not retrieve `appcast` checkpoint for cask '#{cask}': #{result[:command_result].stderr}"
else
puts((cask_tokens.count > 1) ? "#{checkpoint} #{cask}" : checkpoint)
puts((cask_tokens.count > 1) ? "#{checkpoint} #{cask}": checkpoint)
count += 1
end
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def filtered_list
names.each do |d|
versions = d.subdirs.map { |pn| pn.basename.to_s }
next if ARGV.include?("--multiple") && versions.length < 2
puts "#{d.basename} #{versions * " "}"
puts "#{d.basename} #{versions*" "}"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def search_taps(query)

def search_formulae(regex)
aliases = Formula.alias_full_names
results = (Formula.full_names + aliases).grep(regex).sort
results = (Formula.full_names+aliases).grep(regex).sort

results.map do |name|
begin
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/switch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def switch
end

# Does the target version exist?
unless (rack/version).directory?
unless (rack+version).directory?
onoe "#{name} does not have a version \"#{version}\" in the Cellar."

versions = rack.subdirs.map { |d| Keg.new(d).version }
Expand All @@ -41,7 +41,7 @@ def switch
keg.unlink
end

keg = Keg.new(rack/version)
keg = Keg.new(rack+version)

# Link new version, if not keg-only
if keg_only?(rack)
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/debrew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def self.choose

choice = nil
while choice.nil?
menu.entries.each_with_index { |e, i| puts "#{i + 1}. #{e.name}" }
menu.entries.each_with_index { |e, i| puts "#{i+1}. #{e.name}" }
print menu.prompt unless menu.prompt.nil?

input = $stdin.gets || exit
input.chomp!

i = input.to_i
if i > 0
choice = menu.entries[i - 1]
choice = menu.entries[i-1]
else
possible = menu.entries.find_all { |e| e.name.start_with?(input) }

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/audit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def audit_text

def audit_lines
text.without_patch.split("\n").each_with_index do |line, lineno|
line_problems(line, lineno + 1)
line_problems(line, lineno+1)
end
end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/bottle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def bottle_formula(f)
mv "#{relocatable_tar_path}.gz", bottle_path
end

if bottle_path.size > 1 * 1024 * 1024
if bottle_path.size > 1*1024*1024
ohai "Detecting if #{filename} is relocatable..."
end

Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/dev-cmd/edit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def edit
if ["mate", "subl"].include?(editor)
# If the user is using TextMate or Sublime Text,
# give a nice project view instead.
exec_editor HOMEBREW_REPOSITORY/"bin/brew",
HOMEBREW_REPOSITORY/"README.md",
HOMEBREW_REPOSITORY/".gitignore",
exec_editor HOMEBREW_REPOSITORY+"bin/brew",
HOMEBREW_REPOSITORY+"README.md",
HOMEBREW_REPOSITORY+".gitignore",
*library_folders
else
exec_editor HOMEBREW_REPOSITORY
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/development_tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def gcc_4_0_build_version
def gcc_4_2_build_version
@gcc_4_2_build_version ||= begin
gcc = locate("gcc-4.2") || HOMEBREW_PREFIX.join("opt/apple-gcc42/bin/gcc-4.2")
if gcc.exist? && !gcc.realpath.basename.to_s.start_with?("llvm") &&
if gcc.exist? && !gcc.realpath.basename.to_s.start_with?("llvm")&&
build_version = `#{gcc} --version 2>/dev/null`[/build (\d{4,})/, 1]
Version.new build_version
else
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def check_for_stray_dylibs
"libosxfuse_i32.2.dylib", # OSXFuse
"libosxfuse_i64.2.dylib", # OSXFuse
"libosxfuse.2.dylib", # OSXFuse
"libTrAPI.dylib", # TrAPI/Endpoint Security VPN
"libTrAPI.dylib", # TrAPI / Endpoint Security VPN
"libntfs-3g.*.dylib", # NTFS-3G
"libntfs.*.dylib", # NTFS-3G
"libublio.*.dylib", # NTFS-3G
Expand Down Expand Up @@ -470,7 +470,7 @@ def check_user_path_3
return if $seen_prefix_sbin

# 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?

<<-EOS.undent
Expand Down
24 changes: 12 additions & 12 deletions Library/Homebrew/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ def cache_tag
end

def repo_valid?
(cached_location/".svn").directory?
cached_location.join(".svn").directory?
end

def clone_repo
Expand All @@ -711,7 +711,7 @@ def clone_repo
fetch_repo cached_location, @url, main_revision, true

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
else
fetch_repo cached_location, @url
Expand All @@ -737,7 +737,7 @@ def initialize(name, resource)

def stage
super
cp_r cached_location/".", Dir.pwd, preserve: true
cp_r File.join(cached_location, "."), Dir.pwd, preserve: true
end

def source_modified_time
Expand Down Expand Up @@ -781,7 +781,7 @@ def support_depth?
end

def git_dir
cached_location/".git"
cached_location.join(".git")
end

def ref?
Expand All @@ -797,7 +797,7 @@ def repo_valid?
end

def submodules?
(cached_location/".gitmodules").exist?
cached_location.join(".gitmodules").exist?
end

def clone_args
Expand Down Expand Up @@ -977,7 +977,7 @@ def source_modified_time
end

def stage
cp_r cached_location/".", Dir.pwd, preserve: true
cp_r File.join(cached_location, "."), Dir.pwd, preserve: true
end

private
Expand All @@ -987,7 +987,7 @@ def cache_tag
end

def repo_valid?
(cached_location/"CVS").directory?
cached_location.join("CVS").directory?
end

def clone_repo
Expand All @@ -1004,8 +1004,8 @@ def update

def split_url(in_url)
parts = in_url.split(/:/)
mod = parts.pop
url = parts.join(":")
mod=parts.pop
url=parts.join(":")
[mod, url]
end
end
Expand Down Expand Up @@ -1045,7 +1045,7 @@ def cache_tag
end

def repo_valid?
(cached_location/".hg").directory?
cached_location.join(".hg").directory?
end

def clone_repo
Expand All @@ -1066,7 +1066,7 @@ def initialize(name, resource)
def stage
# The export command doesn't work on checkouts
# See https://bugs.launchpad.net/bzr/+bug/897511
cp_r cached_location/".", Dir.pwd, preserve: true
cp_r File.join(cached_location, "."), Dir.pwd, preserve: true
rm_r ".bzr"
end

Expand All @@ -1085,7 +1085,7 @@ def cache_tag
end

def repo_valid?
(cached_location/".bzr").directory?
cached_location.join(".bzr").directory?
end

def clone_repo
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def message
message << "Cannot install #{formula.full_name} because conflicting formulae are installed."
message.concat conflicts.map { |c| conflict_message(c) } << ""
message << <<-EOS.undent
Please `brew unlink #{conflicts.map(&:name) * " "}` before continuing.
Please `brew unlink #{conflicts.map(&:name)*" "}` before continuing.

Unlinking removes a formula's symlinks from #{HOMEBREW_PREFIX}. You can
link the formula again after the install finishes. You can --force this
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/ARGV.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def include?(arg)
end

def next
at(@n + 1) || raise(UsageError)
at(@n+1) || raise(UsageError)
end

def value(name)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/ENV/std.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def determine_cc
# @private
def determine_cxx
dir, base = determine_cc.split
dir/base.to_s.sub("gcc", "g++").sub("clang", "clang++")
dir / base.to_s.sub("gcc", "g++").sub("clang", "clang++")
end

def gcc_4_0
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/os/mac/extend/ENV/std.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def setup_build_environment(formula = nil)
# Mountain Lion's sed is stricter, and errors out when
# it encounters files with mixed character sets
delete("LC_ALL")
self["LC_CTYPE"] = "C"
self["LC_CTYPE"]="C"
end

# Add lib and include etc. from the current macosxsdk to compiler flags:
Expand Down
14 changes: 7 additions & 7 deletions Library/Homebrew/extend/pathname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def rmdir_if_possible
rmdir
true
rescue Errno::ENOTEMPTY
if (ds_store = join(".DS_Store")).exist? && children.length == 1
if (ds_store = self+".DS_Store").exist? && children.length == 1
ds_store.unlink
retry
else
Expand Down Expand Up @@ -343,7 +343,7 @@ def subdirs

# @private
def resolved_path
symlink? ? dirname.join(readlink) : self
symlink? ? dirname+readlink : self
end

# @private
Expand All @@ -353,7 +353,7 @@ def resolved_path_exists?
# The link target contains NUL bytes
false
else
dirname.join(link).exist?
(dirname+link).exist?
end

# @private
Expand All @@ -367,7 +367,7 @@ def /(other)
if !other.respond_to?(:to_str) && !other.respond_to?(:to_path)
odeprecated "Pathname#/ with #{other.class}", "a String or a Pathname"
end
join(other.to_s)
self + other.to_s
end
end

Expand Down Expand Up @@ -403,7 +403,7 @@ def write_exec_script(*targets)
mkpath
targets.each do |target|
target = Pathname.new(target) # allow pathnames or strings
join(target.basename).write <<-EOS.undent
(self+target.basename).write <<-EOS.undent
#!/bin/bash
exec "#{target}" "$@"
EOS
Expand All @@ -427,15 +427,15 @@ def env_script_all_files(dst, env)
Pathname.glob("#{self}/*") do |file|
next if file.directory?
dst.install(file)
new_file = dst.join(file.basename)
new_file = dst+file.basename
file.write_env_script(new_file, env)
end
end

# Writes an exec script that invokes a java jar
def write_jar_script(target_jar, script_name, java_opts = "")
mkpath
join(script_name).write <<-EOS.undent
(self+script_name).write <<-EOS.undent
#!/bin/bash
exec java #{java_opts} -jar #{target_jar} "$@"
EOS
Expand Down