Compare commits
4 Commits
e5312509b9
...
4f8f8e22bf
Author | SHA1 | Date |
---|---|---|
Bauke | 4f8f8e22bf | |
Bauke | d38c3bbebd | |
Bauke | a73c981a82 | |
Bauke | 72fd56f313 |
|
@ -1,14 +1,7 @@
|
||||||
# Generated by Cargo
|
# Generated by Cargo
|
||||||
# will have compiled files and executables
|
Cargo.lock
|
||||||
debug/
|
debug/
|
||||||
target/
|
target/
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
# Code coverage results
|
||||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
coverage/
|
||||||
Cargo.lock
|
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
|
||||||
**/*.rs.bk
|
|
||||||
|
|
||||||
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
||||||
*.pdb
|
|
||||||
|
|
10
Cargo.toml
10
Cargo.toml
|
@ -3,10 +3,10 @@
|
||||||
[package]
|
[package]
|
||||||
name = "gravatar-rs"
|
name = "gravatar-rs"
|
||||||
description = "Gravatar image URL library"
|
description = "Gravatar image URL library"
|
||||||
authors = ["Holllo <helllo@holllo.cc>"]
|
|
||||||
version = "0.2.0"
|
|
||||||
license = "MIT OR Apache-2.0"
|
|
||||||
repository = "https://github.com/Holllo/gravatar-rs"
|
repository = "https://github.com/Holllo/gravatar-rs"
|
||||||
|
license = "MIT OR Apache-2.0"
|
||||||
|
version = "0.2.1"
|
||||||
|
authors = ["Holllo <helllo@holllo.org>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
keywords = ["gravatar", "ivatar", "libravatar"]
|
keywords = ["gravatar", "ivatar", "libravatar"]
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ path = "source/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
md5 = "0.7.0"
|
md5 = "0.7.0"
|
||||||
urlencoding = "2.1.0"
|
urlencoding = "2.1.2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
insta = "1.14.0"
|
insta = "1.20.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 Holllo <helllo@holllo.cc>
|
Copyright (c) 2022 Holllo <helllo@holllo.org>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
20
README.md
20
README.md
|
@ -1,28 +1,30 @@
|
||||||
# gravatar-rs
|
# Gravatar 📇 Rust
|
||||||
|
|
||||||
> Gravatar image URL library
|
> **Gravatar image URL library for Rust.**
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
For full documentation see [docs.rs].
|
For full documentation see [docs.rs](https://docs.rs/gravatar-rs).
|
||||||
|
|
||||||
[docs.rs]: https://docs.rs/gravatar-rs
|
## Example
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
use gravatar_rs::Generator;
|
use gravatar_rs::Generator;
|
||||||
|
|
||||||
let generator = Generator::default();
|
let generator = Generator::default();
|
||||||
|
|
||||||
let gravatar_url = generator.generate("helllo@holllo.cc");
|
let gravatar_url = generator.generate("helllo@holllo.org");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
gravatar_url,
|
gravatar_url,
|
||||||
"https://www.gravatar.com/avatar/ebff9105dce4954b1bdb57fdab079ff3"
|
"https://www.gravatar.com/avatar/e9a2c03d607ec80a5b725ad42c19ee36"
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Feedback
|
||||||
|
|
||||||
|
Found a problem or want to request a new feature? Email [helllo@holllo.org](mailto:helllo@holllo.org) and I'll see what I can do for you.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed under either of [Apache License, Version 2.0](https://github.com/Holllo/gravatar-rs/blob/main/LICENSE-Apache) or [MIT license](https://github.com/Holllo/gravatar-rs/blob/main/LICENSE-MIT) at your option.
|
Distributed under the [Apache License 2.0](https://spdx.org/licenses/Apache-2.0.html) and [MIT](https://spdx.org/licenses/MIT.html) licenses, see [LICENSE-Apache](https://git.bauke.xyz/Holllo/gravatar-rs/src/branch/main/LICENSE-Apache) and [LICENSE-MIT](https://git.bauke.xyz/Holllo/gravatar-rs/src/branch/main/LICENSE-MIT) for more information.
|
||||||
|
|
||||||
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in either crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
|
|
||||||
|
|
|
@ -17,11 +17,11 @@
|
||||||
//!
|
//!
|
||||||
//! let generator = Generator::default();
|
//! let generator = Generator::default();
|
||||||
//!
|
//!
|
||||||
//! let gravatar_url = generator.generate("helllo@holllo.cc");
|
//! let gravatar_url = generator.generate("helllo@holllo.org");
|
||||||
//!
|
//!
|
||||||
//! assert_eq!(
|
//! assert_eq!(
|
||||||
//! gravatar_url,
|
//! gravatar_url,
|
||||||
//! "https://www.gravatar.com/avatar/ebff9105dce4954b1bdb57fdab079ff3"
|
//! "https://www.gravatar.com/avatar/e9a2c03d607ec80a5b725ad42c19ee36"
|
||||||
//! );
|
//! );
|
||||||
//! ```
|
//! ```
|
||||||
//!
|
//!
|
||||||
|
@ -79,11 +79,11 @@ impl Generator {
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// use gravatar_rs::Generator;
|
/// use gravatar_rs::Generator;
|
||||||
///
|
///
|
||||||
/// let hash = Generator::hash_email("helllo@holllo.cc");
|
/// let hash = Generator::hash_email("helllo@holllo.org");
|
||||||
///
|
///
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
/// hash,
|
/// hash,
|
||||||
/// "ebff9105dce4954b1bdb57fdab079ff3"
|
/// "e9a2c03d607ec80a5b725ad42c19ee36"
|
||||||
/// );
|
/// );
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use gravatar_rs::Generator;
|
use gravatar_rs::Generator;
|
||||||
|
|
||||||
const BAUKE_EMAIL: &str = "me@bauke.xyz";
|
const BAUKE_EMAIL: &str = "me@bauke.xyz";
|
||||||
const HOLLLO_EMAIL: &str = "helllo@holllo.cc";
|
const HOLLLO_EMAIL: &str = "helllo@holllo.org";
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_hash_email() {
|
fn test_hash_email() {
|
||||||
|
|
|
@ -4,5 +4,5 @@ expression: urls
|
||||||
---
|
---
|
||||||
[
|
[
|
||||||
"https://cdn.libravatar.org/avatar/ecd836ee843ff0ab75d4720bd40c2baf.jpg?d=identicon&f=y&s=128&r=pg",
|
"https://cdn.libravatar.org/avatar/ecd836ee843ff0ab75d4720bd40c2baf.jpg?d=identicon&f=y&s=128&r=pg",
|
||||||
"https://cdn.libravatar.org/avatar/ebff9105dce4954b1bdb57fdab079ff3.jpg?d=identicon&f=y&s=128&r=pg",
|
"https://cdn.libravatar.org/avatar/e9a2c03d607ec80a5b725ad42c19ee36.jpg?d=identicon&f=y&s=128&r=pg",
|
||||||
]
|
]
|
||||||
|
|
|
@ -7,14 +7,14 @@ expression: snapshot
|
||||||
"generate-gravatar",
|
"generate-gravatar",
|
||||||
[
|
[
|
||||||
"https://www.gravatar.com/avatar/ecd836ee843ff0ab75d4720bd40c2baf",
|
"https://www.gravatar.com/avatar/ecd836ee843ff0ab75d4720bd40c2baf",
|
||||||
"https://www.gravatar.com/avatar/ebff9105dce4954b1bdb57fdab079ff3",
|
"https://www.gravatar.com/avatar/e9a2c03d607ec80a5b725ad42c19ee36",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"generate-libravatar",
|
"generate-libravatar",
|
||||||
[
|
[
|
||||||
"https://cdn.libravatar.org/avatar/ecd836ee843ff0ab75d4720bd40c2baf",
|
"https://cdn.libravatar.org/avatar/ecd836ee843ff0ab75d4720bd40c2baf",
|
||||||
"https://cdn.libravatar.org/avatar/ebff9105dce4954b1bdb57fdab079ff3",
|
"https://cdn.libravatar.org/avatar/e9a2c03d607ec80a5b725ad42c19ee36",
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -17,14 +17,14 @@ expression: snapshot
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"hash-holllo",
|
"hash-holllo",
|
||||||
"ebff9105dce4954b1bdb57fdab079ff3",
|
"e9a2c03d607ec80a5b725ad42c19ee36",
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"hash-holllo-whitespace",
|
"hash-holllo-whitespace",
|
||||||
"ebff9105dce4954b1bdb57fdab079ff3",
|
"e9a2c03d607ec80a5b725ad42c19ee36",
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"hash-holllo-casing",
|
"hash-holllo-casing",
|
||||||
"ebff9105dce4954b1bdb57fdab079ff3",
|
"e9a2c03d607ec80a5b725ad42c19ee36",
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue