utils: prepare for deprecation of Utils.gzip
This commit is contained in:
		
							parent
							
								
									c75adc8238
								
							
						
					
					
						commit
						f6474c5048
					
				@ -183,15 +183,6 @@ describe "globally-scoped helper methods" do
 | 
			
		||||
    expect(which_editor).to eq("vemate -w")
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  specify "#gzip" do
 | 
			
		||||
    mktmpdir do |path|
 | 
			
		||||
      somefile = path/"somefile"
 | 
			
		||||
      FileUtils.touch somefile
 | 
			
		||||
      expect(gzip(somefile)[0].to_s).to eq("#{somefile}.gz")
 | 
			
		||||
      expect(Pathname.new("#{somefile}.gz")).to exist
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  specify "#capture_stderr" do
 | 
			
		||||
    err = capture_stderr do
 | 
			
		||||
      $stderr.print "test"
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,7 @@ require "utils/gems"
 | 
			
		||||
require "utils/git"
 | 
			
		||||
require "utils/git_repository"
 | 
			
		||||
require "utils/github"
 | 
			
		||||
require "utils/gzip"
 | 
			
		||||
require "utils/inreplace"
 | 
			
		||||
require "utils/link"
 | 
			
		||||
require "utils/popen"
 | 
			
		||||
@ -397,11 +398,10 @@ module Kernel
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # GZips the given paths, and returns the gzipped paths.
 | 
			
		||||
  # TODO: Add deprecation
 | 
			
		||||
  # odeprecated "Utils.gzip" "Utils::Gzip.compress"
 | 
			
		||||
  def gzip(*paths)
 | 
			
		||||
    paths.map do |path|
 | 
			
		||||
      safe_system "gzip", path
 | 
			
		||||
      Pathname.new("#{path}.gz")
 | 
			
		||||
    end
 | 
			
		||||
    Utils::Gzip.compress(*paths)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def ignore_interrupts(_opt = nil)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user