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")
|
expect(which_editor).to eq("vemate -w")
|
||||||
end
|
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
|
specify "#capture_stderr" do
|
||||||
err = capture_stderr do
|
err = capture_stderr do
|
||||||
$stderr.print "test"
|
$stderr.print "test"
|
||||||
|
|||||||
@ -11,6 +11,7 @@ require "utils/gems"
|
|||||||
require "utils/git"
|
require "utils/git"
|
||||||
require "utils/git_repository"
|
require "utils/git_repository"
|
||||||
require "utils/github"
|
require "utils/github"
|
||||||
|
require "utils/gzip"
|
||||||
require "utils/inreplace"
|
require "utils/inreplace"
|
||||||
require "utils/link"
|
require "utils/link"
|
||||||
require "utils/popen"
|
require "utils/popen"
|
||||||
@ -397,11 +398,10 @@ module Kernel
|
|||||||
end
|
end
|
||||||
|
|
||||||
# GZips the given paths, and returns the gzipped paths.
|
# GZips the given paths, and returns the gzipped paths.
|
||||||
|
# TODO: Add deprecation
|
||||||
|
# odeprecated "Utils.gzip" "Utils::Gzip.compress"
|
||||||
def gzip(*paths)
|
def gzip(*paths)
|
||||||
paths.map do |path|
|
Utils::Gzip.compress(*paths)
|
||||||
safe_system "gzip", path
|
|
||||||
Pathname.new("#{path}.gz")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def ignore_interrupts(_opt = nil)
|
def ignore_interrupts(_opt = nil)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user