lib/service_skeleton/config.rb in service_skeleton-0.0.0.25.gbf57918 vs lib/service_skeleton/config.rb in service_skeleton-0.0.0.28.gae2711b
- old
+ new
@@ -22,20 +22,28 @@
private
def parse_registered_variables(env)
@svc.registered_variables.each do |var|
- val = var.value(env[var.name.to_s])
+ val = var.value(env)
+
define_singleton_method(var.method_name(@svc.service_name)) do
val
end
+ define_singleton_method(var.method_name(@svc.service_name) + "=") do |v|
+ val = v
+ end
+
if var.sensitive?
if env.object_id != ENV.object_id
raise ServiceSkeleton::Error::CannotSanitizeEnvironmentError,
"Attempted to sanitize sensitive variable #{var.name}, but was not passed the ENV object"
end
- env[var.name.to_s] = "*SENSITIVE*"
+
+ var.env_keys(env).each do |k|
+ env[k] = "*SENSITIVE*"
+ end
end
end
end
def setup_logger