Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Simeon H.K. Fitch committed May 14, 2016
2 parents 0f9d582 + 2f453c7 commit 463a969
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: scala
scala:
- 2.11.8
jdk:
- oraclejdk8
script:
- sbt ++$TRAVIS_SCALA_VERSION --warn update compile test

sudo: false
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

_Typesafe Config wrapped in a [`Dynamic`][dsd] blanket._

[![Build Status](https://travis-ci.org/ElderResearch/ssc.svg?branch=develop)](https://travis-ci.org/ElderResearch/ssc)

## Overview

[_Typesafe Config_][tc] is about as perfect as an application configuration system can be. [HOCON][hocon] is fantastic to work with, and the underlying Java implementation is both robust and consistent.
Expand Down Expand Up @@ -36,10 +38,12 @@ _Simple Scala Config_ is able to do this via the use of Scala's [`Dynamic`][dsd]

## Using

The library is published via XXX. Add this to your sbt build definitions:
The library is published via bintray. Add this to your sbt build definitions:

```scala
libraryDependencies += "com.elderresearch" %% "ssc" % "0.1.0-SNAPSHOT"
resolvers += "ERI OSS" at "http://dl.bintray.com/elderresearch/OSS"

libraryDependencies += "com.elderresearch" %% "ssc" % "0.1.0"
```

It will transitively pull in the Typesafe Config and Scala Reflection libraries:
Expand All @@ -49,6 +53,8 @@ It will transitively pull in the Typesafe Config and Scala Reflection libraries:
"org.scala-lang" % "scala-reflect" % scalaVersion.value
```

Note: **Requires Java 8**, as does _Typesafe Config_ >= `1.3.0`

## Examples

### Basic
Expand Down
14 changes: 13 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@ name := "Simple Scala Config"

moduleName := "ssc"

version := "0.1.0-SNAPSHOT"
version := "0.1.0"

organization := "com.elderresearch"

licenses := Seq(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")))

scalaVersion := "2.11.8"

scalacOptions += "-target:jvm-1.8"

libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"com.typesafe" % "config" % "1.3.0",
"org.scalatest" %% "scalatest" % "2.2.6" % "test"
)

publishMavenStyle := false

bintrayOrganization := Some("elderresearch")

bintrayRepository := "OSS"

bintrayReleaseOnPublish in ThisBuild := false
22 changes: 22 additions & 0 deletions notes/0.1.0.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Initial Release

* Supports field-dereference syntax for _Typesafe Config_ lookups, supporting types `T` and `Option[T]` where `T` is `{Boolean|Int|Double|Long|Float|String|Duration|Path|File|Config|AnyRef}`.


`object MyConfig extends SSConfig()`
`val tmp = MyConfig.myapp.tempdir.as[Path]`
`val runtime = MyConfig.java.runtime.name.as[String]`
`val timeout = MyConfig.akka.actor.'creation-timeout'.as[Duration].getSeconds`
`val debugMode = MyConfig.app.debug.asOption[Boolean].getOrElse(false)`


* Allows nested configuration via optional path parameter:

`object AkkaConfig extends SSConfig("akka")`
`val akkaVersion = AkkaConfig.version.as[String]`
`val timeout = AkkaConfig.actor.`creation-timeout`.as[Duration].getSeconds`

* Allows custom config loading via optional `Config` parameter:

`val props = new SSConfig(ConfigFactory.load("myprops.properties"))`
`val version = props.version.as[String]`
1 change: 1 addition & 0 deletions notes/about.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Simple Scala Config](https://github.com/ElderResearch/ssc) is [Typesafe Config](https://github.com/typesafehub/config) wrapped in a [`Dynamic`](http://www.scala-lang.org/api/2.11.8/#scala.Dynamic) Scala blanket. It is an extremely thin wrapper (less than 100 SLOC), allowing retrieval of configuration values using field-dereference syntax.
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")

0 comments on commit 463a969

Please sign in to comment.