diff options
| author | Mike McQuaid | 2017-09-25 21:29:03 +0100 |
|---|---|---|
| committer | GitHub | 2017-09-25 21:29:03 +0100 |
| commit | a5893036166b9708d705a5060aa85002d5a6be16 (patch) | |
| tree | 03a254a34d12926540a0be677ffc8c9b9f32d5d0 /Library/Homebrew/cask | |
| parent | ac8b58537fe3dd71098a43afcc6a1785dcde1d39 (diff) | |
| parent | cf5fdeef1d8e9fd053121145882835b87eec2a43 (diff) | |
| download | brew-a5893036166b9708d705a5060aa85002d5a6be16.tar.bz2 | |
Merge pull request #3183 from MikeMcQuaid/rubocop-upgrade
Rubocop: 0.50.0 and Ruby 2.3
Diffstat (limited to 'Library/Homebrew/cask')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cask_loader.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/container/naked.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/dsl.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/dsl/version.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/installer.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/system_command.rb | 2 |
6 files changed, 7 insertions, 7 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/container/naked.rb b/Library/Homebrew/cask/lib/hbc/container/naked.rb index 375d62f7a..dc265c402 100644 --- a/Library/Homebrew/cask/lib/hbc/container/naked.rb +++ b/Library/Homebrew/cask/lib/hbc/container/naked.rb @@ -16,7 +16,7 @@ module Hbc def target_file return @path.basename if @nested - URI.decode(File.basename(@cask.url.path)) + CGI.unescape(File.basename(@cask.url.path)) end end end 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/dsl/version.rb b/Library/Homebrew/cask/lib/hbc/dsl/version.rb index d73205f52..9605feb57 100644 --- a/Library/Homebrew/cask/lib/hbc/dsl/version.rb +++ b/Library/Homebrew/cask/lib/hbc/dsl/version.rb @@ -49,7 +49,7 @@ module Hbc end end - DIVIDERS.keys.each do |divider| + DIVIDERS.each_key do |divider| define_divider_methods(divider) 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 |
