aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cask_loader.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/dsl.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/installer.rb4
-rw-r--r--Library/Homebrew/cask/lib/hbc/system_command.rb2
4 files changed, 5 insertions, 5 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cask_loader.rb b/Library/Homebrew/cask/lib/hbc/cask_loader.rb
index 532d9f3c3..8fce9636a 100644
--- a/Library/Homebrew/cask/lib/hbc/cask_loader.rb
+++ b/Library/Homebrew/cask/lib/hbc/cask_loader.rb
@@ -56,7 +56,7 @@ module Hbc
class FromURILoader < FromPathLoader
def self.can_load?(ref)
- ref.to_s.match?(::URI.regexp)
+ ref.to_s.match?(::URI::DEFAULT_PARSER.make_regexp)
end
attr_reader :url
diff --git a/Library/Homebrew/cask/lib/hbc/dsl.rb b/Library/Homebrew/cask/lib/hbc/dsl.rb
index 2dda47627..3824b9761 100644
--- a/Library/Homebrew/cask/lib/hbc/dsl.rb
+++ b/Library/Homebrew/cask/lib/hbc/dsl.rb
@@ -161,7 +161,7 @@ module Hbc
begin
DSL::Container.new(*args).tap do |container|
# TODO: remove this backward-compatibility section after removing nested_container
- if container && container.nested
+ if container&.nested
artifacts[:nested_container] << Artifact::NestedContainer.new(cask, container.nested)
end
end
diff --git a/Library/Homebrew/cask/lib/hbc/installer.rb b/Library/Homebrew/cask/lib/hbc/installer.rb
index b9c34e3a1..01aae935d 100644
--- a/Library/Homebrew/cask/lib/hbc/installer.rb
+++ b/Library/Homebrew/cask/lib/hbc/installer.rb
@@ -159,7 +159,7 @@ module Hbc
odebug "Extracting primary container"
FileUtils.mkdir_p @cask.staged_path
- container = if @cask.container && @cask.container.type
+ container = if @cask.container&.type
Container.from_type(@cask.container.type)
else
Container.for_path(@downloaded_path, @command)
@@ -361,7 +361,7 @@ module Hbc
savedir = @cask.metadata_subdir("Casks", timestamp: :now, create: true)
FileUtils.copy @cask.sourcefile_path, savedir
- old_savedir.rmtree unless old_savedir.nil?
+ old_savedir&.rmtree
end
def uninstall
diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb
index b735ae4f9..be083c29e 100644
--- a/Library/Homebrew/cask/lib/hbc/system_command.rb
+++ b/Library/Homebrew/cask/lib/hbc/system_command.rb
@@ -61,7 +61,7 @@ module Hbc
end
def assert_success
- return if processed_status && processed_status.success?
+ return if processed_status&.success?
raise CaskCommandFailedError.new(command, processed_output[:stdout], processed_output[:stderr], processed_status)
end