diff --git a/README.md b/README.md index 954200e6..5b547deb 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,8 @@ At a high level, the process is as follows: ## Versions -Release [1.5.1](https://github.com/ekrich/sconfig/releases/tag/v1.5.1) - (2023-09-14)
+Release [1.6.0](https://github.com/ekrich/sconfig/releases/tag/v1.6.0) - (2023-12-28)
+Release [1.5.1](https://github.com/ekrich/sconfig/releases/tag/v1.5.1) - (2023-09-15)
Release [1.5.0](https://github.com/ekrich/sconfig/releases/tag/v1.5.0) - (2022-09-19)
Release [1.4.9](https://github.com/ekrich/sconfig/releases/tag/v1.4.9) - (2022-01-25)
Release [1.4.8](https://github.com/ekrich/sconfig/releases/tag/v1.4.8) - (2022-01-12)
diff --git a/build.sbt b/build.sbt index 6193ad34..91d20a1e 100644 --- a/build.sbt +++ b/build.sbt @@ -8,8 +8,8 @@ addCommandAlias( ).mkString(";", ";", "") ) -val prevVersion = "1.5.1" -val nextVersion = "1.5.2" +val prevVersion = "1.6.0" +val nextVersion = "1.7.0" // stable snapshot is not great for publish local def versionFmt(out: sbtdynver.GitDescribeOutput): String = { diff --git a/docs/SCALA-NATIVE.md b/docs/SCALA-NATIVE.md index b548a6a6..49ee1198 100644 --- a/docs/SCALA-NATIVE.md +++ b/docs/SCALA-NATIVE.md @@ -45,6 +45,34 @@ val maxCol = conf.getInt("maxColumn") val isGit = conf.getBoolean("project.git") ``` +## Using Reader - StringReader example + +Both JS and Native now support `java.io.Reader` which allows using `sconfig` +to parse all supported formats by passing a filename with extension. See the +following examples from the shared `ConfigFactoryTest` file. + +```scala +val filename = "/test01.properties" +val fileStr = + """ + |# test01.properties file + |fromProps.abc=abc + |fromProps.one=1 + |fromProps.bool=true + |fromProps.specialChars=hello^^ + """.stripMargin + +// create Reader +var test01Reader = new StringReader(fileStr) + +val config = ConfigFactory.parseReader( + test01Reader, + ConfigParseOptions.defaults + .setSyntaxFromFilename(filename) +) +val specialChars = config.getString("fromProps.specialChars") +``` + ### How to read a HOCON configuation file into a String for Scala Native In order to read the configuration file into a `String` you need to know the relative