Commit 72180ca

mo <mo.khan@gmail.com>
2018-05-19 16:01:07
extract blank? method.
1 parent 0c1ea5c
Changed files (1)
lib
lib/del/cli.rb
@@ -97,12 +97,16 @@ module Del
         IO.read(options[:configuration_file]),
         symbolize_names: true
       )
-      if settings[:password].nil? || settings[:password].length.zero?
+      if blank?(settings[:password])
         settings[:password] = ask('Password:', echo: false)
       end
       settings[:log_level] = options[:log_level]
       settings[:socket_file] = options[:socket_file]
       settings.merge(additional_settings)
     end
+
+    def blank?(string)
+      string.nil? || string.length.zero?
+    end
   end
 end