From 2191cbf2aa0e1214ad6a62eda1f4d29e1d173502 Mon Sep 17 00:00:00 2001 From: Ahmet Sezgin Duran Date: Mon, 25 Aug 2014 09:53:35 +0300 Subject: [PATCH] TB-46 #time 5m Fix condition errors --- lib/katip/change_logger.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/katip/change_logger.rb b/lib/katip/change_logger.rb index 6b2f401..e83fba5 100644 --- a/lib/katip/change_logger.rb +++ b/lib/katip/change_logger.rb @@ -56,10 +56,8 @@ def parse_change_log tags = tags.split prev_begin = nil - if !tags.include?(@tag_from) or !tags.include?(@tag_to) - puts 'Could not find the given tags. Make sure that both of tags exist.' - puts 'Listing found tags:' - puts tags + if (!@tag_from.nil? && !tags.include?(@tag_from)) || (!@tag_to.nil? && !tags.include?(@tag_to)) + show_not_found_message(tags) return output end @@ -115,5 +113,11 @@ def parse_change_log output end + + def show_not_found_message(tags) + puts 'Could not find the given tags. Make sure that given tags exist.' + puts 'Listing found tags:' + puts tags + end end end