This repository was archived by the owner on Aug 17, 2019. It is now read-only.
File tree 4 files changed +28
-13
lines changed
src/main/scala/com/ckkloverdos/sys
4 files changed +28
-13
lines changed Original file line number Diff line number Diff line change 3
3
project.organization =com.ckkloverdos
4
4
project.name =sysprop
5
5
sbt.version =0.7.7
6
- project.version =0.1.0
6
+ project.version =0.2.0-SNAPSHOT
7
7
publish.remote =false
8
- build.scala.versions =2.9.1 2.8.2 2.8.1
8
+ build.scala.versions =2.9.1
9
9
project.initialize =false
Original file line number Diff line number Diff line change @@ -56,20 +56,12 @@ class SysProp(info: ProjectInfo) extends DefaultProject(info) {
56
56
<developer >
57
57
<id >loverdos</id >
58
58
<name >Christos KK Loverdos </name >
59
+ <email >loverdos@ gmail.com</email >
59
60
</developer >
60
61
</developers >;
61
62
62
- // val lib_slf4j = "org.slf4j" % "slf4j-api" % "1.6.1" % "compile" withSources()
63
- // val lib_logback_simple = "ch.qos.logback" % "logback-classic" % "0.9.28" % "test" withSources()
64
- // val lib_junit_interface = "com.novocode" % "junit-interface" % "0.7" % "test"
65
- // val lib_scalatest = "org.scalatest" % "scalatest_2.9.0" % "1.4.1" % "test" withSources()
66
- // val lib_maybe = buildScalaVersion match {
67
- // case "2.8.2" => "com.ckkloverdos" % "maybe_2.8.2" % "0.1.0" % "compile" withSources()
68
- // case "2.9.1" => "com.ckkloverdos" % "maybe_2.9.1" % "0.1.0" % "compile" withSources()
69
- // case v => error("Unsupported Scala version " + v)
70
- // }
71
-
72
- val lib_maybe = " com.ckkloverdos" % " maybe_%s" .format(buildScalaVersion) % " 0.3.0" % " compile" withSources()
63
+ val lib_maybe = " com.ckkloverdos" %% " maybe" % " 0.4.0-SNAPSHOT" % " compile" withSources()
64
+ val lib_converter = " com.ckkloverdos" %% " converter" % " 0.4.0-SNAPSHOT" % " compile" withSources()
73
65
74
66
override def testOptions =
75
67
super .testOptions ++
Original file line number Diff line number Diff line change 16
16
17
17
package com .ckkloverdos .sys
18
18
19
+ import com .ckkloverdos .convert .Converters
20
+
19
21
/**
20
22
* Abstraction for environment variables.
21
23
*
@@ -53,4 +55,15 @@ object SysEnv {
53
55
lazy val LC_CTYPE = this (" LC_CTYPE" )
54
56
55
57
def apply (name : String ): SysEnv = new SysEnv (name)
58
+
59
+ def isSysEnvTrue (name : String )(implicit converters : Converters = Converters .DefaultConverters ): Boolean = {
60
+ val maybeValue = for {
61
+ propValue <- SysEnv (name)
62
+ booleanValue <- converters.convertToBoolean(propValue)
63
+ } yield {
64
+ booleanValue
65
+ }
66
+
67
+ maybeValue.getOr(false )
68
+ }
56
69
}
Original file line number Diff line number Diff line change 17
17
package com .ckkloverdos .sys
18
18
19
19
import collection .immutable .SortedSet
20
+ import com .ckkloverdos .convert .Converters
20
21
21
22
/**
22
23
* Abstraction for jvm system properties.
@@ -92,4 +93,13 @@ object SysProp {
92
93
)
93
94
94
95
def apply (name : String ): SysProp = new SysProp (name)
96
+
97
+ def isSysPropTrue (name : String )(implicit converters : Converters = Converters .DefaultConverters ): Boolean = {
98
+ val maybeValue = for {
99
+ propValue <- SysProp (name)
100
+ booleanValue <- converters.convertToBoolean(propValue)
101
+ } yield booleanValue
102
+
103
+ maybeValue.getOr(false )
104
+ }
95
105
}
You can’t perform that action at this time.
0 commit comments