From 929f0021457bc0ba5e678bd84c19ee244e0c20d4 Mon Sep 17 00:00:00 2001 From: Hombre-x Date: Mon, 27 Apr 2026 19:19:28 -0500 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=94=A7=20Rename=20project=20to=20gato?= =?UTF-8?q?s=20on=20SBT=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sbt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 9b41f3d..223624a 100644 --- a/build.sbt +++ b/build.sbt @@ -17,13 +17,13 @@ ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("17")) ThisBuild / crossScalaVersions := Seq("2.13.15", "3.3.4") -lazy val root = tlCrossRootProject.aggregate(catscript, examples) +lazy val root = tlCrossRootProject.aggregate(gatos, examples) -lazy val catscript = crossProject(JVMPlatform, JSPlatform, NativePlatform) +lazy val gatos = crossProject(JVMPlatform, JSPlatform, NativePlatform) .crossType(CrossType.Pure) - .in(file("catscript")) + .in(file("gatos")) .settings( - name := "catscript", + name := "gatos", libraryDependencies ++= List( "org.typelevel" %% "cats-core" % "2.12.0", "org.typelevel" %% "alleycats-core" % "2.12.0", @@ -45,16 +45,16 @@ lazy val catscript = crossProject(JVMPlatform, JSPlatform, NativePlatform) lazy val examples = project .in(file("examples")) .enablePlugins(NoPublishPlugin) - .dependsOn(catscript.jvm) + .dependsOn(gatos.jvm) .settings( - name := "catscript-examples", + name := "gatos-examples", Compile / run / fork := true ) lazy val docs = project .in(file("site")) .enablePlugins(TypelevelSitePlugin) - .dependsOn(catscript.jvm) + .dependsOn(gatos.jvm) .settings( laikaConfig := LaikaConfig.defaults .withConfigValue( From 11950089fbc7d4b2b58087b8d3923bd714923350 Mon Sep 17 00:00:00 2001 From: Hombre-x Date: Mon, 27 Apr 2026 19:20:00 -0500 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=9A=9A=20Move=20files=20from=20catscr?= =?UTF-8?q?ipt=20package=20to=20gatos=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/scala/org/typelevel.gatos}/Catscript.scala | 2 +- .../scala/org/typelevel.gatos}/syntax/path/package.scala | 6 ++---- .../src/test/scala/org/typelevel/CatscriptSpec.scala | 0 .../test/scala/org/typelevel/syntax/path/SyntaxSpec.scala | 0 4 files changed, 3 insertions(+), 5 deletions(-) rename {catscript/src/main/scala/org/typelevel => gatos/src/main/scala/org/typelevel.gatos}/Catscript.scala (99%) rename {catscript/src/main/scala/org/typelevel => gatos/src/main/scala/org/typelevel.gatos}/syntax/path/package.scala (99%) rename {catscript => gatos}/src/test/scala/org/typelevel/CatscriptSpec.scala (100%) rename {catscript => gatos}/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala (100%) diff --git a/catscript/src/main/scala/org/typelevel/Catscript.scala b/gatos/src/main/scala/org/typelevel.gatos/Catscript.scala similarity index 99% rename from catscript/src/main/scala/org/typelevel/Catscript.scala rename to gatos/src/main/scala/org/typelevel.gatos/Catscript.scala index 58ac181..b32ba43 100644 --- a/catscript/src/main/scala/org/typelevel/Catscript.scala +++ b/gatos/src/main/scala/org/typelevel.gatos/Catscript.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.typelevel.catscript +package org.typelevel.gatos import cats.syntax.all.* import cats.effect.IO diff --git a/catscript/src/main/scala/org/typelevel/syntax/path/package.scala b/gatos/src/main/scala/org/typelevel.gatos/syntax/path/package.scala similarity index 99% rename from catscript/src/main/scala/org/typelevel/syntax/path/package.scala rename to gatos/src/main/scala/org/typelevel.gatos/syntax/path/package.scala index 3c2808f..c166d49 100644 --- a/catscript/src/main/scala/org/typelevel/syntax/path/package.scala +++ b/gatos/src/main/scala/org/typelevel.gatos/syntax/path/package.scala @@ -14,13 +14,11 @@ * limitations under the License. */ -package org.typelevel.catscript -package syntax +package org.typelevel.gatos.syntax import cats.effect.IO - import fs2.io.file.* - +import org.typelevel.gatos.Catscript import scodec.bits.ByteVector import scodec.Codec diff --git a/catscript/src/test/scala/org/typelevel/CatscriptSpec.scala b/gatos/src/test/scala/org/typelevel/CatscriptSpec.scala similarity index 100% rename from catscript/src/test/scala/org/typelevel/CatscriptSpec.scala rename to gatos/src/test/scala/org/typelevel/CatscriptSpec.scala diff --git a/catscript/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala b/gatos/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala similarity index 100% rename from catscript/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala rename to gatos/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala From 3d2e2f10e3bae95417702b6d97a79161e99fe75e Mon Sep 17 00:00:00 2001 From: Hombre-x Date: Mon, 27 Apr 2026 19:22:04 -0500 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20script=20object=20t?= =?UTF-8?q?o=20Gatos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{Catscript.scala => Gatos.scala} | 2 +- .../typelevel.gatos/syntax/path/package.scala | 138 +++++++++--------- .../{CatscriptSpec.scala => GatosSpec.scala} | 2 +- 3 files changed, 71 insertions(+), 71 deletions(-) rename gatos/src/main/scala/org/typelevel.gatos/{Catscript.scala => Gatos.scala} (99%) rename gatos/src/test/scala/org/typelevel/{CatscriptSpec.scala => GatosSpec.scala} (99%) diff --git a/gatos/src/main/scala/org/typelevel.gatos/Catscript.scala b/gatos/src/main/scala/org/typelevel.gatos/Gatos.scala similarity index 99% rename from gatos/src/main/scala/org/typelevel.gatos/Catscript.scala rename to gatos/src/main/scala/org/typelevel.gatos/Gatos.scala index b32ba43..15e2e51 100644 --- a/gatos/src/main/scala/org/typelevel.gatos/Catscript.scala +++ b/gatos/src/main/scala/org/typelevel.gatos/Gatos.scala @@ -29,7 +29,7 @@ import scala.concurrent.duration.FiniteDuration import java.nio.charset.Charset -object Catscript { +object Gatos { private val files: Files[IO] = Files[IO] diff --git a/gatos/src/main/scala/org/typelevel.gatos/syntax/path/package.scala b/gatos/src/main/scala/org/typelevel.gatos/syntax/path/package.scala index c166d49..0aa664b 100644 --- a/gatos/src/main/scala/org/typelevel.gatos/syntax/path/package.scala +++ b/gatos/src/main/scala/org/typelevel.gatos/syntax/path/package.scala @@ -18,7 +18,7 @@ package org.typelevel.gatos.syntax import cats.effect.IO import fs2.io.file.* -import org.typelevel.gatos.Catscript +import org.typelevel.gatos.Gatos import scodec.bits.ByteVector import scodec.Codec @@ -38,7 +38,7 @@ package object path { * @return * The file loaded in memory as a String */ - def read: IO[String] = Catscript.read(path) + def read: IO[String] = Gatos.read(path) /** * Reads the contents of the file at the path using the provided charset. @@ -52,7 +52,7 @@ package object path { * The file loaded in memory as a String */ def read(charset: Charset): IO[String] = - Catscript.read(path, charset) + Gatos.read(path, charset) /** * Reads the contents of the file at the path and returns it as a @@ -62,7 +62,7 @@ package object path { * @return * The file loaded in memory as a ByteVector */ - def readBytes: IO[ByteVector] = Catscript.readBytes(path) + def readBytes: IO[ByteVector] = Gatos.readBytes(path) /** * Reads the contents of the file at the path using UTF-8 decoding and @@ -74,7 +74,7 @@ package object path { * @return * The file loaded in memory as a collection of lines of Strings */ - def readLines: IO[List[String]] = Catscript.readLines(path) + def readLines: IO[List[String]] = Gatos.readLines(path) /** * Reads the contents of the file and deserializes its contents as `A` using @@ -88,7 +88,7 @@ package object path { * @return * The file loaded in memory as a type `A` */ - def readAs[A: Codec]: IO[A] = Catscript.readAs(path) + def readAs[A: Codec]: IO[A] = Gatos.readAs(path) // Write operations: @@ -102,7 +102,7 @@ package object path { * @param contents * The contents to write to the file */ - def write(contents: String): IO[Unit] = Catscript.write(path, contents) + def write(contents: String): IO[Unit] = Gatos.write(path, contents) /** * This function overwrites the contents of the file at the path using the @@ -117,7 +117,7 @@ package object path { * The charset to use to encode the file */ def write(contents: String, charset: Charset): IO[Unit] = - Catscript.write(path, contents, charset) + Gatos.write(path, contents, charset) /** * This function overwrites the contents of the file at the path with the @@ -129,7 +129,7 @@ package object path { * The contents to write to the file */ def writeBytes(contents: ByteVector): IO[Unit] = - Catscript.writeBytes(path, contents) + Gatos.writeBytes(path, contents) /** * This function overwrites the contents of the file at the path using UTF-8 @@ -142,7 +142,7 @@ package object path { * The contents to write to the file */ def writeLines(contents: Seq[String]): IO[Unit] = - Catscript.writeLines(path, contents) + Gatos.writeLines(path, contents) /** * The functions writes the contents of the file at the path with the @@ -160,7 +160,7 @@ package object path { * The codec that translates the type A into a ByteVector */ def writeAs[A: Codec](contents: A): IO[Unit] = - Catscript.writeAs(path, contents) + Gatos.writeAs(path, contents) /** * Similar to `write`, but appends to the file instead of overwriting it. @@ -171,7 +171,7 @@ package object path { * @param contents * The contents to write to the file */ - def append(contents: String): IO[Unit] = Catscript.append(path, contents) + def append(contents: String): IO[Unit] = Gatos.append(path, contents) /** * Similar to `write`, but appends to the file instead of overwriting it. @@ -189,7 +189,7 @@ package object path { contents: String, charset: Charset ): IO[Unit] = - Catscript.append(path, contents, charset) + Gatos.append(path, contents, charset) /** * Similar to `write`, but appends to the file instead of overwriting it. @@ -201,7 +201,7 @@ package object path { * The contents to write to the file */ def appendBytes(contents: ByteVector): IO[Unit] = - Catscript.appendBytes(path, contents) + Gatos.appendBytes(path, contents) /** * Similar to `write`, but appends to the file instead of overwriting it. @@ -214,7 +214,7 @@ package object path { * The contents to write to the file */ def appendLines(contents: Seq[String]): IO[Unit] = - Catscript.appendLines(path, contents) + Gatos.appendLines(path, contents) /** * Similar to append, but appends a single line to the end file as a newline @@ -228,7 +228,7 @@ package object path { * The contents to write to the file */ def appendLine(contents: String): IO[Unit] = - Catscript.appendLine(path, contents) + Gatos.appendLine(path, contents) /** * Similar to `write`, but appends to the file instead of overwriting it @@ -244,7 +244,7 @@ package object path { * The codec that translates the type A into a ByteVector */ def appendAs[A: Codec](contents: A): IO[Unit] = - Catscript.appendAs[A](path, contents) + Gatos.appendAs[A](path, contents) // File operations: @@ -254,7 +254,7 @@ package object path { * `path.copy(target, CopyFlags(CopyFlag.ReplaceExisting))`. */ def copy(target: Path): IO[Unit] = - Catscript.copy(path, target, CopyFlags.empty) + Gatos.copy(path, target, CopyFlags.empty) /** * Copies the source to the target, following any directives supplied in the @@ -262,25 +262,25 @@ package object path { * this can be overridden via CopyFlag.ReplaceExisting. */ def copy(target: Path, flags: CopyFlags): IO[Unit] = - Catscript.copy(path, target, flags) + Gatos.copy(path, target, flags) /** * Creates the specified directory with the permissions of "rwxrwxr-x" by * default. Fails if the parent path does not already exist. */ - def createDirectory: IO[Unit] = Catscript.createDirectory(path) + def createDirectory: IO[Unit] = Gatos.createDirectory(path) /** * Creates the specified directory with the specified permissions. Fails if * the parent path does not already exist. */ def createDirectory(permissions: Permissions): IO[Unit] = - Catscript.createDirectory(path, permissions) + Gatos.createDirectory(path, permissions) /** * Creates the specified directory and any non-existent parent directories. */ - def createDirectories: IO[Unit] = Catscript.createDirectories(path) + def createDirectories: IO[Unit] = Gatos.createDirectories(path) /** * Creates the specified directory and any parent directories, using the @@ -288,55 +288,55 @@ package object path { * this operation. */ def createDirectories(permissions: Permissions): IO[Unit] = - Catscript.createDirectories(path, permissions) + Gatos.createDirectories(path, permissions) /** * Creates the specified file with the permissions of "rw-rw-r--" by * default. Fails if the parent path does not already exist. */ - def createFile: IO[Unit] = Catscript.createFile(path) + def createFile: IO[Unit] = Gatos.createFile(path) /** * Creates the specified file with the specified permissions. Fails if the * parent path does not already exist. */ def createFile(permissions: Permissions): IO[Unit] = - Catscript.createFile(path, permissions) + Gatos.createFile(path, permissions) /** Creates a hard link with an existing file. */ def createLink(existing: Path): IO[Unit] = - Catscript.createLink(path, existing) + Gatos.createLink(path, existing) /** Creates a symbolic link which points to the supplied target. */ def createSymbolicLink(target: Path): IO[Unit] = - Catscript.createSymbolicLink(path, target) + Gatos.createSymbolicLink(path, target) /** * Creates a symbolic link which points to the supplied target with optional * permissions. */ def createSymbolicLink(target: Path, permissions: Permissions): IO[Unit] = - Catscript.createSymbolicLink(path, target, permissions) + Gatos.createSymbolicLink(path, target, permissions) // Deletion /** * Deletes the specified file or empty directory, failing if it does not * exist. */ - def delete: IO[Unit] = Catscript.delete(path) + def delete: IO[Unit] = Gatos.delete(path) /** * Deletes the specified file or empty directory, passing if it does not * exist. */ - def deleteIfExists: IO[Boolean] = Catscript.deleteIfExists(path) + def deleteIfExists: IO[Boolean] = Gatos.deleteIfExists(path) /** * Deletes the specified file or directory. If the path is a directory and * is non-empty, its contents are recursively deleted. Symbolic links are * not followed (but are deleted). */ - def deleteRecursively: IO[Unit] = Catscript.deleteRecursively(path) + def deleteRecursively: IO[Unit] = Gatos.deleteRecursively(path) /** * Deletes the specified file or directory. If the path is a directory and @@ -344,34 +344,34 @@ package object path { * followed when `followLinks` is true. */ def deleteRecursively(followLinks: Boolean): IO[Unit] = - Catscript.deleteRecursively(path, followLinks) + Gatos.deleteRecursively(path, followLinks) /** * Returns true if the specified path exists. Symbolic links are followed -- * see the overload for more details on links. */ - def exists: IO[Boolean] = Catscript.exists(path) + def exists: IO[Boolean] = Gatos.exists(path) /** * Returns true if the specified path exists. Symbolic links are followed * when `followLinks` is true. */ def exists(followLinks: Boolean): IO[Boolean] = - Catscript.exists(path, followLinks) + Gatos.exists(path, followLinks) /** * Gets `BasicFileAttributes` for the supplied path. Symbolic links are not * followed. */ def getBasicFileAttributes: IO[BasicFileAttributes] = - Catscript.getBasicFileAttributes(path) + Gatos.getBasicFileAttributes(path) /** * Gets `BasicFileAttributes` for the supplied path. Symbolic links are * followed when `followLinks` is true. */ def getBasicFileAttributes(followLinks: Boolean): IO[BasicFileAttributes] = - Catscript.getBasicFileAttributes(path, followLinks) + Gatos.getBasicFileAttributes(path, followLinks) /** * Gets the last modified time of the supplied path. The last modified time @@ -379,7 +379,7 @@ package object path { * followed. */ def getLastModifiedTime: IO[FiniteDuration] = - Catscript.getLastModifiedTime(path) + Gatos.getLastModifiedTime(path) /** * Gets the last modified time of the supplied path. The last modified time @@ -387,92 +387,92 @@ package object path { * followed when `followLinks` is true. */ def getLastModifiedTime(followLinks: Boolean): IO[FiniteDuration] = - Catscript.getLastModifiedTime(path, followLinks) + Gatos.getLastModifiedTime(path, followLinks) /** * Gets the POSIX attributes for the supplied path. Symbolic links are not * followed. */ def getPosixFileAttributes: IO[PosixFileAttributes] = - Catscript.getPosixFileAttributes(path) + Gatos.getPosixFileAttributes(path) /** * Gets the POSIX attributes for the supplied path. Symbolic links are * followed when `followLinks` is true. */ def getPosixFileAttributes(followLinks: Boolean): IO[PosixFileAttributes] = - Catscript.getPosixFileAttributes(path, followLinks) + Gatos.getPosixFileAttributes(path, followLinks) /** * Gets the POSIX permissions of the supplied path. Symbolic links are * followed. */ def getPosixPermissions: IO[PosixPermissions] = - Catscript.getPosixPermissions(path) + Gatos.getPosixPermissions(path) /** * Gets the POSIX permissions of the supplied path. Symbolic links are * followed when `followLinks` is true. */ def getPosixPermissions(followLinks: Boolean): IO[PosixPermissions] = - Catscript.getPosixPermissions(path, followLinks) + Gatos.getPosixPermissions(path, followLinks) /** * Returns true if the supplied path exists and is a directory. Symbolic * links are followed. */ - def isDirectory: IO[Boolean] = Catscript.isDirectory(path) + def isDirectory: IO[Boolean] = Gatos.isDirectory(path) /** * Returns true if the supplied path exists and is a directory. Symbolic * links are followed when `followLinks` is true. */ def isDirectory(followLinks: Boolean): IO[Boolean] = - Catscript.isDirectory(path, followLinks) + Gatos.isDirectory(path, followLinks) /** Returns true if the supplied path exists and is executable. */ - def isExecutable: IO[Boolean] = Catscript.isExecutable(path) + def isExecutable: IO[Boolean] = Gatos.isExecutable(path) /** * Returns true if the supplied path is a hidden file (note: may not check * for existence). */ - def isHidden: IO[Boolean] = Catscript.isHidden(path) + def isHidden: IO[Boolean] = Gatos.isHidden(path) /** Returns true if the supplied path exists and is readable. */ - def isReadable: IO[Boolean] = Catscript.isReadable(path) + def isReadable: IO[Boolean] = Gatos.isReadable(path) /** * Returns true if the supplied path is a regular file. Symbolic links are * followed. */ - def isRegularFile: IO[Boolean] = Catscript.isRegularFile(path) + def isRegularFile: IO[Boolean] = Gatos.isRegularFile(path) /** * Returns true if the supplied path is a regular file. Symbolic links are * followed when `followLinks` is true. */ def isRegularFile(followLinks: Boolean): IO[Boolean] = - Catscript.isRegularFile(path, followLinks) + Gatos.isRegularFile(path, followLinks) /** Returns true if the supplied path is a symbolic link. */ - def isSymbolicLink: IO[Boolean] = Catscript.isSymbolicLink(path) + def isSymbolicLink: IO[Boolean] = Gatos.isSymbolicLink(path) /** Returns true if the supplied path exists and is writable. */ - def isWritable: IO[Boolean] = Catscript.isWritable(path) + def isWritable: IO[Boolean] = Gatos.isWritable(path) /** Returns true if the supplied path reference the same file. */ - def isSameFile(path2: Path): IO[Boolean] = Catscript.isSameFile(path, path2) + def isSameFile(path2: Path): IO[Boolean] = Gatos.isSameFile(path, path2) /** Gets the contents of the specified directory. */ - def list: IO[List[Path]] = Catscript.list(path) + def list: IO[List[Path]] = Gatos.list(path) /** * Moves the source to the target, failing if source does not exist or the * target already exists. To replace the existing instead, use * `path.move(target, CopyFlags(CopyFlag.ReplaceExisting))`. */ - def move(target: Path): IO[Unit] = Catscript.move(path, target) + def move(target: Path): IO[Unit] = Gatos.move(path, target) /** * Moves the source to the target, following any directives supplied in the @@ -480,11 +480,11 @@ package object path { * this can be overridden via `CopyFlag.ReplaceExisting`. */ def move(target: Path, flags: CopyFlags): IO[Unit] = - Catscript.move(path, target, flags) + Gatos.move(path, target, flags) // Real Path /** Returns the real path i.e. the actual location of `path`. */ - def realPath: IO[Path] = Catscript.realPath(path) + def realPath: IO[Path] = Gatos.realPath(path) /** * Sets the last modified, last access, and creation time fields of the @@ -496,7 +496,7 @@ package object path { creationTime: Option[FiniteDuration], followLinks: Boolean ): IO[Unit] = - Catscript.setFileTimes( + Gatos.setFileTimes( path, lastModified, lastAccess, @@ -509,10 +509,10 @@ package object path { * systems. */ def setPosixPermissions(permissions: PosixPermissions): IO[Unit] = - Catscript.setPosixPermissions(path, permissions) + Gatos.setPosixPermissions(path, permissions) /** Gets the size of the supplied path, failing if it does not exist. */ - def size: IO[Long] = Catscript.size(path) + def size: IO[Long] = Gatos.size(path) } @@ -524,7 +524,7 @@ package object path { * Alternatively, use `tempFile` to get a resource, which is deleted upon * resource finalization. */ - def createTempFile: IO[Path] = Catscript.createTempFile + def createTempFile: IO[Path] = Gatos.createTempFile /** * Creates a temporary file. The created file is not automatically deleted - @@ -548,7 +548,7 @@ package object path { suffix: String, permissions: Permissions ): IO[Path] = - Catscript.createTempFile(dir, prefix, suffix, permissions) + Gatos.createTempFile(dir, prefix, suffix, permissions) /** * Creates a temporary directory. The created directory is not automatically @@ -556,7 +556,7 @@ package object path { * deleted. Alternatively, use `tempDirectory` to get a resource which deletes * upon resource finalization. */ - def createTempDirectory: IO[Path] = Catscript.createTempDirectory + def createTempDirectory: IO[Path] = Gatos.createTempDirectory /** * Creates a temporary directory. The created directory is not automatically @@ -577,19 +577,19 @@ package object path { prefix: String, permissions: Permissions ): IO[Path] = - Catscript.createTempDirectory(dir, prefix, permissions) + Gatos.createTempDirectory(dir, prefix, permissions) /** User's current working directory */ - def currentWorkingDirectory: IO[Path] = Catscript.currentWorkingDirectory + def currentWorkingDirectory: IO[Path] = Gatos.currentWorkingDirectory /** Returns the line separator for the specific OS */ - def lineSeparator: String = Catscript.lineSeparator + def lineSeparator: String = Gatos.lineSeparator /** * Creates a temporary file and deletes it at the end of the use of it. */ def withTempFile[A](use: Path => IO[A]): IO[A] = - Catscript.withTempFile(use) + Gatos.withTempFile(use) /** * Creates a temporary file and deletes it at the end of the use of it. @@ -617,13 +617,13 @@ package object path { suffix: String, permissions: Permissions )(use: Path => IO[A]): IO[A] = - Catscript.withTempFile(dir, prefix, suffix, permissions)(use) + Gatos.withTempFile(dir, prefix, suffix, permissions)(use) /** * Creates a temporary directory and deletes it at the end of the use of it. */ def withTempDirectory[A](use: Path => IO[A]): IO[A] = - Catscript.withTempDirectory(use) + Gatos.withTempDirectory(use) /** * Creates a temporary directory and deletes it at the end of the use of it. @@ -649,7 +649,7 @@ package object path { prefix: String, permissions: Permissions )(use: Path => IO[A]): IO[A] = - Catscript.withTempDirectory(dir, prefix, permissions)(use) + Gatos.withTempDirectory(dir, prefix, permissions)(use) /** User's home directory */ def userHome: IO[Path] = Files[IO].userHome diff --git a/gatos/src/test/scala/org/typelevel/CatscriptSpec.scala b/gatos/src/test/scala/org/typelevel/GatosSpec.scala similarity index 99% rename from gatos/src/test/scala/org/typelevel/CatscriptSpec.scala rename to gatos/src/test/scala/org/typelevel/GatosSpec.scala index 89de34b..4212201 100644 --- a/gatos/src/test/scala/org/typelevel/CatscriptSpec.scala +++ b/gatos/src/test/scala/org/typelevel/GatosSpec.scala @@ -32,7 +32,7 @@ import scala.concurrent.duration.* import syntax.path.* -object CatscriptSpec extends SimpleIOSuite with Checkers { +object GatosSpec extends SimpleIOSuite with Checkers { test("The API should delete a file") { withTempFile { path => From d620092c1a574ed4acd48620be50c785d6024a91 Mon Sep 17 00:00:00 2001 From: Hombre-x Date: Mon, 27 Apr 2026 19:36:29 -0500 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=93=9D=20Change=20instances=20of=20Ca?= =?UTF-8?q?tscript=20like=20this:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .Catscript -> .Gatos Catscript. -> Gatos. `Catscript` -> `Gatos` Catscript-. GatOS --- docs/examples/index.md | 30 +++++++------- docs/examples/solutions.md | 12 +++--- docs/index.md | 14 +++---- docs/introduction/index.md | 22 +++++------ docs/tutorial/creating_cli.md | 66 +++++++++++++++---------------- docs/tutorial/file_handling.md | 66 +++++++++++++++---------------- docs/tutorial/path.md | 2 +- docs/tutorial/reading_writing.md | 30 +++++++------- docs/wiki/file_manipulation.md | 52 ++++++++++++------------ docs/wiki/file_reading_writing.md | 50 +++++++++++------------ 10 files changed, 172 insertions(+), 172 deletions(-) diff --git a/docs/examples/index.md b/docs/examples/index.md index c3bd0f4..50f32fa 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -71,7 +71,7 @@ import cats.effect.{IO, IOApp} import fs2.io.file.Path -import catscript.syntax.path.* +import gatos.syntax.path.* object Scores extends IOApp.Simple: @@ -105,7 +105,7 @@ import cats.effect.{IO, IOApp} import fs2.io.file.Path -import catscript.Catscript +import gatos.Gatos object Scores extends IOApp.Simple: @@ -123,10 +123,10 @@ object Scores extends IOApp.Simple: def run: IO[Unit] = for - lines <- Catscript.readLines(path) + lines <- Gatos.readLines(path) scores <- lines.traverse(parseScore(_).liftTo[IO]) _ <- IO(scores.foreach(score => println(score.show))) - _ <- Catscript.appendLine(path, Score("daniela", 100).show) + _ <- Gatos.appendLine(path, Score("daniela", 100).show) yield () end Scores @@ -206,7 +206,7 @@ Here, the complete script: import cats.effect.{IO, IOApp} import fs2.io.file.Path -import catscript.syntax.path.* +import gatos.syntax.path.* object Uppercase extends IOApp.Simple: @@ -228,7 +228,7 @@ end Uppercase import cats.effect.{IO, IOApp} import fs2.io.file.Path -import catscript.syntax.Catscript +import gatos.syntax.Gatos object Uppercase extends IOApp.Simple: @@ -237,8 +237,8 @@ object Uppercase extends IOApp.Simple: def run: IO[Unit] = for - file <- Catscript.read(path) - _ <- Catscript.write(upperPath, file.toUpperCase) + file <- Gatos.read(path) + _ <- Gatos.write(upperPath, file.toUpperCase) yield () end Uppercase @@ -270,7 +270,7 @@ end Uppercase ## Places -Catscript can handle binary files in custom binary formats since it includes [scodec](https://scodec.org/). In this example, we are going to create a binary file with a list of places. +GatOS can handle binary files in custom binary formats since it includes [scodec](https://scodec.org/). In this example, we are going to create a binary file with a list of places. We start by defining type representations of the data we are going to work with: @@ -326,7 +326,7 @@ import fs2.io.file.Path import scodec.codecs.* import scodec.Codec -import catscript.syntax.path.* +import gatos.syntax.path.* object Place extends IOApp.Simple: @@ -358,7 +358,7 @@ import fs2.io.file.Path import scodec.codecs.* import scodec.Codec -import catscript.syntax.Catscript +import gatos.syntax.Gatos object Place extends IOApp.Simple: @@ -368,11 +368,11 @@ object Place extends IOApp.Simple: def run: IO[Unit] = for - exists <- Catscript.exists(path) + exists <- Gatos.exists(path) // Equivalent of doing `if (exists) IO.unit else path.createFile` - _ <- Catscript.createFile(path).unlessA(exists) - _ <- Catscript.writeAs[Place](path, Place(1, "Michael Phelps")) - place <- Catscript.readAs[Place](path) + _ <- Gatos.createFile(path).unlessA(exists) + _ <- Gatos.writeAs[Place](path, Place(1, "Michael Phelps")) + place <- Gatos.readAs[Place](path) _ <- IO.println(place) yield () diff --git a/docs/examples/solutions.md b/docs/examples/solutions.md index f72da4d..06980b9 100644 --- a/docs/examples/solutions.md +++ b/docs/examples/solutions.md @@ -7,7 +7,7 @@ This section offers possible solutions to the documentation's exercises. Refer t ```scala mdoc:compile-only import cats.effect.{IO, IOApp} import fs2.io.file.Path -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* object ReadingSolution extends IOApp.Simple: @@ -28,7 +28,7 @@ end ReadingSolution ```scala mdoc:compile-only import cats.effect.{IO, IOApp} import fs2.io.file.Path -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* object WritingSolution extends IOApp.Simple: @@ -50,7 +50,7 @@ end WritingSolution ```scala mdoc:compile-only import cats.effect.{IO, IOApp} import fs2.io.file.Path -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* object LinesSolution extends IOApp.Simple: @@ -72,7 +72,7 @@ end LinesSolution ```scala mdoc:compile-only import cats.effect.IO import fs2.io.file.Path -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* extension (path: Path) def createFileAndDirectories: IO[Unit] = @@ -88,7 +88,7 @@ extension (path: Path) import cats.syntax.all.* import cats.effect.IO import fs2.io.file.Path -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* extension (path: Path) def deleteIfChubby(threshold: Long): IO[Boolean] = @@ -104,7 +104,7 @@ extension (path: Path) ```scala mdoc:compile-only import cats.effect.{IO, Resource} import fs2.io.file.Path -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* def makeTempFile: Resource[IO, Path] = Resource.make(createTempFile)(p => p.deleteIfExists.void) diff --git a/docs/index.md b/docs/index.md index 8fc7589..52f549e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,31 +1,31 @@ -# Catscript 😸 +# GatOS 😸 **Making scripts in pure Scala much easier!** ## Getting Started -You can use Catscript in a new or existing Scala 2.13.x or 3.x project by adding it to your `build.sbt` file: +You can use GatOS in a new or existing Scala 2.13.x or 3.x project by adding it to your `build.sbt` file: ```scala libraryDependencies ++= Seq( - "org.typelevel" %% "catscript" % "@VERSION@" + "org.typelevel" %% "gatos" % "@VERSION@" ) ``` ## Example -Catscript is a library to perform common script operations such as working with processes and files while maintaining referential transparency! +GatOS is a library to perform common script operations such as working with processes and files while maintaining referential transparency! ```scala 3 mdoc:reset import cats.effect.{IO, IOApp, ExitCode} -import catscript.* -import catscript.syntax.path.* +import gatos.* +import gatos.syntax.path.* object Main extends IOApp: def run(args: List[String]): IO[ExitCode] = for home <- userHome - config = home / ".catscript" / "config.conf" + config = home / ".gatos" / "config.conf" _ <- config.createFile _ <- config.write("scripting.made.easy = true") newconfig <- config.read diff --git a/docs/introduction/index.md b/docs/introduction/index.md index f67bc39..a01406a 100644 --- a/docs/introduction/index.md +++ b/docs/introduction/index.md @@ -2,20 +2,20 @@ ## Which API should I use? -In Catscript, you have two different ways of doing things: +In GatOS, you have two different ways of doing things: -- First, if you prefer a more concise syntax, use the extension methods (e.g. `path.read()`) by importing the `catscript.syntax.path.*` package. +- First, if you prefer a more concise syntax, use the extension methods (e.g. `path.read()`) by importing the `gatos.syntax.path.*` package. -- If you prefer calling static methods, use direct method calls on the `Catscript` object (e.g., `Catscript.read(path)`). You can also import all the functions inside the `catscript.Catscript` package if you don't want to call the `Catscript` object every time (e.g., `read(path)`). +- If you prefer calling static methods, use direct method calls on the `Gatos` object (e.g., `Gatos.read(path)`). You can also import all the functions inside the `gatos.Gatos` package if you don't want to call the `Gatos` object every time (e.g., `read(path)`). -In this documentation we'll call the methods on the `Catscript` objects in the static variant to differentiate them from the extension ones. +In this documentation we'll call the methods on the `Gatos` objects in the static variant to differentiate them from the extension ones. @:select(api-style) @:choice(syntax) ```scala 3 -import catscript.syntax.all.* +import gatos.syntax.all.* val path = Path("data/test.txt") @@ -28,13 +28,13 @@ yield () @:choice(static) ```scala 3 -import catscript.Catscript +import gatos.Gatos val path = Path("data/test.txt") for - file <- Catscript.read(path) - _ <- Catscript.append(path, "I'll place this here.") + file <- Gatos.read(path) + _ <- Gatos.append(path, "I'll place this here.") yield () ``` @@ -44,11 +44,11 @@ Which one you should use really depends on your preferences and choices; if you ## Imports -If you just want to start scripting right away, importing `catscript.*` will do the trick; it imports all the extension methods and functionality you need, such as types and functions, to start working right away. +If you just want to start scripting right away, importing `gatos.*` will do the trick; it imports all the extension methods and functionality you need, such as types and functions, to start working right away. -But if you want more concise functionality, the `catscript.syntax.path.*` will only import the extension methods. +But if you want more concise functionality, the `gatos.syntax.path.*` will only import the extension methods. -For the static methods, the `catscript.Catscript` will provide the functions to work with files, if that is your preferred style. +For the static methods, the `gatos.Gatos` will provide the functions to work with files, if that is your preferred style. ## Talking about computations diff --git a/docs/tutorial/creating_cli.md b/docs/tutorial/creating_cli.md index 8b4f8e0..cd7d638 100644 --- a/docs/tutorial/creating_cli.md +++ b/docs/tutorial/creating_cli.md @@ -49,7 +49,7 @@ examples/ - `app`: This package will contain the main entry point of the application. - `cli`: This package will contain the CLI logic such as prompt parsing and command execution. -- `core`: This package will contain the business logic of the application, here is where we will use Catscript! +- `core`: This package will contain the business logic of the application, here is where we will use GatOS! - `domain`: This package will contain important business logic (mostly types) that `app`, `cli` and `core` will use. Let us first start by defining our domain. @@ -58,7 +58,7 @@ Let us first start by defining our domain. Our domain will be straightforward, we will have a `Contact` case class that will represent a contact. ```scala -//src/main/catscript/contacts/domain/contact.scala +//src/main/gatos/contacts/domain/contact.scala type Username = String type Name = String type PhoneNumber = String @@ -77,7 +77,7 @@ The type aliases are great, not only for added readability, but they also provid We will also need a function to display the contact in a nice format. ```scala 3 -//src/main/catscript/contacts/domain/contact.scala +//src/main/gatos/contacts/domain/contact.scala case class Contact( ... ): def show: String = s""" |----- $username ----- @@ -93,7 +93,7 @@ We will also define a custom error type that gets thrown when adding an already ```scala 3 -//src/main/catscript/contacts/domain/contact.scala +//src/main/gatos/contacts/domain/contact.scala case class ContactFound(username: Username) extends NoStackTrace ``` @@ -102,7 +102,7 @@ This will make `ContactFound` a subtype of `Throwable` and will allow us to prop The next step is defining the different commands that our CLI will support. ```scala 3 -//src/main/catscript/contacts/domain/argument.scala +//src/main/gatos/contacts/domain/argument.scala enum CliCommand: case AddContact case RemoveContact(username: Username) @@ -118,7 +118,7 @@ enum CliCommand: We will also need a `Flag` type to represent the different options that we can update in a contact. ```scala 3 -//src/main/catscript/contacts/domain/flag.scala +//src/main/gatos/contacts/domain/flag.scala enum Flag: case FirstNameFlag(firstName: String) case LastNameFlag(lastName: String) @@ -133,7 +133,7 @@ Now that we have our domain defined, let us move to the core of our application. In this section, we will define the core business logic of our application. We will define a `ContactManager` algebra that will contain all the logic to manage contacts: ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala` +//src/main/gatos/contacts/core/ContactManager.scala` trait ContactManager: // Save a new contact to the contact list @@ -167,12 +167,12 @@ trait ContactManager: end ContactManager ``` -Now that we have our algebra defined, let us implement it using Catscript. +Now that we have our algebra defined, let us implement it using GatOS. For that, it's common to implement the interface (or in Scala argot, the *algebra*) in the companion object of the trait: ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala +//src/main/gatos/contacts/core/ContactManager.scala object ContactManager: def apply(bookPath: Path): ContactManager = new ContactManager: @@ -202,7 +202,7 @@ Once we defined the encoding, we need a function to parse the file representatio ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala +//src/main/gatos/contacts/core/ContactManager.scala def apply(bookPath: Path): ContactManager = new ContactManager: private def parseContact(contact: String): IO[Contact] = @@ -217,7 +217,7 @@ def apply(bookPath: Path): ContactManager = new ContactManager: Next, a function to encode the contact to a string: ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala +//src/main/gatos/contacts/core/ContactManager.scala private def encodeContact(contact: Contact): String = s"${contact.username}|${contact.firstName}|${contact.lastName}|${contact.phoneNumber}|${contact.email}" ``` @@ -243,7 +243,7 @@ We first load all the contacts in memory using our `readLines` function and then We can now implement the `addContact` function: ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala +//src/main/gatos/contacts/core/ContactManager.scala override def addContact(contact: Contact): IO[Username] = for contacts <- getAll // (1) @@ -259,7 +259,7 @@ First, we read all of our contacts, line by line using the `ContactManager.getAl Now that we have the `addContact` function implemented, we can move to the `removeContact` function: ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala +//src/main/gatos/contacts/core/ContactManager.scala override def removeContact(username: Username): IO[Unit] = for contacts <- getAll @@ -273,7 +273,7 @@ Here we load all the contacts from the file, and then we filter the ones that do Now onto the search functionality. The first one is the `searchId` function: ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala +//src/main/gatos/contacts/core/ContactManager.scala override def searchUsername(username: Username): IO[Option[Contact]] = getAll.map(contacts => contacts.find(_.username === username)) ``` @@ -283,7 +283,7 @@ Again we load all the contacts from the file, and then we find the contact that The next three functions are very similar, so we will only show one of them, the `searchName` function: ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala +//src/main/gatos/contacts/core/ContactManager.scala override def searchName(name: Name): IO[List[Contact]] = getAll.map(contacts => contacts.filter(c => c.firstName === name || c.lastName === name) @@ -296,7 +296,7 @@ The first part is similar to the previous functions, we load all the contacts fr The last function we need to implement is the `updateContact` function. Be aware that this is the most complex function to implement, so we will break it down into smaller parts. ```scala 3 -//src/main/catscript/contacts/core/ContactManager.scala +//src/main/gatos/contacts/core/ContactManager.scala override def updateContact( username: Username )(modify: Contact => Contact): IO[Contact] = @@ -327,7 +327,7 @@ In this section, we will define our application's command line interface: it wil It makes little sense to define the behaviour of the CLI in terms of an interface, as there are only a few ways of interacting with the user via a console. That's why we will just wrap these functionalities in some functions in a `Cli` object: ```scala 3 -//src/main/catscript/contacts/cli/Cli.scala +//src/main/gatos/contacts/cli/Cli.scala object Cli: def addCommand ... ``` @@ -337,7 +337,7 @@ One way of passing the `ContactManager` dependency to these functions is to pass That said, the first function is going to be the `addCommand`. The idea is to ask the user the contact's information one step at a time and then add it to the contact list: ```scala 3 -//src/main/catscript/contacts/cli/Cli.scala +//src/main/gatos/contacts/cli/Cli.scala def addCommand(using cm: ContactManager): IO[Unit] = for username <- IO.println("Enter the username: ") >> IO.readLine @@ -364,7 +364,7 @@ The first five `IO.readLine` calls in the `for` comprehension ask for the contac Now the `removeCommand` function: ```scala 3 -//src/main/catscript/contacts/cli/Cli.scala +//src/main/gatos/contacts/cli/Cli.scala def removeCommand(username: Username)(using cm: ContactManager): IO[Unit] = cm.removeContact(username) >> IO.println(s"Contact $username removed") ``` @@ -373,7 +373,7 @@ It simply calls the `removeContact` function and prints a message to the user. T The `searchIdCommand` function is also straight forward, matches the `Options` returned by the `searchId` method and prints the user information if it exists: ```scala 3 -//src/main/catscript/contacts/cli/Cli.scala +//src/main/gatos/contacts/cli/Cli.scala def searchIdCommand(username: Username)(using cm: ContactManager): IO[Unit] = for contact <- cm.searchId(username) @@ -386,7 +386,7 @@ def searchIdCommand(username: Username)(using cm: ContactManager): IO[Unit] = All the `searchX` variants are fairly similar so we'll show just one of them: ```scala 3 -//src/main/catscript/contacts/cli/Cli.scala +//src/main/gatos/contacts/cli/Cli.scala def searchEmailCommand(email: Email)(using cm: ContactManager): IO[Unit] = for { contacts <- cm.searchEmail(email) @@ -401,7 +401,7 @@ Last but not least, the `updateCommand` function. We take as a first parameter the username of the contact we want to update in the database, so we can search for its existence. ```scala 3 -//src/main/catscript/contacts/cli/Cli.scala +//src/main/gatos/contacts/cli/Cli.scala def updateCommand(username: Username, options: List[Flag])( using cm: ContactManager ): IO[Unit] = @@ -428,7 +428,7 @@ This is also quite a bit of code, but let's break it down: First, we call the `updateContact` method of the `ContactManager` and pass the function that will modify the contact. To do this, we're going to reduce the list of flags using `foldLeft`. This function takes an initial value (the contact we want to update) and a function describing how to update the initial value (`acc`) with each one of the flags in turn (`flag`) (1). Where, we just use the `copy` methods and pattern match the flags to update the contact (2). After that, we print a message to the user saying that the contact was updated successfully (3). If the contact is not found, we print a message to the user saying that. ```scala 3 -//src/main/catscript/contacts/cli/Cli.scala +//src/main/gatos/contacts/cli/Cli.scala def helpCommand: IO[Unit] = IO.println: s""" @@ -464,7 +464,7 @@ We strongly suggest you to use a command line parsing library, like [Decline](ht The first thing we'll do is creating a `parsePrompt` function that will pattern match over the user input and, according to the value will return the appropriate `CliCommand`: ```scala 3 -//src/main/catscript/contacts/cli/Prompt.scala +//src/main/gatos/contacts/cli/Prompt.scala def parsePrompt(args: List[String]): CliCommand = args match case "add" :: Nil => AddContact @@ -485,7 +485,7 @@ end parsePrompt We also created a `parseUpdateFlags` function that creates a list of flags that can change the updating behaviour using a similar pattern: ```scala 3 -//src/main/catscript/contacts/cli/Prompt.scala` +//src/main/gatos/contacts/cli/Prompt.scala` private def parseUpdateFlags(options: List[String]): List[Flag] = @tailrec @@ -520,14 +520,14 @@ Because the update flags can be unordered, we case use a recursive function to m Now that we have all the required components we can define the entry point of our application. -The first thing that we need to do is create an initial function that that will create our in-memory database (located at `~/.catscript/contacts.data`) if needed: +The first thing that we need to do is create an initial function that that will create our in-memory database (located at `~/.gatos/contacts.data`) if needed: ```scala 3 -//src/main/catscript/contacts/app/App.scala +//src/main/gatos/contacts/app/App.scala private val getOrCreateBookPath: IO[Path] = for home <- userHome - dir = home / ".catscript" + dir = home / ".gatos" path = dir / "contacts.data" exists <- path.exists _ <- dir.createDirectories.unlessA(exists) @@ -548,7 +548,7 @@ getOrCreateBookPath With that, our main (`run`) function will be like this: ```scala 3 -//src/main/catscript/contacts/app/App.scala +//src/main/gatos/contacts/app/App.scala .flatMap: case given ContactManager => @@ -570,13 +570,13 @@ With that, our main (`run`) function will be like this: This is what the final code looks like: ```scala 3 -//src/main/catscript/contacts/app/App.scala +//src/main/gatos/contacts/app/App.scala object App extends IOApp: private val getOrCreateBookPath: IO[Path] = for home <- userHome - dir = home / ".catscript" + dir = home / ".gatos" path = dir / "contacts.data" exists <- path.exists _ <- dir.createDirectories.unlessA(exists) @@ -606,8 +606,8 @@ object App extends IOApp: And that's it! -We’ve created a simple CLI application that manages contacts using Catscript and Cats Effect. -We hope you enjoyed this tutorial and learned a lot about how to use Catscript in a real-world application. +We’ve created a simple CLI application that manages contacts using GatOS and Cats Effect. +We hope you enjoyed this tutorial and learned a lot about how to use GatOS in a real-world application. ### Exercise We used a hard-coded path to store our contacts. diff --git a/docs/tutorial/file_handling.md b/docs/tutorial/file_handling.md index 5acd0f5..2007318 100644 --- a/docs/tutorial/file_handling.md +++ b/docs/tutorial/file_handling.md @@ -13,7 +13,7 @@ It is generally possible to create empty files and directories using the `create @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -34,7 +34,7 @@ end Creating @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -44,8 +44,8 @@ object Creating extends IOApp.Simple: def run: IO[Unit] = for - _ <- Catscript.createFile(filePath) - created <- Catscript.exists(filePath) + _ <- Gatos.createFile(filePath) + created <- Gatos.exists(filePath) _ <- IO.println(s"File created? $created") yield () @@ -63,7 +63,7 @@ Here, we are first creating the file using the `createFile` method and then chec @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -80,7 +80,7 @@ end Creating @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -89,8 +89,8 @@ object Creating extends IOApp.Simple: val emptyDirectories = Path("create/me/first") def run: IO[Unit] = - Catscript.createDirectories(emptyDirectories) >> - Catscript.createFile(Path("now_i_can_be_created.fs")) + Gatos.createDirectories(emptyDirectories) >> + Gatos.createFile(Path("now_i_can_be_created.fs")) end Creating ``` @@ -132,7 +132,7 @@ Deleting a file is as easy as using the `delete` method: @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -153,7 +153,7 @@ end Deleting @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -163,8 +163,8 @@ object Deleting extends IOApp.Simple: def run: IO[Unit] = for - exists <- Catscript.exists(annoyingFile) - _ <- if exists then Catscript.delete(annoyingFile) + exists <- Gatos.exists(annoyingFile) + _ <- if exists then Gatos.delete(annoyingFile) else IO.unit yield () @@ -180,7 +180,7 @@ Note that we are first checking if the file exists before deleting it, this is b @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.syntax.applicative.* // You can instead import cats.syntax.all.* ! import cats.effect.{IO, IOApp} @@ -201,7 +201,7 @@ end Deleting @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.syntax.applicative.* // You can instead import cats.syntax.all.* ! import cats.effect.{IO, IOApp} @@ -212,8 +212,8 @@ object Deleting extends IOApp.Simple: def run: IO[Unit] = for - exists <- Catscript.exists(annoyingFile) - _ <- Catscript.delete(annoyingFile).whenA(exists) + exists <- Gatos.exists(annoyingFile) + _ <- Gatos.delete(annoyingFile).whenA(exists) yield () end Deleting @@ -228,7 +228,7 @@ Or even better, use the convenience method `deleteIfExists`: @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -248,7 +248,7 @@ end Deleting @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -258,7 +258,7 @@ object Deleting extends IOApp.Simple: def run: IO[Unit] = for - deleted <- Catscript.deleteIfExists(annoyingFile) + deleted <- Gatos.deleteIfExists(annoyingFile) _ <- IO.println(s"Are they reaching out? $deleted") yield () @@ -295,7 +295,7 @@ Finally, you may want to delete not one but multiple files and directories, here @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -311,7 +311,7 @@ end Deleting @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -319,7 +319,7 @@ object Deleting extends IOApp.Simple: val nonEmptyFolder = Path("downloads/non empty folder") - def run: IO[Unit] = Catscript.deleteRecursively(nonEmptyFolder) + def run: IO[Unit] = Gatos.deleteRecursively(nonEmptyFolder) end Deleting ``` @@ -370,7 +370,7 @@ The former takes as a parameter a function that describes how you want to use th @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import cats.syntax.all.* import cats.effect.{IO, IOApp} @@ -389,16 +389,16 @@ end Temporary @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import cats.syntax.all.* import cats.effect.{IO, IOApp} object Temporary extends IOApp.Simple: - def run: IO[Unit] = Catscript.withTempFile: path => + def run: IO[Unit] = Gatos.withTempFile: path => for - _ <- Catscript.writeLines(path, LazyList.from('a').map(_.toChar.toString).take(26)) - alphabet <- Catscript.read(path) + _ <- Gatos.writeLines(path, LazyList.from('a').map(_.toChar.toString).take(26)) + alphabet <- Gatos.read(path) _ <- IO.println("ASCII took hispanics into account!").whenA(alphabet.contains('ñ')) yield () @@ -416,7 +416,7 @@ The last alternative is with `createTempFile` or `createTempDirectory`. The diff @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -437,7 +437,7 @@ end Temporary @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -445,11 +445,11 @@ object Temporary extends IOApp.Simple: val secretPath = Path(".secrets/to_my_secret_lover.txt") - def run: IO[Unit] = Catscript.createTempFile.flatMap: path => + def run: IO[Unit] = Gatos.createTempFile.flatMap: path => for - _ <- Catscript.write(path,"A confession to my lover: ") - letter <- Catscript.read(secretPath) - _ <- Catscript.appendLine(path, letter) + _ <- Gatos.write(path,"A confession to my lover: ") + letter <- Gatos.read(secretPath) + _ <- Gatos.appendLine(path, letter) yield () end Temporary diff --git a/docs/tutorial/path.md b/docs/tutorial/path.md index d274524..b2bb359 100644 --- a/docs/tutorial/path.md +++ b/docs/tutorial/path.md @@ -1,6 +1,6 @@ # Using Paths -Catscript is implemented with [fs2-io](https://fs2.io/#/io), and one of the abstraction it provides is [`Path`](https://www.javadoc.io/static/co.fs2/fs2-docs_3/3.8.0/fs2/io/file/Path.html). It represents a path to a file or a directory. +GatOS is implemented with [fs2-io](https://fs2.io/#/io), and one of the abstraction it provides is [`Path`](https://www.javadoc.io/static/co.fs2/fs2-docs_3/3.8.0/fs2/io/file/Path.html). It represents a path to a file or a directory. You can start using `Path`'s by importing the type from the library: diff --git a/docs/tutorial/reading_writing.md b/docs/tutorial/reading_writing.md index baf6095..cd0f1c1 100644 --- a/docs/tutorial/reading_writing.md +++ b/docs/tutorial/reading_writing.md @@ -14,13 +14,13 @@ The first thing you need to do is import the `read` method and the `Path` type: @:choice(syntax) ```scala -import catscript.syntax.path.* +import gatos.syntax.path.* ``` @:choice(static) ```scala -import catscript.Catscript +import gatos.Gatos ``` @:@ @@ -71,7 +71,7 @@ object App extends IOApp.Simple: val path = Path("testdata/readme.txt") - def run: IO[Unit] = Catscript.read(path) + def run: IO[Unit] = Gatos.read(path) end App ``` @@ -91,7 +91,7 @@ path.read.flatMap(file => IO(println(file))) @:choice(static) ```scala -Catscript.read(path).flatMap(file => IO(println(file))) +Gatos.read(path).flatMap(file => IO(println(file))) ``` @:@ @@ -106,7 +106,7 @@ Now pass the program to the `run` method and everything should go nicely: @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -122,7 +122,7 @@ end App @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -130,7 +130,7 @@ object App extends IOApp.Simple: val path = Path("testdata/readme.txt") - def run: IO[Unit] = Catscript.read(path).flatMap(file => IO(println(file))) + def run: IO[Unit] = Gatos.read(path).flatMap(file => IO(println(file))) end App ``` @@ -163,7 +163,7 @@ To write to a file, use the `write` function to save the contents to a new file. @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -184,7 +184,7 @@ end App @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -194,9 +194,9 @@ object App extends IOApp.Simple: def run: IO[Unit] = for - file <- Catscript.read(path) + file <- Gatos.read(path) reversedFile = file.reverse - _ <- Catscript.write(path, reversedFile) + _ <- Gatos.write(path, reversedFile) yield () end App @@ -214,7 +214,7 @@ Try loading the contents of two different files, concatenating them, and saving ## Working line by line -Catscript provides a method called `readLines`, which reads the file line by line and stores them on a `List[String]`. This comes handy when you are working with a list of things that you want to convert: +GatOS provides a method called `readLines`, which reads the file line by line and stores them on a `List[String]`. This comes handy when you are working with a list of things that you want to convert: `testdata/names.data` @@ -233,7 +233,7 @@ River @:choice(syntax) ```scala mdoc:compile-only -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.syntax.path.* import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -256,7 +256,7 @@ end Names @:choice(static) ```scala mdoc:compile-only -import org.typelevel.catscript.Catscript +import org.typelevel.gatos.Gatos import fs2.io.file.Path import cats.effect.{IO, IOApp} @@ -268,7 +268,7 @@ object Names extends IOApp.Simple: def run: IO[Unit] = for - lines <- Catscript.readLines(namesPath) // (1) + lines <- Gatos.readLines(namesPath) // (1) names = lines.map(Name(_)) // (2) _ <- IO(names.foreach(println)) // (3) yield () diff --git a/docs/wiki/file_manipulation.md b/docs/wiki/file_manipulation.md index 798b979..f064cd6 100644 --- a/docs/wiki/file_manipulation.md +++ b/docs/wiki/file_manipulation.md @@ -1,6 +1,6 @@ # Handling files and doing operations -Beyond simple file reading and writing operations, Catscript allows you to interact directly with the file system. There are functions for creating and deleting files and directories, creating temporary files for short-term use and managing file and directory permissions for added control, among other useful methods. +Beyond simple file reading and writing operations, GatOS allows you to interact directly with the file system. There are functions for creating and deleting files and directories, creating temporary files for short-term use and managing file and directory permissions for added control, among other useful methods. ## Creating files and directories @@ -21,7 +21,7 @@ import fs2.io.file.{Path, Files} import org.typelevel.catscript import catscript.syntax.path.* -import catscript.Catscript +import catscript.Gatos val path = Path("testdata/dummy.something") ``` @@ -41,11 +41,11 @@ path.createFile >> path.exists // Should return true @:choice(static) ```scala mdoc:compile-only -import catscript.Catscript +import catscript.Gatos val path = Path("path/to/create/file.txt") -Catscript.createFile(path) >> Catscript.exists(path) // Should return true +Gatos.createFile(path) >> Gatos.exists(path) // Should return true ``` @:choice(fs2) @@ -81,7 +81,7 @@ directories.createDirectories >> path.createFile val directories = Path("here/are/some/dirs") val path = directories / Path("file.txt") -Catscript.createDirectories(directories) >> Catscript.createFile(path) +Gatos.createDirectories(directories) >> Gatos.createFile(path) ``` @:choice(fs2) @@ -117,10 +117,10 @@ yield () ```scala mdoc:compile-only for - path <- Catscript.createTempFile + path <- Gatos.createTempFile // It's going to be deleted eventually! - _ <- Catscript.write(path, "I don't wanna go!") + _ <- Gatos.write(path, "I don't wanna go!") yield () ``` @@ -154,8 +154,8 @@ withTempFile: path => @:choice(static) ```scala 3 mdoc:compile-only -Catscript.withTempFile: path => - Catscript.write(path, "I have accepted my fate...") +Gatos.withTempFile: path => + Gatos.write(path, "I have accepted my fate...") ``` @:choice(fs2) @@ -189,8 +189,8 @@ yield () ```scala mdoc:compile-only for - dir <- Catscript.createTempDirectory - _ <- Catscript.createFile(dir / "tempfile.tmp") + dir <- Gatos.createTempDirectory + _ <- Gatos.createFile(dir / "tempfile.tmp") yield () ``` @@ -223,8 +223,8 @@ withTempDirectory: dir => @:choice(static) ```scala 3 mdoc:compile-only -Catscript.withTempDirectory: dir => - Catscript.createFile(dir / "its_going_to_go_soon.mp3") +Gatos.withTempDirectory: dir => + Gatos.createFile(dir / "its_going_to_go_soon.mp3") ``` @:choice(fs2) @@ -258,7 +258,7 @@ linkPath.createSymbolicLink(targetPath) val linkPath = Path("store/the/link/here/symlink") val targetPath = Path("path/to/file/to/target.sh") -Catscript.createSymbolicLink(linkPath, targetPath) +Gatos.createSymbolicLink(linkPath, targetPath) ``` @:choice(fs2) @@ -291,9 +291,9 @@ path.createFile >> @:choice(static) ```scala mdoc:compile-only -Catscript.createFile(path) >> - Catscript.write(path, "TOP SECRET 🚫, MUST DELETE") >> - Catscript.delete(path) +Gatos.createFile(path) >> + Gatos.write(path, "TOP SECRET 🚫, MUST DELETE") >> + Gatos.delete(path) ``` @:choice(fs2) @@ -329,7 +329,7 @@ path.deleteIfExists >>= @:choice(static) ```scala mdoc:compile-only -Catscript.deleteIfExists(path) >>= +Gatos.deleteIfExists(path) >>= (deleted => IO.println(s"Was the file deleted? $deleted")) ``` @@ -367,8 +367,8 @@ yield () val dirs = Path("this/folders/will/be/created/and/deleted") for - _ <- Catscript.createDirectories(dirs) - _ <- Catscript.deleteRecursively(dirs) // Will delete all of them! + _ <- Gatos.createDirectories(dirs) + _ <- Gatos.deleteRecursively(dirs) // Will delete all of them! yield () ``` @@ -417,8 +417,8 @@ val source = Path("source/file/secret.txt") val target = Path("target/dir/not_so_secret.txt") for - _ <- Catscript.write(source, "The no-cloning theorem says you can't copy me!") - _ <- Catscript.copy(source, target) + _ <- Gatos.write(source, "The no-cloning theorem says you can't copy me!") + _ <- Gatos.copy(source, target) yield () ``` @@ -458,7 +458,7 @@ source.move(target) val source = Path("i/cant/move.mp4") val target = Path("teleporting/around/movie.mp4") -Catscript.move(source, target) +Gatos.move(source, target) ``` @:choice(fs2) @@ -502,9 +502,9 @@ val source = Path("need/to/ve/copied/bin.sha256") val target = Path("need/to/be/deleted/bin.sha254") for - _ <- Catscript.delete(target) // Delete before copying to avoid errors (and flags) - exists <- Catscript.exists(target) - _ <- Catscript.copy(source, target).whenA(exists) + _ <- Gatos.delete(target) // Delete before copying to avoid errors (and flags) + exists <- Gatos.exists(target) + _ <- Gatos.copy(source, target).whenA(exists) yield () ``` diff --git a/docs/wiki/file_reading_writing.md b/docs/wiki/file_reading_writing.md index 979e2a4..58b6aaf 100644 --- a/docs/wiki/file_reading_writing.md +++ b/docs/wiki/file_reading_writing.md @@ -1,6 +1,6 @@ # Reading, writing, and appending -Catscript comes with three different functions for reading and writing operations, `read`, `write` and `append`, each with four different variants: Standalone, `Bytes`, `Lines` and `As`, with these variants you will be able to work with the file and/or its contents as a UTF-8 string or with a custom `java.nio.charset.Charset`, as bytes, line by line, and with a custom codec respectively. +GatOS comes with three different functions for reading and writing operations, `read`, `write` and `append`, each with four different variants: Standalone, `Bytes`, `Lines` and `As`, with these variants you will be able to work with the file and/or its contents as a UTF-8 string or with a custom `java.nio.charset.Charset`, as bytes, line by line, and with a custom codec respectively. ```scala mdoc:invisible // This section adds every import to the code snippets @@ -11,9 +11,9 @@ import cats.syntax.all.* import fs2.Stream import fs2.io.file.{Path, Files} -import org.typelevel.catscript -import catscript.syntax.path.* -import catscript.Catscript +import org.typelevel.gatos +import gatos.syntax.path.* +import gatos.Gatos val path = Path("testdata/dummy.something") ``` @@ -33,7 +33,7 @@ This function loads the whole file as a string in memory using UTF-8 encoding. ```scala mdoc:compile-only import cats.syntax.all.* -import catscript.syntax.path.* +import gatos.syntax.path.* val path = Path("link/to/your/file.txt") @@ -45,11 +45,11 @@ path.read >>= IO.println ```scala scala mdoc:compile-only import cats.syntax.all.* -import catscript.Catscript +import gatos.Gatos val path = Path("link/to/your/file.txt") -Catscript.read(path) >>= IO.println +Gatos.read(path) >>= IO.println ``` @:choice(fs2) @@ -81,7 +81,7 @@ path.read(StandardCharsets.UTF_16) ```scala 3 mdoc:compile-only import java.nio.charset.StandardCharsets -Catscript.read(path, StandardCharsets.UTF_16) +Gatos.read(path, StandardCharsets.UTF_16) ``` @:choice(fs2) @@ -113,7 +113,7 @@ path.readBytes.map(_.rotateLeft(2)) @:choice(static) ```scala mdoc:compile-only -Catscript.readBytes(path).map(_.rotateLeft(2)) +Gatos.readBytes(path).map(_.rotateLeft(2)) ``` @:choice(fs2) @@ -149,7 +149,7 @@ yield () ```scala mdoc:compile-only for - lines <- Catscript.readLines(path) + lines <- Gatos.readLines(path) _ <- IO(lines.foreach(println)) yield () ``` @@ -186,7 +186,7 @@ import scodec.Codec case class Coordinates(x: Double, y: Double) derives Codec -Catscript.readAs[Coordinates](path).map(coord => coord.x + coord.y) +Gatos.readAs[Coordinates](path).map(coord => coord.x + coord.y) ``` @:choice(fs2) @@ -250,7 +250,7 @@ val poem = | |— Robert Herrick""".stripMargin -Catscript.write(path, poem) +Gatos.write(path, poem) ``` @:choice(fs2) @@ -297,7 +297,7 @@ import java.nio.charset.StandardCharsets val message = "Java? No thanks, I'm allergic to coffee λ" -Catscript.write(path, message, StandardCharsets.US_ASCII) +Gatos.write(path, message, StandardCharsets.US_ASCII) ``` @:choice(fs2) @@ -338,7 +338,7 @@ path.writeBytes(niceBytes) import scodec.bits.* val niceBytes = hex"DeadC0de" -Catscript.writeBytes(path, niceBytes) +Gatos.writeBytes(path, niceBytes) ``` @:choice(fs2) @@ -389,7 +389,7 @@ val todoList = List( "Take the dog for a walk" ) -Catscript.writeLines(path, todoList) +Gatos.writeLines(path, todoList) ``` @:choice(fs2) @@ -434,7 +434,7 @@ import scodec.Codec case class Rectangle(base: Float, height: Float) derives Codec -Catscript.writeAs[Rectangle](path, Rectangle(2.4, 6.0)) +Gatos.writeAs[Rectangle](path, Rectangle(2.4, 6.0)) ``` @:choice(fs2) @@ -486,8 +486,8 @@ val path = Path("path/to/append.txt") val secretFormula = "And the dish's final secret ingredient is " for - _ <- Catscript.write(path, secretFormula) - _ <- Catscript.append(path, "Rustacean legs! 🦀") + _ <- Gatos.write(path, secretFormula) + _ <- Gatos.append(path, "Rustacean legs! 🦀") yield () ``` @@ -529,7 +529,7 @@ path.append("Which encoding I'm I?", StandardCharsets.ISO_8859_1) ```scala 3 mdoc:compile-only import java.nio.charset.StandardCharsets -Catscript.append(path, "Which encoding I'm I?", StandardCharsets.ISO_8859_1) +Gatos.append(path, "Which encoding I'm I?", StandardCharsets.ISO_8859_1) ``` @:choice(fs2) @@ -568,8 +568,8 @@ yield () ```scala mdoc:compile-only for - _ <- Catscript.write(path, "I'm at the top!") - _ <- Catscript.appendLine(path, "I'm at the bottom 😞") + _ <- Gatos.write(path, "I'm at the top!") + _ <- Gatos.appendLine(path, "I'm at the bottom 😞") yield () ``` @@ -613,9 +613,9 @@ yield () import scodec.bits.ByteVector for - document <- Catscript.read(path) + document <- Gatos.read(path) signature <- IO(document.hashCode().toByte) - _ <- Catscript.appendBytes(path, ByteVector(signature)) + _ <- Gatos.appendBytes(path, ByteVector(signature)) yield () ``` @@ -663,7 +663,7 @@ val missingIngredients = Vector( "500 ml mascarpone, cold." ) -Catscript.appendLines(path, missingIngredients) +Gatos.appendLines(path, missingIngredients) ``` @:choice(fs2) @@ -712,7 +712,7 @@ import scodec.codecs.* opaque type Ranking = (Int, Long) given rankingCodec: Codec[Ranking] = uint8 :: int64 -Catscript.appendAs[Ranking](path, (2, 3120948123123L)) +Gatos.appendAs[Ranking](path, (2, 3120948123123L)) ``` @:choice(fs2) From 204b710ad0eb800cdbe5de8da5e9314cc659a6d8 Mon Sep 17 00:00:00 2001 From: Hombre-x Date: Mon, 27 Apr 2026 19:44:06 -0500 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=93=9D=20Change=20instances=20of=20Ca?= =?UTF-8?q?tscript=20like=20this:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .Catscript -> .Gatos Catscript. -> Gatos. `Catscript` -> `Gatos` Catscript-. GatOS --- README.md | 18 +++++++++--------- docs/wiki/file_manipulation.md | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6e93968..d1b91b2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Catscript 😸 +# GatOS 😸 ### _Making scripts in Scala much easier!_ -![Continuous Integration](https://github.com/typelevel/catscript/workflows/Continuous%20Integration/badge.svg) +![Continuous Integration](https://github.com/typelevel/gatos/workflows/Continuous%20Integration/badge.svg) ## Overview -Catscript is a library for working with files (and soon processes) using pure [`IO`](https://typelevel.org/cats-effect/docs/getting-started), designed to make things much easier. +GatOS (that's Spanish for Cats!) is a library for working with files (and soon processes) using pure [`IO`](https://typelevel.org/cats-effect/docs/getting-started), designed to make things much easier. **Before** ```scala 3 @@ -23,29 +23,29 @@ It does this by drastically reducing the complexity of the `Files' API and getti ## Getting Started -You can use Catscript in a new or existing Scala 2.13.x or 3.x project by adding it to your `build.sbt` file: +You can use GatOS in a new or existing Scala 2.13.x or 3.x project by adding it to your `build.sbt` file: ```scala libraryDependencies ++= List( - "org.typelevel" %% "catscript" % latest + "org.typelevel" %% "gatos" % latest ) ``` ## Example -Catscript is a library to perform common script operations such as working with processes and files while maintaining referential transparency! +GatOS is a library to perform common script operations such as working with processes and files while maintaining referential transparency! ```scala 3 mdoc:reset import cats.effect.{IO, IOApp, ExitCode} -import catscript.* -import catscript.syntax.path.* +import gatos.* +import gatos.syntax.path.* object Main extends IOApp: def run(args: List[String]): IO[ExitCode] = for home <- userHome - config = home / ".catscript" / "config.conf" + config = home / ".gatos" / "config.conf" _ <- config.createFile _ <- config.write("scripting.made.easy = true") newconfig <- config.read diff --git a/docs/wiki/file_manipulation.md b/docs/wiki/file_manipulation.md index f064cd6..f25e376 100644 --- a/docs/wiki/file_manipulation.md +++ b/docs/wiki/file_manipulation.md @@ -19,9 +19,9 @@ import cats.syntax.all.* import fs2.Stream import fs2.io.file.{Path, Files} -import org.typelevel.catscript -import catscript.syntax.path.* -import catscript.Gatos +import org.typelevel.gatos +import gatos.syntax.path.* +import gatos.Gatos val path = Path("testdata/dummy.something") ``` @@ -31,7 +31,7 @@ val path = Path("testdata/dummy.something") @:choice(syntax) ```scala mdoc:compile-only -import catscript.syntax.path.* +import gatos.syntax.path.* val path = Path("path/to/create/file.txt") @@ -41,7 +41,7 @@ path.createFile >> path.exists // Should return true @:choice(static) ```scala mdoc:compile-only -import catscript.Gatos +import gatos.Gatos val path = Path("path/to/create/file.txt") @@ -389,7 +389,7 @@ yield () ## File operations -catscript provides essential functions for renaming, moving, and copying files, allowing you to efficiently manage your data. These are especially useful in scripting scenarios. +gatos provides essential functions for renaming, moving, and copying files, allowing you to efficiently manage your data. These are especially useful in scripting scenarios. ### `copy` From 76ef47a7f6e9a67e4fb1e12ecaaa3ba100ff3f55 Mon Sep 17 00:00:00 2001 From: Hombre-x Date: Mon, 27 Apr 2026 19:44:48 -0500 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=9A=9A=20Rename=20Catscript=20to=20Ga?= =?UTF-8?q?tOS=20on=20tutorial=20and=20example=20projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scala/org/typelevel/catscript/Place.scala | 2 +- .../org/typelevel/catscript/Scores.scala | 2 +- .../org/typelevel/catscript/Uppercase.scala | 2 +- .../catscript/contacts/app/App.scala | 12 +++++------ .../catscript/contacts/cli/Cli.scala | 8 ++++---- .../catscript/contacts/cli/Prompt.scala | 6 +++--- .../contacts/core/ContactManager.scala | 6 +++--- .../catscript/contacts/domain/argument.scala | 6 +++--- .../catscript/contacts/domain/contact.scala | 2 +- .../catscript/contacts/domain/flag.scala | 2 +- .../test/scala/org/typelevel/GatosSpec.scala | 2 +- .../typelevel/syntax/path/SyntaxSpec.scala | 20 +++++++++---------- 12 files changed, 35 insertions(+), 35 deletions(-) diff --git a/examples/src/main/scala/org/typelevel/catscript/Place.scala b/examples/src/main/scala/org/typelevel/catscript/Place.scala index 13c06fe..5a5644b 100644 --- a/examples/src/main/scala/org/typelevel/catscript/Place.scala +++ b/examples/src/main/scala/org/typelevel/catscript/Place.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.typelevel.catscript +package org.typelevel.gatos import cats.syntax.applicative.* import cats.effect.{IO, IOApp} diff --git a/examples/src/main/scala/org/typelevel/catscript/Scores.scala b/examples/src/main/scala/org/typelevel/catscript/Scores.scala index 1d27c75..04ee85a 100644 --- a/examples/src/main/scala/org/typelevel/catscript/Scores.scala +++ b/examples/src/main/scala/org/typelevel/catscript/Scores.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.typelevel.catscript +package org.typelevel.gatos import cats.syntax.all.* import cats.effect.{IO, IOApp} diff --git a/examples/src/main/scala/org/typelevel/catscript/Uppercase.scala b/examples/src/main/scala/org/typelevel/catscript/Uppercase.scala index 40568c6..a5715a8 100644 --- a/examples/src/main/scala/org/typelevel/catscript/Uppercase.scala +++ b/examples/src/main/scala/org/typelevel/catscript/Uppercase.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.typelevel.catscript +package org.typelevel.gatos import cats.effect.{IO, IOApp} import fs2.io.file.Path diff --git a/examples/src/main/scala/org/typelevel/catscript/contacts/app/App.scala b/examples/src/main/scala/org/typelevel/catscript/contacts/app/App.scala index 9032dab..0743d71 100644 --- a/examples/src/main/scala/org/typelevel/catscript/contacts/app/App.scala +++ b/examples/src/main/scala/org/typelevel/catscript/contacts/app/App.scala @@ -14,22 +14,22 @@ * limitations under the License. */ -package org.typelevel.catscript.contacts.app +package org.typelevel.gatos.contacts.app import cats.syntax.applicative.* import cats.effect.{ExitCode, IO, IOApp} import fs2.io.file.Path -import org.typelevel.catscript.contacts.cli.{Cli, Prompt} -import org.typelevel.catscript.contacts.core.ContactManager -import org.typelevel.catscript.contacts.domain.argument.* -import org.typelevel.catscript.syntax.path.* +import org.typelevel.gatos.contacts.cli.{Cli, Prompt} +import org.typelevel.gatos.contacts.core.ContactManager +import org.typelevel.gatos.contacts.domain.argument.* +import org.typelevel.gatos.syntax.path.* object App extends IOApp { private val getOrCreateBookPath: IO[Path] = for { home <- userHome - dir = home / ".catscript" + dir = home / ".gatos" path = dir / "contacts.data" exists <- path.exists _ <- dir.createDirectories.unlessA(exists) diff --git a/examples/src/main/scala/org/typelevel/catscript/contacts/cli/Cli.scala b/examples/src/main/scala/org/typelevel/catscript/contacts/cli/Cli.scala index 6277246..e7d82db 100644 --- a/examples/src/main/scala/org/typelevel/catscript/contacts/cli/Cli.scala +++ b/examples/src/main/scala/org/typelevel/catscript/contacts/cli/Cli.scala @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.typelevel.catscript.contacts.cli +package org.typelevel.gatos.contacts.cli import cats.effect.IO import cats.syntax.all.* -import org.typelevel.catscript.contacts.core.ContactManager -import org.typelevel.catscript.contacts.domain.flag.* -import org.typelevel.catscript.contacts.domain.contact.* +import org.typelevel.gatos.contacts.core.ContactManager +import org.typelevel.gatos.contacts.domain.flag.* +import org.typelevel.gatos.contacts.domain.contact.* object Cli { diff --git a/examples/src/main/scala/org/typelevel/catscript/contacts/cli/Prompt.scala b/examples/src/main/scala/org/typelevel/catscript/contacts/cli/Prompt.scala index fd36f30..345c9cf 100644 --- a/examples/src/main/scala/org/typelevel/catscript/contacts/cli/Prompt.scala +++ b/examples/src/main/scala/org/typelevel/catscript/contacts/cli/Prompt.scala @@ -14,10 +14,10 @@ * limitations under the License. */ -package org.typelevel.catscript.contacts.cli +package org.typelevel.gatos.contacts.cli -import org.typelevel.catscript.contacts.domain.argument.* -import org.typelevel.catscript.contacts.domain.flag.* +import org.typelevel.gatos.contacts.domain.argument.* +import org.typelevel.gatos.contacts.domain.flag.* import scala.annotation.tailrec diff --git a/examples/src/main/scala/org/typelevel/catscript/contacts/core/ContactManager.scala b/examples/src/main/scala/org/typelevel/catscript/contacts/core/ContactManager.scala index 1ebc556..4f2fa74 100644 --- a/examples/src/main/scala/org/typelevel/catscript/contacts/core/ContactManager.scala +++ b/examples/src/main/scala/org/typelevel/catscript/contacts/core/ContactManager.scala @@ -14,13 +14,13 @@ * limitations under the License. */ -package org.typelevel.catscript.contacts.core +package org.typelevel.gatos.contacts.core import cats.syntax.all.* import cats.effect.IO import fs2.io.file.Path -import org.typelevel.catscript.syntax.path.* -import org.typelevel.catscript.contacts.domain.contact.* +import org.typelevel.gatos.syntax.path.* +import org.typelevel.gatos.contacts.domain.contact.* trait ContactManager { def addContact(contact: Contact): IO[Username] diff --git a/examples/src/main/scala/org/typelevel/catscript/contacts/domain/argument.scala b/examples/src/main/scala/org/typelevel/catscript/contacts/domain/argument.scala index ec546e9..c556d42 100644 --- a/examples/src/main/scala/org/typelevel/catscript/contacts/domain/argument.scala +++ b/examples/src/main/scala/org/typelevel/catscript/contacts/domain/argument.scala @@ -14,10 +14,10 @@ * limitations under the License. */ -package org.typelevel.catscript.contacts.domain +package org.typelevel.gatos.contacts.domain -import org.typelevel.catscript.contacts.domain.contact.* -import org.typelevel.catscript.contacts.domain.flag.Flag +import org.typelevel.gatos.contacts.domain.contact.* +import org.typelevel.gatos.contacts.domain.flag.Flag object argument { sealed abstract class CliCommand diff --git a/examples/src/main/scala/org/typelevel/catscript/contacts/domain/contact.scala b/examples/src/main/scala/org/typelevel/catscript/contacts/domain/contact.scala index f228cb5..a1ecc5c 100644 --- a/examples/src/main/scala/org/typelevel/catscript/contacts/domain/contact.scala +++ b/examples/src/main/scala/org/typelevel/catscript/contacts/domain/contact.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.typelevel.catscript.contacts.domain +package org.typelevel.gatos.contacts.domain import scala.util.control.NoStackTrace diff --git a/examples/src/main/scala/org/typelevel/catscript/contacts/domain/flag.scala b/examples/src/main/scala/org/typelevel/catscript/contacts/domain/flag.scala index 8ee90e4..4e95b40 100644 --- a/examples/src/main/scala/org/typelevel/catscript/contacts/domain/flag.scala +++ b/examples/src/main/scala/org/typelevel/catscript/contacts/domain/flag.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.typelevel.catscript.contacts.domain +package org.typelevel.gatos.contacts.domain object flag { sealed abstract class Flag diff --git a/gatos/src/test/scala/org/typelevel/GatosSpec.scala b/gatos/src/test/scala/org/typelevel/GatosSpec.scala index 4212201..fb1e146 100644 --- a/gatos/src/test/scala/org/typelevel/GatosSpec.scala +++ b/gatos/src/test/scala/org/typelevel/GatosSpec.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.typelevel.catscript +package org.typelevel.gatos import weaver.SimpleIOSuite import weaver.scalacheck.Checkers diff --git a/gatos/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala b/gatos/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala index e8f527a..6677e46 100644 --- a/gatos/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala +++ b/gatos/src/test/scala/org/typelevel/syntax/path/SyntaxSpec.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.typelevel.catscript +package org.typelevel.gatos package syntax import weaver.SimpleIOSuite @@ -35,9 +35,9 @@ object SyntaxSpec extends SimpleIOSuite with Checkers { _ <- path.write(contents) _ <- path.append("Hi from the test!") s1 <- path.read - _ <- Catscript.write(path, contents) - _ <- Catscript.append(path, "Hi from the test!") - s2 <- Catscript.read(path) + _ <- Gatos.write(path, contents) + _ <- Gatos.append(path, "Hi from the test!") + s2 <- Gatos.read(path) } yield expect.same(s1, s2) } } @@ -52,9 +52,9 @@ object SyntaxSpec extends SimpleIOSuite with Checkers { _ <- path.createFile exists <- path.exists deleted <- path.deleteIfExists - _ <- Catscript.createFile(path) - exists2 <- Catscript.exists(path) - deleted2 <- Catscript.deleteIfExists(path) + _ <- Gatos.createFile(path) + exists2 <- Gatos.exists(path) + deleted2 <- Gatos.deleteIfExists(path) } yield expect(exists && deleted) and expect(exists2 && deleted2) } } @@ -70,7 +70,7 @@ object SyntaxSpec extends SimpleIOSuite with Checkers { for { _ <- original.write(contents) _ <- original.copy(copy1) - _ <- Catscript.copy(original, copy2) + _ <- Gatos.copy(original, copy2) s1 <- copy1.read s2 <- copy2.read } yield expect.same(s1, s2) @@ -93,8 +93,8 @@ object SyntaxSpec extends SimpleIOSuite with Checkers { _ <- moved.delete - _ <- Catscript.write(original, contents) - _ <- Catscript.move(original, moved) + _ <- Gatos.write(original, contents) + _ <- Gatos.move(original, moved) exists2 <- moved.exists } yield expect(exists && exists2) } From 47d9436484e6520a25b99b7e85f255bcb8105ccb Mon Sep 17 00:00:00 2001 From: Hombre-x Date: Mon, 27 Apr 2026 19:46:24 -0500 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=91=B7=20Rename=20packages=20on=20ci?= =?UTF-8?q?=20cd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e44dfb3..2aba730 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,11 +83,11 @@ jobs: - name: Make target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: mkdir -p catscript/.js/target catscript/.native/target catscript/.jvm/target project/target + run: mkdir -p gatos/.native/target gatos/.js/target gatos/.jvm/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: tar cf targets.tar catscript/.js/target catscript/.native/target catscript/.jvm/target project/target + run: tar cf targets.tar gatos/.native/target gatos/.js/target gatos/.jvm/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') @@ -244,7 +244,7 @@ jobs: - name: Submit Dependencies uses: scalacenter/sbt-dependency-submission@v2 with: - modules-ignore: catscript-examples_2.13 catscript-examples_3 rootjs_2.13 rootjs_3 docs_2.13 docs_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3 + modules-ignore: gatos-examples_2.13 gatos-examples_3 rootjs_2.13 rootjs_3 docs_2.13 docs_3 rootjvm_2.13 rootjvm_3 rootnative_2.13 rootnative_3 configs-ignore: test scala-tool scala-doc-tool test-internal site: