kittyverse 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +5 -3
- data/README.md +69 -10
- data/lib/kittyverse.rb +9 -268
- data/lib/kittyverse/cattributes.rb +29 -22
- data/lib/kittyverse/config/fancies.rb +550 -0
- data/lib/kittyverse/{purrstige.rb → config/purrstiges.rb} +1 -1
- data/lib/kittyverse/config/traits.rb +377 -0
- data/lib/kittyverse/{traits_timeline.rb → config/traits_timeline.rb} +0 -0
- data/lib/kittyverse/fancies.rb +158 -550
- data/lib/kittyverse/links.rb +6 -9
- data/lib/kittyverse/traits.rb +262 -374
- data/lib/kittyverse/version.rb +1 -1
- data/test/test_cattributes.rb +22 -34
- data/test/test_fancies.rb +52 -0
- data/test/test_traits.rb +66 -169
- metadata +7 -5
- data/lib/kittyverse/catalog.rb +0 -27
data/lib/kittyverse/version.rb
CHANGED
data/test/test_cattributes.rb
CHANGED
@@ -11,46 +11,34 @@ require 'helper'
|
|
11
11
|
class TestCattributes < MiniTest::Test
|
12
12
|
|
13
13
|
def test_savannah
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
assert_equal 1, c.traits.size
|
23
|
-
|
24
|
-
c = Cattribute[ 'savannah' ]
|
25
|
-
assert_equal 'savannah', c.name
|
26
|
-
assert_equal 'Fur', c.type.name
|
27
|
-
assert_equal 1, c.traits.size
|
14
|
+
[ Cattribute.find_by_name( 'savannah' ),
|
15
|
+
Cattribute.find_by( name: 'savannah' ),
|
16
|
+
Cattribute[ 'savannah' ]
|
17
|
+
].each do |c|
|
18
|
+
assert_equal 'Savannah', c.name
|
19
|
+
assert_equal 'Fur', c.type.name
|
20
|
+
assert_equal 1, c.traits.size
|
21
|
+
end
|
28
22
|
end
|
29
23
|
|
30
24
|
def test_totesbasic
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
assert_equal 'Pattern', c.type.name
|
39
|
-
assert_equal 3, c.traits.size
|
40
|
-
|
25
|
+
[ Cattribute.find_by_name( :totesbasic ),
|
26
|
+
Cattribute[ 'totesbasic' ]
|
27
|
+
].each do |c|
|
28
|
+
assert_equal 'Totesbasic', c.name
|
29
|
+
assert_equal 'Pattern', c.type.name
|
30
|
+
assert_equal 3, c.traits.size
|
31
|
+
end
|
41
32
|
end
|
42
33
|
|
43
34
|
def test_bionic
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
assert_equal 'bionic', c.name
|
52
|
-
assert_equal 'Purrstige', c.type.name
|
53
|
-
assert_equal 0, c.traits.size
|
35
|
+
[ Cattribute.find_by_name( 'bionic' ),
|
36
|
+
Cattribute[ 'bionic' ]
|
37
|
+
].each do |c|
|
38
|
+
assert_equal 'Bionic', c.name
|
39
|
+
assert_equal 'Purrstige', c.type.name
|
40
|
+
assert_equal 0, c.traits.size
|
41
|
+
end
|
54
42
|
end
|
55
43
|
|
56
44
|
end # class TestCattributes
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
###
|
4
|
+
# to run use
|
5
|
+
# ruby -I ./lib -I ./test test/test_fancies.rb
|
6
|
+
|
7
|
+
|
8
|
+
require 'helper'
|
9
|
+
|
10
|
+
|
11
|
+
class TestFancies < MiniTest::Test
|
12
|
+
|
13
|
+
|
14
|
+
def test_bugcat
|
15
|
+
[ Fancy.find_by( key: 'bugcat' ),
|
16
|
+
Fancy[ :bugcat ],
|
17
|
+
Fancy[ 'Bug Cat' ]
|
18
|
+
].each do |fancy|
|
19
|
+
assert_equal 'Bug Cat', fancy.name
|
20
|
+
assert_equal :bugcat, fancy.key
|
21
|
+
assert_equal 3, fancy.ids.size
|
22
|
+
assert_equal [101,102,103], fancy.ids
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_bugcat_v2
|
27
|
+
[ Fancy.find_by( name: 'Bug Cat V2' ),
|
28
|
+
Fancy.find_by( name: 'BugCatV2' ),
|
29
|
+
Fancy[ 'Bug Cat V2' ],
|
30
|
+
Fancy[ :bugcatv2 ]
|
31
|
+
].each do |fancy|
|
32
|
+
assert_equal 'Bug Cat V2', fancy.name
|
33
|
+
assert_equal :bugcatv2, fancy.key
|
34
|
+
assert_equal 20, fancy.ids.size
|
35
|
+
assert_equal (167..186).to_a, fancy.ids
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
def test_misc
|
41
|
+
Fancy.each do |fancy|
|
42
|
+
p fancy.name
|
43
|
+
end
|
44
|
+
|
45
|
+
pp Fancy.size
|
46
|
+
pp Fancy.exclusives.size
|
47
|
+
pp Fancy.special_editions.size
|
48
|
+
pp Fancy.fancies.size
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
end # class TestFancies
|
data/test/test_traits.rb
CHANGED
@@ -11,187 +11,84 @@ require 'helper'
|
|
11
11
|
class TestTraits < MiniTest::Test
|
12
12
|
|
13
13
|
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
t = Traits[ 'savannah' ]
|
40
|
-
assert_equal Trait, t.class
|
41
|
-
assert_equal "savannah", t.name
|
42
|
-
assert_equal "Fur", t.type.name
|
43
|
-
assert_equal "FU00", t.code
|
44
|
-
assert_equal "1", t.kai
|
45
|
-
|
46
|
-
t = Traits[ 'Savannah' ]
|
47
|
-
assert_equal Trait, t.class
|
48
|
-
assert_equal "savannah", t.name
|
49
|
-
assert_equal "Fur", t.type.name
|
50
|
-
assert_equal "FU00", t.code
|
51
|
-
assert_equal "1", t.kai
|
52
|
-
|
53
|
-
t = Trait.find_by_name( 'Savannah' )
|
54
|
-
assert_equal Trait, t.class
|
55
|
-
assert_equal "savannah", t.name
|
56
|
-
assert_equal "Fur", t.type.name
|
57
|
-
assert_equal "FU00", t.code
|
58
|
-
assert_equal "1", t.kai
|
59
|
-
|
60
|
-
t = Trait.find_by( name: 'Savannah' )
|
61
|
-
assert_equal Trait, t.class
|
62
|
-
assert_equal "savannah", t.name
|
63
|
-
assert_equal "Fur", t.type.name
|
64
|
-
assert_equal "FU00", t.code
|
65
|
-
assert_equal "1", t.kai
|
66
|
-
|
67
|
-
t = Traits[ :body ][ '1' ]
|
68
|
-
assert_equal Trait, t.class
|
69
|
-
assert_equal "savannah", t.name
|
70
|
-
assert_equal "Fur", t.type.name
|
71
|
-
assert_equal "FU00", t.code
|
72
|
-
assert_equal "1", t.kai
|
73
|
-
|
74
|
-
t = Traits[ :body ][ 'x' ]
|
75
|
-
assert_equal Trait, t.class
|
76
|
-
assert_equal "body_x", t.name
|
77
|
-
assert_equal "Fur", t.type.name
|
78
|
-
assert_equal "FU31", t.code
|
79
|
-
assert_equal "x", t.kai
|
80
|
-
|
81
|
-
t = Traits[ :body ][ '00' ]
|
82
|
-
assert_equal Trait, t.class
|
83
|
-
assert_equal "savannah", t.name
|
84
|
-
assert_equal "Fur", t.type.name
|
85
|
-
assert_equal "FU00", t.code
|
86
|
-
assert_equal "1", t.kai
|
87
|
-
|
88
|
-
t = Traits[ :body ][ '31' ]
|
89
|
-
assert_equal Trait, t.class
|
90
|
-
assert_equal "body_x", t.name
|
91
|
-
assert_equal "Fur", t.type.name
|
92
|
-
assert_equal "FU31", t.code
|
93
|
-
assert_equal "x", t.kai
|
94
|
-
|
95
|
-
t = Traits[ :body ][ 0 ]
|
96
|
-
assert_equal Trait, t.class
|
97
|
-
assert_equal "savannah", t.name
|
98
|
-
assert_equal "Fur", t.type.name
|
99
|
-
assert_equal "FU00", t.code
|
100
|
-
assert_equal "1", t.kai
|
101
|
-
|
102
|
-
t = Traits[ :body ][ 31 ]
|
103
|
-
assert_equal Trait, t.class
|
104
|
-
assert_equal "body_x", t.name
|
105
|
-
assert_equal "Fur", t.type.name
|
106
|
-
assert_equal "FU31", t.code
|
107
|
-
assert_equal "x", t.kai
|
108
|
-
|
109
|
-
|
110
|
-
t = Traits[ :body ]
|
111
|
-
assert_equal TraitType, t.class
|
112
|
-
assert_equal "Fur", t.name
|
113
|
-
|
114
|
-
t = TraitType.find_by_key( :body )
|
115
|
-
assert_equal TraitType, t.class
|
116
|
-
assert_equal "Fur", t.name
|
117
|
-
|
118
|
-
t = TraitType.find_by( :key => :body )
|
119
|
-
assert_equal TraitType, t.class
|
120
|
-
assert_equal "Fur", t.name
|
121
|
-
|
122
|
-
|
123
|
-
t = Traits['FU']['00']
|
124
|
-
assert_equal Trait, t.class
|
125
|
-
assert_equal "savannah", t.name
|
126
|
-
assert_equal "Fur", t.type.name
|
127
|
-
assert_equal "FU00", t.code
|
128
|
-
assert_equal "1", t.kai
|
129
|
-
|
130
|
-
t = Traits['FU'][0]
|
131
|
-
assert_equal Trait, t.class
|
132
|
-
assert_equal "savannah", t.name
|
133
|
-
assert_equal "Fur", t.type.name
|
134
|
-
assert_equal "FU00", t.code
|
135
|
-
assert_equal "1", t.kai
|
136
|
-
|
137
|
-
t = Traits[:FU][0]
|
138
|
-
assert_equal Trait, t.class
|
139
|
-
assert_equal "savannah", t.name
|
140
|
-
assert_equal "Fur", t.type.name
|
141
|
-
assert_equal "FU00", t.code
|
142
|
-
assert_equal "1", t.kai
|
143
|
-
|
144
|
-
t = Traits[:FU00]
|
145
|
-
assert_equal Trait, t.class
|
146
|
-
assert_equal "savannah", t.name
|
147
|
-
assert_equal "Fur", t.type.name
|
148
|
-
assert_equal "FU00", t.code
|
149
|
-
assert_equal "1", t.kai
|
150
|
-
|
151
|
-
t = Traits['Fur'][0]
|
152
|
-
assert_equal Trait, t.class
|
153
|
-
assert_equal "savannah", t.name
|
154
|
-
assert_equal "Fur", t.type.name
|
155
|
-
assert_equal "FU00", t.code
|
156
|
-
assert_equal "1", t.kai
|
157
|
-
|
158
|
-
t = Traits['Pattern'][0]
|
159
|
-
assert_equal Trait, t.class
|
160
|
-
assert_equal "vigilante", t.name
|
161
|
-
assert_equal "Pattern", t.type.name
|
162
|
-
assert_equal "PA00", t.code
|
163
|
-
assert_equal "1", t.kai
|
164
|
-
|
165
|
-
t = Traits['PA00']
|
166
|
-
assert_equal Trait, t.class
|
167
|
-
assert_equal "vigilante", t.name
|
168
|
-
assert_equal "Pattern", t.type.name
|
169
|
-
assert_equal "PA00", t.code
|
170
|
-
assert_equal "1", t.kai
|
171
|
-
|
172
|
-
t = Traits['Vigilante']
|
173
|
-
assert_equal Trait, t.class
|
174
|
-
assert_equal "vigilante", t.name
|
175
|
-
assert_equal "Pattern", t.type.name
|
176
|
-
assert_equal "PA00", t.code
|
177
|
-
assert_equal "1", t.kai
|
14
|
+
def test_savannah
|
15
|
+
[ Traits[ 'FU00' ],
|
16
|
+
Trait.find_by_code( 'FU00' ),
|
17
|
+
Trait.find_by( code: 'FU00' ),
|
18
|
+
Traits[ 'savannah' ],
|
19
|
+
Traits[ 'Savannah' ],
|
20
|
+
Trait.find_by_name( 'Savannah' ),
|
21
|
+
Trait.find_by( name: 'Savannah' ),
|
22
|
+
Traits[ :body ][ '1' ],
|
23
|
+
Traits[ :body ][ '00' ],
|
24
|
+
Traits[ :body ][ 0 ],
|
25
|
+
Traits['FU']['00'],
|
26
|
+
Traits['FU'][0],
|
27
|
+
Traits[:FU][0],
|
28
|
+
Traits[:FU00],
|
29
|
+
Traits['Fur'][0]
|
30
|
+
].each do |t|
|
31
|
+
assert_equal Trait, t.class
|
32
|
+
assert_equal "Savannah", t.name
|
33
|
+
assert_equal "Fur", t.type.name
|
34
|
+
assert_equal "FU00", t.code
|
35
|
+
assert_equal "1", t.kai
|
36
|
+
end
|
178
37
|
end
|
179
38
|
|
39
|
+
def test_fu31
|
40
|
+
[ Traits[ :body ][ 'x' ],
|
41
|
+
Traits[ :body ][ '31' ],
|
42
|
+
Traits[ :body ][ 31 ]
|
43
|
+
].each do |t|
|
44
|
+
assert_equal Trait, t.class
|
45
|
+
assert_equal nil, t.name
|
46
|
+
assert_equal "Fur", t.type.name
|
47
|
+
assert_equal "FU31", t.code
|
48
|
+
assert_equal "x", t.kai
|
49
|
+
end
|
50
|
+
end
|
180
51
|
|
181
|
-
def
|
182
|
-
|
183
|
-
|
52
|
+
def test_vigilante
|
53
|
+
[ Traits['Pattern'][0],
|
54
|
+
Traits['PA00'],
|
55
|
+
Traits['Vigilante']
|
56
|
+
].each do |t|
|
57
|
+
assert_equal Trait, t.class
|
58
|
+
assert_equal "Vigilante", t.name
|
59
|
+
assert_equal "Pattern", t.type.name
|
60
|
+
assert_equal "PA00", t.code
|
61
|
+
assert_equal "1", t.kai
|
184
62
|
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_body
|
66
|
+
[ Traits[ :body ],
|
67
|
+
TraitType.find_by_key( :body ),
|
68
|
+
TraitType.find_by( :key => :body )
|
69
|
+
].each do |tt|
|
70
|
+
assert_equal TraitType, tt.class
|
71
|
+
assert_equal "Fur", tt.name
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
185
75
|
|
76
|
+
|
77
|
+
|
78
|
+
def test_each
|
186
79
|
Traits.each do |type|
|
187
80
|
puts "#{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
|
188
81
|
end
|
189
82
|
|
190
|
-
|
83
|
+
Traits.each_with_index do |type,i|
|
191
84
|
puts "#{i}: #{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
|
192
85
|
end
|
193
86
|
|
194
|
-
|
87
|
+
TraitType.each do |type|
|
88
|
+
puts "#{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
|
89
|
+
end
|
90
|
+
|
91
|
+
TraitType.each_with_index do |type,i|
|
195
92
|
puts "#{i}: #{type.key} => #{type.name} (#{type.code}), genes #{type.genes}"
|
196
93
|
end
|
197
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kittyverse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base32-alphabets
|
@@ -69,18 +69,20 @@ files:
|
|
69
69
|
- README.md
|
70
70
|
- Rakefile
|
71
71
|
- lib/kittyverse.rb
|
72
|
-
- lib/kittyverse/catalog.rb
|
73
72
|
- lib/kittyverse/cattributes.rb
|
73
|
+
- lib/kittyverse/config/fancies.rb
|
74
|
+
- lib/kittyverse/config/purrstiges.rb
|
75
|
+
- lib/kittyverse/config/traits.rb
|
76
|
+
- lib/kittyverse/config/traits_timeline.rb
|
74
77
|
- lib/kittyverse/fancies.rb
|
75
78
|
- lib/kittyverse/links.rb
|
76
79
|
- lib/kittyverse/mewtations.rb
|
77
80
|
- lib/kittyverse/pages/genes.rb
|
78
|
-
- lib/kittyverse/purrstige.rb
|
79
81
|
- lib/kittyverse/traits.rb
|
80
|
-
- lib/kittyverse/traits_timeline.rb
|
81
82
|
- lib/kittyverse/version.rb
|
82
83
|
- test/helper.rb
|
83
84
|
- test/test_cattributes.rb
|
85
|
+
- test/test_fancies.rb
|
84
86
|
- test/test_traits.rb
|
85
87
|
homepage: https://github.com/cryptocopycats/kittyverse
|
86
88
|
licenses:
|
data/lib/kittyverse/catalog.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
|
4
|
-
class Catalog ## todo: use a module - move to its own file - why? why not?
|
5
|
-
|
6
|
-
@@special_editions = {} # special edition fancies
|
7
|
-
@@exclusives = {} # exclusive fancies
|
8
|
-
@@fancies = {} # "normal" fancies
|
9
|
-
|
10
|
-
|
11
|
-
## use special_cats, exclusive_cats, etc. - why? why not?
|
12
|
-
def self.special_editions() @@special_editions; end
|
13
|
-
def self.exclusives() @@exclusives; end
|
14
|
-
def self.fancies() @@fancies; end
|
15
|
-
|
16
|
-
|
17
|
-
## auto-fill
|
18
|
-
FANCIES.each do |key,h|
|
19
|
-
if h[:specialedition]
|
20
|
-
special_editions[key] = h
|
21
|
-
elsif h[:exclusive]
|
22
|
-
exclusives[key] = h
|
23
|
-
else
|
24
|
-
fancies[key] = h
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end # class Catalog
|