cmd/update-report: fix Rubocop warnings.
This commit is contained in:
		
							parent
							
								
									49e009df29
								
							
						
					
					
						commit
						cc526601cf
					
				@ -134,13 +134,13 @@ module Homebrew
 | 
			
		||||
    world_writable = legacy_cache.stat.mode & 0777 == 0777
 | 
			
		||||
    return if world_writable
 | 
			
		||||
    return if legacy_cache.symlink?
 | 
			
		||||
    return if !legacy_cache.owned? && legacy_cache.lstat.uid != 0
 | 
			
		||||
    return if !legacy_cache.owned? && legacy_cache.lstat.uid.nonzero?
 | 
			
		||||
 | 
			
		||||
    ohai "Migrating #{legacy_cache} to #{HOMEBREW_CACHE}..."
 | 
			
		||||
    HOMEBREW_CACHE.mkpath
 | 
			
		||||
    legacy_cache.cd do
 | 
			
		||||
      legacy_cache.entries.each do |f|
 | 
			
		||||
        next if [".", "..", ".migration_attempted"].include? "#{f}"
 | 
			
		||||
        next if [".", "..", ".migration_attempted"].include? f.to_s
 | 
			
		||||
        begin
 | 
			
		||||
          FileUtils.cp_r f, HOMEBREW_CACHE
 | 
			
		||||
        rescue
 | 
			
		||||
@ -173,7 +173,7 @@ module Homebrew
 | 
			
		||||
    link_src_dst_dirs(HOMEBREW_REPOSITORY/"etc/bash_completion.d",
 | 
			
		||||
                      HOMEBREW_PREFIX/"etc/bash_completion.d", command)
 | 
			
		||||
    link_src_dst_dirs(HOMEBREW_REPOSITORY/"share/doc/homebrew",
 | 
			
		||||
                      HOMEBREW_PREFIX/"share/doc/homebrew", command, link_dir: true)
 | 
			
		||||
                      HOMEBREW_PREFIX/"share/doc/homebrew", command, :link_dir => true)
 | 
			
		||||
    link_src_dst_dirs(HOMEBREW_REPOSITORY/"share/zsh/site-functions",
 | 
			
		||||
                      HOMEBREW_PREFIX/"share/zsh/site-functions", command)
 | 
			
		||||
    link_path_manpages(HOMEBREW_REPOSITORY/"share", command)
 | 
			
		||||
@ -359,10 +359,10 @@ class Reporter
 | 
			
		||||
  private
 | 
			
		||||
 | 
			
		||||
  def repo_var
 | 
			
		||||
    @repo_var ||= tap.path.to_s.
 | 
			
		||||
        strip_prefix(Tap::TAP_DIRECTORY.to_s).
 | 
			
		||||
        tr("^A-Za-z0-9", "_").
 | 
			
		||||
        upcase
 | 
			
		||||
    @repo_var ||= tap.path.to_s
 | 
			
		||||
                     .strip_prefix(Tap::TAP_DIRECTORY.to_s)
 | 
			
		||||
                     .tr("^A-Za-z0-9", "_")
 | 
			
		||||
                     .upcase
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def diff
 | 
			
		||||
@ -387,7 +387,7 @@ class ReporterHub
 | 
			
		||||
 | 
			
		||||
  def add(reporter)
 | 
			
		||||
    @reporters << reporter
 | 
			
		||||
    report = reporter.report.delete_if { |k,v| v.empty? }
 | 
			
		||||
    report = reporter.report.delete_if { |_k, v| v.empty? }
 | 
			
		||||
    @hash.update(report) { |_key, oldval, newval| oldval.concat(newval) }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user