originals 1.0.1 → 1.1.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 +1 -0
- data/README.md +107 -7
- data/Rakefile +1 -0
- data/lib/originals/service.rb +63 -0
- data/lib/originals/tool.rb +48 -8
- data/lib/originals/version.rb +2 -2
- data/lib/originals.rb +72 -80
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0ba81141f671af0a54e1b962097a36eda487d0c8e6b1b04732709f3cb83d261
|
4
|
+
data.tar.gz: aa95846faac6ceb0209d86929a6f80a4263236c12cae8a30322db1876e0d237e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '018a112f6b7718e71c2ad4becfd7637c15292bed978c8bdf6c6b6cf924747fbbacdef7a23e39e56527ed8ea8348d7d0d0bc86aa57251be42265e8196e8afdca2'
|
7
|
+
data.tar.gz: 9f27aefeb8bdd22667e4784d569b95871bd0f7588c3c60ee76c10d8081e8287fa5417f604cd94b00da2aa07dab96eff50634c9a607e5bd7b0cec80f42b3b5432
|
data/Manifest.txt
CHANGED
data/README.md
CHANGED
@@ -23,10 +23,12 @@ $ fab -h
|
|
23
23
|
resulting in:
|
24
24
|
|
25
25
|
```
|
26
|
-
Usage: fab [options] name [attribute
|
26
|
+
Usage: fab [options] name [attribute attribute ...]
|
27
|
+
fab [options] name id
|
27
28
|
-z, --zoom NUM Zoom factor x2, x4, x8, etc. (default: 1)
|
28
29
|
-b, --background, --bg STRING Background (default: transparent)
|
29
30
|
-i, --id NUM Unique identifier (default: none)
|
31
|
+
-n, --name STRING Base name (default: punk|phunk|marilyn|etc.)
|
30
32
|
|
31
33
|
-h, --help Prints this help
|
32
34
|
```
|
@@ -35,10 +37,11 @@ Usage: fab [options] name [attribute] ...
|
|
35
37
|
|
36
38
|
### Punks (24x24)
|
37
39
|
|
38
|
-
|
40
|
+
_A free (pixel) art service brought to you by the [punks, (phunks, philips, marilyns, & more) generation library / gem »](https://github.com/cryptopunksnotdead/cryptopunks/tree/master/cryptopunks)_
|
39
41
|
|
40
42
|
|
41
|
-
|
43
|
+
|
44
|
+
Fab(ricate) punk character pixel art originals from text attributes (from scratch / zero) via built-in spritesheet. Let's try:
|
42
45
|
|
43
46
|
```
|
44
47
|
$ fab punk alien headband
|
@@ -110,7 +113,7 @@ resulting in:
|
|
110
113
|
|
111
114
|
|
112
115
|
|
113
|
-
|
116
|
+
#### Phunks (24x24)
|
114
117
|
|
115
118
|
Let's try some left-looking punks also known as Phunks - "hand-phlipped" by Philip the Intern
|
116
119
|
|
@@ -128,7 +131,7 @@ resulting in:
|
|
128
131
|
|
129
132
|
|
130
133
|
|
131
|
-
|
134
|
+
#### Philips (24x24)
|
132
135
|
|
133
136
|
Let's try some left-looking philips (pre-configured phunk
|
134
137
|
with the built-in attributes: Male 3):
|
@@ -150,7 +153,7 @@ resulting in:
|
|
150
153
|
|
151
154
|
|
152
155
|
|
153
|
-
|
156
|
+
#### Marilyns (24x24)
|
154
157
|
|
155
158
|
Let's try some left-looking marilyns (pre-configured phunk
|
156
159
|
with the built-in attributes: Female 3, Wild Blonde, Mole, Blue Eye Shadow):
|
@@ -190,8 +193,11 @@ resulting in:
|
|
190
193
|
![](https://github.com/pixelartexchange/originals/raw/master/i/marilyn2.4@4x.png)
|
191
194
|
|
192
195
|
|
196
|
+
|
193
197
|
### Shiba Inu Doge (24x24)
|
194
198
|
|
199
|
+
_A free (pixel) art service brought to you by the [shiba-inus generation library / gem »](https://github.com/pixelartexchange/pixelart/tree/master/shibainus)_
|
200
|
+
|
195
201
|
|
196
202
|
Let's try some shiba inu doge - much wow:
|
197
203
|
|
@@ -230,6 +236,8 @@ resulting in:
|
|
230
236
|
|
231
237
|
### Coolcats (24x24)
|
232
238
|
|
239
|
+
_A free (pixel) art service brought to you by the [coolcats generation library / gem »](https://github.com/pixelartexchange/pixelart/tree/master/coolcats)_
|
240
|
+
|
233
241
|
|
234
242
|
Let's try some coolcats:
|
235
243
|
|
@@ -271,6 +279,8 @@ resulting in:
|
|
271
279
|
|
272
280
|
### Nouns (32x32)
|
273
281
|
|
282
|
+
_A free (pixel) art service brought to you by the [nouns generation library / gem »](https://github.com/pixelartexchange/pixelart/tree/master/nouns)_
|
283
|
+
|
274
284
|
|
275
285
|
Let's try some noun (pixel avatars):
|
276
286
|
|
@@ -321,6 +331,9 @@ resulting in:
|
|
321
331
|
|
322
332
|
### Moonbirds / Owls (42x42)
|
323
333
|
|
334
|
+
_A free (pixel) art service brought to you by the [moonbirds (& owls)generation library / gem »](https://github.com/pixelartexchange/pixelart/tree/master/moonbirds)_
|
335
|
+
|
336
|
+
|
324
337
|
|
325
338
|
Let's try some super-rare never-before-seen moonbirds / owls:
|
326
339
|
|
@@ -360,12 +373,99 @@ resulting in:
|
|
360
373
|
|
361
374
|
|
362
375
|
|
363
|
-
|
364
376
|
And so on. Stay tuned for more original artwork series!
|
365
377
|
|
366
378
|
|
367
379
|
|
368
380
|
|
381
|
+
### Bonus: Readymades - Start w/ (Pixel) Art From (Online) Collections
|
382
|
+
|
383
|
+
_A free readymade (pixel) art service brought to you by the [artbase (server edition) »](https://github.com/pixelartexchange/artbase.server)_
|
384
|
+
|
385
|
+
|
386
|
+
Yes, you can. Pick any readymade pixel art (by number) from any of the many collections served-up by an artbase (server edition)
|
387
|
+
installation.
|
388
|
+
By default "out-of-the-box" the artbase web server / service installation running online
|
389
|
+
at [pixelartexchange.herokuapp.com](https://pixelartexchange.herokuapp.com/) gets called via HTTP.
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
#### More Punks (24x24)
|
394
|
+
|
395
|
+
Let's try some more punks:
|
396
|
+
|
397
|
+
```
|
398
|
+
$ fab morepunk no.179
|
399
|
+
$ fab morepunk no.180
|
400
|
+
$ fab morepunk no.190
|
401
|
+
```
|
402
|
+
|
403
|
+
resulting in:
|
404
|
+
|
405
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/morepunk179.png)
|
406
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/morepunk180.png)
|
407
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/morepunk190.png)
|
408
|
+
|
409
|
+
4x (using the `--zoom=4`/`-z4` option)
|
410
|
+
|
411
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/morepunk179@4x.png)
|
412
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/morepunk180@4x.png)
|
413
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/morepunk190@4x.png)
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
#### Punk Rocks (24x24)
|
418
|
+
|
419
|
+
Let's try some punk rocks:
|
420
|
+
|
421
|
+
```
|
422
|
+
$ fab punkrock no.1
|
423
|
+
$ fab punkrock no.4
|
424
|
+
$ fab punkrock no.5
|
425
|
+
```
|
426
|
+
|
427
|
+
resulting in:
|
428
|
+
|
429
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/punkrock1.png)
|
430
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/punkrock4.png)
|
431
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/punkrock5.png)
|
432
|
+
|
433
|
+
4x (using the `--zoom=4`/`-z4` option)
|
434
|
+
|
435
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/punkrock1@4x.png)
|
436
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/punkrock4@4x.png)
|
437
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/punkrock5@4x.png)
|
438
|
+
|
439
|
+
|
440
|
+
|
441
|
+
#### Dooggies (32x32)
|
442
|
+
|
443
|
+
Let's try some dooggies:
|
444
|
+
|
445
|
+
```
|
446
|
+
$ fab dooggie no.0
|
447
|
+
$ fab dooggie no.571
|
448
|
+
$ fab dooggie no.7411
|
449
|
+
```
|
450
|
+
|
451
|
+
resulting in:
|
452
|
+
|
453
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/dooggie0.png)
|
454
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/dooggie571.png)
|
455
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/dooggie7411.png)
|
456
|
+
|
457
|
+
4x (using the `--zoom=4`/`-z4` option)
|
458
|
+
|
459
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/dooggie0@4x.png)
|
460
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/dooggie571@4x.png)
|
461
|
+
![](https://github.com/pixelartexchange/originals/raw/master/i/dooggie7411@4x.png)
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
And so on.
|
466
|
+
|
467
|
+
|
468
|
+
|
369
469
|
## Install
|
370
470
|
|
371
471
|
Just install the gem:
|
data/Rakefile
CHANGED
@@ -0,0 +1,63 @@
|
|
1
|
+
|
2
|
+
## get image via artbase (HTTP) web service
|
3
|
+
|
4
|
+
|
5
|
+
## forward define superclass for image
|
6
|
+
module Artbase
|
7
|
+
class Image < Pixelart::Image; end
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
module Artbase
|
13
|
+
################
|
14
|
+
# convenience helpers / shortcuts
|
15
|
+
def self.service ## "shared" single (default) instance
|
16
|
+
@service ||= Service.new
|
17
|
+
end
|
18
|
+
|
19
|
+
class Image
|
20
|
+
def self.get( name, id ) Artbase.service.get( name, id ); end
|
21
|
+
end # class Image
|
22
|
+
|
23
|
+
|
24
|
+
## todo/fix: move name variants into artbase server itelf - why? why not?
|
25
|
+
COLLECTIONS = {
|
26
|
+
'punk' => 'punks',
|
27
|
+
'morepunk' => 'morepunks',
|
28
|
+
}
|
29
|
+
|
30
|
+
###################
|
31
|
+
# main artbase service handler / machinery
|
32
|
+
class Service
|
33
|
+
DEFAULT_BASE_URL = 'https://pixelartexchange.herokuapp.com'
|
34
|
+
|
35
|
+
|
36
|
+
def initialize( base_url=DEFAULT_BASE_URL )
|
37
|
+
@base_url = base_url
|
38
|
+
end
|
39
|
+
|
40
|
+
def get( collection, id )
|
41
|
+
|
42
|
+
url = "#{@base_url}/#{collection}/#{id}.png"
|
43
|
+
res = Webclient.get( url )
|
44
|
+
|
45
|
+
puts "#{res.status.code} #{res.status.message}"
|
46
|
+
puts " content_type: #{res.content_type}"
|
47
|
+
puts " content_length: #{res.content_length} bytes (#{res.content_length.class.name})"
|
48
|
+
|
49
|
+
if res.status.ok?
|
50
|
+
## todo/fix: move to Pixelart::Image itself
|
51
|
+
## use from_blob or such - why? why not
|
52
|
+
img_inner = ChunkyPNG::Image.from_blob( res.blob )
|
53
|
+
img = Artbase::Image.new( img_inner.width, img_inner.height, img_inner )
|
54
|
+
img
|
55
|
+
else
|
56
|
+
puts "!! HTTP ERROR - image data request failed; sorry"
|
57
|
+
return nil
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end # class Service
|
61
|
+
|
62
|
+
end # module Artbase
|
63
|
+
|
data/lib/originals/tool.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
module Originals
|
2
2
|
class Tool
|
3
3
|
|
4
|
+
|
5
|
+
|
6
|
+
|
4
7
|
def self.main( args=ARGV )
|
5
8
|
puts "==> welcome to the fab(ricate) tool with args:"
|
6
9
|
pp args
|
@@ -50,20 +53,57 @@ class Tool
|
|
50
53
|
name = args[0] ## todo/check - use collection_name/slug or such?
|
51
54
|
attributes = args[1..-1]
|
52
55
|
|
56
|
+
|
53
57
|
## normalize name of series
|
54
58
|
## e.g. Shiba Inu => shibainu etc.
|
55
|
-
key =
|
59
|
+
key = Originals.factory._norm_name( name )
|
60
|
+
|
61
|
+
## check for readymade via series id
|
62
|
+
## allow some "literal" variants e.g.
|
63
|
+
## punk no.1 or no.001
|
64
|
+
## punk #1 or #001
|
65
|
+
## etc.
|
66
|
+
## and some more in the future - why? why not?
|
67
|
+
|
68
|
+
id = nil
|
69
|
+
|
70
|
+
img = if attributes.size == 1 && id=Originals.factory._parse_id( attributes[0] )
|
71
|
+
## check for known collection names
|
72
|
+
## (mostly singular to plural) - keep? why? why not?
|
73
|
+
collection = Artbase::COLLECTIONS[ key ] || key
|
74
|
+
Artbase::Image.get( collection, id )
|
75
|
+
else
|
76
|
+
Original::Image.fabricate( key, *attributes )
|
77
|
+
end
|
78
|
+
|
79
|
+
if img.nil?
|
80
|
+
puts "!! ERROR - don't know how to fabricate >#{name}<; sorry"
|
81
|
+
exit 1
|
82
|
+
end
|
56
83
|
|
57
|
-
img = Original::Image.fabricate( key, *attributes,
|
58
|
-
background: options[ :background] )
|
59
84
|
|
85
|
+
## note: keep adding background as a separate step for now
|
86
|
+
if options[ :background]
|
87
|
+
## hack: for now for artbase collections
|
88
|
+
## try to remove background if any
|
89
|
+
## keep? why? why not?
|
90
|
+
img = img.transparent if id
|
60
91
|
|
92
|
+
img = Original.factory._background( img,
|
93
|
+
options[ :background ] )
|
94
|
+
end
|
61
95
|
|
62
|
-
basename =
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
96
|
+
basename = String.new('') ## note: start with our own string buffer
|
97
|
+
## otherwise assigned first string gets modified!!
|
98
|
+
basename += options[:name] ? options[:name] : key
|
99
|
+
|
100
|
+
basename += if options[:id]
|
101
|
+
options[:id]
|
102
|
+
elsif id
|
103
|
+
id.to_s
|
104
|
+
else
|
105
|
+
'' # add nothing
|
106
|
+
end
|
67
107
|
|
68
108
|
|
69
109
|
path = if options[:zoom]
|
data/lib/originals/version.rb
CHANGED
data/lib/originals.rb
CHANGED
@@ -5,6 +5,8 @@ require 'moonbirds'
|
|
5
5
|
require 'coolcats'
|
6
6
|
require 'nouns'
|
7
7
|
|
8
|
+
require 'webclient'
|
9
|
+
|
8
10
|
|
9
11
|
|
10
12
|
## our own code
|
@@ -28,127 +30,113 @@ end
|
|
28
30
|
##
|
29
31
|
# "wrap" fabricate inside Image - why? why not?
|
30
32
|
class Image
|
31
|
-
|
33
|
+
|
34
|
+
def self.fabricate( name, *attributes, background: nil )
|
32
35
|
## normalize name of series
|
33
36
|
## e.g. Shiba Inu => shibainu etc.
|
34
|
-
key =
|
35
|
-
|
36
|
-
img =
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
37
|
+
key = Originals.factory._norm_name( name )
|
38
|
+
|
39
|
+
img = if ['punk', 'punks',
|
40
|
+
'cryptopunk', 'cryptopunks'].include?( key )
|
41
|
+
Originals.factory.punk( *attributes )
|
42
|
+
elsif ['phunk', 'phunks',
|
43
|
+
'cryptophunk', 'cryptophunks'].include?( key )
|
44
|
+
Originals.factory.phunk( *attributes )
|
45
|
+
elsif ['marilyn', 'marilyns' ].include?( key )
|
46
|
+
Originals.factory.marilyn( *attributes )
|
47
|
+
elsif ['philip', 'philips',
|
48
|
+
'philipp', 'philipps' ].include?( key )
|
49
|
+
Originals.factory.philip( *attributes )
|
50
|
+
elsif ['doge', 'doges',
|
51
|
+
'shiba', 'shibas',
|
52
|
+
'shibainu', 'shibainus'].include?( key )
|
53
|
+
Originals.factory.shiba( *attributes )
|
54
|
+
elsif ['bird', 'birds',
|
55
|
+
'moonbird', 'moonbirds',
|
56
|
+
'owl', 'owls'].include?( key )
|
57
|
+
Originals.factory.bird( *attributes )
|
58
|
+
elsif ['coolcat', 'coolcats'].include?( key )
|
59
|
+
Originals.factory.coolcat( *attributes )
|
60
|
+
elsif ['noun', 'nouns'].include?( key )
|
61
|
+
Originals.factory.noun( *attributes )
|
62
|
+
else
|
63
|
+
return nil ## return nil
|
64
|
+
end
|
65
|
+
|
66
|
+
## note: keep add background as a separate (last) step for now - why? why not?
|
67
|
+
img = Originals.factory._background( img, background ) if background
|
63
68
|
img
|
64
69
|
end
|
65
70
|
class << self
|
66
|
-
|
71
|
+
alias_method :fab, :fabricate
|
67
72
|
end
|
68
|
-
end # class Image
|
69
73
|
|
70
74
|
|
75
|
+
end # class Image
|
71
76
|
|
72
77
|
|
73
78
|
|
74
79
|
class Factory ## add Fabricator/Artist/Artfactory/? alias or such - why? why not?
|
75
80
|
|
76
|
-
|
81
|
+
|
82
|
+
def punk( *attributes )
|
77
83
|
## note: if no attributes passed in
|
78
84
|
## default to ['Male 2']
|
79
85
|
attributes = ['Male 2'] if attributes.size == 0
|
80
86
|
|
81
|
-
|
82
|
-
mirror: mirror,
|
83
|
-
background: background )
|
87
|
+
Cryptopunks::Image.generate( *attributes )
|
84
88
|
end
|
85
89
|
|
86
|
-
def phunk( *attributes
|
87
|
-
|
88
|
-
mirror: true,
|
89
|
-
background: background )
|
90
|
+
def phunk( *attributes )
|
91
|
+
punk( *attributes ).mirror
|
90
92
|
end
|
91
93
|
|
92
94
|
|
93
95
|
MARILYN_ATTRIBUTES = ['Female 3', 'Wild Blonde', 'Mole',
|
94
96
|
'Blue Eye Shadow']
|
95
97
|
|
96
|
-
def marilyn( *attributes
|
97
|
-
|
98
|
-
*attributes,
|
99
|
-
mirror: true,
|
100
|
-
background: background )
|
98
|
+
def marilyn( *attributes )
|
99
|
+
phunk( *MARILYN_ATTRIBUTES, *attributes )
|
101
100
|
end
|
102
101
|
|
103
102
|
|
104
103
|
PHILIP_ATTRIBUTES = ['Male 3']
|
105
|
-
def philip( *attributes
|
106
|
-
|
107
|
-
*attributes,
|
108
|
-
mirror: true,
|
109
|
-
background: background )
|
104
|
+
def philip( *attributes )
|
105
|
+
phunk( *PHILIP_ATTRIBUTES, *attributes )
|
110
106
|
end
|
111
107
|
|
112
108
|
|
113
109
|
|
114
110
|
## add method alias doge, shiba_inu etc. - why? why not?
|
115
|
-
def shiba( *attributes
|
111
|
+
def shiba( *attributes )
|
116
112
|
## note: if no attributes passed in
|
117
113
|
## default to ['Classic']
|
118
114
|
attributes = ['Classic'] if attributes.size == 0
|
119
115
|
|
120
|
-
|
121
|
-
doge = _background( doge, background ) if background
|
122
|
-
doge
|
116
|
+
Shiba::Image.generate( *attributes )
|
123
117
|
end
|
124
118
|
|
125
119
|
|
126
120
|
## add method alias moonbird, owl etc. - why? why not?
|
127
|
-
def bird( *attributes
|
121
|
+
def bird( *attributes )
|
128
122
|
attributes = ['Brave Glitch'] if attributes.size == 0
|
129
123
|
|
130
|
-
|
131
|
-
bird = _background( bird, background ) if background
|
132
|
-
bird
|
124
|
+
Moonbird::Image.generate( *attributes )
|
133
125
|
end
|
134
126
|
|
135
127
|
|
136
|
-
def coolcat( *attributes
|
137
|
-
|
138
|
-
cat = _background( cat, background ) if background
|
139
|
-
cat
|
128
|
+
def coolcat( *attributes )
|
129
|
+
Coolcat::Image.generate( *attributes )
|
140
130
|
end
|
141
131
|
|
142
132
|
|
143
|
-
def noun( *attributes
|
133
|
+
def noun( *attributes )
|
144
134
|
attributes = ['Body Grayscale 1',
|
145
135
|
'Checker Bigwalk Rainbow',
|
146
136
|
'Head Beer',
|
147
137
|
'Glasses Square Fullblack'] if attributes.size == 0
|
148
138
|
|
149
|
-
|
150
|
-
noun = _background( noun, background ) if background
|
151
|
-
noun
|
139
|
+
Noun::Image.generate( *attributes )
|
152
140
|
end
|
153
141
|
|
154
142
|
|
@@ -157,19 +145,6 @@ end
|
|
157
145
|
###
|
158
146
|
# helpers
|
159
147
|
|
160
|
-
def _generate_punk( *attributes,
|
161
|
-
mirror: false,
|
162
|
-
background: nil )
|
163
|
-
punk = Cryptopunks::Image.generate( *attributes )
|
164
|
-
|
165
|
-
punk = punk.mirror if mirror
|
166
|
-
## note: add background as LAST step (after mirror operation)
|
167
|
-
## that is, if mirror=true background will NOT get mirrored
|
168
|
-
punk = _background( punk, background ) if background
|
169
|
-
punk
|
170
|
-
end
|
171
|
-
|
172
|
-
|
173
148
|
def _background( base, background )
|
174
149
|
width, height = base.width, base.height
|
175
150
|
|
@@ -187,6 +162,23 @@ def _background( base, background )
|
|
187
162
|
img2
|
188
163
|
end
|
189
164
|
|
165
|
+
def _norm_name( str )
|
166
|
+
str.downcase.gsub( /[ ()_-]/, '' )
|
167
|
+
end
|
168
|
+
|
169
|
+
def _parse_id( str )
|
170
|
+
if str.gsub( /[ #()._-]/, '' ) =~ /
|
171
|
+
^(no|n|id)?
|
172
|
+
(?<id>[0-9]+)$
|
173
|
+
/ix
|
174
|
+
id = Regexp.last_match[:id].to_i(10) ## note: add base 10 (for 008 or such)
|
175
|
+
id
|
176
|
+
else
|
177
|
+
nil # retur nil if no match
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
|
190
182
|
end # class Factory
|
191
183
|
|
192
184
|
|
@@ -194,7 +186,7 @@ end # module Originals
|
|
194
186
|
|
195
187
|
|
196
188
|
|
197
|
-
|
189
|
+
require 'originals/service'
|
198
190
|
require 'originals/tool'
|
199
191
|
|
200
192
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: originals
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.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: 2022-06-
|
11
|
+
date: 2022-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cryptopunks
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: webclient
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rdoc
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +150,7 @@ files:
|
|
136
150
|
- bin/fab
|
137
151
|
- bin/fabricate
|
138
152
|
- lib/originals.rb
|
153
|
+
- lib/originals/service.rb
|
139
154
|
- lib/originals/tool.rb
|
140
155
|
- lib/originals/version.rb
|
141
156
|
homepage: https://github.com/pixelartexchange/originals
|