diff options
| author | Markus Reiter | 2016-08-23 02:36:21 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-08-24 00:43:32 +0200 |
| commit | 85635a1e1927281edbf55ac0214357fd184c70bc (patch) | |
| tree | 62139240e7241836e80a690b63a1a5c67e9e98fd /Library/Homebrew/cask/lib | |
| parent | a70c60baeacf6ec6835fb0112fb5d1c9dd51012a (diff) | |
| download | brew-85635a1e1927281edbf55ac0214357fd184c70bc.tar.bz2 | |
Merge Cask’s `Pathname` extension with Homebrew’s.
Diffstat (limited to 'Library/Homebrew/cask/lib')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/container/gzip.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/extend.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/extend/pathname.rb | 19 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/installer.rb | 1 |
4 files changed, 2 insertions, 22 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/container/gzip.rb b/Library/Homebrew/cask/lib/hbc/container/gzip.rb index 1d2cc1f37..161578162 100644 --- a/Library/Homebrew/cask/lib/hbc/container/gzip.rb +++ b/Library/Homebrew/cask/lib/hbc/container/gzip.rb @@ -10,7 +10,7 @@ class Hbc::Container::Gzip < Hbc::Container::Base def extract Dir.mktmpdir do |unpack_dir| @command.run!("/usr/bin/ditto", args: ["--", @path, unpack_dir]) - @command.run!("/usr/bin/gunzip", args: ["--quiet", "--", Pathname.new(unpack_dir).join(@path.basename)]) + @command.run!("/usr/bin/gunzip", args: ["--quiet", "--name", "--", Pathname.new(unpack_dir).join(@path.basename)]) extract_nested_inside(unpack_dir) end diff --git a/Library/Homebrew/cask/lib/hbc/extend.rb b/Library/Homebrew/cask/lib/hbc/extend.rb index 629c53468..e836b6bc8 100644 --- a/Library/Homebrew/cask/lib/hbc/extend.rb +++ b/Library/Homebrew/cask/lib/hbc/extend.rb @@ -2,5 +2,5 @@ require "hbc/extend/hash" require "hbc/extend/io" require "hbc/extend/optparse" -require "hbc/extend/pathname" +require "extend/pathname" require "hbc/extend/string" diff --git a/Library/Homebrew/cask/lib/hbc/extend/pathname.rb b/Library/Homebrew/cask/lib/hbc/extend/pathname.rb deleted file mode 100644 index 598a99cd2..000000000 --- a/Library/Homebrew/cask/lib/hbc/extend/pathname.rb +++ /dev/null @@ -1,19 +0,0 @@ -require "pathname" - -class Pathname - # extended to support common double extensions - def extname(path = to_s) - %r{(\.(dmg|tar|cpio|pax)\.(gz|bz2|lz|xz|Z|zip))$} =~ path - return Regexp.last_match(1) if Regexp.last_match(1) - File.extname(path) - end - - # https://bugs.ruby-lang.org/issues/9915 - if RUBY_VERSION == "2.0.0" - prepend Module.new { - def inspect - super.force_encoding(@path.encoding) - end - } - end -end diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb index 8e55b8a99..8f43884a3 100644 --- a/Library/Homebrew/cask/lib/hbc/installer.rb +++ b/Library/Homebrew/cask/lib/hbc/installer.rb @@ -1,6 +1,5 @@ require "rubygems" -require "extend/pathname" require "hbc/cask_dependencies" require "hbc/staged" require "hbc/verify" |
