lib/ipizza/config.rb in ipizza-0.5.0 vs lib/ipizza/config.rb in ipizza-0.5.1

- old
+ new

@@ -30,11 +30,11 @@ if /^(swedbank|seb|sampo|nordea)_(.*)=$/ =~ m.to_s clz = Ipizza::Provider.const_get($1.capitalize) key = $2 value = args.first - value = normalize_file_location(value) if /^file_(cert|key)/ =~ key + value = load_certificate(value) if /^file_(cert|key)/ =~ key if clz.respond_to?(:"#{key}=") return clz.send(:"#{key}=", *[value]) end end @@ -42,10 +42,10 @@ super end private - def normalize_file_location(file_path) + def load_certificate(file_path) if File.exists?(file_path) file_path else file_path = File.expand_path(File.join(certs_root, file_path)) end