From ae7b944238ca23aff13d29375e4c59b32ae9d436 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 14 Oct 2016 20:11:33 +0200 Subject: [PATCH] Align `end` with beginning of line where `if/unless` is. --- .../cask/lib/hbc/artifact/symlinked.rb | 8 ++++---- Library/Homebrew/cask/lib/hbc/cask.rb | 12 +++++------ Library/Homebrew/cask/lib/hbc/cli/cleanup.rb | 14 ++++++------- Library/Homebrew/cask/lib/hbc/cli/doctor.rb | 4 ++-- Library/Homebrew/cask/lib/hbc/cli/style.rb | 12 +++++------ Library/Homebrew/cask/lib/hbc/download.rb | 14 ++++++------- .../Homebrew/cask/lib/hbc/dsl/depends_on.rb | 20 +++++++++---------- Library/Homebrew/cask/lib/hbc/installer.rb | 16 +++++++-------- Library/Homebrew/cask/lib/hbc/locations.rb | 12 +++++------ Library/Homebrew/cask/lib/hbc/verify/gpg.rb | 8 ++++---- 10 files changed, 60 insertions(+), 60 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb b/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb index 46dd42322a..32d8d68405 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/symlinked.rb @@ -61,10 +61,10 @@ module Hbc "#{printable_target} -> #{target.readlink} (#{target.readlink.abv})" else string = if self.class.islink?(target) - "#{printable_target} -> #{target.readlink}" - else - printable_target - end + "#{printable_target} -> #{target.readlink}" + else + printable_target + end Formatter.error(string, label: "Broken Link") end diff --git a/Library/Homebrew/cask/lib/hbc/cask.rb b/Library/Homebrew/cask/lib/hbc/cask.rb index b66f16a8ef..6f005c0361 100644 --- a/Library/Homebrew/cask/lib/hbc/cask.rb +++ b/Library/Homebrew/cask/lib/hbc/cask.rb @@ -38,12 +38,12 @@ module Hbc raise CaskError, "Cannot create metadata path when timestamp is :latest" end path = if timestamp == :latest - Pathname.glob(metadata_versioned_container_path.join("*")).sort.last - elsif timestamp == :now - Utils.nowstamp_metadata_path(metadata_versioned_container_path) - else - metadata_versioned_container_path.join(timestamp) - end + Pathname.glob(metadata_versioned_container_path.join("*")).sort.last + elsif timestamp == :now + Utils.nowstamp_metadata_path(metadata_versioned_container_path) + else + metadata_versioned_container_path.join(timestamp) + end if create odebug "Creating metadata directory #{path}" FileUtils.mkdir_p path diff --git a/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb b/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb index 0296dc96dc..e65ee422d1 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb @@ -72,14 +72,14 @@ module Hbc ohai message deletable_cache_files = if tokens.empty? - cache_files - else - start_withs = tokens.map { |token| "#{token}--" } + cache_files + else + start_withs = tokens.map { |token| "#{token}--" } - cache_files.select { |path| - path.basename.to_s.start_with?(*start_withs) - } - end + cache_files.select { |path| + path.basename.to_s.start_with?(*start_withs) + } + end delete_paths(deletable_cache_files) end diff --git a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb index a41781a0cf..f4262a62c4 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb @@ -78,8 +78,8 @@ module Hbc def self.homebrew_taps @homebrew_taps ||= if homebrew_repository.respond_to?(:join) - homebrew_repository.join("Library", "Taps") - end + homebrew_repository.join("Library", "Taps") + end end def self.homebrew_constants(name) diff --git a/Library/Homebrew/cask/lib/hbc/cli/style.rb b/Library/Homebrew/cask/lib/hbc/cli/style.rb index fcb59230ef..01ba394119 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/style.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/style.rb @@ -37,12 +37,12 @@ module Hbc def cask_paths @cask_paths ||= if cask_tokens.empty? - Hbc.all_tapped_cask_dirs - elsif cask_tokens.any? { |file| File.exist?(file) } - cask_tokens - else - cask_tokens.map { |token| Hbc.path(token) } - end + Hbc.all_tapped_cask_dirs + elsif cask_tokens.any? { |file| File.exist?(file) } + cask_tokens + else + cask_tokens.map { |token| Hbc.path(token) } + end end def cask_tokens diff --git a/Library/Homebrew/cask/lib/hbc/download.rb b/Library/Homebrew/cask/lib/hbc/download.rb index 4166fc74dc..43ccfb97e1 100644 --- a/Library/Homebrew/cask/lib/hbc/download.rb +++ b/Library/Homebrew/cask/lib/hbc/download.rb @@ -23,13 +23,13 @@ module Hbc def downloader @downloader ||= case cask.url.using - when :svn - SubversionDownloadStrategy.new(cask) - when :post - CurlPostDownloadStrategy.new(cask) - else - CurlDownloadStrategy.new(cask) - end + when :svn + SubversionDownloadStrategy.new(cask) + when :post + CurlPostDownloadStrategy.new(cask) + else + CurlDownloadStrategy.new(cask) + end end def clear_cache diff --git a/Library/Homebrew/cask/lib/hbc/dsl/depends_on.rb b/Library/Homebrew/cask/lib/hbc/dsl/depends_on.rb index f402c603cc..6bd6445ff6 100644 --- a/Library/Homebrew/cask/lib/hbc/dsl/depends_on.rb +++ b/Library/Homebrew/cask/lib/hbc/dsl/depends_on.rb @@ -87,16 +87,16 @@ module Hbc def macos=(*arg) @macos ||= [] macos = if arg.count == 1 && arg.first =~ /^\s*(<|>|[=<>]=)\s*(\S+)\s*$/ - raise "'depends_on macos' comparison expressions cannot be combined" unless @macos.empty? - operator = Regexp.last_match[1].to_sym - release = self.class.coerce_os_release(Regexp.last_match[2]) - [[operator, release]] - else - raise "'depends_on macos' comparison expressions cannot be combined" if @macos.first.is_a?(Symbol) - Array(*arg).map { |elt| - self.class.coerce_os_release(elt) - }.sort - end + raise "'depends_on macos' comparison expressions cannot be combined" unless @macos.empty? + operator = Regexp.last_match[1].to_sym + release = self.class.coerce_os_release(Regexp.last_match[2]) + [[operator, release]] + else + raise "'depends_on macos' comparison expressions cannot be combined" if @macos.first.is_a?(Symbol) + Array(*arg).map { |elt| + self.class.coerce_os_release(elt) + }.sort + end @macos.concat(macos) end diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb index 12d79132b5..5a26c0791c 100644 --- a/Library/Homebrew/cask/lib/hbc/installer.rb +++ b/Library/Homebrew/cask/lib/hbc/installer.rb @@ -84,10 +84,10 @@ module Hbc def summary s = if MacOS.version >= :lion && !ENV["HOMEBREW_NO_EMOJI"] - (ENV["HOMEBREW_INSTALL_BADGE"] || "\xf0\x9f\x8d\xba") + " " - else - Formatter.headline("Success! ", color: :blue) - end + (ENV["HOMEBREW_INSTALL_BADGE"] || "\xf0\x9f\x8d\xba") + " " + else + Formatter.headline("Success! ", color: :blue) + end s << "#{@cask} was successfully installed!" end @@ -113,10 +113,10 @@ module Hbc odebug "Extracting primary container" FileUtils.mkdir_p @cask.staged_path container = if @cask.container && @cask.container.type - Container.from_type(@cask.container.type) - else - Container.for_path(@downloaded_path, @command) - end + Container.from_type(@cask.container.type) + else + Container.for_path(@downloaded_path, @command) + end unless container raise CaskError, "Uh oh, could not figure out how to unpack '#{@downloaded_path}'" end diff --git a/Library/Homebrew/cask/lib/hbc/locations.rb b/Library/Homebrew/cask/lib/hbc/locations.rb index 099caf6658..a7757aea44 100644 --- a/Library/Homebrew/cask/lib/hbc/locations.rb +++ b/Library/Homebrew/cask/lib/hbc/locations.rb @@ -139,12 +139,12 @@ module Hbc query_without_extension = query.sub(/\.rb$/i, "") token_with_tap = if query =~ %r{\A[^/]+/[^/]+/[^/]+\Z} - query_without_extension - else - all_tokens.detect { |tap_and_token| - tap_and_token.split("/")[2] == query_without_extension - } - end + query_without_extension + else + all_tokens.detect { |tap_and_token| + tap_and_token.split("/")[2] == query_without_extension + } + end if token_with_tap user, repo, token = token_with_tap.split("/") diff --git a/Library/Homebrew/cask/lib/hbc/verify/gpg.rb b/Library/Homebrew/cask/lib/hbc/verify/gpg.rb index 6eb5fc23b2..dbb537756d 100644 --- a/Library/Homebrew/cask/lib/hbc/verify/gpg.rb +++ b/Library/Homebrew/cask/lib/hbc/verify/gpg.rb @@ -40,10 +40,10 @@ module Hbc def import_key args = if cask.gpg.key_id - ["--recv-keys", cask.gpg.key_id] - elsif cask.gpg.key_url - ["--fetch-key", cask.gpg.key_url.to_s] - end + ["--recv-keys", cask.gpg.key_id] + elsif cask.gpg.key_url + ["--fetch-key", cask.gpg.key_url.to_s] + end @command.run!("gpg", args: args) end