From 74df71b445aed7c3fdd8ae47f0baf90d266112c8 Mon Sep 17 00:00:00 2001 From: Ivan Kuchin Date: Thu, 2 Oct 2014 15:02:33 +0200 Subject: [PATCH] fail if did not got version, resolves part of #39 --- .rubocop.yml | 2 +- CHANGELOG.markdown | 1 + lib/image_optim/bin_resolver.rb | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 684e8e6d..e697bf42 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,7 +12,7 @@ Metrics/CyclomaticComplexity: Max: 10 Metrics/MethodLength: - Max: 20 + Max: 25 Metrics/PerceivedComplexity: Max: 8 diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 41f1a2dd..621d667c 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -2,6 +2,7 @@ ## unreleased +* Fail if version of bin can't be detected [#39](https://github.com/toy/image_optim/issues/39) [@toy](https://github.com/toy) * Check path in `XXX_BIN` to exist, be a file and be executable [@toy](https://github.com/toy) ## v0.16.0 (2014-09-12) diff --git a/lib/image_optim/bin_resolver.rb b/lib/image_optim/bin_resolver.rb index cdcf0b27..cad5622e 100644 --- a/lib/image_optim/bin_resolver.rb +++ b/lib/image_optim/bin_resolver.rb @@ -29,6 +29,8 @@ def to_s end def check! + fail BadVersion, "didn't get version of `#{self}`" unless version + is = ComparableCondition.is case name when :pngcrush