diff options
| author | Markus Reiter | 2016-08-24 12:32:17 +0200 |
|---|---|---|
| committer | GitHub | 2016-08-24 12:32:17 +0200 |
| commit | fa19447a2d9d311909452ee35b309d08558c9a3a (patch) | |
| tree | 5b0ca185d5fd05dddc9cc5bdde563a44947487fd /Library/Homebrew/cask/lib | |
| parent | ff7d3f226ae3b2bd216539d10b1724b18be1a127 (diff) | |
| parent | 85635a1e1927281edbf55ac0214357fd184c70bc (diff) | |
| download | brew-fa19447a2d9d311909452ee35b309d08558c9a3a.tar.bz2 | |
Merge pull request #793 from reitermarkus/refactoring-pathname
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" |
