Skip to content

Commit

Permalink
Update to adjective_adjective_animal
Browse files Browse the repository at this point in the history
  • Loading branch information
moparisthebest committed Aug 7, 2018
1 parent 843ca9c commit 2403083
Show file tree
Hide file tree
Showing 18 changed files with 11,040 additions and 2,680 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
target
/Cargo.lock
Cargo.lock
cli/Cargo.lock
.idea
12 changes: 0 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,3 @@ script:
- cargo test --verbose
- cargo doc --verbose
- "(cd cli && cargo build --verbose)"

after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
echo '<meta http-equiv=refresh content=0;url=names/index.html>' > target/doc/index.html &&
pip install ghp-import --user $USER &&
$HOME/.local/bin/ghp-import -n target/doc &&
git push -fq https://${TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages
env:
global:
secure: B6wLsR6HDHo/VhjM2azghFJ66PZIyNyDDfly4FT0P9UmmHEwdM1mk3YWlNx9NT2s8jp9I+wChYehPeWjCTd8QHVyYgvKS0FdHFNZDMTBE306q6fjQgMxLXsLINkc4U2+b3JUjx/lyAzvVjNIO53KXq+ydWXbrHEWIKTvzkm5o7zNNJQ2ZHMQm6SlJVY++x439PMMPTp9KZWYcwroNrpf+cUdMbvVhF7DA/5SysJpXDL4Y7KC7kzyOXdZPOhW4qK1FNKCmIB7t1OwgMXS8/b260nvAKPRUCA7IodRdogBieDEZ3CW5qhiT/kUgWC3aRgpS9nhiv3YLbArR5bv3IO2s8t2w34A4TJl5NcTMzW2PZQSniGxhX4CA2gQJHa3QlVxZkOXDATJkZeqtoB7vY6Amf/Gv8pZoMnz5OlKqbkAy8iRhtgTczEfG91C6jxY5FLixo/g3ccZoOK5Fy9O+CI8VNp7DAlMSK2+NZVdIDNhuRgGFxT6HMQCeo65tgdWAwIigR6D58cO4sLbh8TvQL7vzNOtfvZ8IZKVSIOMb4KDxAzKShq3m3P7XOWQUt2DuhpYiT4PdcyVqoQUrUmSp1M6mulglefSqVuyv4h7vUAGzmLgcO4lpZy69452JfvphRAYOniWvXZA5HKCVWZCjBy9H+/szQqeJ445pVlsZMUQAUQ=
29 changes: 1 addition & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
## 0.11.0 / 2016-04-29

### Breaking API changes

* Move adjectives const to `names::ADJECTIVES`. ([@fnichol][])
* Move nouns const to `names::NOUNS`. ([@fnichol][])

### Improvements

* (cli) Add color and suggestions features. ([@fnichol][])
* Inline adjective and noun data from plaintext files. ([@fnichol][])


## 0.10.0 / 2015-11-01

### Breaking API changes

* Use `Default` trait for Generator & Name types. ([@fnichol][])

### Improvements

* (cli) Update usage output. ([@fnichol][])


## 0.9.0 / 2015-09-15
## 0.1.0 / 2018-10-06

The initial release.

<!--- The following link definition list is generated by PimpMyChangelog --->
[@fnichol]: https://github.com/fnichol
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[package]
name = "names"
version = "0.11.0"
authors = ["Fletcher Nichol <fnichol@nichol.ca>"]
name = "adjective_adjective_animal"
version = "0.1.0"
authors = ["Travis Burtrum <admin.github@moparisthebest.com>", "Fletcher Nichol <fnichol@nichol.ca>"]
license = "MIT"
readme = "README.md"
documentation = "http://fnichol.github.io/names/names/"
repository = "https://github.com/fnichol/names.git"
homepage = "https://github.com/fnichol/names.git"
keywords = ["name", "random"]
documentation = "https://github.com/moparisthebest/adjective-adjective-animal"
repository = "https://github.com/moparisthebest/adjective-adjective-animal.git"
homepage = "https://github.com/moparisthebest/adjective-adjective-animal"
keywords = ["name", "random", "adjective", "animal"]
description = """
A library to generate random name strings suitable for use in container
instances, project names, application instances, etc.
A library to generate suitably random and reasonably unique human readable (and fairly adorable) ids,
ala GiphyCat
"""
exclude = ["cli"]
build = "build.rs"

[lib]
name = "names"
name = "adjective_adjective_animal"
path = "src/lib.rs"

[dependencies]
rand = "0.3.0"
rand = "0.5.4"
1 change: 1 addition & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Copyright (c) 2018 Travis Burtrum
Copyright (c) 2015 Fletcher Nichol

Permission is hereby granted, free of charge, to any
Expand Down
59 changes: 27 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
# names
# adjective_adjective_animal

[![Build Status](https://travis-ci.org/fnichol/names.svg?branch=master)](https://travis-ci.org/fnichol/names) [![](http://meritbadge.herokuapp.com/names)](https://crates.io/crates/names) [![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/fnichol/names/blob/master/LICENSE-MIT)
[![Build Status](https://travis-ci.org/moparisthebest/adjective-adjective-animal.svg?branch=master)](https://travis-ci.org/moparisthebest/adjective-adjective-animal) [![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/moparisthebest/adjective-adjective-animal/blob/master/LICENSE-MIT)

Random name generator for Rust
Rust library to generate suitably random and reasonably unique human readable (and fairly adorable) ids,
ala GiphyCat

* Crate: https://crates.io/crates/names
* Documentation http://fnichol.github.io/names/names/
* Source Code: https://github.com/fnichol/names
* Crate: https://crates.io/crates/adjective_adjective_animal
* Documentation https://docs.rs/crate/adjective_adjective_animal
* Source Code: https://github.com/moparisthebest/adjective-adjective-animal

## Usage

This crate is [on crates.io](https://crates.io/crates/names) and can be
used by adding `names` to your dependencies in your project's `Cargo.toml`
This crate is [on crates.io](https://crates.io/crates/adjective_adjective_animal) and can be
used by adding `adjective_adjective_animal` to your dependencies in your project's `Cargo.toml`
file:

```toml
[dependencies]
names = "0.10.0"
adjective_adjective_animal = "0.1.0"
```

and this to your crate root:

```rust
extern crate names;
extern crate adjective_adjective_animal;
```

### Example: Painless defaults
Expand All @@ -31,43 +32,37 @@ The easiest way to get started is to use the default `Generator` to return
a name:

```rust
use names::{Generator, Name};
use adjective_adjective_animal::Generator;

fn main() {
let mut generator = Generator::with_naming(Name::Plain);

let mut generator = Generator::default();
println!("Your project is: {}", generator.next().unwrap());
// #=> "Your project is: rusty-nail"
// #=> "Your project is: IndustrialSecretiveSwan"

}
```

If more randomness is required, you can generate a name with a trailing
4-digit number:

```rust
use names::{Generator, Name};

fn main() {
let mut generator = Generator::with_naming(Name::Numbered);
println!("Your project is: {}", generator.next().unwrap());
// #=> "Your project is: pushy-pencil-5602"
}
```

# Example: with custom dictionaries

If you would rather supply your own custom adjective and noun word lists,
If you would rather supply your own custom adjective and animal word lists,
you can provide your own by supplying 2 string slices. For example,
this returns only one result:

```
use names::{Generator, Name};
use adjective_adjective_animal::Generator;
fn main() {
let adjectives = &["imaginary"];
let nouns = &["roll"];
let mut generator = Generator::new(adjectives, nouns, Name::Plain);
let adjectives = &["Imaginary"];
let animals = &["Bear"];
let mut generator = Generator::new(adjectives, animals);
assert_eq!("imaginary-roll", generator.next().unwrap());
assert_eq!("ImaginaryImaginaryBear", generator.next().unwrap());
}
```

# Credits
* rust's [names](https://github.com/fnichol/names) crate, which this is forked from
* npm's [adjective-adjective-animal](https://github.com/a-type/adjective-adjective-animal) for lists
* `curl 'https://raw.githubusercontent.com/a-type/adjective-adjective-animal/master/lib/lists/animals.js' | grep -Eo '"[^"]+"' | tr -d '"' | tr '[:upper:]' '[:lower:]' | sed 's/.*/\u&/' | sort | uniq > animals.txt`
* `curl 'https://raw.githubusercontent.com/a-type/adjective-adjective-animal/master/lib/lists/adjectives.js' | grep -Eo '"[^"]+"' | tr -d '"' | tr '[:upper:]' '[:lower:]' | sed 's/.*/\u&/' | sort | uniq > adjectives.txt`
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use std::path::Path;
fn main() {
generate(Path::new("data").join("adjectives.txt").as_path(),
Path::new(&env::var("OUT_DIR").unwrap()).join("adjectives.rs").as_path());
generate(Path::new("data").join("nouns.txt").as_path(),
Path::new(&env::var("OUT_DIR").unwrap()).join("nouns.rs").as_path());
generate(Path::new("data").join("animals.txt").as_path(),
Path::new(&env::var("OUT_DIR").unwrap()).join("animals.rs").as_path());
}

fn generate(src_path: &Path, dst_path: &Path) {
Expand Down
170 changes: 0 additions & 170 deletions cli/Cargo.lock

This file was deleted.

Loading

0 comments on commit 2403083

Please sign in to comment.