cryptopunks 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -3
- data/Manifest.txt +0 -3
- data/README.md +666 -633
- data/Rakefile +40 -32
- data/bin/cryptopunk +17 -17
- data/bin/punk +17 -17
- data/lib/cryptopunks/attributes.rb +147 -147
- data/lib/cryptopunks/colors.rb +162 -162
- data/lib/cryptopunks/composite.rb +38 -38
- data/lib/cryptopunks/contract/punksdata-assets.rb +338 -338
- data/lib/cryptopunks/contract/punksdata-contract.rb +55 -55
- data/lib/cryptopunks/contract/punksdata-meta.rb +2107 -2107
- data/lib/cryptopunks/dataset.rb +67 -67
- data/lib/cryptopunks/image.rb +35 -33
- data/lib/cryptopunks/structs.rb +161 -161
- data/lib/cryptopunks/tool.rb +382 -381
- data/lib/cryptopunks/version.rb +27 -23
- data/lib/cryptopunks.rb +66 -194
- metadata +16 -19
- data/config/spritesheet.csv +0 -762
- data/config/spritesheet.png +0 -0
- data/lib/cryptopunks/generator.rb +0 -309
data/lib/cryptopunks/version.rb
CHANGED
@@ -1,23 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
module
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
|
1
|
+
|
2
|
+
|
3
|
+
module Pixelart
|
4
|
+
module Module
|
5
|
+
module Cryptopunks
|
6
|
+
|
7
|
+
MAJOR = 3
|
8
|
+
MINOR = 0
|
9
|
+
PATCH = 0
|
10
|
+
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
11
|
+
|
12
|
+
def self.version
|
13
|
+
VERSION
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.banner
|
17
|
+
"cryptopunks/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.root
|
21
|
+
File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
|
22
|
+
end
|
23
|
+
|
24
|
+
end # module Cryptopunks
|
25
|
+
end # module Module
|
26
|
+
end # module Pixelart
|
27
|
+
|
data/lib/cryptopunks.rb
CHANGED
@@ -1,194 +1,66 @@
|
|
1
|
-
## 3rd party
|
2
|
-
require '
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
##
|
8
|
-
require '
|
9
|
-
require '
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
40
|
-
require 'cryptopunks/
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
###### hack for black&white
|
70
|
-
## auto-add b&w (black&white) to all attribute names e.g.
|
71
|
-
## Eyes => Eyes B&W
|
72
|
-
## Smile => Smile B&W
|
73
|
-
## ....
|
74
|
-
|
75
|
-
archetype_key = Generator.normalize_key( values[0] )
|
76
|
-
if archetype_key.end_with?( 'bw' ) || ## e.g. B&W
|
77
|
-
archetype_key.end_with?( '1bit') ## e.g. 1-Bit or 1Bit
|
78
|
-
|
79
|
-
values = [values[0]] + values[1..-1].map do |attribute|
|
80
|
-
attribute_key = Generator.normalize_key( attribute )
|
81
|
-
if ['wildhair'].include?( attribute_key ) ## pass through known b&w attributes by "default"
|
82
|
-
attribute
|
83
|
-
elsif attribute_key.index( "black" )
|
84
|
-
attribute ## pass through as-is
|
85
|
-
else
|
86
|
-
"#{attribute} B&W"
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
pp values
|
91
|
-
end
|
92
|
-
|
93
|
-
|
94
|
-
# note: female mouth by default has "custom" colors (not black)
|
95
|
-
# for every 1/2/3/4 (human) skin tone and for zombie
|
96
|
-
# auto-"magically" add mapping
|
97
|
-
#
|
98
|
-
# todo/check/fix - add more "contraints"
|
99
|
-
# for mapping to only kick-in for "basic" versions
|
100
|
-
# and not "colored" e.g. golden and such - why? why not?
|
101
|
-
#
|
102
|
-
# move this mapping here to "post-lookup" processing
|
103
|
-
# to get/incl. more "meta" attribute info - why? why not?
|
104
|
-
if archetype_key.index( 'female1' ) ||
|
105
|
-
archetype_key.index( 'female2' ) ||
|
106
|
-
archetype_key.index( 'female3' ) ||
|
107
|
-
archetype_key.index( 'female4' ) ||
|
108
|
-
archetype_key.index( 'zombiefemale' )
|
109
|
-
|
110
|
-
values = [values[0]] + values[1..-1].map do |attribute|
|
111
|
-
attribute_key = Generator.normalize_key( attribute )
|
112
|
-
|
113
|
-
if attribute_key == 'smile' || attribute_key == 'frown'
|
114
|
-
attribute += if archetype_key.index( 'zombiefemale' ) then ' Zombie'
|
115
|
-
elsif archetype_key.index( 'female1' ) then ' 1'
|
116
|
-
elsif archetype_key.index( 'female2' ) then ' 2'
|
117
|
-
elsif archetype_key.index( 'female3' ) then ' 3'
|
118
|
-
elsif archetype_key.index( 'female4' ) then ' 4'
|
119
|
-
else
|
120
|
-
puts "!! ERROR - smile or frown (mouth expression) not supported for archetype:"
|
121
|
-
pp values
|
122
|
-
exit 1
|
123
|
-
end
|
124
|
-
end
|
125
|
-
attribute
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
img = Cryptopunks.generator.generate( *values, style: style )
|
130
|
-
## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
|
131
|
-
new( img.image )
|
132
|
-
end # method Image.generate
|
133
|
-
|
134
|
-
end # class Image
|
135
|
-
|
136
|
-
|
137
|
-
class Spritesheet
|
138
|
-
## note: for now class used for "namespace" only
|
139
|
-
def self.find_by( name:, gender: nil, size: nil ) ## return archetype/attribute image by name
|
140
|
-
# note: pass along name as q (query string)
|
141
|
-
Cryptopunks.generator.find( name,
|
142
|
-
gender: gender,
|
143
|
-
size: size )
|
144
|
-
end
|
145
|
-
end # class Spritesheet
|
146
|
-
## add convenience (alternate spelling) alias - why? why not?
|
147
|
-
SpriteSheet = Spritesheet
|
148
|
-
Sheet = Spritesheet
|
149
|
-
Sprite = Spritesheet
|
150
|
-
end # module Cryptopunks
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
####
|
155
|
-
# add CryptoPunksData (off-chain) contract
|
156
|
-
require 'cryptopunks/contract/punksdata-assets'
|
157
|
-
require 'cryptopunks/contract/punksdata-meta'
|
158
|
-
require 'cryptopunks/contract/punksdata-contract'
|
159
|
-
CryptoPunksData = CryptopunksData
|
160
|
-
PunksData = CryptopunksData
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
require 'cryptopunks/tool'
|
167
|
-
|
168
|
-
### add tool convenience helper
|
169
|
-
module Cryptopunks
|
170
|
-
def self.main( args=ARGV ) Tool.new.run( args ); end
|
171
|
-
end ## module Cryptopunks
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
### add some convenience shortcuts
|
178
|
-
CryptoPunks = Cryptopunks
|
179
|
-
Punks = Cryptopunks
|
180
|
-
## add singular too -why? why not?
|
181
|
-
Cryptopunk = Cryptopunks
|
182
|
-
CryptoPunk = Cryptopunks
|
183
|
-
Punk = Cryptopunks
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
###
|
189
|
-
# note: for convenience auto include Pixelart namespace!!! - why? why not?
|
190
|
-
include Pixelart
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
puts Cryptopunks.banner # say hello
|
1
|
+
## 3rd party
|
2
|
+
require 'punks'
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
## extra stdlibs
|
7
|
+
require 'digest' ## move/add to pixelart upstream - why? why not?
|
8
|
+
require 'optparse'
|
9
|
+
require 'gli' ## used for command line tool
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## our own code
|
14
|
+
require 'cryptopunks/version' # note: let version always go first
|
15
|
+
|
16
|
+
|
17
|
+
require 'cryptopunks/attributes'
|
18
|
+
require 'cryptopunks/structs'
|
19
|
+
require 'cryptopunks/composite'
|
20
|
+
|
21
|
+
|
22
|
+
## add old backwards compatible alias
|
23
|
+
module Punk
|
24
|
+
class Image
|
25
|
+
Composite = ImageComposite
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
require 'cryptopunks/dataset'
|
32
|
+
|
33
|
+
require 'cryptopunks/colors'
|
34
|
+
require 'cryptopunks/image'
|
35
|
+
|
36
|
+
|
37
|
+
####
|
38
|
+
# add CryptoPunksData (off-chain) contract
|
39
|
+
require 'cryptopunks/contract/punksdata-assets'
|
40
|
+
require 'cryptopunks/contract/punksdata-meta'
|
41
|
+
require 'cryptopunks/contract/punksdata-contract'
|
42
|
+
CryptoPunksData = CryptopunksData
|
43
|
+
PunksData = CryptopunksData
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
require 'cryptopunks/tool'
|
50
|
+
|
51
|
+
### add tool convenience helper
|
52
|
+
module Punk
|
53
|
+
def self.main( args=ARGV ) Tool.new.run( args ); end
|
54
|
+
end ## module Punk
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
###
|
61
|
+
# note: for convenience auto include Pixelart namespace!!! - why? why not?
|
62
|
+
include Pixelart
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
puts Pixelart::Module::Cryptopunks.banner # say hello
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptopunks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.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-
|
11
|
+
date: 2022-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pixelart
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2
|
19
|
+
version: 1.3.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.2
|
26
|
+
version: 1.3.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: punks
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 0.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 0.2.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: gli
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -78,17 +78,17 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '3.
|
81
|
+
version: '3.23'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '3.
|
89
|
-
description: cryptopunks -
|
90
|
-
|
91
|
-
collection; incl. 2x/4x/8x zoom for bigger sizes
|
88
|
+
version: '3.23'
|
89
|
+
description: cryptopunks - generate your own 24×24 pixel punk images (off-chain) from
|
90
|
+
the Official Genuine Matt & John's® Punks sha256-verified original 10 000 unique
|
91
|
+
character collection; incl. 2x/4x/8x zoom for bigger sizes
|
92
92
|
email: wwwmake@googlegroups.com
|
93
93
|
executables:
|
94
94
|
- cryptopunk
|
@@ -105,8 +105,6 @@ files:
|
|
105
105
|
- Rakefile
|
106
106
|
- bin/cryptopunk
|
107
107
|
- bin/punk
|
108
|
-
- config/spritesheet.csv
|
109
|
-
- config/spritesheet.png
|
110
108
|
- lib/cryptopunks.rb
|
111
109
|
- lib/cryptopunks/attributes.rb
|
112
110
|
- lib/cryptopunks/colors.rb
|
@@ -115,7 +113,6 @@ files:
|
|
115
113
|
- lib/cryptopunks/contract/punksdata-contract.rb
|
116
114
|
- lib/cryptopunks/contract/punksdata-meta.rb
|
117
115
|
- lib/cryptopunks/dataset.rb
|
118
|
-
- lib/cryptopunks/generator.rb
|
119
116
|
- lib/cryptopunks/image.rb
|
120
117
|
- lib/cryptopunks/structs.rb
|
121
118
|
- lib/cryptopunks/tool.rb
|
@@ -141,10 +138,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
138
|
- !ruby/object:Gem::Version
|
142
139
|
version: '0'
|
143
140
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
141
|
+
rubygems_version: 3.3.7
|
145
142
|
signing_key:
|
146
143
|
specification_version: 4
|
147
|
-
summary: cryptopunks -
|
148
|
-
Official Genuine
|
149
|
-
incl. 2x/4x/8x zoom for bigger sizes
|
144
|
+
summary: cryptopunks - generate your own 24×24 pixel punk images (off-chain) from
|
145
|
+
the Official Genuine Matt & John's® Punks sha256-verified original 10 000 unique
|
146
|
+
character collection; incl. 2x/4x/8x zoom for bigger sizes
|
150
147
|
test_files: []
|