Skip to content

Commit

Permalink
Fix docs publishing (#1252)
Browse files Browse the repository at this point in the history
  • Loading branch information
aartigao authored Oct 1, 2023
1 parent 6290b5f commit 2a1a3d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/src/main/mdoc/consumers.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ We could combine `stopConsuming` with the custom resource handling and implement
```scala mdoc:silent
import cats.effect.{Deferred, Ref}

object WithGracefulShutdownExample extends IOApp.Simple {
object WithGracefulShutdownExampleCE2 extends IOApp.Simple {
val run: IO[Unit] = {
def processRecord(record: CommittableConsumerRecord[IO, String, String]): IO[Unit] =
IO(println(s"Processing record: $record"))
Expand Down Expand Up @@ -395,7 +395,7 @@ object WithGracefulShutdownExample extends IOApp.Simple {
For cats-effect 3 the example above will not work as in cats-effect 2, because in cats-effect 3 cancelation semantics [was changed](https://typelevel.org/cats-effect/docs/typeclasses/monadcancel). Here is the example of graceful shutdown for cats-effect 3:

```scala mdoc:silent
object WithGracefulShutdownExample extends IOApp.Simple {
object WithGracefulShutdownExampleCE3 extends IOApp.Simple {
val run: IO[Unit] = {
def processRecord(record: CommittableConsumerRecord[IO, String, String]): IO[Unit] =
IO(println(s"Processing record: $record"))
Expand Down
13 changes: 6 additions & 7 deletions docs/src/main/scala/fs2/kafka/docs/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ package fs2.kafka.docs

import fs2.kafka.build.info._
import java.nio.file.{FileSystems, Path}
import scala.collection.Seq

object Main {
def sourceDirectoryPath(rest: String*): Path =
FileSystems.getDefault.getPath(sourceDirectory.getAbsolutePath, rest: _*)

def minorVersion(version: String): String = {
val Array(major, minor, _) = version.split('.')
s"$major.$minor"
def minorVersion(version: String): String = version.split('.') match {
case Array(major, minor, _) => s"$major.$minor"
case _ => throw new IllegalArgumentException(s"Invalid major/minor: $version")
}

def majorVersion(version: String): String = {
val Array(major, _, _) = version.split('.')
major
def majorVersion(version: String): String = version.split('.') match {
case Array(major, _, _) => major
case _ => throw new IllegalArgumentException(s"Invalid major: $version")
}

def minorVersionsString(versions: Seq[String]): String = {
Expand Down

0 comments on commit 2a1a3d7

Please sign in to comment.