ordinals 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/Manifest.txt +2 -0
- data/README.md +237 -3
- data/Rakefile +1 -1
- data/lib/ordinals/recursive/generator.rb +69 -0
- data/lib/ordinals/sandbox.rb +127 -0
- data/lib/ordinals.rb +4 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19ed27e28ef41fc1d249f8275cc9a5dc829dee789693c3b32ee4af3ebfd40408
|
4
|
+
data.tar.gz: 28b5186c473c0b21fcf493d446edb718c3715667cf1ba89eebff2609a7d0f28b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61a44488afd23242742de448620670b9b610ec68b5df9fe00c94f7e282449c41785476e35f4a78a29429a3d1ace452382eb62b42f4a013d69d84f88cd546b1da
|
7
|
+
data.tar.gz: 9faa0175c1a53637db9f2119f9b20dd6c632c72f8f631b2daef505c67f85056820d1259bfe6f8d7c618dd8f26908f241f8dd467e7a7140db553137f53a63fb40
|
data/CHANGELOG.md
CHANGED
data/Manifest.txt
CHANGED
data/README.md
CHANGED
@@ -97,11 +97,238 @@ pp data
|
|
97
97
|
# "offset"=>"0"}
|
98
98
|
```
|
99
99
|
|
100
|
-
That's it
|
100
|
+
That's it.
|
101
101
|
|
102
102
|
|
103
|
+
### Bonus - Recursive Images - Generate .SVG Inscriptions
|
103
104
|
|
104
|
-
|
105
|
+
Ordinal helper classes for generating recursive images include:
|
106
|
+
- `RecursiveImage`
|
107
|
+
- `RecursiveImageComposite`
|
108
|
+
- `RecursiveGenerator`
|
109
|
+
|
110
|
+
|
111
|
+
#### Sample No 1 - (Recursive) D.I.Y. Martians - Aliens Vol. 2
|
112
|
+
|
113
|
+
|
114
|
+
```ruby
|
115
|
+
require 'ordinals'
|
116
|
+
|
117
|
+
## 50 .PNG "one-by-one" images - each 24×24px
|
118
|
+
inscribes = [
|
119
|
+
'0829dc471f8bb92a971dfdfb00a71c016b833c8f1d5f39dcb15aa5535d08fc15i0',
|
120
|
+
'9482552ec759b76577b28923741eb4bfc7770cead528755bf8fa44196ae9318ci0',
|
121
|
+
'5b8eb4a05f13fffc49f824f457fb080b67e4fdc312fbbf2f804cef59e6d5fad2i0',
|
122
|
+
'85e0efd6cc2801ab7e1fe28e23110441348ca40481599f880c571ff4f69f066fi0',
|
123
|
+
'7953ccb6614a41e7b4c4ed2a2b112b52feda387de92de2c1a314f03d5da41955i0',
|
124
|
+
'2f1219924cfa01f9816581e8a39e201f15e19ab447e852ff9b43b13fa7b0c75di0',
|
125
|
+
'e60f597ec41c50e823ea382c101dfc2f30c13a927222be3b73cedd88bd1b9237i0',
|
126
|
+
'5ce9f89ad571e5380baa5b5ee387f08ea313421e7e54662b3899d411c39321ddi0',
|
127
|
+
'3459b14a4fcb7bce1df0465abc711b556caba6f7b42d4f925f1ddf830be47125i0',
|
128
|
+
'1355524a2aab576e069bac91227b0e52d227d65d84c5535377d3a0ea4e44d470i0',
|
129
|
+
'a6b4b81f69e8c217db24f0a71954195d67ced49a819b67a4daf9f3ca7fa1b971i0',
|
130
|
+
'83827ec13cb55a35fe3adca5acf67caf943c3bd6810f8fa893b067e8015c8f19i0',
|
131
|
+
'5b1e638c050318bec23f17b8b7758ccf13945e422516da6c722c67ae5ed4e26di0',
|
132
|
+
'5dcf96b13e5762d5a288d8bee36deb933fe192a55475199fe9a39ae29dd16853i0',
|
133
|
+
'5760ce05009e94a750a7245cac994fa9ffd388eadc757929ac17737811455429i0',
|
134
|
+
'0bd902941392ea138adb7db30cecdf5bc09a92c80e3e1bc3ecdf3c2d0abf6631i0',
|
135
|
+
'7c2fd41b52624ddb1ba11fe1c6d95475f2e42c4b53d6aaf6a16a09064acebe38i0',
|
136
|
+
'0f473c9dcd14e3f43a6599b038d810eac16bc6394edcfcf6b32f8df992ab6791i0',
|
137
|
+
'd32c50c23693a028e2381d6f756746a9ff684f2028edf694ab7b1b6cde78e2cdi0',
|
138
|
+
'd61fc2a89ecc6ae65cf91cdfac9edc37fd60c38621dac211f3a70891ef79b69ai0',
|
139
|
+
'680e2ee8cad86aa174b4f3373d733370c9a6fc4230b9708d520a0f6bcb8e72a6i0',
|
140
|
+
'56d3f4f661b2b4a9fc17755171d7cf4da74e570614b6b45de0cc87a809c3eb3ci0',
|
141
|
+
'fe4321178bd841e52fdeb72ce4456c5b7596c0d611b19da15ba75ec63b5314cai0',
|
142
|
+
'eddc1242f0fd290e130332e046897ad41dce1e7e112df48ecf2168e43172d383i0',
|
143
|
+
'a2110fb4afaa29bc70bcfac445f750ecb5e81777e8d080be2d2b07eb030ba0ffi0',
|
144
|
+
'c1277df4b986067b2a3f006d717b7f6d042896840c8b592e5a8b9ff22444b08fi0',
|
145
|
+
'722dfdc90a67ff7eb892d13393a8a5b360b8a109f3d809600919684a600ff60ei0',
|
146
|
+
'a0d11e78978a9dd5f1d891b71f06bd2d411c08372eba1f23e8b0722474388130i0',
|
147
|
+
'2c2d812754b9374ffb699173da7f6d476af138a99906b66b8453cc4343305167i0',
|
148
|
+
'964c52312f1db9025695b181d5f631292d29bec63ff9587138a589cb5ff8c26di0',
|
149
|
+
'545fd4d45d2f6d732d48accc082f72b67a00d19f88517320f814bf1fe827c816i0',
|
150
|
+
'72fe7ebda802852f499dca865ec22ac43eacfcf4796d761969ae8358791e943ci0',
|
151
|
+
'4db2e931b5cd489d8007d111d20ab97d84161b84c8f7ff3038e1afe79567b9afi0',
|
152
|
+
'4869c9bb7cf23e68ad94da5b1e9de1feff1ebdcaf9a08fccca5f1887dd40e239i0',
|
153
|
+
'06136a5b4fb585069ef6265a0fde3baf67ee914b9f784d2c951f3a8187800d54i0',
|
154
|
+
'8043604c7c96a5a43a97e251b246102ca40c0203431ff21bd26f23330dfa554ci0',
|
155
|
+
'92e7f48454546718f98103d7464d954033adbee21855f06584be06faa3e291ddi0',
|
156
|
+
'a01012b213ed425c5d4038bc36016f19f4f342ca052ff9bf6971672164e1a402i0',
|
157
|
+
'87d89d290ebde5d5b7aa75b4c8d0359515e25ea1542bc0646dc3f5b0b2fc55fdi0',
|
158
|
+
'aab67a4269ca0bda649fe341bd88c862aba2e9bf6e0826b9dfa5c4ba8fe62c2di0',
|
159
|
+
'189b02ffc8aac68a45102e9837a1ca92e422bf5544d9011a863626cf6b0abeeai0',
|
160
|
+
'43e93e43f2dac75b141baaa5b08df440e0b6ec5755577a9554a7af6540447bb7i0',
|
161
|
+
'39d774f7d7514371c88bc4f939346f6b23000c9892ac4ae8ea36c76694e3b842i0',
|
162
|
+
'b268b2acccd6b04680c2aa3130863ffbaa450f6870f100af678428cd07212ef6i0',
|
163
|
+
'ac810c9098681e100964166b7510d1ac371c147861b0ae2a862da3a8b8256037i0',
|
164
|
+
'4b9f880df07b072a4147a62acdd0881d024d14da6d84174db9b5ac555b71b346i0',
|
165
|
+
'014ad6ed6297bc4ed624b2856e036c6bde115d51eb7200b14e3b3413ad53db08i0',
|
166
|
+
'e139b5b0649186772cbf044bb8d3c5e43b77e3cf0472008ce2aaf52966c921eci0',
|
167
|
+
'6eb271ad3fdd15cc2ec34dda462e71aaa8a7ef7e306cfd189931ef37216a9c60i0',
|
168
|
+
'47cb34f1d73371df0b27ca0a259927fa80e2b2d9ee0e1d487fca5c9029b67b49i0',
|
169
|
+
]
|
170
|
+
|
171
|
+
diymartians = RecursiveGenerator.new( 24, 24,
|
172
|
+
inscribes: inscribes )
|
173
|
+
|
174
|
+
|
175
|
+
[
|
176
|
+
'41 0 39 37 23 8',
|
177
|
+
'44 1 10 23',
|
178
|
+
'46 3 21 15',
|
179
|
+
'47 2 39 26 37',
|
180
|
+
'47 4 39 20 33 35 36',
|
181
|
+
'41 0 32 35 13 36',
|
182
|
+
'44 6 16 28 37 34 35',
|
183
|
+
'41 0 10 33 34 35 36 8 7',
|
184
|
+
'48 2 33 8 34 35 37 14',
|
185
|
+
'49 3 21 14 35 34 35 37 18 14',
|
186
|
+
].each_with_index do |spec,i|
|
187
|
+
img = diymartians.generate( spec )
|
188
|
+
write_text( "./diymartian#{i}.svg", img.to_svg )
|
189
|
+
end
|
190
|
+
```
|
191
|
+
|
192
|
+
resulting in (hosted on ordtest - Ordinals (Recursive) Testing Sandbox):
|
193
|
+
|
194
|
+
- <https://ordtest.github.io/diymartian0.svg> - d.i.y. martian no. 0
|
195
|
+
- <https://ordtest.github.io/diymartian1.svg> - d.i.y. martian no. 1
|
196
|
+
- <https://ordtest.github.io/diymartian2.svg>
|
197
|
+
- <https://ordtest.github.io/diymartian3.svg>
|
198
|
+
- <https://ordtest.github.io/diymartian4.svg>
|
199
|
+
- <https://ordtest.github.io/diymartian5.svg>
|
200
|
+
- <https://ordtest.github.io/diymartian6.svg>
|
201
|
+
- <https://ordtest.github.io/diymartian7.svg>
|
202
|
+
- <https://ordtest.github.io/diymartian8.svg>
|
203
|
+
- <https://ordtest.github.io/diymartian9.svg>
|
204
|
+
|
205
|
+
|
206
|
+
Tip: If you select "show source" in the "right-click" menu in your web browser you will see the "magic" recursive .SVG source text.
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
#### Sample No 2 - (Recursive) D.I.Y. Maxi Biz (Punks)
|
211
|
+
|
212
|
+
```ruby
|
213
|
+
require 'ordinals'
|
214
|
+
|
215
|
+
## all-in-one spritesheet .PNG image 240×216px (10×9 grid - 24×24px each)
|
216
|
+
inscribes = [
|
217
|
+
['ad56d4f242677ac334844002f1c27b9b636ba71f68590cdc0cc5a2cbce080990i0', { width: 240, height: 216 }],
|
218
|
+
]
|
219
|
+
|
220
|
+
diymaxibiz = RecursiveGenerator.new( 24, 24,
|
221
|
+
inscribes: inscribes )
|
222
|
+
|
223
|
+
|
224
|
+
[
|
225
|
+
'87 6 25 41 74 59',
|
226
|
+
'87 6 25 41 74',
|
227
|
+
'87 6 25 41',
|
228
|
+
'84 13 68 33 73',
|
229
|
+
'87 12 21 38 46 73',
|
230
|
+
'84 14 66 35 73',
|
231
|
+
'84 11 35 69 72',
|
232
|
+
'84 1 44 73 40',
|
233
|
+
'87 3 40 43 73',
|
234
|
+
'87 83 77',
|
235
|
+
].each_with_index do |spec,i|
|
236
|
+
img = diymaxibiz.generate( spec )
|
237
|
+
write_text( "./diymaxibiz#{i}.svg", img.to_svg )
|
238
|
+
end
|
239
|
+
```
|
240
|
+
|
241
|
+
resulting in (hosted on ordtest - Ordinals (Recursive) Testing Sandbox):
|
242
|
+
|
243
|
+
- <https://ordtest.github.io/diymaxibiz0.svg>
|
244
|
+
- <https://ordtest.github.io/diymaxibiz1.svg>
|
245
|
+
- <https://ordtest.github.io/diymaxibiz2.svg>
|
246
|
+
- <https://ordtest.github.io/diymaxibiz3.svg>
|
247
|
+
- <https://ordtest.github.io/diymaxibiz4.svg>
|
248
|
+
- <https://ordtest.github.io/diymaxibiz5.svg>
|
249
|
+
- <https://ordtest.github.io/diymaxibiz6.svg>
|
250
|
+
- <https://ordtest.github.io/diymaxibiz7.svg>
|
251
|
+
- <https://ordtest.github.io/diymaxibiz8.svg>
|
252
|
+
- <https://ordtest.github.io/diymaxibiz9.svg>
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
#### Sample No 3 - All-In-One 100 Ordinal Punks Composite
|
257
|
+
|
258
|
+
_100 recursions each 96×96px in 10×10 grid_
|
259
|
+
|
260
|
+
```ruby
|
261
|
+
require 'ordinals'
|
262
|
+
|
263
|
+
|
264
|
+
composite = RecursiveImageComposite.new( 10, 10, width: 96,
|
265
|
+
height: 96 )
|
266
|
+
|
267
|
+
data = read_json( "./ordinalpunks.json" )
|
268
|
+
puts " #{data['items'].size} inscribe(s)"
|
269
|
+
|
270
|
+
data['items'].each_with_index do |rec|
|
271
|
+
id = rec['inscription_id']
|
272
|
+
comment = rec['name']
|
273
|
+
|
274
|
+
composite << [id, {pixelate: true,
|
275
|
+
comment: comment}]
|
276
|
+
end
|
277
|
+
|
278
|
+
write_text( "./ordinalpunks.svg", composite.to_svg )
|
279
|
+
```
|
280
|
+
|
281
|
+
resulting in (hosted on ordtest - Ordinals (Recursive) Testing Sandbox):
|
282
|
+
|
283
|
+
- <https://ordtest.github.io/ordinalpunks.svg>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
#### Sample No 4 - Nine D.I.Y. Punks Composite
|
288
|
+
|
289
|
+
_9 recursions each 24×24px in 3×3 grid_
|
290
|
+
|
291
|
+
```ruby
|
292
|
+
require 'ordinals'
|
293
|
+
|
294
|
+
## all-in-one spritesheet .PNG image 240×144px (10×6 grid - 24×24px each)
|
295
|
+
inscribes = [
|
296
|
+
['cf5df319bbe23fa3d012e5ee0810700c8e82aebff41164246f0d87d7b60a9903i0', { width: 240, height: 144 }],
|
297
|
+
]
|
298
|
+
|
299
|
+
diypunks = RecursiveGenerator.new( 24, 24,
|
300
|
+
inscribes: inscribes )
|
301
|
+
|
302
|
+
|
303
|
+
composite = RecursiveImageComposite.new( 3, 3, width: 24,
|
304
|
+
height: 24)
|
305
|
+
|
306
|
+
[
|
307
|
+
'59 0',
|
308
|
+
'59 1',
|
309
|
+
'59 2',
|
310
|
+
'59 3',
|
311
|
+
'59 4',
|
312
|
+
'59 5',
|
313
|
+
'59 6',
|
314
|
+
'59 7',
|
315
|
+
'59 8',
|
316
|
+
].each do |spec|
|
317
|
+
img = diypunks.generate( spec )
|
318
|
+
composite << img
|
319
|
+
end
|
320
|
+
|
321
|
+
write_text( "./diypunks.svg", composite.to_svg )
|
322
|
+
```
|
323
|
+
|
324
|
+
resulting in (hosted on ordtest - Ordinals (Recursive) Testing Sandbox):
|
325
|
+
|
326
|
+
- <https://ordtest.github.io/diypunks.svg>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
## Appendix: Ordinal Pixel Art Collections
|
105
332
|
|
106
333
|
|
107
334
|
See the [**Ordinals (Pixel Art) Sandbox (& Cache)**](https://github.com/ordbase/ordinals.sandbox)
|
@@ -120,8 +347,15 @@ The scripts are dedicated to the public domain.
|
|
120
347
|
Use it as you please with no restrictions whatsoever.
|
121
348
|
|
122
349
|
|
350
|
+
|
351
|
+
|
352
|
+
|
123
353
|
## Questions? Comments?
|
124
354
|
|
125
|
-
|
355
|
+
Join us in the [Ordgen / ORC-721 discord (chat server)](https://discord.gg/dDhvHKjm2t). Yes you can.
|
356
|
+
Your questions and commetary welcome.
|
357
|
+
|
358
|
+
|
359
|
+
Or post them over at the [Help & Support](https://github.com/geraldb/help) page. Thanks.
|
126
360
|
|
127
361
|
|
data/Rakefile
CHANGED
@@ -0,0 +1,69 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
class RecursiveGenerator
|
4
|
+
def initialize( width, height,
|
5
|
+
pixelate: true,
|
6
|
+
inscribes: )
|
7
|
+
@width = width
|
8
|
+
@height = height
|
9
|
+
@recursions = _prepare( inscribes )
|
10
|
+
@pixelate = pixelate
|
11
|
+
end
|
12
|
+
|
13
|
+
def [](index) ## return recursion (config) as array
|
14
|
+
@recursions[index]
|
15
|
+
end
|
16
|
+
|
17
|
+
def count() @recursions.size; end
|
18
|
+
alias_method :size, :count ## add size alias (confusing if starting with 0?) - why? why not?
|
19
|
+
|
20
|
+
def width() @width; end
|
21
|
+
def height() @height; end
|
22
|
+
|
23
|
+
|
24
|
+
def _prepare( inscribes)
|
25
|
+
## prepare (flatten) recursion lookup table indexed 0,1,2,3, etc.
|
26
|
+
index = []
|
27
|
+
inscribes.each do |rec|
|
28
|
+
if rec.is_a?( Array ) ## assume spritesheet
|
29
|
+
id = rec[0]
|
30
|
+
opts = rec[1]
|
31
|
+
cols = opts[:width] / width
|
32
|
+
rows = opts[:height] / height
|
33
|
+
count = cols*rows
|
34
|
+
count.times do |num|
|
35
|
+
index << [id, { spritesheet: [opts[:width],opts[:height]],
|
36
|
+
num: num }
|
37
|
+
]
|
38
|
+
end
|
39
|
+
else ## assume "standalone / one-by-one" inscribe
|
40
|
+
id = rec
|
41
|
+
index << [id, {}]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
index
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
SEP_RX = %r{[ \t/,;*+_-]+
|
49
|
+
}x
|
50
|
+
|
51
|
+
def _parse( str )
|
52
|
+
str.strip.split( SEP_RX ).map { |str| str.to_i(10) }
|
53
|
+
end
|
54
|
+
|
55
|
+
def generate( *args )
|
56
|
+
g = if args.size==1 && args.is_a?( String )
|
57
|
+
_parse( args[0] )
|
58
|
+
else ## assume integer numbers
|
59
|
+
args
|
60
|
+
end
|
61
|
+
img = RecursiveImage.new( @width, @height )
|
62
|
+
g.each do |num|
|
63
|
+
id, opts = @recursions[num]
|
64
|
+
img << [id, opts.merge( {pixelate: @pixelate} )]
|
65
|
+
end
|
66
|
+
img
|
67
|
+
end
|
68
|
+
end # class RecursiveGenerator
|
69
|
+
|
@@ -0,0 +1,127 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
module Ordinals
|
4
|
+
class Sandbox
|
5
|
+
def initialize( dir='./content' )
|
6
|
+
@dir = dir
|
7
|
+
@force = false
|
8
|
+
@delay_in_s = 0.5 ## wait 0.5s before next (possible) request
|
9
|
+
@requests = 0
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
def exist?( id ) ### add alias for different name(s) - why? why not?
|
14
|
+
path = "#{@dir}/#{id}"
|
15
|
+
File.exist?( path )
|
16
|
+
end
|
17
|
+
|
18
|
+
def read( id )
|
19
|
+
path = "#{@dir}/#{id}"
|
20
|
+
read_blob( path )
|
21
|
+
end
|
22
|
+
|
23
|
+
def add( id )
|
24
|
+
path = "#{@dir}/#{id}"
|
25
|
+
if !@force && File.exist?( path )
|
26
|
+
## puts " in sandbox"
|
27
|
+
else
|
28
|
+
sleep( @delay_in_s ) if @delay_in_s && @requests > 0
|
29
|
+
|
30
|
+
## note: save text as blob - byte-by-byte as is (might be corrupt text)
|
31
|
+
content = Ordinals.content( id )
|
32
|
+
## pp content
|
33
|
+
#=> #<Ordinals::Api::Content:0x000001a1352df938
|
34
|
+
# @data="RIFF\xF8\v\x00\x00WEBPVP8 \xEC\v\x00\x00...",
|
35
|
+
# @length=3072,
|
36
|
+
# @type="image/png"
|
37
|
+
|
38
|
+
## puts "data:"
|
39
|
+
## puts content.data
|
40
|
+
write_blob( path, content.data )
|
41
|
+
@requests += 1
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def add_csv( path )
|
47
|
+
recs = read_csv( path )
|
48
|
+
puts " #{recs.size} record(s)"
|
49
|
+
|
50
|
+
recs.each_with_index do |rec,i|
|
51
|
+
id = rec['id']
|
52
|
+
puts "==> #{i+1}/#{recs.size} - #{id}..."
|
53
|
+
add( id )
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def add_collection( path )
|
58
|
+
data = read_json( path )
|
59
|
+
puts " #{data['items'].size} record(s)"
|
60
|
+
|
61
|
+
data['items'].each_with_index do |rec,i|
|
62
|
+
name = rec['name']
|
63
|
+
id = rec['inscription_id']
|
64
|
+
puts "==> #{i+1}/#{data['items'].size} - #{name} @ #{id}..."
|
65
|
+
add( id )
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
ID_RX = /[a-f0-9]{64}i[0-9]/x
|
72
|
+
|
73
|
+
def _find_ids( values )
|
74
|
+
values.select { |val| val.is_a?(String) && ID_RX.match(val) }
|
75
|
+
end
|
76
|
+
|
77
|
+
def add_data( obj )
|
78
|
+
if obj.is_a?( Array )
|
79
|
+
recs = obj
|
80
|
+
puts " #{recs.size} record(s)"
|
81
|
+
recs.each_with_index do |rec,i|
|
82
|
+
if rec.is_a?( String )
|
83
|
+
id = rec
|
84
|
+
puts "==> #{i+1}/#{recs.size} #{id}..."
|
85
|
+
add( id )
|
86
|
+
else ## assume array of strings for now
|
87
|
+
values = rec
|
88
|
+
print "==> #{i+1}/#{recs.size} "
|
89
|
+
ids = _find_ids( values )
|
90
|
+
if ids.size == 1
|
91
|
+
id = ids[0]
|
92
|
+
puts " #{id}..."
|
93
|
+
add( id )
|
94
|
+
else
|
95
|
+
puts
|
96
|
+
if ids.empty?
|
97
|
+
puts "!! ERROR - no inscribe id found in data row:"
|
98
|
+
else
|
99
|
+
puts "!! ERROR - more than one (that is, #{ids.size}) inscribe id found in data row:"
|
100
|
+
end
|
101
|
+
pp values
|
102
|
+
exit 1
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
else
|
107
|
+
## todo/fix: raise ArgumentError - why? why not?
|
108
|
+
puts "!! ERROR - sorry"
|
109
|
+
exit 1
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
# todo/add
|
114
|
+
# def add_html( path )
|
115
|
+
# end
|
116
|
+
|
117
|
+
|
118
|
+
def add_dir( rootdir )
|
119
|
+
## glob for **.csv and **.html
|
120
|
+
datasets = Dir.glob( "#{rootdir}/**/*.csv" )
|
121
|
+
datasets.each do |path|
|
122
|
+
add_csv( path )
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end ## class Sandbox
|
126
|
+
end ## module Ordinals
|
127
|
+
|
data/lib/ordinals.rb
CHANGED
@@ -85,12 +85,16 @@ end # module Ordinals
|
|
85
85
|
|
86
86
|
## our own code
|
87
87
|
require_relative 'ordinals/api'
|
88
|
+
|
89
|
+
require_relative 'ordinals/sandbox' ## (blob) "flat" content cache by inscribe id (./content)
|
88
90
|
require_relative 'ordinals/stats'
|
89
91
|
|
90
92
|
|
91
93
|
### add recursive image helpers
|
92
94
|
require_relative 'ordinals/recursive/image'
|
93
95
|
require_relative 'ordinals/recursive/composite'
|
96
|
+
require_relative 'ordinals/recursive/generator'
|
97
|
+
|
94
98
|
|
95
99
|
## add conveniecen shortcuts/alias - why? why not?
|
96
100
|
RcsvImage = RecursiveImage
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ordinals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocos
|
@@ -89,7 +89,9 @@ files:
|
|
89
89
|
- lib/ordinals.rb
|
90
90
|
- lib/ordinals/api.rb
|
91
91
|
- lib/ordinals/recursive/composite.rb
|
92
|
+
- lib/ordinals/recursive/generator.rb
|
92
93
|
- lib/ordinals/recursive/image.rb
|
94
|
+
- lib/ordinals/sandbox.rb
|
93
95
|
- lib/ordinals/stats.rb
|
94
96
|
homepage: https://github.com/ordbase/ordbase
|
95
97
|
licenses:
|