adjective_animal 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +24 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +90 -0
- data/Rakefile +9 -0
- data/adjective_animal.gemspec +29 -0
- data/lib/adjective_animal/version.rb +3 -0
- data/lib/adjective_animal.rb +107 -0
- data/spec/adjective_animal_spec.rb +52 -0
- data/spec/spec_helper.rb +11 -0
- metadata +168 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 19cafbf4da7651f5bb5af64d8798bbfd0912da05
|
4
|
+
data.tar.gz: 238089d5c9ca9f3ba3fb6872f2b99bc27e11d3e9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bddc2a79bf6ca66688c4fb90ab81962ef6c38364ae011f7374e5b6537ca802143a17c00bf1df6b544ef5ed31a7fe7eca9f05fd01713d3b9335fe27f340cf2ac9
|
7
|
+
data.tar.gz: b0b6e885845360eb445051b87578fcaa2edc782e935656c4d6c4e4d2ff7b1c3e6594138fd5389c7bf2f8b35266c87354499a30c1493fda58fd13c092f3076e38
|
data/.gitignore
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
23
|
+
|
24
|
+
.idea/*
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 IgniteMark
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
# AdjectiveAnimal
|
2
|
+
|
3
|
+
Creates an adjective and an animal. Things like "Hulking Hornet", "Ambivalent Duck" and "Overjoyed Beaver". That's all it does.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'adjective_animal'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install adjective_animal
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
There are four fun and exciting ways to use adjective_animal:
|
21
|
+
|
22
|
+
* Create a random adjective animal.
|
23
|
+
```ruby
|
24
|
+
aa = AdjectiveAnimal.new
|
25
|
+
aa.adjective = "Overjoyed"
|
26
|
+
aa.animal = "Beaver"
|
27
|
+
```
|
28
|
+
|
29
|
+
* Create an adjective animal with the same starting letter
|
30
|
+
```ruby
|
31
|
+
aa = AdjectiveAnimal.new(:k)
|
32
|
+
aa.adjective = "Knowledgeable"
|
33
|
+
aa.animal = "Kangaroo"
|
34
|
+
```
|
35
|
+
|
36
|
+
* Create an array of 26 adjective animals that start with the letters A-Z
|
37
|
+
```ruby
|
38
|
+
aa = AdjectiveAnimal.all
|
39
|
+
# [#<AdjectiveAnimal::AdjAni:0x0000010378fe48 @adjective="Accessible", @animal="Alpaca", @starts_with="a">,
|
40
|
+
#<AdjectiveAnimal::AdjAni:0x0000010377ec88 @adjective="Better", @animal="Baboon", @starts_with="b">,
|
41
|
+
#<AdjectiveAnimal::AdjAni:0x000001036949a8 @adjective="Cloudy", @animal="Camel", @starts_with="c">,
|
42
|
+
#<AdjectiveAnimal::AdjAni:0x00000103686dd0 @adjective="Didactic", @animal="Deer", @starts_with="d">
|
43
|
+
...] to Z
|
44
|
+
```
|
45
|
+
|
46
|
+
* Fork the gem and add your own stupid stuff to it. This is a really good way to procrastinate when you are supposed to be working on seed data.
|
47
|
+
|
48
|
+
##Helpers
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
aa = AdjectiveAnimal.new
|
52
|
+
# yield both adjective and animal together as a string
|
53
|
+
aa.to_s = "Tawdry Cod"
|
54
|
+
# if typing 'adjective' is too much work, you can type 'adj'
|
55
|
+
aa.adj = "Tawdry"
|
56
|
+
# and 'ani'
|
57
|
+
aa.ani = "Cod"
|
58
|
+
# but wait, theres more! You can also do 'first_name' and 'last_name'
|
59
|
+
aa.first_name = "Tawdry"
|
60
|
+
aa.last_name = "Cod"
|
61
|
+
# you can also pass a string or symbol, upper or lower case as an argument to new()
|
62
|
+
aa = AdjectiveAnimal.new(:K)
|
63
|
+
aa = AdjectiveAnimal.new('k')
|
64
|
+
```
|
65
|
+
|
66
|
+
## Uses
|
67
|
+
I can imagine three possible uses for this gem.
|
68
|
+
* Liven up your seed or factory data! User.first_name = 'Test' and User.last_name = 'User' is boring. A user named "Lowly Herring" is good times.
|
69
|
+
* Create names for medieval or fantasy Inns! "The Broken Beetle" is a great place to find adventure. I think it would also work for taverns, bordellos and alehouses.
|
70
|
+
* Start conversations with people more attractive than you. They would go something like:
|
71
|
+
> You: "Hi, have you heard of the gem adjective_animal?"
|
72
|
+
|
73
|
+
> Them: "Who are you? Please get away from me."
|
74
|
+
|
75
|
+
Note: I have only tested one of the above uses, so YMMV.
|
76
|
+
|
77
|
+
## FAQ
|
78
|
+
* Q: What about the gem [faker](https://github.com/stympy/faker), isn't that a better gem?
|
79
|
+
* A: Yes it is, in pretty much every way imagineable. You should probably use it.
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
## Contributing
|
85
|
+
|
86
|
+
1. Fork it ( https://github.com/[my-github-username]/adjective_animal/fork )
|
87
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
88
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
89
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
90
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'adjective_animal/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "adjective_animal"
|
8
|
+
spec.version = AdjectiveAnimal::VERSION
|
9
|
+
spec.authors = ["montch"]
|
10
|
+
spec.email = ["montch@gmail.com"]
|
11
|
+
spec.summary = %q{ Creates an adjective and an animal}
|
12
|
+
spec.description = %q{ No, really, that's all it does}
|
13
|
+
spec.homepage = "https://github.com/montch/adjective_animal"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "pry"
|
24
|
+
spec.add_development_dependency "pry-debugger"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
spec.add_development_dependency "simplecov"
|
27
|
+
spec.add_development_dependency "pry-rescue"
|
28
|
+
spec.add_development_dependency "pry-stack_explorer"
|
29
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require "adjective_animal/version"
|
3
|
+
|
4
|
+
module AdjectiveAnimal
|
5
|
+
|
6
|
+
|
7
|
+
def self.new(options={})
|
8
|
+
self::AdjAni.new(options)
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.all
|
12
|
+
out = Array.new
|
13
|
+
('a'..'z').to_a.each do |l|
|
14
|
+
out.push(self.new(l.to_s))
|
15
|
+
end
|
16
|
+
out
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
class AdjAni
|
21
|
+
|
22
|
+
|
23
|
+
FIELDS = [:adjective, :animal, :full, :starts_with, :the]
|
24
|
+
attr_accessor(*FIELDS)
|
25
|
+
|
26
|
+
def initialize(options={})
|
27
|
+
if options.is_a?(String) || options.is_a?(Symbol)
|
28
|
+
options.length == 1 ? self.starts_with = options.downcase.to_s : self.starts_with = nil
|
29
|
+
end
|
30
|
+
if options.is_a?(Hash)
|
31
|
+
sym_opts = symbolize_hash(options) #.map { |k, v| [k.to_sym, v] }.to_h
|
32
|
+
if sym_opts.has_key?(:starts_with)
|
33
|
+
sym_opts[:starts_with].length == 1 ? self.starts_with = sym_opts[:starts_with].downcase.to_sym : self.starts_with = nil
|
34
|
+
end
|
35
|
+
end
|
36
|
+
generate_aa
|
37
|
+
end
|
38
|
+
|
39
|
+
def generate_aa
|
40
|
+
self.adjective = AdjectiveAnimal::AdjAni.humanize(AdjectiveAnimal::AdjAni.get_adjective(self.starts_with))
|
41
|
+
self.animal = AdjectiveAnimal::AdjAni.humanize(AdjectiveAnimal::AdjAni.get_animal(self.starts_with))
|
42
|
+
self
|
43
|
+
end
|
44
|
+
|
45
|
+
def adj
|
46
|
+
self.adjective
|
47
|
+
end
|
48
|
+
|
49
|
+
alias first_name adj
|
50
|
+
|
51
|
+
def ani
|
52
|
+
self.animal
|
53
|
+
end
|
54
|
+
|
55
|
+
alias last_name ani
|
56
|
+
|
57
|
+
def to_s
|
58
|
+
"#{self.adjective} #{self.animal}"
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def self.get_animal(starts_with='')
|
64
|
+
if starts_with.nil?
|
65
|
+
AdjectiveAnimal::AdjAni.animal.sample.strip
|
66
|
+
else
|
67
|
+
subset = Array.new
|
68
|
+
AdjectiveAnimal::AdjAni.animal.collect do |a|
|
69
|
+
a.start_with?(starts_with.to_s) ? subset.push(a) : next
|
70
|
+
end
|
71
|
+
subset.length == 0 ? AdjectiveAnimal::AdjAni.animal.sample.strip : subset.sample.strip
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.get_adjective(starts_with='')
|
76
|
+
if starts_with.nil?
|
77
|
+
AdjectiveAnimal::AdjAni.adjective.sample.strip
|
78
|
+
else
|
79
|
+
subset = Array.new
|
80
|
+
AdjectiveAnimal::AdjAni.adjective.collect do |a|
|
81
|
+
a.start_with?(starts_with.to_s) ? subset.push(a) : next
|
82
|
+
end
|
83
|
+
subset.length == 0 ? AdjectiveAnimal::AdjAni.adjective.sample.strip : subset.sample.strip
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
|
88
|
+
#railsy helpers
|
89
|
+
def symbolize_hash(hash)
|
90
|
+
hash.map { |k, v| [k.to_sym, v] }.to_h
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.humanize(string)
|
94
|
+
string.slice(0, 1).capitalize + string.slice(1..-1)
|
95
|
+
end
|
96
|
+
|
97
|
+
# i stole these all from the internet, thanks internet
|
98
|
+
def self.animal
|
99
|
+
['alligator', 'crocodile', 'alpaca', 'ant', 'antelope', 'ape', 'armadillo', 'ass', ' donkey', 'burro', 'baboon', 'badger', 'bat', 'bear', 'beaver', 'bee', 'beetle', 'buffalo', 'butterfly', 'camel', 'carabao', 'caribou', 'cat', 'cattle', 'cheetah', 'chimpanzee', 'chinchilla', 'cicada', 'clam', 'cockroach', 'cod', 'coyote', 'crab', 'cricket', 'crow', ' raven', 'deer', 'dinosaur', 'dog', 'dolphin', 'porpoise', 'duck', 'eel', 'elephant', 'elk', 'ferret', 'fish', 'fly', 'fox', 'frog', ' toad', 'gerbil', 'giraffe', 'gnat', 'gnu', ' wildebeest', 'goat', 'goldfish', 'gorilla', 'grasshopper', 'guinea pig', 'hamster', 'hare', 'hedgehog', 'herring', 'hippopotamus', 'hornet', 'horse', 'hound', 'hyena', 'impala', 'insect', 'jackal', 'jellyfish', 'kangaroo', 'wallaby', 'leopard', 'lion', 'lizard', 'llama', 'locust', 'louse', 'mallard', 'mammoth', 'manatee', 'marten', 'mink', 'minnow', 'mole', 'monkey', 'moose', 'mosquito', 'mouse', ' rat', 'mule', 'muskrat', 'narwhal', 'numbat', 'otter', 'ox', 'oyster', 'panda', 'pig', 'quail', 'quetzal', 'hog', 'swine', 'platypus', 'porcupine', 'pug', 'rabbit', 'raccoon', 'reindeer', 'rhinoceros', 'salmon', 'umbrellabird', 'uromastix', 'urial', 'sardine', 'scorpion', 'seal', 'serval', 'shark', 'sheep', 'skunk', 'snail', 'snake', 'spider', 'squirrel', 'termite', 'tiger', 'trout', 'turtle', ' tortoise', 'walrus', 'wasp', 'weasel', 'whale', 'wolf', 'wombat', 'woodchuck', 'worm', 'yak', 'yorkie', 'zebra', 'zebu', 'viper', 'vulture', 'xerus', 'xenops', 'xantos']
|
100
|
+
end
|
101
|
+
|
102
|
+
def self.adjective
|
103
|
+
['aback', 'abaft', 'abandoned', 'abashed', 'aberrant', 'abhorrent', 'abiding', 'abject', 'ablaze', 'abnormal', 'aboard', 'aboriginal', 'abortive', 'abounding', 'abrasive', 'abrupt', 'absent', 'absorbed', 'absorbing', 'abstracted', 'absurd', 'abusive', 'acceptable', 'accessible', 'accidental', 'accurate', 'acoustic', 'acrid', 'ad', 'hoc', 'adamant', 'adaptable', 'addicted', 'adhesive', 'adjoining', 'adorable', 'afraid', 'agonizing', 'ahead', 'alcoholic', 'alert', 'alike', 'alive', 'alleged', 'alluring', 'aloof', 'ambiguous', 'ambitious', 'amuck', 'ancient', 'animated', 'apathetic', 'aquatic', 'aromatic', 'aspiring', 'assorted', 'astonishing', 'auspicious', 'available', 'average', 'aware', 'axiomatic ', 'bad', 'barbarous', 'bashful', 'bawdy', 'beautiful', 'belligerent', 'berserk', 'better', 'big', 'billowy', 'bizarre', 'black', 'boiling', 'boorish', 'boring', 'boundless', 'brash', 'brawny', 'breezy', 'brief', 'bright', 'broad', 'broken', 'bumpy', 'burly ', 'cagey', 'callous', 'capable', 'capricious', 'ceaseless', 'changeable', 'cheerful', 'childlike', 'chilly', 'chivalrous', 'chubby', 'chunky', 'clammy', 'classy', 'cloistered', 'cloudy', 'clumsy', 'coherent', 'cold', 'colossal', 'combative', 'comfortable', 'cooing', 'cool', 'cooperative', 'courageous', 'cowardly', 'crabby', 'craven', 'crazy', 'credible', 'creepy', 'crooked', 'cuddly', 'cultured', 'curly', 'curved', 'cynical ', 'daffy', 'daily', 'damaged', 'damaging', 'damp', 'dapper', 'dashing', 'dazzling', 'deadpan', 'debonair', 'decisive', 'decorous', 'deep', 'deeply', 'defective', 'delightful', 'demonic', 'deranged', 'deserted', 'detailed', 'determined', 'devilish', 'didactic', 'diligent', 'direful', 'dirty', 'disagreeable', 'discreet', 'disillusioned', 'dispensable', 'divergent', 'dizzy', 'domineering', 'draconian', 'dramatic', 'drunk', 'dry', 'dull', 'dusty', 'dynamic', 'dysfunctional ', 'eager', 'early', 'earsplitting', 'earthy', 'eatable', 'economic', 'educated', 'efficacious', 'efficient', 'elated', 'elderly', 'elfin', 'elite', 'eminent', 'empty', 'enchanting', 'encouraging', 'endurable', 'energetic', 'entertaining', 'enthusiastic', 'equable', 'erect', 'erratic', 'ethereal', 'evanescent', 'evasive', 'evil', 'excellent', 'excited', 'exclusive', 'exotic', 'expensive', 'exuberant', 'exultant ', 'fabulous', 'faded', 'fallacious', 'fanatical', 'fancy', 'fantastic', 'fascinated', 'fast', 'fat', 'faulty', 'fearless', 'feigned', 'fertile', 'festive', 'filthy', 'finicky', 'flagrant', 'flashy', 'flawless', 'flippant', 'flowery', 'foamy', 'foregoing', 'forgetful', 'fortunate', 'frail', 'fretful', 'friendly', 'functional', 'funny', 'furtive', 'futuristic ', 'gabby', 'gainful', 'gamy', 'gaping', 'garrulous', 'gaudy', 'gentle', 'giant', 'giddy', 'gigantic', 'glamorous', 'glib', 'glorious', 'glossy', 'godly', 'good', 'goofy', 'gorgeous', 'graceful', 'grandiose', 'great', 'greedy', 'green', 'groovy', 'grotesque', 'grouchy', 'gruesome', 'grumpy', 'guarded', 'guiltless', 'gullible', 'gusty', 'guttural ', 'habitual', 'half', 'hallowed', 'halting', 'handsome', 'handsomely', 'hapless', 'happy', 'harmonious', 'heady', 'healthy', 'heartbreaking', 'heavenly', 'heavy', 'hellish', 'helpful', 'hesitant', 'high', 'highfalutin', 'hilarious', 'historical', 'holistic', 'hollow', 'honorable', 'horrible', 'hospitable', 'huge', 'hulking', 'humdrum', 'humorous', 'hungry', 'hurried', 'hurt', 'hypnotic', 'hysterical ', 'icky', 'idiotic', 'ignorant', 'illegal', 'illustrious', 'imaginary', 'immense', 'imminent', 'impartial', 'imperfect', 'imported', 'incandescent', 'incompetent', 'inconclusive', 'industrious', 'innate', 'instinctive', 'internal', 'invincible', 'irate', 'itchy ', 'jaded', 'jagged', 'jazzy', 'jealous', 'jittery', 'jobless', 'jolly', 'joyous', 'judicious', 'jumbled', 'jumpy', 'juvenile ', 'kaput', 'kind', 'kindhearted', 'knotty', 'knowing', 'knowledgeable', 'known ', 'labored', 'lackadaisical', 'lacking', 'lamentable', 'languid', 'large', 'late', 'laughable', 'lavish', 'lazy', 'lean', 'learned', 'legal', 'lethal', 'level', 'lewd', 'light', 'likeable', 'literate', 'little', 'lively', 'long', 'longing', 'lopsided', 'loutish', 'lovely', 'loving', 'low', 'lowly', 'lucky', 'ludicrous', 'lush', 'luxuriant', 'lying', 'lyrical ', 'macabre', 'macho', 'maddening', 'madly', 'magenta', 'magical', 'magnificent', 'majestic', 'makeshift', 'malicious', 'mammoth', 'maniacal', 'many', 'marked', 'massive', 'materialistic', 'mature', 'measly', 'meek', 'melodic', 'merciful', 'mere', 'mighty', 'mindless', 'miniature', 'minor', 'miscreant', 'moaning', 'modern', 'moldy', 'momentous', 'muddled', 'mundane', 'murky', 'mushy', 'mysterious ', 'naive', 'nappy', 'narrow', 'nasty', 'nauseating', 'nebulous', 'needless', 'needy', 'neighborly', 'nervous', 'new', 'nice', 'nifty', 'noiseless', 'noisy', 'nonchalant', 'nondescript', 'nonstop', 'nostalgic', 'nosy', 'noxious', 'null', 'numberless', 'numerous', 'nutritious', 'oafish', 'obedient', 'obeisant', 'obscene', 'obsequious', 'observant', 'obsolete', 'obtainable', 'oceanic', 'odd', 'offbeat', 'old', 'omniscient', 'onerous', 'optimal', 'orange', 'ordinary', 'organic', 'ossified', 'oval', 'overconfident', 'overjoyed', 'overrated', 'overt', 'overwrought ', 'painful', 'painstaking', 'panoramic', 'parched', 'parsimonious', 'pastoral', 'pathetic', 'peaceful', 'penitent', 'perfect', 'periodic', 'permissible', 'perpetual', 'petite', 'phobic', 'picayune', 'piquant', 'placid', 'plausible', 'pleasant', 'plucky', 'pointless', 'political', 'possessive', 'precious', 'premium', 'pretty', 'prickly', 'productive', 'profuse', 'protective', 'proud', 'psychedelic', 'psychotic', 'puffy', 'pumped', 'puny', 'purple ', 'quack', 'quaint', 'quarrelsome', 'questionable', 'quick', 'quickest', 'quiet', 'quixotic', 'quizzical ', 'rabid', 'racial', 'ragged', 'rainy', 'rambunctious', 'rampant', 'rare', 'raspy', 'ratty', 'rebellious', 'receptive', 'recondite', 'red', 'redundant', 'reflective', 'relieved', 'reminiscent', 'resolute', 'resonant', 'rhetorical', 'righteous', 'rightful', 'ritzy', 'roasted', 'robust', 'romantic', 'roomy', 'round', 'royal', 'ruddy', 'rural', 'rustic', 'ruthless ', 'sable', 'sad', 'sassy', 'satisfying', 'scandalous', 'scarce', 'scary', 'scientific', 'scintillating', 'scrawny', 'secretive', 'sedate', 'seemly', 'selective', 'shallow', 'shocking', 'short', 'shrill', 'silly', 'sincere', 'skillful', 'skinny', 'sloppy', 'slow', 'small', 'smelly', 'sneaky', 'snobbish', 'snotty', 'soggy', 'somber', 'sordid', 'spectacular', 'spicy', 'spiffy', 'spiritual', 'splendid', 'spooky', 'spurious', 'squalid', 'square', 'squeamish', 'staking', 'standing', 'statuesque', 'steadfast', 'stereotyped', 'stimulating', 'stingy', 'strange', 'subdued', 'subsequent', 'successful', 'succinct', 'sulky', 'supreme', 'swanky', 'sweltering', 'symptomatic', 'synonymous ', 'taboo', 'tacit', 'tacky', 'talented', 'tall', 'tame', 'tan', 'tangible', 'tangy', 'tart', 'tasteful', 'tawdry', 'tearful', 'telling', 'temporary', 'tender', 'tenuous', 'tested', 'testy', 'therapeutic', 'thinkable', 'threatening', 'tight', 'tightfisted', 'tiny', 'tiresome', 'toothsome', 'torpid', 'tough', 'towering', 'tranquil', 'trashy', 'tricky', 'trite', 'truculent', 'typical ', 'ubiquitous', 'ugliest', 'ugly', 'ultra', 'unable', 'unaccountable', 'unadvised', 'unarmed', 'unbecoming', 'unbiased', 'uncovered', 'understood', 'undesirable', 'unequaled', 'uneven', 'unsightly', 'unsuitable', 'unusual', 'upbeat', 'uppity', 'upset', 'uptight', 'used', 'utopian', 'utter', 'uttermost ', 'vacuous', 'vague', 'various', 'vast', 'vengeful', 'venomous', 'verdant', 'versed', 'victorious', 'vigorous', 'vivacious', 'voiceless', 'volatile', 'voracious', 'vulgar ', 'wacky', 'waggish', 'wakeful', 'wanting', 'warlike', 'warm', 'wary', 'wasteful', 'watchful', 'watery', 'weak', 'wealthy', 'weary', 'wee', 'wet', 'whimsical', 'whispering', 'wholesale', 'wicked', 'wide', 'willing', 'wiry', 'wise', 'wistful', 'woebegone', 'womanly', 'wonderful', 'wooden', 'woozy', 'workable', 'worried', 'worthless', 'wrathful', 'wretched', 'wry ', 'yellow', 'yielding', 'young', 'youthful', 'yummy ', 'zany', 'zealous', 'zippy', 'zonked', 'xenophobic', 'xeric', 'xenail']
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AdjectiveAnimal do
|
4
|
+
|
5
|
+
|
6
|
+
it "creates a name using adjective_animal" do
|
7
|
+
adjective_animal = AdjectiveAnimal.new
|
8
|
+
expect(adjective_animal.adj.length).to be > 0
|
9
|
+
expect(adjective_animal.ani.length).to be > 0
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
it "creates a name using the same starting letter as the symbol or string passed in" do
|
14
|
+
adjective_animal = AdjectiveAnimal.new(:y)
|
15
|
+
expect(adjective_animal.adj).to start_with 'Y'
|
16
|
+
expect(adjective_animal.ani).to start_with 'Y'
|
17
|
+
adjective_animal = AdjectiveAnimal.new(:K)
|
18
|
+
expect(adjective_animal.adj).to start_with 'K'
|
19
|
+
expect(adjective_animal.ani).to start_with 'K'
|
20
|
+
adjective_animal = AdjectiveAnimal.new('b')
|
21
|
+
expect(adjective_animal.adj).to start_with 'B'
|
22
|
+
expect(adjective_animal.ani).to start_with 'B'
|
23
|
+
adjective_animal = AdjectiveAnimal.new('C')
|
24
|
+
expect(adjective_animal.adj).to start_with 'C'
|
25
|
+
expect(adjective_animal.ani).to start_with 'C'
|
26
|
+
end
|
27
|
+
|
28
|
+
it "ignores new() arguments that are not a single character or a single symbol" do
|
29
|
+
adjective_animal = AdjectiveAnimal.new('woops')
|
30
|
+
expect(adjective_animal.adj.length).to be > 0
|
31
|
+
expect(adjective_animal.ani.length).to be > 0
|
32
|
+
adjective_animal = AdjectiveAnimal.new('1')
|
33
|
+
expect(adjective_animal.adj.length).to be > 0
|
34
|
+
expect(adjective_animal.ani.length).to be > 0
|
35
|
+
end
|
36
|
+
|
37
|
+
it "generates an array of 26 objects with letters A-Z" do
|
38
|
+
adjective_animals = AdjectiveAnimal.all
|
39
|
+
expect(adjective_animals.length).to eql 26
|
40
|
+
expect(adjective_animals.first.adjective).to start_with 'A'
|
41
|
+
expect(adjective_animals.first.animal).to start_with 'A'
|
42
|
+
expect(adjective_animals.last.adjective).to start_with 'Z'
|
43
|
+
expect(adjective_animals.last.animal).to start_with 'Z'
|
44
|
+
end
|
45
|
+
|
46
|
+
it "outputs the adjective and animal as two words using to_s" do
|
47
|
+
adjective_animal = AdjectiveAnimal.new
|
48
|
+
expect(adjective_animal.to_s.split(' ').length).to eql 2
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,168 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: adjective_animal
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- montch
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-debugger
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry-rescue
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry-stack_explorer
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: " No, really, that's all it does"
|
126
|
+
email:
|
127
|
+
- montch@gmail.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".gitignore"
|
133
|
+
- Gemfile
|
134
|
+
- LICENSE.txt
|
135
|
+
- README.md
|
136
|
+
- Rakefile
|
137
|
+
- adjective_animal.gemspec
|
138
|
+
- lib/adjective_animal.rb
|
139
|
+
- lib/adjective_animal/version.rb
|
140
|
+
- spec/adjective_animal_spec.rb
|
141
|
+
- spec/spec_helper.rb
|
142
|
+
homepage: https://github.com/montch/adjective_animal
|
143
|
+
licenses:
|
144
|
+
- MIT
|
145
|
+
metadata: {}
|
146
|
+
post_install_message:
|
147
|
+
rdoc_options: []
|
148
|
+
require_paths:
|
149
|
+
- lib
|
150
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
requirements: []
|
161
|
+
rubyforge_project:
|
162
|
+
rubygems_version: 2.2.2
|
163
|
+
signing_key:
|
164
|
+
specification_version: 4
|
165
|
+
summary: Creates an adjective and an animal
|
166
|
+
test_files:
|
167
|
+
- spec/adjective_animal_spec.rb
|
168
|
+
- spec/spec_helper.rb
|