namegen 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -3
- data/bin/namegen +8 -2
- data/lib/namegen.rb +14 -10
- data/lib/namegen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 563ce6af9ade7d183a8bf96ec57b542fa3d2d42d
|
4
|
+
data.tar.gz: 68dc5e2668259758740070b1a917a3e5954de987
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72b3eef33cd7d41740acb9d27489eeebd0c77ed4ee4f169d02f8fc858df776ac2ad0f4697ac7fd22720730c240cfb7d9b787babab0d66bad1b18af445d2225f3
|
7
|
+
data.tar.gz: 5b88662de18772af2a9234a3308bbe3e9ff3a60f775567336ba4af1fc30e206bab0508ad6161c9d1641f67d80192046729c0547fd22a3a8492d64c6954f930aa
|
data/README.md
CHANGED
@@ -5,6 +5,9 @@ generate for applications and repositories, so I went ahead and wrote one of my
|
|
5
5
|
I used a list of ["exquisite"](http://www.dailywritingtips.com/100-exquisite-adjectives)
|
6
6
|
adjectives and some custom ones as well to pair with a custom list of nouns.
|
7
7
|
|
8
|
+
### 'calamitous-knife'
|
9
|
+
A name I generated using this gem!
|
10
|
+
|
8
11
|
## Installation
|
9
12
|
|
10
13
|
Add this line to your application's Gemfile:
|
@@ -21,10 +24,12 @@ Or install it yourself as:
|
|
21
24
|
|
22
25
|
## Usage
|
23
26
|
|
24
|
-
After installing the gem, just type
|
25
|
-
adjective-noun pair will be printed out. A verbose option
|
27
|
+
After installing the gem, just type `namegen` from your command line and an
|
28
|
+
adjective-noun pair will be printed out. A verbose option `namegen -v` can
|
26
29
|
be specified to include a definition of the adjective (in case some of the words
|
27
|
-
are a little too "exquisite" for you like they were for me).
|
30
|
+
are a little too "exquisite" for you like they were for me). You can also
|
31
|
+
include a number `namegen 5` or `namegen -v 5` to give you a few options at
|
32
|
+
once.
|
28
33
|
|
29
34
|
## Contributing
|
30
35
|
|
data/bin/namegen
CHANGED
@@ -4,7 +4,13 @@ require 'namegen'
|
|
4
4
|
|
5
5
|
|
6
6
|
if ARGV[0] == '-v'
|
7
|
-
|
7
|
+
if ARGV[1] =~ /^\d*$/
|
8
|
+
Namegen::generate_v(ARGV[1].to_i)
|
9
|
+
else
|
10
|
+
Namegen::generate_v
|
11
|
+
end
|
12
|
+
elsif ARGV[0] =~ /^\d*$/
|
13
|
+
Namegen::generate(ARGV[0].to_i)
|
8
14
|
else
|
9
|
-
|
15
|
+
Namegen::generate
|
10
16
|
end
|
data/lib/namegen.rb
CHANGED
@@ -4,20 +4,24 @@ require "namegen/adjective"
|
|
4
4
|
require "namegen/noun"
|
5
5
|
|
6
6
|
module Namegen
|
7
|
-
def self.generate
|
8
|
-
|
7
|
+
def self.generate(n = 1)
|
8
|
+
n.times do
|
9
|
+
puts "#{Adjective.random}-#{Noun.random}"
|
10
|
+
end
|
9
11
|
end
|
10
12
|
|
11
13
|
# Generate verbosely (include adjective definition)
|
12
|
-
def self.generate_v
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
def self.generate_v(n = 1)
|
15
|
+
n.times do
|
16
|
+
adj = Adjective.random
|
17
|
+
defn = Adjective::EXQUISITE[adj]
|
18
|
+
rtn = "#{adj}-#{Noun.random}"
|
19
|
+
|
20
|
+
if defn
|
21
|
+
rtn += "\n #{adj}: #{defn}"
|
22
|
+
end
|
16
23
|
|
17
|
-
|
18
|
-
rtn += "\n #{adj}: #{defn}"
|
19
|
-
else
|
20
|
-
rtn
|
24
|
+
puts rtn
|
21
25
|
end
|
22
26
|
end
|
23
27
|
end
|
data/lib/namegen/version.rb
CHANGED