Skip to content

Commit

Permalink
Update docs and readme for release
Browse files Browse the repository at this point in the history
  • Loading branch information
ekrich committed Dec 28, 2023
1 parent de74512 commit a603982
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)<br/>
Release [1.6.0](https://github.com/ekrich/sconfig/releases/tag/v1.6.0) - (2023-12-28)<br/>
Release [1.5.1](https://github.com/ekrich/sconfig/releases/tag/v1.5.1) - (2023-09-15)<br/>
Release [1.5.0](https://github.com/ekrich/sconfig/releases/tag/v1.5.0) - (2022-09-19)<br/>
Release [1.4.9](https://github.com/ekrich/sconfig/releases/tag/v1.4.9) - (2022-01-25)<br/>
Release [1.4.8](https://github.com/ekrich/sconfig/releases/tag/v1.4.8) - (2022-01-12)<br/>
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
28 changes: 28 additions & 0 deletions docs/SCALA-NATIVE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a603982

Please sign in to comment.