Skip to content

Commit

Permalink
vbump v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bunopnu committed Apr 13, 2024
1 parent b0a2d27 commit dbaa464
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 bunopnu <[email protected]>
Copyright (c) 2024 bunopnu <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gleam add glevatar

## Compatibility

This library requires Gleam version `0.32.0` or later.
This library requires Gleam version `1.0.0` or later.

## Example

Expand Down
8 changes: 4 additions & 4 deletions gleam.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name = "glevatar"
version = "0.1.1"
version = "0.1.2"
description = "Easily create Gravatar URLs in Gleam"
gleam = ">= 0.32.0"
gleam = ">= 1.0.0"

licences = ["MIT"]
repository = { type = "github", user = "bunopnu", repo = "glevatar" }

[dependencies]
gleam_stdlib = "~> 0.32"
gleam_stdlib = "~> 0.36"
glesha = "~> 0.1"

[dev-dependencies]
gleeunit = "~> 0.11"
gleeunit = "~> 1.1"

[javascript.deno]
allow_read = ["./"]
10 changes: 5 additions & 5 deletions manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# 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 = "gleeunit", version = "0.11.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "1397E5C4AC4108769EE979939AC39BF7870659C5AFB714630DEEEE16B8272AD5" },
{ name = "glesha", version = "0.1.3", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glesha", source = "hex", outer_checksum = "8DC5F211670C12870FC36C211B8C0A0FFB07BC83708484174CAE1F9DA4B8AF9F" },
{ 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 = "glesha", version = "0.1.4", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glesha", source = "hex", outer_checksum = "31AAC355BF83A0565D858252F81193A61F4E6C3763D071EA6F76BA7686E8A65A" },
]

[requirements]
gleam_stdlib = { version = "~> 0.32" }
gleeunit = { version = "~> 0.11" }
gleam_stdlib = { version = "~> 0.36" }
gleeunit = { version = "~> 1.1" }
glesha = { version = "~> 0.1" }
14 changes: 7 additions & 7 deletions src/glevatar.gleam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//// Easily create Gravatar URLs in Gleam.

import gleam/map
import gleam/dict
import gleam/int
import gleam/bit_array
import gleam/uri
Expand All @@ -9,7 +9,7 @@ import glesha

/// This type defines a Gravatar builder, which should not be manually modified.
pub type GravatarBuilder =
#(String, map.Map(String, String))
#(String, dict.Dict(String, String))

/// This type is employed when the provided email address does not correspond to any Gravatar image.
pub type DefaultImage {
Expand Down Expand Up @@ -53,13 +53,13 @@ pub fn new(email: String) -> GravatarBuilder {
|> glesha.hash(glesha.Sha256)
|> glesha.encode_hex()

#(hash, map.new())
#(hash, dict.new())
}

/// Set a specific image size; the default is `80`.
pub fn set_size(builder: GravatarBuilder, size: Int) -> GravatarBuilder {
let #(hash, options) = builder
#(hash, map.insert(options, "s", int.to_string(size)))
#(hash, dict.insert(options, "s", int.to_string(size)))
}

/// Set the default image to be used when the provided email address doesn't match any image.
Expand All @@ -80,7 +80,7 @@ pub fn set_default_image(
CustomImage(url) -> url
}

#(hash, map.insert(options, "d", value))
#(hash, dict.insert(options, "d", value))
}

/// Set image rating restrictions.
Expand All @@ -96,7 +96,7 @@ pub fn set_rating(
Adult -> "x"
}

#(hash, map.insert(options, "r", value))
#(hash, dict.insert(options, "r", value))
}

/// Convert the `GravatarBuilder` into an Uri structure.
Expand All @@ -106,7 +106,7 @@ pub fn to_uri(builder: GravatarBuilder) -> uri.Uri {
let path = "/avatar/" <> hash
let query =
options
|> map.to_list
|> dict.to_list
|> uri.query_to_string

uri.Uri(
Expand Down
4 changes: 2 additions & 2 deletions test/glevatar_test.gleam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gleeunit
import gleeunit/should
import gleam/map
import gleam/dict
import glevatar

pub fn main() {
Expand All @@ -11,7 +11,7 @@ pub fn basic_builder_test() {
let got = glevatar.new("[email protected]")
let expected = #(
"973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b",
map.new(),
dict.new(),
)

should.equal(got, expected)
Expand Down

0 comments on commit dbaa464

Please sign in to comment.