punks 2024.1.26 → 2024.2.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +1 -0
- data/config/punks-12x12.csv +306 -243
- data/config/punks-12x12.png +0 -0
- data/lib/punks/dataset/dataset.rb +82 -0
- data/lib/punks/version.rb +2 -2
- data/lib/punks.rb +5 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 268d33b0f900e9a7f201ecb80d10b626579d27582cf54971311d8a45ac0e8aec
|
4
|
+
data.tar.gz: df7a2f5e2dde66145fd018a6419b4e2a1db0087c894f5af3813658c31b2bb392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc8c35a941d18ef6ed0393c7c4ac7c9178866f104e7a904db1250398aa70c169f8c0262417a05f6338dcb879ac1c1e51d55729e1e7ff01ee4df5dd6de9839c73
|
7
|
+
data.tar.gz: 918815fe3bc9fd342bfcb9cb65d71ee9c506840ac49e1423251f77edbf58bb25c260a931d1b353327f95bcebe5f232334e4f198468fc77aa89227bbf5b36eee6
|
data/Manifest.txt
CHANGED
data/config/punks-12x12.csv
CHANGED
@@ -66,246 +66,309 @@ id, category, name, more_names
|
|
66
66
|
64, base, vampire orange,
|
67
67
|
65, base, mummy,
|
68
68
|
66, base, mummy orange,
|
69
|
-
67, base,
|
70
|
-
68, base,
|
71
|
-
69, base,
|
72
|
-
70, base,
|
73
|
-
71, base,
|
74
|
-
72, base,
|
75
|
-
73, base,
|
76
|
-
74, base,
|
77
|
-
75, base,
|
78
|
-
76, base,
|
79
|
-
77, base,
|
80
|
-
78, base,
|
81
|
-
79, base,
|
82
|
-
80, base,
|
83
|
-
81, base,
|
84
|
-
82, base,
|
85
|
-
83, base,
|
86
|
-
84, base,
|
87
|
-
85, base,
|
88
|
-
86, base,
|
89
|
-
87, base,
|
90
|
-
88, base,
|
91
|
-
89, base,
|
92
|
-
90, base,
|
93
|
-
91,
|
94
|
-
92,
|
95
|
-
93,
|
96
|
-
94,
|
97
|
-
95,
|
98
|
-
96,
|
99
|
-
97,
|
100
|
-
98,
|
101
|
-
99,
|
102
|
-
100,
|
103
|
-
101,
|
104
|
-
102,
|
105
|
-
103,
|
106
|
-
104,
|
107
|
-
105,
|
108
|
-
106,
|
109
|
-
107,
|
110
|
-
108,
|
111
|
-
109,
|
112
|
-
110,
|
113
|
-
111,
|
114
|
-
112,
|
115
|
-
113,
|
116
|
-
114,
|
117
|
-
115,
|
118
|
-
116,
|
119
|
-
117,
|
120
|
-
118,
|
121
|
-
119,
|
122
|
-
120,
|
123
|
-
121,
|
124
|
-
122,
|
125
|
-
123,
|
126
|
-
124,
|
127
|
-
125,
|
128
|
-
126,
|
129
|
-
127,
|
130
|
-
128,
|
131
|
-
129,
|
132
|
-
130,
|
133
|
-
131,
|
134
|
-
132,
|
135
|
-
133,
|
136
|
-
134,
|
137
|
-
135,
|
138
|
-
136,
|
139
|
-
137,
|
140
|
-
138,
|
141
|
-
139,
|
142
|
-
140,
|
143
|
-
141,
|
144
|
-
142,
|
145
|
-
143,
|
146
|
-
144,
|
147
|
-
145,
|
148
|
-
146,
|
149
|
-
147,
|
150
|
-
148,
|
151
|
-
149,
|
152
|
-
150,
|
153
|
-
151,
|
154
|
-
152,
|
155
|
-
153,
|
156
|
-
154,
|
157
|
-
155,
|
158
|
-
156, hair,
|
159
|
-
157, hair,
|
160
|
-
158, hair,
|
161
|
-
159, hair,
|
162
|
-
160, hair,
|
163
|
-
161,
|
164
|
-
162,
|
165
|
-
163,
|
166
|
-
164,
|
167
|
-
165,
|
168
|
-
166,
|
169
|
-
167,
|
170
|
-
168,
|
171
|
-
169,
|
172
|
-
170,
|
173
|
-
171,
|
174
|
-
172,
|
175
|
-
173,
|
176
|
-
174,
|
177
|
-
175,
|
178
|
-
176,
|
179
|
-
177,
|
180
|
-
178,
|
181
|
-
179,
|
182
|
-
180,
|
183
|
-
181,
|
184
|
-
182,
|
185
|
-
183,
|
186
|
-
184,
|
187
|
-
185,
|
188
|
-
186,
|
189
|
-
187,
|
190
|
-
188,
|
191
|
-
189,
|
192
|
-
190,
|
193
|
-
191,
|
194
|
-
192,
|
195
|
-
193,
|
196
|
-
194,
|
197
|
-
195,
|
198
|
-
196,
|
199
|
-
197,
|
200
|
-
198,
|
201
|
-
199,
|
202
|
-
200,
|
203
|
-
201,
|
204
|
-
202,
|
205
|
-
203,
|
206
|
-
204,
|
207
|
-
205,
|
208
|
-
206,
|
209
|
-
207,
|
210
|
-
208,
|
211
|
-
209,
|
212
|
-
210,
|
213
|
-
211,
|
214
|
-
212,
|
215
|
-
213,
|
216
|
-
214,
|
217
|
-
215,
|
218
|
-
216,
|
219
|
-
217,
|
220
|
-
218,
|
221
|
-
219,
|
222
|
-
220,
|
223
|
-
221,
|
224
|
-
222,
|
225
|
-
223,
|
226
|
-
224,
|
227
|
-
225,
|
228
|
-
226,
|
229
|
-
227,
|
230
|
-
228,
|
231
|
-
229,
|
232
|
-
230,
|
233
|
-
231,
|
234
|
-
232,
|
235
|
-
233,
|
236
|
-
234,
|
237
|
-
235,
|
238
|
-
236,
|
239
|
-
237,
|
240
|
-
238,
|
241
|
-
239,
|
242
|
-
240,
|
243
|
-
241,
|
244
|
-
242,
|
245
|
-
243,
|
246
|
-
244,
|
247
|
-
245,
|
248
|
-
246,
|
249
|
-
247,
|
250
|
-
248,
|
251
|
-
249,
|
252
|
-
250,
|
253
|
-
251,
|
254
|
-
252,
|
255
|
-
253,
|
256
|
-
254,
|
257
|
-
255,
|
258
|
-
256,
|
259
|
-
257,
|
260
|
-
258,
|
261
|
-
259,
|
262
|
-
260,
|
263
|
-
261,
|
264
|
-
262,
|
265
|
-
263,
|
266
|
-
264,
|
267
|
-
265,
|
268
|
-
266,
|
269
|
-
267,
|
270
|
-
268,
|
271
|
-
269,
|
272
|
-
270,
|
273
|
-
271,
|
274
|
-
272,
|
275
|
-
273,
|
276
|
-
274,
|
277
|
-
275,
|
278
|
-
276,
|
279
|
-
277,
|
280
|
-
278,
|
281
|
-
279,
|
282
|
-
280,
|
283
|
-
281,
|
284
|
-
282,
|
285
|
-
283,
|
286
|
-
284,
|
287
|
-
285,
|
288
|
-
286,
|
289
|
-
287,
|
290
|
-
288,
|
291
|
-
289,
|
292
|
-
290,
|
293
|
-
291,
|
294
|
-
292,
|
295
|
-
293,
|
296
|
-
294,
|
297
|
-
295,
|
298
|
-
296,
|
299
|
-
297,
|
300
|
-
298,
|
301
|
-
299,
|
302
|
-
300,
|
303
|
-
301,
|
304
|
-
302,
|
305
|
-
303,
|
306
|
-
304,
|
307
|
-
305,
|
308
|
-
306,
|
309
|
-
307,
|
310
|
-
308,
|
311
|
-
309,
|
69
|
+
67, base, marc,
|
70
|
+
68, base, marc (xl),
|
71
|
+
69, base, bitmap orange,
|
72
|
+
70, base, bitmap pink,
|
73
|
+
71, base, bitmap (1bit),
|
74
|
+
72, base, rock gray,
|
75
|
+
73, base, rock block gray,
|
76
|
+
74, base, rock gold,
|
77
|
+
75, base, rock block gold,
|
78
|
+
76, base, rock pink,
|
79
|
+
77, base, rock pepe,
|
80
|
+
78, base, monke light,
|
81
|
+
79, base, monke orange,
|
82
|
+
80, base, monke pink,
|
83
|
+
81, base, monke orc,
|
84
|
+
82, base, monke alien,
|
85
|
+
83, base, doge,
|
86
|
+
84, base, doge (a),
|
87
|
+
85, base, doge dark,
|
88
|
+
86, base, doge dark (a),
|
89
|
+
87, base, doge zombie,
|
90
|
+
88, base, doge zombie (a),
|
91
|
+
89, base, doge alien,
|
92
|
+
90, base, doge alien (a),
|
93
|
+
91, readymades, davinci,
|
94
|
+
92, readymades, davinci (a),
|
95
|
+
93, readymades, shakespeare,
|
96
|
+
94, readymades, vangogh,
|
97
|
+
95, readymades, frida,
|
98
|
+
96, readymades, frida (a),
|
99
|
+
97, readymades, girlwithpearl,
|
100
|
+
98, readymades, girlwithpearl pepe,
|
101
|
+
99, readymades, girlwithpearl bitmap orange,
|
102
|
+
100, readymades, joe,
|
103
|
+
101, readymades, joe (a),
|
104
|
+
102, readymades, joe (1bit),
|
105
|
+
103, readymades, donald,
|
106
|
+
104, readymades, donald (a),
|
107
|
+
105, readymades, donald (1bit),
|
108
|
+
106, readymades, nikki,
|
109
|
+
107, readymades, nikki (a),
|
110
|
+
108, readymades, nikki (b),
|
111
|
+
109, readymades, nikki (1bit),
|
112
|
+
110, readymades, mundl,
|
113
|
+
111, pork, pork,
|
114
|
+
112, pork, pork (a),
|
115
|
+
113, pork, pork (aa),
|
116
|
+
114, pork, pork (aaa),
|
117
|
+
115, pork, pork (1bit),
|
118
|
+
116, pork, pork alien,
|
119
|
+
117, pork, pork alien (a),
|
120
|
+
118, pork, pork alien (aa),
|
121
|
+
119, pork, pork alien (aaa),
|
122
|
+
120, pork, pork alien (b),
|
123
|
+
121, pork, pork alien red,
|
124
|
+
122, pork, pork alien red (a),
|
125
|
+
123, pork, pork alien red (aa),
|
126
|
+
124, pork, pork alien red (aaa),
|
127
|
+
125, pork, pork alien red (b),
|
128
|
+
126, pork, pork blue,
|
129
|
+
127, pork, pork blue (a),
|
130
|
+
128, pork, pork blue (aa),
|
131
|
+
129, pork, pork blue (aaa),
|
132
|
+
130, pork, pork blue (b),
|
133
|
+
131, pork, pork gold,
|
134
|
+
132, pork, pork gold (a),
|
135
|
+
133, pork, pork gold (aa),
|
136
|
+
134, pork, pork gold (aaa),
|
137
|
+
135, pork, pork gold (b),
|
138
|
+
136, pork, pork green,
|
139
|
+
137, pork, pork green (a),
|
140
|
+
138, pork, pork green (aa),
|
141
|
+
139, pork, pork green (aaa),
|
142
|
+
140, pork, pork green (b),
|
143
|
+
141, pork, pork orange,
|
144
|
+
142, pork, pork orange (a),
|
145
|
+
143, pork, pork orange (aa),
|
146
|
+
144, pork, pork orange (aaa),
|
147
|
+
145, pork, pork orange (b),
|
148
|
+
146, pork, pork orc,
|
149
|
+
147, pork, pork orc (a),
|
150
|
+
148, pork, pork orc (aa),
|
151
|
+
149, pork, pork orc (aaa),
|
152
|
+
150, pork, pork orc (b),
|
153
|
+
151, pork, pork pink,
|
154
|
+
152, pork, pork pink (a),
|
155
|
+
153, pork, pork pink (aa),
|
156
|
+
154, pork, pork pink (aaa),
|
157
|
+
155, pork, pork pink (b),
|
158
|
+
156, hair, blonde bob,
|
159
|
+
157, hair, blonde bob (pork),
|
160
|
+
158, hair, blonde bob (bmp),
|
161
|
+
159, hair, crazy hair (f),
|
162
|
+
160, hair, crazy hair (m),
|
163
|
+
161, hair, crazy hair (pork),
|
164
|
+
162, hair, mohawk dark,
|
165
|
+
163, hair, peak spike,
|
166
|
+
164, hair, peak spike (rock),
|
167
|
+
165, hair, peak spike red (rock),
|
168
|
+
166, hair, peak spike blonde (rock),
|
169
|
+
167, hair, purple hair,
|
170
|
+
168, hair, purple hair (bmp),
|
171
|
+
169, hair, purple hair (doge),
|
172
|
+
170, hair, straight hair blonde,
|
173
|
+
171, hair, wild blonde,
|
174
|
+
172, hair, wild blonde (bmp),
|
175
|
+
173, hair, wild blonde (pork),
|
176
|
+
174, hair, wild hair (m),
|
177
|
+
175, hair, wild hair (doge),
|
178
|
+
176, hair, wild hair (f),
|
179
|
+
177, hair, wild white hair,
|
180
|
+
178, hair, wild white hair (doge),
|
181
|
+
179, hair, half shaved,
|
182
|
+
180, hair, half shaved blonde,
|
183
|
+
181, hair, half shaved blonde (bmp),
|
184
|
+
182, hair, half shaved purple,
|
185
|
+
183, hair, mohawk thin,
|
186
|
+
184, hair, mohawk,
|
187
|
+
185, hair, red mohawk,
|
188
|
+
186, hair, red mohawk (bmp),
|
189
|
+
187, hair, red mohawk (doge),
|
190
|
+
188, hair, red mohawk (pork),
|
191
|
+
189, hair, messy hair (m),
|
192
|
+
190, hair, messy hair (f),
|
193
|
+
191, hair, messy hair green (f),
|
194
|
+
192, hair, messy hair blonde (f),
|
195
|
+
193, hair, dark hair,
|
196
|
+
194, hair, straight hair,
|
197
|
+
195, hair, straight hair dark,
|
198
|
+
196, hair, shaved head,
|
199
|
+
197, hair, blonde short,
|
200
|
+
198, hair, pink short,
|
201
|
+
199, hair, stringy hair,
|
202
|
+
200, hair, frumpy hair (f),
|
203
|
+
201, hair, frumpy hair (m),
|
204
|
+
202, hair, orange side,
|
205
|
+
203, hair, orange side (pork),
|
206
|
+
204, hair, blonde side,
|
207
|
+
205, hair, blonde side (pork),
|
208
|
+
206, hair, white side,
|
209
|
+
207, hair, pink with hat,
|
210
|
+
208, hair, clown hair green (f),
|
211
|
+
209, hair, clown hair green (m),
|
212
|
+
210, hair, clown hair blue (m),
|
213
|
+
211, hair, vampire hair,
|
214
|
+
212, hair, pigtails,
|
215
|
+
213, hair, pigtails red,
|
216
|
+
214, hair, pigtails blonde,
|
217
|
+
215, head, bandana,
|
218
|
+
216, head, bandana (xl),
|
219
|
+
217, head, cap,
|
220
|
+
218, head, cap (1bit),
|
221
|
+
219, head, cap red,
|
222
|
+
220, head, cap red (rock),
|
223
|
+
221, head, cap blue,
|
224
|
+
222, head, cap forward,
|
225
|
+
223, head, cowboy hat,
|
226
|
+
224, head, cowboy hat (xl),
|
227
|
+
225, head, headband,
|
228
|
+
226, head, knitted cap,
|
229
|
+
227, head, knitted cap (rock),
|
230
|
+
228, head, top hat,
|
231
|
+
229, head, top hat (rock),
|
232
|
+
230, head, beanie,
|
233
|
+
231, head, do-rag,
|
234
|
+
232, head, police cap,
|
235
|
+
233, head, pilot helmet,
|
236
|
+
234, head, tassle hat,
|
237
|
+
235, head, fedora,
|
238
|
+
236, head, tiara,
|
239
|
+
237, head, crown,
|
240
|
+
238, head, jester hat,
|
241
|
+
239, head, flowers,
|
242
|
+
240, head, sombrero,
|
243
|
+
241, head, birthday hat,
|
244
|
+
242, head, bow,
|
245
|
+
243, head, sun hat,
|
246
|
+
244, head, sun hat (a),
|
247
|
+
245, eyes, 3d glasses,
|
248
|
+
246, eyes, 3d glasses (rock),
|
249
|
+
247, eyes, big shades,
|
250
|
+
248, eyes, classic shades,
|
251
|
+
249, eyes, classic shades (xl),
|
252
|
+
250, eyes, classic shades green,
|
253
|
+
251, eyes, clown eyes green,
|
254
|
+
252, eyes, clown eyes blue,
|
255
|
+
253, eyes, nerd glasses,
|
256
|
+
254, eyes, regular shades,
|
257
|
+
255, eyes, regular shades (xl),
|
258
|
+
256, eyes, vr,
|
259
|
+
257, eyes, vr pro,
|
260
|
+
258, eyes, small shades,
|
261
|
+
259, eyes, laser eyes,
|
262
|
+
260, eyes, laser eyes (rock),
|
263
|
+
261, eyes, laser eyes gold,
|
264
|
+
262, eyes, laser eyes blue,
|
265
|
+
263, eyes, laser eyes blue (rock),
|
266
|
+
264, eyes, eye mask,
|
267
|
+
265, eyes, eye mask (a),
|
268
|
+
266, eyes, horned rim glasses,
|
269
|
+
267, eyes, horned rim glasses (xl),
|
270
|
+
268, eyes, eye patch,
|
271
|
+
269, eyes, eye patch (xl),
|
272
|
+
270, eyes, green eye shadow,
|
273
|
+
271, eyes, purple eye shadow,
|
274
|
+
272, eyes, blue eye shadow,
|
275
|
+
273, eyes, heart shades,
|
276
|
+
274, eyes, noun glasses,
|
277
|
+
275, eyes, noun glasses pink,
|
278
|
+
276, beard, chinstrap,
|
279
|
+
277, beard, big beard,
|
280
|
+
278, beard, luxurious beard,
|
281
|
+
279, beard, luxurious white beard,
|
282
|
+
280, beard, goat,
|
283
|
+
281, beard, front beard dark,
|
284
|
+
282, beard, front beard,
|
285
|
+
283, beard, normal beard,
|
286
|
+
284, beard, normal beard black,
|
287
|
+
285, beard, muttonchops,
|
288
|
+
286, beard, handlebars,
|
289
|
+
287, beard, shadow beard,
|
290
|
+
288, beard, mustache,
|
291
|
+
289, more, clown nose,
|
292
|
+
290, more, earring,
|
293
|
+
291, more, earring (doge),
|
294
|
+
292, more, earring (xl),
|
295
|
+
293, more, earcross,
|
296
|
+
294, more, choker,
|
297
|
+
295, more, pipe,
|
298
|
+
296, more, pipe (bmp),
|
299
|
+
297, more, cigarette,
|
300
|
+
298, more, cigar,
|
301
|
+
299, more, vape,
|
302
|
+
300, more, gold chain,
|
303
|
+
301, more, silver chain,
|
304
|
+
302, more, spots,
|
305
|
+
303, more, mole,
|
306
|
+
304, more, rosy cheeks,
|
307
|
+
305, more, black lipstick,
|
308
|
+
306, more, purple lipstick,
|
309
|
+
307, more, hot lipstick,
|
310
|
+
308, more, pink lipstick,
|
311
|
+
309, more, burgundy lipstick,
|
312
|
+
310, more, green lipstick,
|
313
|
+
311, more, medical mask,
|
314
|
+
312, more, buck teeth,
|
315
|
+
313, more, demon horns,
|
316
|
+
314, more, bubble gum,
|
317
|
+
315, more, tears,
|
318
|
+
316, more, frown,
|
319
|
+
317, hoodies, hoodie,
|
320
|
+
318, hoodies, hoodie (pork),
|
321
|
+
319, hoodies, hoodie green,
|
322
|
+
320, hoodies, hoodie red,
|
323
|
+
321, hoodies, hoodie white,
|
324
|
+
322, hoodies, hood,
|
325
|
+
323, hoodies, hood (pork),
|
326
|
+
324, hoodies, hoodie dark,
|
327
|
+
325, hoodies, hoodie dark (pork),
|
328
|
+
326, hoodies, hood dark,
|
329
|
+
327, hoodies, hood dark (pork),
|
330
|
+
328, hoodies, hoodie ice,
|
331
|
+
329, hoodies, hoodie light,
|
332
|
+
330, hoodies, hoodie light (pork),
|
333
|
+
331, hoodies, hood light,
|
334
|
+
332, hoodies, hoodie pink,
|
335
|
+
333, hoodies, hood pink,
|
336
|
+
334, hoodies, hood pharoah,
|
337
|
+
335, hoodies, hood pharoah purple,
|
338
|
+
336, hoodies, hood pharoah purple (a),
|
339
|
+
337, saudis, brown shemagh agal,
|
340
|
+
338, saudis, brown shemagh agal (pork),
|
341
|
+
339, saudis, red shemagh,
|
342
|
+
340, saudis, red shemagh agal,
|
343
|
+
341, saudis, red shemagh (pork),
|
344
|
+
342, saudis, red shemagh agal (pork),
|
345
|
+
343, saudis, white shemagh,
|
346
|
+
344, saudis, white shemagh agal,
|
347
|
+
345, saudis, white shemagh gold agal,
|
348
|
+
346, saudis, white shemagh gold agal (pork),
|
349
|
+
347, fastfood, cap mcd,
|
350
|
+
348, fastfood, cap mcd flipped,
|
351
|
+
349, fastfood, cap mcd white,
|
352
|
+
350, fastfood, cap mcd black,
|
353
|
+
351, fastfood, cap mcd visor (xl),
|
354
|
+
352, fastfood, cap burgerking,
|
355
|
+
353, fastfood, cap subway,
|
356
|
+
354, rgb, regular shades red,
|
357
|
+
355, rgb, regular shades green,
|
358
|
+
356, rgb, regular shades blue,
|
359
|
+
357, rgb, maxibiz laser eyes red,
|
360
|
+
358, rgb, maxibiz laser eyes green,
|
361
|
+
359, rgb, maxibiz laser eyes blue,
|
362
|
+
360, monkes, mohawk (monke),
|
363
|
+
361, monkes, mohawk blonde (monke),
|
364
|
+
362, monkes, mohawk purple (monke),
|
365
|
+
363, monkes, mohawk red (monke),
|
366
|
+
364, monkes, mohawk2 blonde (monke),
|
367
|
+
365, monkes, mohawk2 purple (monke),
|
368
|
+
366, monkes, peak spike (monke),
|
369
|
+
367, monkes, cap red (monke),
|
370
|
+
368, monkes, 3d glasses (monke),
|
371
|
+
369, monkes, clown eyes green (monke),
|
372
|
+
370, monkes, polarized shades (monke),
|
373
|
+
371, monkes, vr pro (monke),
|
374
|
+
372, monkes, clown nose (monke),
|
data/config/punks-12x12.png
CHANGED
Binary file
|
@@ -0,0 +1,82 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
module Punk
|
4
|
+
|
5
|
+
|
6
|
+
class Metadata
|
7
|
+
attr_reader :id,
|
8
|
+
:type,
|
9
|
+
:accessories
|
10
|
+
|
11
|
+
alias_method :attributes, :accessories
|
12
|
+
|
13
|
+
|
14
|
+
def self.parse( row ) ## rename metod to build - why? why not?
|
15
|
+
id = row['id'].to_i( 10 )
|
16
|
+
type = row['type']
|
17
|
+
|
18
|
+
## split into array - allow accessores or aattributes key / header
|
19
|
+
accessories = row.has_key?( 'accessories' ) ? row['accessories'] : row['attribuutes']
|
20
|
+
accessories = accessories.split( '/' ).map { |acc| acc.strip }
|
21
|
+
|
22
|
+
## optional count to double check - why? why not?
|
23
|
+
count = row.has_key?( 'count' ) ? row['count'].to_i( 10 ) : nil
|
24
|
+
|
25
|
+
if count && count != accessories.size
|
26
|
+
puts "!! ERROR - punk data assertion failed - expected accessories count #{count}; got #{accessories.size}"
|
27
|
+
pp row
|
28
|
+
exit 1
|
29
|
+
end
|
30
|
+
|
31
|
+
new( id: id,
|
32
|
+
type: type,
|
33
|
+
accessories: accessories )
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize( id:, type:, accessories: [] )
|
37
|
+
@id = id
|
38
|
+
@type = type
|
39
|
+
@accessories = accessories
|
40
|
+
end
|
41
|
+
end # class Metadata
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
module Dataset
|
46
|
+
|
47
|
+
def self.read( path )
|
48
|
+
rows = []
|
49
|
+
|
50
|
+
## check if path include wildcard (*)
|
51
|
+
## e.g. './datasets/punks/*.csv'
|
52
|
+
if path.index( '*' ) ## allow glob to read multiple files - keep? why? why not?
|
53
|
+
#=> ["./datasets/punks/0-999.csv",
|
54
|
+
# "./datasets/punks/1000-1999.csv",
|
55
|
+
# "./datasets/punks/2000-2999.csv",
|
56
|
+
# "./datasets/punks/3000-3999.csv",
|
57
|
+
# "./datasets/punks/4000-4999.csv",
|
58
|
+
# "./datasets/punks/5000-5999.csv",
|
59
|
+
# "./datasets/punks/6000-6999.csv",
|
60
|
+
# "./datasets/punks/7000-7999.csv",
|
61
|
+
# "./datasets/punks/8000-8999.csv",
|
62
|
+
# "./datasets/punks/9000-9999.csv"]
|
63
|
+
datasets = Dir.glob( path )
|
64
|
+
datasets.each do |dataset|
|
65
|
+
rows += read_csv( dataset )
|
66
|
+
end
|
67
|
+
else ## "vanilla" (single) datafile
|
68
|
+
rows += read_csv( path )
|
69
|
+
end
|
70
|
+
|
71
|
+
# puts " #{rows.size} rows(s)"
|
72
|
+
#=> 10000 rows(s)
|
73
|
+
|
74
|
+
|
75
|
+
### wrap in punk struct for easier access
|
76
|
+
punks = rows.map { |row| Metadata.parse( row ) }
|
77
|
+
punks
|
78
|
+
end
|
79
|
+
end # module Dataset
|
80
|
+
end # module Punk
|
81
|
+
|
82
|
+
|
data/lib/punks/version.rb
CHANGED
data/lib/punks.rb
CHANGED
@@ -32,6 +32,11 @@ require_relative 'punks/punks_12'
|
|
32
32
|
require_relative 'punks/nodepunks' # 24x24
|
33
33
|
|
34
34
|
|
35
|
+
## extra/bonus - add dataset (csv reader) with metadata struct
|
36
|
+
require_relative 'punks/dataset/dataset'
|
37
|
+
|
38
|
+
|
39
|
+
|
35
40
|
|
36
41
|
### add some convenience shortcuts
|
37
42
|
Cryptopunks = Punk
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: punks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2024.
|
4
|
+
version: 2024.2.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pixelart
|
@@ -123,6 +123,7 @@ files:
|
|
123
123
|
- lib/punks.rb
|
124
124
|
- lib/punks/bodies_32.rb
|
125
125
|
- lib/punks/bodies_40.rb
|
126
|
+
- lib/punks/dataset/dataset.rb
|
126
127
|
- lib/punks/marcs.rb
|
127
128
|
- lib/punks/marilyns.rb
|
128
129
|
- lib/punks/nodepunks.rb
|