Skip to content

Instantly share code, notes, and snippets.

@2m
Created October 24, 2016 07:43
Show Gist options
  • Save 2m/ef0a45915f6ef9dbdcb5b47509ea14f2 to your computer and use it in GitHub Desktop.
Save 2m/ef0a45915f6ef9dbdcb5b47509ea14f2 to your computer and use it in GitHub Desktop.
Config with colon in key names
➜ ~ amm
Loading...
Welcome to the Ammonite Repl 0.7.6
(Scala 2.11.8 Java 1.8.0_112)
@ import $ivy.`com.typesafe:config:1.3.1`
import $ivy.$
@ import com.typesafe.config.ConfigFactory
import com.typesafe.config.ConfigFactory
@ ConfigFactory.parseString("""
services: {
FOO"::"BAR"::"BAZ: {
enabled: true
}
}
""")
res2: com.typesafe.config.Config = Config(SimpleConfigObject({"services":{"FOO::BAR::BAZ":{"enabled":true}}}))
@ res2.getBoolean("""services.FOO"::"BAR"::"BAZ.enabled""")
res3: Boolean = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment