Skip to content

Commit a1a8262

Browse files
committed
Upgrade version and docs
1 parent f9f8057 commit a1a8262

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

build.sbt

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import com.sun.xml.internal.messaging.saaj.util.ByteInputStream
21
import microsites.CdnDirectives
32

4-
import scala.tools.nsc.interpreter.InputStream
5-
63
lazy val root = (project in file("."))
74
.dependsOn(macros)
85
.settings(
@@ -110,4 +107,3 @@ lazy val rootBuildSettings = Seq(
110107
pomIncludeRepository := { _ => false },
111108
publishMavenStyle := true
112109
)
113-

docs/src/main/tut/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ Easy ! Use `safeStr"your log $a $b, $c"` instead of `s"your log $a $b, $c"` !
2727
Add this in your build.sbt
2828

2929
```scala
30-
libraryDependencies += "io.github.afsalthaj" %% "safe-string" % "1.2.8"
30+
libraryDependencies += "io.github.afsalthaj" %% "safe-string" % "1.2.9"
3131
```
3232

3333
Or, in ammonite;
3434

3535
```scala
36-
@ import $ivy.`io.github.afsalthaj::safe-string:1.2.8`
36+
@ import $ivy.`io.github.afsalthaj::safe-string:1.2.9`
3737
import $ivy.$
3838
```
3939

macros/src/main/scala/com/thaj/safe/string/interpolator/SafeString.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ object SafeString {
5858
val r: Set[c.universe.Tree] =
5959
nextElement.tpe.members.collect {
6060
case CaseClassFieldAndName(nme, typ) =>
61-
q"""com.thaj.safe.string.interpolator.Field(${nme.toString}, $nextElement.$nme)"""
61+
q"""com.thaj.safe.string.interpolator.Field(${nme.toString}, $nextElement.$nme.asStr)"""
6262
}.toSet
6363

6464
val field = q"""com.thaj.safe.string.interpolator.SafeString.Macro.jsonLike($r.map(_.toString))"""

test/src/test/scala/test/com/thaj/safe/string/interpolator/SafeStringSpec.scala

+19-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package test.com.thaj.safe.string.interpolator
33
import com.thaj.safe.string.interpolator.SafeString._
44
import com.thaj.safe.string.interpolator.Secret
55
import org.specs2.{ScalaCheck, Specification}
6-
import scalaz.NonEmptyList
6+
import scalaz.{@@, NonEmptyList, Tag}
7+
import test.com.thaj.safe.string.interpolator.SafeStringSpec.Xxx.{NewTaggedType, StringTT, StringTTT, TaggedType}
78

89
object SafeStringSpec extends Specification with ScalaCheck {
910
def is =
@@ -18,6 +19,7 @@ object SafeStringSpec extends Specification with ScalaCheck {
1819
SafeString works for GADTs $testGADT
1920
SafeString works for maps in case class $testMap
2021
SafeString works for case class with map and nonemptylist $testMapWithNonEmptyList
22+
SafeString works for case class with tagged type in it $testMultipleTaggedType
2123
"""
2224

2325
final case class Dummy(name: String, age: Int)
@@ -92,4 +94,20 @@ object SafeStringSpec extends Specification with ScalaCheck {
9294
prop { a: String =>
9395
safeStr"works for gadt ${TestMapWithNonEmptyList(Map(a -> NonEmptyList(a, a)))}".string must_=== s"works for gadt { mapN: ${a} -> ${a},${a} }"
9496
}
97+
98+
final case class CaseTag(d: StringTTT, f: StringTT)
99+
100+
object Xxx {
101+
102+
sealed trait TaggedType
103+
type StringTT = String @@ TaggedType
104+
105+
sealed trait NewTaggedType
106+
type StringTTT = String @@ NewTaggedType
107+
}
108+
109+
private def testMultipleTaggedType =
110+
prop { a: String =>
111+
safeStr"works for taggedtypes ${CaseTag(Tag[String, NewTaggedType](a), Tag[String, TaggedType](a))}".string must_=== s"works for taggedtypes { f: ${a}, d: ${a} }"
112+
}
95113
}

version.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "1.2.8"
1+
version in ThisBuild := "1.2.9"

0 commit comments

Comments
 (0)