Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Upgraded `birl` to v1.8.0.
- Upgraded `gleam_erlang` to v1.2.0.
- Upgraded `gleam_otp` to v1.0.0.
- Upgraded `gleam_stdlib` to v0.62.0.

## [1.0.0] - 2024-04-12

- Initial release.
Expand Down
10 changes: 5 additions & 5 deletions gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ licenses = ["MIT"]
repository = { type = "github", user = "maxdeviant", repo = "bigben" }

[dependencies]
birl = "~> 1.6"
gleam_erlang = "~> 0.25"
gleam_otp = "~> 0.10"
gleam_stdlib = "~> 0.34 or ~> 1.0"
birl = ">= 1.8.0 and < 2.0.0"
gleam_erlang = ">= 1.2.0 and < 2.0.0"
gleam_otp = ">= 1.0.0 and < 2.0.0"
gleam_stdlib = ">= 0.62.0 and < 1.0.0"

[dev-dependencies]
gleeunit = "~> 1.0"
gleeunit = ">= 1.6.1 and < 2.0.0"
24 changes: 13 additions & 11 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
# You typically do not need to edit this file

packages = [
{ name = "birl", version = "1.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib", "ranger"], otp_app = "birl", source = "hex", outer_checksum = "976CFF85D34D50F7775896615A71745FBE0C325E50399787088F941B539A0497" },
{ name = "gleam_erlang", version = "0.25.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "054D571A7092D2A9727B3E5D183B7507DAB0DA41556EC9133606F09C15497373" },
{ name = "gleam_otp", version = "0.10.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "0B04FE915ACECE539B317F9652CAADBBC0F000184D586AAAF2D94C100945D72B" },
{ name = "gleam_stdlib", version = "0.36.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "C0D14D807FEC6F8A08A7C9EF8DFDE6AE5C10E40E21325B2B29365965D82EB3D4" },
{ name = "gleeunit", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "72CDC3D3F719478F26C4E2C5FED3E657AC81EC14A47D2D2DEBB8693CA3220C3B" },
{ name = "ranger", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "ranger", source = "hex", outer_checksum = "1566C272B1D141B3BBA38B25CB761EF56E312E79EC0E2DFD4D3C19FB0CC1F98C" },
{ name = "birl", version = "1.8.0", build_tools = ["gleam"], requirements = ["gleam_regexp", "gleam_stdlib", "ranger"], otp_app = "birl", source = "hex", outer_checksum = "2AC7BA26F998E3DFADDB657148BD5DDFE966958AD4D6D6957DD0D22E5B56C400" },
{ name = "gleam_erlang", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "F91CE62A2D011FA13341F3723DB7DB118541AAA5FE7311BD2716D018F01EF9E3" },
{ name = "gleam_otp", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib"], otp_app = "gleam_otp", source = "hex", outer_checksum = "7020E652D18F9ABAC9C877270B14160519FA0856EE80126231C505D719AD68DA" },
{ name = "gleam_regexp", version = "1.1.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_regexp", source = "hex", outer_checksum = "9C215C6CA84A5B35BB934A9B61A9A306EC743153BE2B0425A0D032E477B062A9" },
{ name = "gleam_stdlib", version = "0.62.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "DC8872BC0B8550F6E22F0F698CFE7F1E4BDA7312FDEB40D6C3F44C5B706C8310" },
{ name = "gleam_yielder", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_yielder", source = "hex", outer_checksum = "8E4E4ECFA7982859F430C57F549200C7749823C106759F4A19A78AEA6687717A" },
{ name = "gleeunit", version = "1.6.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "FDC68A8C492B1E9B429249062CD9BAC9B5538C6FBF584817205D0998C42E1DAC" },
{ name = "ranger", version = "1.4.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_yielder"], otp_app = "ranger", source = "hex", outer_checksum = "C8988E8F8CDBD3E7F4D8F2E663EF76490390899C2B2885A6432E942495B3E854" },
]

[requirements]
birl = { version = "~> 1.6" }
gleam_erlang = { version = "~> 0.25"}
gleam_otp = { version = "~> 0.10" }
gleam_stdlib = { version = "~> 0.34 or ~> 1.0" }
gleeunit = { version = "~> 1.0" }
birl = { version = ">= 1.8.0 and < 2.0.0" }
gleam_erlang = { version = ">= 1.2.0 and < 2.0.0" }
gleam_otp = { version = ">= 1.0.0 and < 2.0.0" }
gleam_stdlib = { version = ">= 0.62.0 and < 1.0.0" }
gleeunit = { version = ">= 1.6.1 and < 2.0.0" }
9 changes: 5 additions & 4 deletions src/bigben/fake_clock.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ pub fn new() -> FakeClock {

/// Returns a new `FakeClock` at the given time.
pub fn new_at(now: Time) -> FakeClock {
let assert Ok(subject) = actor.start(now, handle_message)
FakeClock(subject)
let assert Ok(actor) =
actor.new(now) |> actor.on_message(handle_message) |> actor.start
FakeClock(actor.data)
}

/// Returns the current time on the given `FakeClock`.
pub fn now(clock: FakeClock) -> Time {
process.call(clock.subject, Get, 10)
process.call(clock.subject, 10, Get)
}

/// Sets the current time on the given `FakeClock` to the specified value.
Expand All @@ -44,7 +45,7 @@ type Message {
Advance(Duration)
}

fn handle_message(message: Message, state: Time) {
fn handle_message(state: Time, message: Message) {
case message {
Get(client) -> {
process.send(client, state)
Expand Down