Change mammut references to elefren

master
Paul Woolcock 6 years ago
parent ecb8629a53
commit a9b6b52890
  1. 8
      Cargo.toml
  2. 20
      README.md
  3. 10
      examples/register.rs
  4. 4
      src/apps.rs
  5. 4
      src/entities/itemsiter.rs
  6. 24
      src/lib.rs
  7. 12
      src/registration.rs
  8. 2
      src/status_builder.rs

@ -1,12 +1,12 @@
[package] [package]
name = "mammut" name = "elefren"
version = "0.11.0" version = "0.12.0"
description = "A wrapper around the Mastodon API." description = "A wrapper around the Mastodon API."
authors = ["Aaron Power <theaaronepower@gmail.com>"] authors = ["Aaron Power <theaaronepower@gmail.com>", "Paul Woolcock <paul@woolcock.us>"]
license = "MIT/Apache-2.0" license = "MIT/Apache-2.0"
readme = "README.md" readme = "README.md"
repository = "https://github.com/Aaronepower/mammut.git" repository = "https://github.com/pwoolcoc/elefren.git"
keywords = ["api", "web", "social", "mastodon", "wrapper"] keywords = ["api", "web", "social", "mastodon", "wrapper"]
categories = ["web-programming", "http-client"] categories = ["web-programming", "http-client"]

@ -1,23 +1,23 @@
# Mammut. A API Wrapper for the Mastodon API. # Elefren. A API Wrapper for the Mastodon API.
[![crates.io](https://img.shields.io/crates/v/mammut.svg)](https://crates.io/crates/mammut) [![crates.io](https://img.shields.io/crates/v/elefren.svg)](https://crates.io/crates/elefren)
[![Docs](https://docs.rs/mammut/badge.svg)](https://docs.rs/mammut) [![Docs](https://docs.rs/elefren/badge.svg)](https://docs.rs/elefren)
[![MIT/APACHE-2.0](https://img.shields.io/crates/l/mammut.svg)](https://crates.io/crates/mammut) [![MIT/APACHE-2.0](https://img.shields.io/crates/l/elefren.svg)](https://crates.io/crates/elefren)
## [Documentation](https://docs.rs/mammut/) ## [Documentation](https://docs.rs/elefren/)
A wrapper around the [API](https://github.com/tootsuite/mastodon/blob/master/docs/Using-the-API/API.md#tag) for [Mastodon](https://mastodon.social/) A wrapper around the [API](https://github.com/tootsuite/mastodon/blob/master/docs/Using-the-API/API.md#tag) for [Mastodon](https://mastodon.social/)
```rust ```rust
extern crate mammut; extern crate elefren;
extern crate toml; extern crate toml;
use std::io; use std::io;
use std::fs::File; use std::fs::File;
use std::io::prelude::*; use std::io::prelude::*;
use mammut::{Data, Mastodon, Registration}; use elefren::{Data, Mastodon, Registration};
use mammut::apps::{AppBuilder, Scopes}; use elefren::apps::{AppBuilder, Scopes};
fn main() { fn main() {
let mastodon = match File::open("mastodon-data.toml") { let mastodon = match File::open("mastodon-data.toml") {
@ -37,10 +37,10 @@ fn main() {
fn register() -> Mastodon { fn register() -> Mastodon {
let app = AppBuilder { let app = AppBuilder {
client_name: "mammut-examples", client_name: "elefren-examples",
redirect_uris: "urn:ietf:wg:oauth:2.0:oob", redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
scopes: Scopes::Read, scopes: Scopes::Read,
website: Some("https://github.com/Aaronepower/mammut"), website: Some("https://github.com/pwoolcoc/elefren"),
}; };
let mut registration = Registration::new("https://mastodon.social"); let mut registration = Registration::new("https://mastodon.social");

@ -1,7 +1,7 @@
extern crate mammut; extern crate elefren;
extern crate toml; extern crate toml;
pub use self::mammut::MastodonClient; pub use self::elefren::MastodonClient;
use std::{ use std::{
error::Error, error::Error,
@ -9,7 +9,7 @@ use std::{
io, io,
}; };
use self::mammut::{ use self::elefren::{
apps::{ apps::{
AppBuilder, AppBuilder,
Scopes Scopes
@ -36,10 +36,10 @@ pub fn get_mastodon_data() -> Result<Mastodon, Box<Error>> {
pub fn register() -> Result<Mastodon, Box<Error>> { pub fn register() -> Result<Mastodon, Box<Error>> {
let app = AppBuilder { let app = AppBuilder {
client_name: "mammut-examples", client_name: "elefren-examples",
redirect_uris: "urn:ietf:wg:oauth:2.0:oob", redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
scopes: Scopes::All, scopes: Scopes::All,
website: Some("https://github.com/Aaronepower/mammut"), website: Some("https://github.com/pwoolcoc/elefren"),
}; };
let website = read_line("Please enter your mastodon instance url:")?; let website = read_line("Please enter your mastodon instance url:")?;

@ -2,10 +2,10 @@ use std::fmt;
/// Builder struct for defining your application. /// Builder struct for defining your application.
/// ``` /// ```
/// use mammut::apps::{AppBuilder, Scopes}; /// use elefren::apps::{AppBuilder, Scopes};
/// ///
/// let app = AppBuilder { /// let app = AppBuilder {
/// client_name: "mammut_test", /// client_name: "elefren_test",
/// redirect_uris: "urn:ietf:wg:oauth:2.0:oob", /// redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
/// scopes: Scopes::Read, /// scopes: Scopes::Read,
/// website: None, /// website: None,

@ -4,8 +4,8 @@ use serde::Deserialize;
/// Abstracts away the `next_page` logic into a single stream of items /// Abstracts away the `next_page` logic into a single stream of items
/// ///
/// ```no_run /// ```no_run
/// # extern crate mammut; /// # extern crate elefren;
/// # use mammut::{Data, Mastodon, MastodonClient}; /// # use elefren::{Data, Mastodon, MastodonClient};
/// # use std::error::Error; /// # use std::error::Error;
/// # fn main() -> Result<(), Box<Error>> { /// # fn main() -> Result<(), Box<Error>> {
/// # let data = Data { /// # let data = Data {

@ -1,19 +1,19 @@
//! # Mammut: API Wrapper around the Mastodon API. //! # Elefren: API Wrapper around the Mastodon API.
//! //!
//! Most of the api is documented on [Mastodon's //! Most of the api is documented on [Mastodon's
//! github](https://github.com/tootsuite/mastodon/blob/master/docs/Using-the-API/API.md#tag) //! github](https://github.com/tootsuite/mastodon/blob/master/docs/Using-the-API/API.md#tag)
//! //!
//! ```no_run //! ```no_run
//! # extern crate mammut; //! # extern crate elefren;
//! # fn main() { //! # fn main() {
//! # try().unwrap(); //! # try().unwrap();
//! # } //! # }
//! # fn try() -> mammut::Result<()> { //! # fn try() -> elefren::Result<()> {
//! use mammut::{MastodonClient, Registration}; //! use elefren::{MastodonClient, Registration};
//! use mammut::apps::{AppBuilder, Scopes}; //! use elefren::apps::{AppBuilder, Scopes};
//! //!
//! let app = AppBuilder { //! let app = AppBuilder {
//! client_name: "mammut_test", //! client_name: "elefren_test",
//! redirect_uris: "urn:ietf:wg:oauth:2.0:oob", //! redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
//! scopes: Scopes::Read, //! scopes: Scopes::Read,
//! website: None, //! website: None,
@ -345,8 +345,8 @@ pub struct ApiError {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// # extern crate mammut; /// # extern crate elefren;
/// # use mammut::StatusesRequest; /// # use elefren::StatusesRequest;
/// let request = StatusesRequest::new() /// let request = StatusesRequest::new()
/// .only_media() /// .only_media()
/// .pinned() /// .pinned()
@ -650,8 +650,8 @@ impl MastodonClient for Mastodon {
/// # Example /// # Example
/// ///
/// ```no_run /// ```no_run
/// # extern crate mammut; /// # extern crate elefren;
/// # use mammut::{Data, Mastodon, MastodonClient}; /// # use elefren::{Data, Mastodon, MastodonClient};
/// # use std::error::Error; /// # use std::error::Error;
/// # fn main() -> Result<(), Box<Error>> { /// # fn main() -> Result<(), Box<Error>> {
/// # let data = Data { /// # let data = Data {
@ -668,8 +668,8 @@ impl MastodonClient for Mastodon {
/// ``` /// ```
/// ///
/// ```no_run /// ```no_run
/// # extern crate mammut; /// # extern crate elefren;
/// # use mammut::{Data, Mastodon, MastodonClient, StatusesRequest}; /// # use elefren::{Data, Mastodon, MastodonClient, StatusesRequest};
/// # use std::error::Error; /// # use std::error::Error;
/// # fn main() -> Result<(), Box<Error>> { /// # fn main() -> Result<(), Box<Error>> {
/// # let data = Data { /// # let data = Data {

@ -29,7 +29,7 @@ struct AccessToken {
impl Registration { impl Registration {
/// Construct a new registration process to the instance of the `base` url. /// Construct a new registration process to the instance of the `base` url.
/// ``` /// ```
/// use mammut::registration::Registration; /// use elefren::registration::Registration;
/// ///
/// let registration = Registration::new("https://mastodon.social"); /// let registration = Registration::new("https://mastodon.social");
/// ``` /// ```
@ -47,16 +47,16 @@ impl Registration {
/// Register the application with the server from the `base` url. /// Register the application with the server from the `base` url.
/// ///
/// ```no_run /// ```no_run
/// # extern crate mammut; /// # extern crate elefren;
/// # fn main() { /// # fn main() {
/// # try().unwrap(); /// # try().unwrap();
/// # } /// # }
/// # fn try() -> mammut::Result<()> { /// # fn try() -> elefren::Result<()> {
/// use mammut::{MastodonClient, Registration}; /// use elefren::{MastodonClient, Registration};
/// use mammut::apps::{AppBuilder, Scopes}; /// use elefren::apps::{AppBuilder, Scopes};
/// ///
/// let app = AppBuilder { /// let app = AppBuilder {
/// client_name: "mammut_test", /// client_name: "elefren_test",
/// redirect_uris: "urn:ietf:wg:oauth:2.0:oob", /// redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
/// scopes: Scopes::Read, /// scopes: Scopes::Read,
/// website: None, /// website: None,

@ -41,7 +41,7 @@ impl StatusBuilder {
/// Create a new status with text. /// Create a new status with text.
/// ``` /// ```
/// use mammut::status_builder::StatusBuilder; /// use elefren::status_builder::StatusBuilder;
/// ///
/// let status = StatusBuilder::new("Hello World!".into()); /// let status = StatusBuilder::new("Hello World!".into());
/// ``` /// ```

Loading…
Cancel
Save