Merge pull request #4 from pwoolcoc/mammut-to-elefren

Change mammut references to elefren
master
Paul Woolcock 6 years ago committed by GitHub
commit 473205a5f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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]
name = "mammut"
version = "0.11.0"
name = "elefren"
version = "0.12.0"
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"
readme = "README.md"
repository = "https://github.com/Aaronepower/mammut.git"
repository = "https://github.com/pwoolcoc/elefren.git"
keywords = ["api", "web", "social", "mastodon", "wrapper"]
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)
[![Docs](https://docs.rs/mammut/badge.svg)](https://docs.rs/mammut)
[![MIT/APACHE-2.0](https://img.shields.io/crates/l/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/elefren/badge.svg)](https://docs.rs/elefren)
[![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/)
```rust
extern crate mammut;
extern crate elefren;
extern crate toml;
use std::io;
use std::fs::File;
use std::io::prelude::*;
use mammut::{Data, Mastodon, Registration};
use mammut::apps::{AppBuilder, Scopes};
use elefren::{Data, Mastodon, Registration};
use elefren::apps::{AppBuilder, Scopes};
fn main() {
let mastodon = match File::open("mastodon-data.toml") {
@ -37,10 +37,10 @@ fn main() {
fn register() -> Mastodon {
let app = AppBuilder {
client_name: "mammut-examples",
client_name: "elefren-examples",
redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
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");

@ -1,7 +1,7 @@
extern crate mammut;
extern crate elefren;
extern crate toml;
pub use self::mammut::MastodonClient;
pub use self::elefren::MastodonClient;
use std::{
error::Error,
@ -9,7 +9,7 @@ use std::{
io,
};
use self::mammut::{
use self::elefren::{
apps::{
AppBuilder,
Scopes
@ -36,10 +36,10 @@ pub fn get_mastodon_data() -> Result<Mastodon, Box<Error>> {
pub fn register() -> Result<Mastodon, Box<Error>> {
let app = AppBuilder {
client_name: "mammut-examples",
client_name: "elefren-examples",
redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
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:")?;

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

@ -4,8 +4,8 @@ use serde::Deserialize;
/// Abstracts away the `next_page` logic into a single stream of items
///
/// ```no_run
/// # extern crate mammut;
/// # use mammut::{Data, Mastodon, MastodonClient};
/// # extern crate elefren;
/// # use elefren::{Data, Mastodon, MastodonClient};
/// # use std::error::Error;
/// # fn main() -> Result<(), Box<Error>> {
/// # 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
//! github](https://github.com/tootsuite/mastodon/blob/master/docs/Using-the-API/API.md#tag)
//!
//! ```no_run
//! # extern crate mammut;
//! # extern crate elefren;
//! # fn main() {
//! # try().unwrap();
//! # }
//! # fn try() -> mammut::Result<()> {
//! use mammut::{MastodonClient, Registration};
//! use mammut::apps::{AppBuilder, Scopes};
//! # fn try() -> elefren::Result<()> {
//! use elefren::{MastodonClient, Registration};
//! use elefren::apps::{AppBuilder, Scopes};
//!
//! let app = AppBuilder {
//! client_name: "mammut_test",
//! client_name: "elefren_test",
//! redirect_uris: "urn:ietf:wg:oauth:2.0:oob",
//! scopes: Scopes::Read,
//! website: None,
@ -345,8 +345,8 @@ pub struct ApiError {
/// # Example
///
/// ```
/// # extern crate mammut;
/// # use mammut::StatusesRequest;
/// # extern crate elefren;
/// # use elefren::StatusesRequest;
/// let request = StatusesRequest::new()
/// .only_media()
/// .pinned()
@ -650,8 +650,8 @@ impl MastodonClient for Mastodon {
/// # Example
///
/// ```no_run
/// # extern crate mammut;
/// # use mammut::{Data, Mastodon, MastodonClient};
/// # extern crate elefren;
/// # use elefren::{Data, Mastodon, MastodonClient};
/// # use std::error::Error;
/// # fn main() -> Result<(), Box<Error>> {
/// # let data = Data {
@ -668,8 +668,8 @@ impl MastodonClient for Mastodon {
/// ```
///
/// ```no_run
/// # extern crate mammut;
/// # use mammut::{Data, Mastodon, MastodonClient, StatusesRequest};
/// # extern crate elefren;
/// # use elefren::{Data, Mastodon, MastodonClient, StatusesRequest};
/// # use std::error::Error;
/// # fn main() -> Result<(), Box<Error>> {
/// # let data = Data {

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

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

Loading…
Cancel
Save