haikunator 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59f2f9946d675d7350256fdb52681202ba198a8d
4
- data.tar.gz: 733807587635fc4329402cf4e5c2cfa74d2a76f0
3
+ metadata.gz: fd8f532e514f39895a0f4354c94cb82d4eeae876
4
+ data.tar.gz: f9a648b600d5b0d2cdfcf6507dc099596b4f7c20
5
5
  SHA512:
6
- metadata.gz: 22aab462e057562af2edd01aa457020b15d88b136fd9acd78955497195edac97d4100c396ec0e65d0fc087c80b50e2d037cf50ca83ede061373590bb4932117c
7
- data.tar.gz: 896d8fd618177659dc4a223065160d0b0e3d93235bb94e0a24b71fc9a81f6a6523c29ed7fe62f3e9378ea13e3e4e94ee521542bfccd80ed9a355060d1a46e55d
6
+ metadata.gz: fe51c0bc411d67a4f2149777676e62686cae191a8b7d7c8675f43a909df34abc988f27182346819e46dacd0a7636585799bd013dc2e97add4ea1d103b857cfce
7
+ data.tar.gz: 6c6047dc844e60b9192cb975c74fc212215c25228a1f57eefe8629debcec19d574241ddec52d01bae34be7cca91c9a6c00bb674687efb5b9a7b014c54d9c0a6d
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Haikunator
2
2
 
3
- TODO: Write a gem description
3
+ [![Gem Version](https://badge.fury.io/rb/haikunator.svg)](http://badge.fury.io/rb/haikunator)
4
+
5
+ Generate Heroku-like memorable random names to use in your apps or anywhere else.
4
6
 
5
7
  ## Installation
6
8
 
@@ -18,7 +20,23 @@ Or install it yourself as:
18
20
 
19
21
  ## Usage
20
22
 
21
- TODO: Write usage instructions here
23
+ Haikunator is pretty simple. There is nothing to configure and it only has a single method, `.haikunate`:
24
+
25
+ ```ruby
26
+ Haikunator.haikunate # => "rough-snowflake-1142"
27
+
28
+ # Token range
29
+ Haikunator.haikunate(100) # => "nameless-star-13"
30
+
31
+ # Don't include the token
32
+ Haikunator.haikunate(0) # => "long-flower"
33
+
34
+ # Use a different delimiter
35
+ Haikunator.haikunate(9999, '.') # => "cool.leaf.6743"
36
+
37
+ # No token, no delimiter
38
+ Haikunator.haikunate(0, ' ') # => "green fire"
39
+ ```
22
40
 
23
41
  ## Contributing
24
42
 
@@ -1,3 +1,3 @@
1
1
  module Haikunator
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/haikunator.rb CHANGED
@@ -4,7 +4,7 @@ require 'securerandom'
4
4
  module Haikunator
5
5
  class << self
6
6
 
7
- def generate(token_range = 9999, delimiter = '-')
7
+ def haikunate(token_range = 9999, delimiter = '-')
8
8
  rnd = (rand * (2 ** 12)).floor
9
9
 
10
10
  sections = []
@@ -14,7 +14,6 @@ module Haikunator
14
14
 
15
15
  sections.compact.join(delimiter)
16
16
  end
17
- alias_method :haikunate, :generate
18
17
 
19
18
  private
20
19
 
@@ -23,8 +22,7 @@ module Haikunator
23
22
  end
24
23
 
25
24
  def adjectives
26
- %w[
27
- autumn hidden bitter misty silent empty dry dark
25
+ %w[autumn hidden bitter misty silent empty dry dark
28
26
  summer icy delicate quiet white cool spring winter
29
27
  patient twilight dawn crimson wispy weathered blue
30
28
  billowing broken cold damp falling frosty green
@@ -32,13 +30,11 @@ module Haikunator
32
30
  red rough still small sparkling throbbing shy
33
31
  wandering withered wild black young holy solitary
34
32
  fragrant aged snowy proud floral restless divine
35
- polished ancient purple lively nameless
36
- ]
33
+ polished ancient purple lively nameless]
37
34
  end
38
35
 
39
36
  def nouns
40
- %w[
41
- waterfall river breeze moon rain wind sea morning
37
+ %w[waterfall river breeze moon rain wind sea morning
42
38
  snow lake sunset pine shadow leaf dawn glitter
43
39
  forest hill cloud meadow sun glade bird brook
44
40
  butterfly bush dew dust field fire flower firefly
@@ -46,8 +42,7 @@ module Haikunator
46
42
  snowflake silence sound sky shape surf thunder
47
43
  violet water wildflower wave water resonance sun
48
44
  wood dream cherry tree fog frost voice paper
49
- frog smoke star
50
- ]
45
+ frog smoke star]
51
46
  end
52
47
 
53
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haikunator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Usman Bashir