aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorAnastasiaSulyagina2016-08-18 22:40:05 +0300
committerAnastasiaSulyagina2016-08-19 14:50:27 +0300
commit092e2797e156a36acd750d2783a18b47305a9747 (patch)
treefbe7354cc4a98158a53c56f317e8419dae3fd883 /Library/Homebrew/cask/lib
parente81f4ab7deeb40308f240be5ea00091fc8786d7a (diff)
downloadbrew-092e2797e156a36acd750d2783a18b47305a9747.tar.bz2
edits
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/doctor.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/macos.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
index d2feb1e06..7ee861508 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/doctor.rb
@@ -166,7 +166,7 @@ class Hbc::CLI::Doctor < Hbc::CLI::Base
# where "doctor" is needed is precisely the situation where such
# things are less dependable.
def self.render_install_location
- locations = Dir.glob(homebrew_cellar.join("brew-cask", "*")).reverse
+ locations = Dir.glob(Pathname.new(homebrew_cellar).join("brew-cask", "*")).reverse
if locations.empty?
none_string
else
diff --git a/Library/Homebrew/cask/lib/hbc/macos.rb b/Library/Homebrew/cask/lib/hbc/macos.rb
index 46047f413..5e25c657e 100644
--- a/Library/Homebrew/cask/lib/hbc/macos.rb
+++ b/Library/Homebrew/cask/lib/hbc/macos.rb
@@ -361,17 +361,17 @@ module OS::Mac
"~/Library/Widgets",
"~/Library/Workflows",
]
- .map { |x| Pathname(x).expand_path }
+ .map { |x| Pathname(x.sub(%r{^~(?=(/|$))}, Dir.home)).expand_path }
.to_set
.union(SYSTEM_DIRS)
.freeze
def system_dir?(dir)
- SYSTEM_DIRS.any? { |u| File.identical?(u, dir) }
+ SYSTEM_DIRS.include?(Pathname.new(dir).expand_path)
end
def undeletable?(dir)
- UNDELETABLE_DIRS.any? { |u| File.identical?(u, dir) }
+ UNDELETABLE_DIRS.include?(Pathname.new(dir).expand_path)
end
alias release version