Skip to content

Commit

Permalink
Merge pull request #8 from rvcas/rvcas/update_otp
Browse files Browse the repository at this point in the history
feat: update gleam_otp and gleam_erlang
  • Loading branch information
rvcas authored Sep 2, 2022
2 parents 49f3d11 + da89b5b commit 7badd72
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
- uses: erlef/[email protected]
with:
otp-version: "23.2"
gleam-version: "0.19.0"
gleam-version: "0.22.1"
- run: gleam test
- run: gleam format --check src test
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ licences = ["Apache-2.0"]
description = "✨ Unique IDs for Gleam"
repository = { type = "github", user = "rvcas", repo = "ids" }

dependencies = { gleam_stdlib = "~> 0.21", gleam_otp = "~> 0.4", gleam_erlang = "~> 0.9" }
dependencies = { gleam_stdlib = "~> 0.21", gleam_otp = "~> 0.5", gleam_erlang = "~> 0.15" }
dev-dependencies = { gleeunit = "~> 0.6" }
12 changes: 6 additions & 6 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# You typically do not need to edit this file

packages = [
{ name = "gleam_erlang", version = "0.9.3", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "0430CFF5DAFAB54C97D6F19AA98BDDAD5E7AA245AC240547F4C0DBC26CDAE85E" },
{ name = "gleam_otp", version = "0.4.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "3F05090CEDFBA5B6DE2AEE20868F92E815D287E71807DAD5663DAA1B566953C2" },
{ name = "gleam_stdlib", version = "0.22.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "9C6C66EDAAFD097267089565488DEDFC111A0497DE9CB2C42248E26330CC48E9" },
{ name = "gleeunit", version = "0.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "5BF486C3E135B7F5ED8C054925FC48E5B2C79016A39F416FD8CF2E860520EE55" },
{ name = "gleam_erlang", version = "0.15.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "0C22868854FBF76F16D5B8BEFCC58C4EEAB85FF0C37214CFD06C2E3A56ACB2AC" },
{ name = "gleam_otp", version = "0.5.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "43CDB5284EEFEE6E006A3B067E23E567ACE1224A72487491E47708FB506CC8F7" },
{ name = "gleam_stdlib", version = "0.22.3", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "F2C2D389B06426E1289D5419F89BDE8E0F7F35A40B2BBB3C88188481F0D44A9F" },
{ name = "gleeunit", version = "0.6.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "A006864621DB80C4FBB0746580703502FD81A4D38D23FCB20A8120984D353DF0" },
]

[requirements]
gleam_erlang = "~> 0.9"
gleam_otp = "~> 0.4"
gleam_erlang = "~> 0.15"
gleam_otp = "~> 0.5"
gleam_stdlib = "~> 0.21"
gleeunit = "~> 0.6"
10 changes: 5 additions & 5 deletions src/ids/cuid.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import gleam/int
import gleam/list
import gleam/erlang.{Millisecond}
import gleam/otp/actor.{Continue, Next, StartResult}
import gleam/otp/process.{Sender}
import gleam/erlang/process.{Subject}
import gleam/string

/// The messages handled by the actor.
///
/// The actor shouldn't be called directly so this type is opaque.
pub opaque type Message {
Generate(Sender(String))
GenerateSlug(Sender(String))
Generate(Subject(String))
GenerateSlug(Subject(String))
}

/// The internal state of the actor.
Expand Down Expand Up @@ -46,7 +46,7 @@ pub fn start() -> StartResult(Message) {
///
/// let slug: String = cuid.slug(channel)
/// ```
pub fn generate(channel: Sender(Message)) -> String {
pub fn generate(channel: Subject(Message)) -> String {
actor.call(channel, Generate, 1000)
}

Expand All @@ -56,7 +56,7 @@ pub fn is_cuid(id: String) -> Bool {
}

/// Generates a slug using the given channel.
pub fn slug(channel: Sender(Message)) -> String {
pub fn slug(channel: Subject(Message)) -> String {
actor.call(channel, GenerateSlug, 1000)
}

Expand Down

0 comments on commit 7badd72

Please sign in to comment.