Skip to content

Commit 26f9f90

Browse files
committed
scala 3.0.0-RC2
1 parent 4aefa6c commit 26f9f90

File tree

5 files changed

+17
-26
lines changed

5 files changed

+17
-26
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ Scala regex collection
55

66
Scala-regex-collection is a pure scala regex collection
77
## Add the library to your project
8-
`libraryDependencies += "com.github.gekomad" %% "scala-regex-collection" % "1.0.1"`
8+
9+
The latest version of the library is available for Scala 2.12, 2.13 and 3.0.
10+
11+
`libraryDependencies += "com.github.gekomad" %% "scala-regex-collection" % "2.0.0"`
912

1013
## Using Library
1114

build.sbt

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
11
name := "scala-regex-collection"
22

3-
version := "1.0.1"
3+
version := "2.0.0"
44

5-
scalaVersion := "2.13.1"
5+
scalaVersion := "3.0.0-RC2"
66
organization := "com.github.gekomad"
77

8-
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.0-M2" % Test
8+
libraryDependencies += "org.typelevel" %% "discipline-scalatest" % "2.1.3" % Test
9+
crossScalaVersions := Seq("2.12.8", "2.13.5", "3.0.0-RC2")
910

10-
crossScalaVersions := Seq("2.10.7", "2.11.12", "2.12.6", "2.12.8", "2.13.0", "2.13.1")
11-
12-
scalacOptions ++= Seq(
13-
"-deprecation",
14-
"-encoding", "UTF-8",
15-
"-language:postfixOps",
16-
"-feature",
17-
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
18-
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
19-
"-Ywarn-dead-code", // Warn when dead code is identified.
20-
"-explaintypes", // Explain type errors in more detail.
21-
"-Xfatal-warnings"
22-
)
11+
scalacOptions ++= Seq("-deprecation", "-language:postfixOps", "-feature", "-unchecked", "-Xfatal-warnings")
2312

2413
publishTo := sonatypePublishTo.value
25-

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.3.6
1+
sbt.version=1.5.0-RC2

src/main/scala/com/github/gekomad/regexcollection/Validator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ object Collection {
142142
def extractToList(mi: Regex.MatchIterator, acc: List[String]): List[String] =
143143
if (!mi.hasNext) acc
144144
else
145-
extractToList(mi, acc ::: List(mi.next))
145+
extractToList(mi, acc ::: List(mi.next()))
146146

147147
extractToList(r.findAllIn(a), Nil)
148148
}

src/test/scala/ReadFile.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class ReadFile extends AnyFunSuite {
88
import com.github.gekomad.regexcollection.Validate.findAll
99
import java.io.File
1010
import scala.util.Try
11-
def getListOfFiles(dir: String)(f : File => Unit): Unit = {
12-
def go(dir: File): Unit= dir match {
13-
case d if d.exists && d.isDirectory && d.canRead=>
11+
def getListOfFiles(dir: String)(f: File => Unit): Unit = {
12+
def go(dir: File): Unit = dir match {
13+
case d if d.exists && d.isDirectory && d.canRead =>
1414
val files = d.listFiles.filter(a => a.canRead && a.isFile).toList
1515
val dirs = dir.listFiles.filter(_.isDirectory).toList
1616
files.foreach(f)
@@ -20,9 +20,9 @@ class ReadFile extends AnyFunSuite {
2020
go(new File(dir))
2121
}
2222

23-
getListOfFiles("/") { filename =>
23+
getListOfFiles("/") { filename =>
2424
Try {
25-
for (line <- Source.fromFile(filename).getLines) {
25+
for (line <- Source.fromFile(filename).getLines()) {
2626
findAll[Email](line).foreach(a => println(s"$filename: [Email] $a"))
2727
findAll[Time24](line).foreach(a => println(s"$filename: [Time24] $a"))
2828
findAll[ApacheError](line).foreach(a => println(s"$filename: [ApacheError] $a"))
@@ -38,9 +38,9 @@ class ReadFile extends AnyFunSuite {
3838
findAll[DMY3](line).foreach(a => println(s"$filename: [DMY3] $a"))
3939
findAll[UUID](line).foreach(a => println(s"$filename: [UUID] $a"))
4040
findAll[Youtube](line).foreach(a => println(s"$filename: [Youtube] $a"))
41-
4241
}
4342
}
43+
()
4444
}
4545
}
4646

0 commit comments

Comments
 (0)