Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete exceptions from homebrew-fork #22574

Merged
merged 2 commits into from
Jul 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ require 'rake/testtask'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'

homebrew_repo = `brew --repository`
$LOAD_PATH.unshift(File.expand_path("#{homebrew_repo.chomp}/Library/Homebrew"))
$LOAD_PATH.unshift(File.expand_path('../lib', __FILE__))

namespace :test do
Expand Down
2 changes: 1 addition & 1 deletion lib/hbc/source/uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def load
odebug "Download target -> #{path.to_s}"
begin
curl(uri, '-o', path.to_s)
rescue Hbc::ErrorDuringExecution
rescue ErrorDuringExecution
raise Hbc::CaskUnavailableError.new uri
end
Hbc::Source::PathSlashOptional.new(path).load
Expand Down
6 changes: 3 additions & 3 deletions lib/vendor/homebrew-fork/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def fetch
had_incomplete_download = temporary_path.exist?
begin
_fetch
rescue Hbc::ErrorDuringExecution
rescue ErrorDuringExecution
# 33 == range not supported
# try wiping the incomplete download and retrying once
if $?.exitstatus == 33 && had_incomplete_download
Expand All @@ -78,14 +78,14 @@ def fetch
msg = "Download failed: #{@url}"
msg << "\nThe incomplete download is cached at #{tarball_path}"
end
raise Hbc::CurlDownloadStrategyError, msg
raise CurlDownloadStrategyError, msg
end
end
Hbc::Utils.ignore_interrupts { temporary_path.rename(tarball_path) }
else
puts "Already downloaded: #{tarball_path}"
end
rescue Hbc::CurlDownloadStrategyError
rescue CurlDownloadStrategyError
raise if mirrors.empty?
puts "Trying a mirror..."
@url = mirrors.shift
Expand Down
12 changes: 0 additions & 12 deletions lib/vendor/homebrew-fork/exceptions.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/vendor/homebrew-fork/global.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'exceptions'
require 'vendor/homebrew-fork/monkeypatch_pathname'
require 'vendor/homebrew-fork/exceptions'
require 'vendor/homebrew-fork/utils'

def cache
Expand Down
4 changes: 2 additions & 2 deletions lib/vendor/homebrew-fork/utils.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'pathname'
require 'vendor/homebrew-fork/exceptions'
require 'exceptions'

def homebrew_fork_system cmd, *args
puts "#{cmd} #{args*' '}" if Hbc.verbose
Expand All @@ -15,7 +15,7 @@ def homebrew_fork_system cmd, *args

# Kernel.system but with exceptions
def safe_system cmd, *args
homebrew_fork_system(cmd, *args) or raise Hbc::ErrorDuringExecution.new(cmd, args)
homebrew_fork_system(cmd, *args) or raise ErrorDuringExecution.new(cmd, args)
end

# prints no output
Expand Down
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
require 'rspec/its'
require 'rspec/wait'

homebrew_repo = `brew --repository`
$LOAD_PATH.unshift(File.expand_path("#{homebrew_repo.chomp}/Library/Homebrew"))

if ENV['COVERAGE']
require 'coveralls'
Coveralls.wear_merged!
Expand Down
3 changes: 3 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
require 'bundler/setup'
require 'pathname'

homebrew_repo = `brew --repository`
$LOAD_PATH.unshift(File.expand_path("#{homebrew_repo.chomp}/Library/Homebrew"))

if ENV['COVERAGE']
require 'coveralls'
Coveralls.wear_merged!
Expand Down