From 6c4fe8384c3ece08b55a334ef8733ac486fd02d2 Mon Sep 17 00:00:00 2001 From: Tim Sharpe Date: Sun, 3 Feb 2019 11:41:25 +1100 Subject: [PATCH] (rubocop) Fix Style/IfInsideElse --- lib/vmfloaty/utils.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vmfloaty/utils.rb b/lib/vmfloaty/utils.rb index 6747524..a145003 100644 --- a/lib/vmfloaty/utils.rb +++ b/lib/vmfloaty/utils.rb @@ -190,12 +190,12 @@ class Utils service_config.merge! values else # If the user provided a service name at the command line, use that service if posible, or fail - if config['services'][options.service] - # If the service is configured but some values are missing, use the top-level defaults to fill them in - service_config.merge! config['services'][options.service] - else + unless config['services'][options.service] raise ArgumentError, "Could not find a configured service named '#{options.service}' in ~/.vmfloaty.yml" end + + # If the service is configured but some values are missing, use the top-level defaults to fill them in + service_config.merge! config['services'][options.service] end end