Skip to content

Commit 49521b3

Browse files
committed
Update image_optim from 0.14.0 -> 0.15.0
The latest version of the `image_optim` gem broke Overcommit's `ImageOptim` pre-commit hook due to a change in the name of the `BinNotFoundError` exception. Fix it and change the version constraint in the gemspec. Change-Id: Ie938de988887b2794115c35c45d654c7f7d9d678 Reviewed-on: http://gerrit.causes.com/42208 Tested-by: jenkins <jenkins@causes.com> Reviewed-by: Shane da Silva <shane.dasilva@brigade.com>
1 parent 185309a commit 49521b3

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Overcommit Changelog
22

3+
## master (unreleased)
4+
5+
* Update minimum version of `image_optim` gem to 0.15.0 (breaking change in
6+
name of exception classes)
7+
38
## 0.17.0
49

510
* Change commit hook header text to bold instead of bold white so that it

lib/overcommit/hook/pre_commit/image_optim.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def run
1111
optimized_images =
1212
begin
1313
optimize_images(applicable_files)
14-
rescue ::ImageOptim::BinNotFoundError => e
14+
rescue ::ImageOptim::BinResolver::BinNotFound => e
1515
return :fail, "#{e.message}. The image_optim gem is dependendent on this binary."
1616
end
1717

overcommit.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
2828

2929
s.add_dependency 'childprocess', '>= 0.5.1'
3030

31-
s.add_development_dependency 'image_optim', '~> 0.14.0'
31+
s.add_development_dependency 'image_optim', '~> 0.15.0'
3232
s.add_development_dependency 'rspec', '~> 3.0'
3333
s.add_development_dependency 'rubocop', '0.25.0' # Pin for Travis builds
3434
end

spec/overcommit/hook/pre_commit/image_optim_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
context 'when a dependency of image_optim is not installed' do
1414
before do
15-
subject.stub(:optimize_images).and_raise(::ImageOptim::BinNotFoundError)
15+
subject.stub(:optimize_images).and_raise(::ImageOptim::BinResolver::BinNotFound)
1616
end
1717

1818
it { should fail_hook }

0 commit comments

Comments
 (0)