Skip to content

Commit

Permalink
Release 3.4.11
Browse files Browse the repository at this point in the history
  • Loading branch information
darkfrog26 committed Jun 16, 2023
1 parent abdd9b3 commit 3af6744
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Powerful configuration management for Scala (JSON, properties, command-line arguments, and environment variables)

# Latest version
3.4.10
3.4.11

# Justification

Expand Down Expand Up @@ -44,8 +44,8 @@ and overriding configuration in your application.
Profig is published to Sonatype OSS and synchronized to Maven Central supporting JVM and Scala.js on 2.11, 2.12, 2.13, and Scala 3.x:

```
libraryDependencies += "com.outr" %% "profig" % "3.4.10" // Scala
libraryDependencies += "com.outr" %%% "profig" % "3.4.10" // Scala.js / Cross-Build
libraryDependencies += "com.outr" %% "profig" % "3.4.11" // Scala
libraryDependencies += "com.outr" %%% "profig" % "3.4.11" // Scala.js / Cross-Build
```

## Getting Started
Expand Down Expand Up @@ -108,7 +108,7 @@ wanted to access the system property "java.version" we can easily do so:

```scala
val javaVersion = Profig("java.version").as[String]
// javaVersion: String = "1.8.0_352"
// javaVersion: String = "20"
```

You can also load from a higher level as a case class to get more information. For example:
Expand All @@ -130,11 +130,11 @@ object Specification {

val info = Profig("java").as[JVMInfo]
// info: JVMInfo = JVMInfo(
// version = "1.8.0_352",
// version = "20",
// specification = Specification(
// vendor = "Oracle Corporation",
// name = "Java Platform API Specification",
// version = "1.8"
// version = "20"
// )
// )
```
Expand Down
7 changes: 3 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ val scala2 = List(scala213)
val allScalaVersions = scala2 ::: scala3

ThisBuild / organization := "com.outr"
ThisBuild / version := "3.4.10"
ThisBuild / version := "3.4.11"
ThisBuild / scalaVersion := scala213
ThisBuild / scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")

Expand All @@ -32,7 +32,7 @@ ThisBuild / developers := List(
Developer(id="darkfrog", name="Matt Hicks", email="matt@matthicks.com", url=url("https://matthicks.com"))
)

val fabric: String = "1.10.0"
val fabric: String = "1.12.0"

val collectionCompat: String = "2.11.0"

Expand All @@ -56,8 +56,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
"org.scala-lang.modules" %%% "scala-collection-compat" % collectionCompat,
"org.scalatest" %% "scalatest" % scalaTest % "test"
),
crossScalaVersions := allScalaVersions,
test / fork := true
crossScalaVersions := allScalaVersions
)

lazy val coreJS = core.js
Expand Down
1 change: 1 addition & 0 deletions core/jvm/src/test/scala/spec/ProfigAllSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package spec

import profig._
import fabric._
import fabric.rw._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

Expand Down
1 change: 1 addition & 0 deletions core/jvm/src/test/scala/spec/ProfigJVMSpec.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package spec

import fabric.JsonPath
import fabric.rw._
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec

Expand Down
8 changes: 4 additions & 4 deletions core/shared/src/main/scala/profig/ProfigPath.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trait ProfigPath extends ProfigPathPlatform {
* @tparam T the type to represent the current path
* @return T
*/
def as[T: Writer]: T = apply().as[T]
def as[T: RW]: T = apply().as[T]

/**
* Loads this path out as the defined type `T`. If no value is set for this path, the default will be used.
Expand All @@ -38,23 +38,23 @@ trait ProfigPath extends ProfigPathPlatform {
* @tparam T the type to represent the current path
* @return T
*/
def asOr[T: Writer](default: => T): T = opt[T].getOrElse(default)
def asOr[T: RW](default: => T): T = opt[T].getOrElse(default)

/**
* Convenience functionality similar to `as` but returns an option if set.
*
* @tparam T the type to represent the current path
* @return T
*/
def opt[T: Writer]: Option[T] = get().map(_.as[T])
def opt[T: RW]: Option[T] = get().map(_.as[T])

/**
* Stores the supplied value into this path.
*
* @param value the value to store
* @tparam T the type of value
*/
def store[T: Reader](value: T): Unit = merge(value.json)
def store[T: RW](value: T): Unit = merge(value.json)

/**
* Returns a Json representation of this path if there is anything defined at this level.
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.8.2
sbt.version=1.9.0

0 comments on commit 3af6744

Please sign in to comment.