Skip to content

Commit

Permalink
v0.23.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Nov 15, 2023
1 parent ec11182 commit d9d88e8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.23.1 - 2023-11-15

- Fixed some internal deprecation warnings.

## v0.23.0 - 2023-11-02

- The `gleam/erlang/file` module has been deprecated.
Expand Down
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "gleam_erlang"

version = "0.23.0"
version = "0.23.1"
licences = ["Apache-2.0"]
description = "A Gleam library for working with Erlang"

Expand Down
2 changes: 1 addition & 1 deletion manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# You typically do not need to edit this file

packages = [
{ name = "gleam_stdlib", version = "0.32.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "07D64C26D014CF570F8ACADCE602761EA2E74C842D26F2FD49B0D61973D9966F" },
{ name = "gleam_stdlib", version = "0.32.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "ABF00CDCCB66FABBCE351A50060964C4ACE798F95A0D78622C8A7DC838792577" },
{ name = "gleeunit", version = "0.11.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "1397E5C4AC4108769EE979939AC39BF7870659C5AFB714630DEEEE16B8272AD5" },
]

Expand Down
20 changes: 14 additions & 6 deletions src/gleam/erlang/file.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,12 @@ pub type FileInfo {
/// ```
///
@deprecated("Use the simplifile package instead")
pub fn file_info(a: String) -> Result(FileInfo, Reason) {
do_file_info(a)
}

@external(erlang, "gleam_erlang_ffi", "file_info")
pub fn file_info(a: String) -> Result(FileInfo, Reason)
fn do_file_info(a: String) -> Result(FileInfo, Reason)

/// Results in `FileInfo` about the given `path` on success, otherwise a
/// `Reason` for failure.
Expand Down Expand Up @@ -337,8 +341,12 @@ pub fn file_info(a: String) -> Result(FileInfo, Reason)
/// ```
///
@deprecated("Use the simplifile package instead")
pub fn link_info(a: String) -> Result(FileInfo, Reason) {
do_link_info(a)
}

@external(erlang, "gleam_erlang_ffi", "link_info")
pub fn link_info(a: String) -> Result(FileInfo, Reason)
fn do_link_info(a: String) -> Result(FileInfo, Reason)

/// Results in a `Bool` on success that indicates whether the given `path` has
/// a `Directory` `FileType`, otherwise a `Reason` for failure.
Expand All @@ -360,7 +368,7 @@ pub fn link_info(a: String) -> Result(FileInfo, Reason)
///
@deprecated("Use the simplifile package instead")
pub fn is_directory(path: String) -> Result(Bool, Reason) {
use FileInfo(file_type: file_type, ..) <- result.map(over: file_info(path))
use FileInfo(file_type: file_type, ..) <- result.map(over: do_file_info(path))
file_type == Directory
}

Expand All @@ -384,7 +392,7 @@ pub fn is_directory(path: String) -> Result(Bool, Reason) {
///
@deprecated("Use the simplifile package instead")
pub fn is_regular(path: String) -> Result(Bool, Reason) {
use FileInfo(file_type: file_type, ..) <- result.map(over: file_info(path))
use FileInfo(file_type: file_type, ..) <- result.map(over: do_file_info(path))
file_type == Regular
}

Expand Down Expand Up @@ -414,7 +422,7 @@ pub fn is_regular(path: String) -> Result(Bool, Reason) {
pub fn file_exists(path: String) -> Result(Bool, Reason) {
let result =
path
|> file_info
|> do_file_info
|> result.replace(True)
case result {
Error(Enoent) -> Ok(False)
Expand Down Expand Up @@ -448,7 +456,7 @@ pub fn file_exists(path: String) -> Result(Bool, Reason) {
pub fn link_exists(path: String) -> Result(Bool, Reason) {
let result =
path
|> link_info
|> do_link_info
|> result.replace(True)
case result {
Error(Enoent) -> Ok(False)
Expand Down

0 comments on commit d9d88e8

Please sign in to comment.