cryptopunks 3.0.1 → 2024.2.29

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 132182e7092509bbfb860a86685a816699ad83837540655610704621502df32b
4
- data.tar.gz: 29852afd5567f7779ff8c9a0b1c9cadc806a4742b1e1640bfa38fc75a7dd2d70
3
+ metadata.gz: 87c03c79927af52b3756913e3a08942cbf07334520ca360d7832ec69bdd4d8db
4
+ data.tar.gz: ae8e96d0926920951cf1154e218e4535f7f5559bb79a7bcc5225fb701a1a8669
5
5
  SHA512:
6
- metadata.gz: 4be03f0828b4b7cea13d040035121879d02ca0b486784f7980a75d2e7d7876ab89ad19f315da6cb049807621a37ccc3a964b6c145b4e8d0de76cf1633006abea
7
- data.tar.gz: a30363a0a877e4bc33b124befd12189cfc92d00cc963a259b1e9c47c726dc1aa528f9696c77ed3a3b8b7b96fa08a1e3c3d02eaecd3e56b04892d552a14da4477
6
+ metadata.gz: d5c4037f12c60031af368c7b296732a9fc28c155efa218dd988ef0ed29bb28dcd816ae8c7777bb668591fb4bd1208bdc77f463ecc50f7cbb286d98e0c8791c01
7
+ data.tar.gz: a629cb29a1caf1f97b678f5305d591b2d61c29bbadb69e3bc51a2754a56c53fc3345fb4b5669f55df12db7ca96a69ebce584dc3cbf630ca07b82e57119afe85e
data/Manifest.txt CHANGED
@@ -11,8 +11,5 @@ lib/cryptopunks/composite.rb
11
11
  lib/cryptopunks/contract/punksdata-assets.rb
12
12
  lib/cryptopunks/contract/punksdata-contract.rb
13
13
  lib/cryptopunks/contract/punksdata-meta.rb
14
- lib/cryptopunks/dataset.rb
15
- lib/cryptopunks/image.rb
16
- lib/cryptopunks/structs.rb
17
14
  lib/cryptopunks/tool.rb
18
15
  lib/cryptopunks/version.rb
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ Hoe.spec 'cryptopunks' do
27
27
 
28
28
  self.extra_deps = [
29
29
  ['pixelart', '>= 1.3.2'],
30
- ['punks', '>= 0.2.0'],
30
+ ['punks', '>= 2024.2.29'],
31
31
  ['gli'],
32
32
  ]
33
33
 
@@ -301,10 +301,11 @@ desc 'List all punk archetype and attribute names from builtin punk spritesheet'
301
301
  command [:l, :ls, :list] do |c|
302
302
  c.action do |g,o,args|
303
303
 
304
- generator = Image.generator
304
+ # generator = Punk::Image.generator
305
+ sheet = Punk::Spritesheet.builtin
305
306
 
306
307
  puts "==> Archetypes"
307
- generator.meta.each do |rec|
308
+ sheet.meta.each do |rec|
308
309
  next unless rec.archetype?
309
310
 
310
311
  print " "
@@ -315,7 +316,7 @@ command [:l, :ls, :list] do |c|
315
316
 
316
317
  puts ""
317
318
  puts "==> Attributes"
318
- generator.meta.each do |rec|
319
+ sheet.meta.each do |rec|
319
320
  next unless rec.attribute?
320
321
 
321
322
  print " "
@@ -325,7 +326,7 @@ command [:l, :ls, :list] do |c|
325
326
  end
326
327
 
327
328
  puts ""
328
- puts " See github.com/cryptopunksnotdead/punks.spritesheet for more."
329
+ puts " See github.com/openpunkart/punkart.spritesheet for more."
329
330
  puts ""
330
331
 
331
332
  puts 'Done.'
@@ -4,9 +4,9 @@ module Pixelart
4
4
  module Module
5
5
  module Cryptopunks
6
6
 
7
- MAJOR = 3
8
- MINOR = 0
9
- PATCH = 1
7
+ MAJOR = 2024
8
+ MINOR = 2
9
+ PATCH = 29
10
10
  VERSION = [MAJOR,MINOR,PATCH].join('.')
11
11
 
12
12
  def self.version
data/lib/cryptopunks.rb CHANGED
@@ -15,23 +15,8 @@ require 'cryptopunks/version' # note: let version always go first
15
15
 
16
16
 
17
17
  require 'cryptopunks/attributes'
18
- require 'cryptopunks/structs'
19
18
  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
19
  require 'cryptopunks/colors'
34
- require 'cryptopunks/image'
35
20
 
36
21
 
37
22
  ####
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: 3.0.1
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: 2022-06-11 00:00:00.000000000 Z
11
+ date: 2024-02-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pixelart
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.0
33
+ version: 2024.2.29
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: 0.2.0
40
+ version: 2024.2.29
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: gli
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '3.23'
81
+ version: '4.1'
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.23'
88
+ version: '4.1'
89
89
  description: cryptopunks - generate your own 24×24 pixel punk images (off-chain) from
90
90
  the Official Genuine Matt & John's® Punks sha256-verified original 10 000 unique
91
91
  character collection; incl. 2x/4x/8x zoom for bigger sizes
@@ -112,9 +112,6 @@ files:
112
112
  - lib/cryptopunks/contract/punksdata-assets.rb
113
113
  - lib/cryptopunks/contract/punksdata-contract.rb
114
114
  - lib/cryptopunks/contract/punksdata-meta.rb
115
- - lib/cryptopunks/dataset.rb
116
- - lib/cryptopunks/image.rb
117
- - lib/cryptopunks/structs.rb
118
115
  - lib/cryptopunks/tool.rb
119
116
  - lib/cryptopunks/version.rb
120
117
  homepage: https://github.com/cryptopunksnotdead/cryptopunks
@@ -138,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
135
  - !ruby/object:Gem::Version
139
136
  version: '0'
140
137
  requirements: []
141
- rubygems_version: 3.3.7
138
+ rubygems_version: 3.4.10
142
139
  signing_key:
143
140
  specification_version: 4
144
141
  summary: cryptopunks - generate your own 24×24 pixel punk images (off-chain) from
@@ -1,67 +0,0 @@
1
-
2
-
3
- module Punk
4
- module Dataset
5
-
6
- def self.read( path='./datasets/punks/*.csv' )
7
-
8
- datasets = Dir.glob( path )
9
- #=> ["./datasets/punks/0-999.csv",
10
- # "./datasets/punks/1000-1999.csv",
11
- # "./datasets/punks/2000-2999.csv",
12
- # "./datasets/punks/3000-3999.csv",
13
- # "./datasets/punks/4000-4999.csv",
14
- # "./datasets/punks/5000-5999.csv",
15
- # "./datasets/punks/6000-6999.csv",
16
- # "./datasets/punks/7000-7999.csv",
17
- # "./datasets/punks/8000-8999.csv",
18
- # "./datasets/punks/9000-9999.csv"]
19
-
20
- rows = []
21
- datasets.each do |dataset|
22
- rows += CsvHash.read( dataset )
23
- end
24
-
25
- # puts " #{rows.size} rows(s)"
26
- #=> 10000 rows(s)
27
-
28
- ### wrap in punk struct for easier access
29
- punks = []
30
- rows.each do |row|
31
- id = row['id'].to_i
32
- type_q = row['type']
33
- count = row['count'].to_i
34
- accessories_q = row['accessories'].split( %r{[ ]*/[ ]*} )
35
-
36
- if count != accessories_q.size
37
- puts "!! ERROR - punk data assertion failed - expected accessories count #{count}; got #{accessories_q.size}"
38
- pp row
39
- exit 1
40
- end
41
-
42
- type = Metadata::Type.find( type_q )
43
- if type.nil?
44
- puts "!! ERROR - punk data assertion failed - unknown punk type >#{type_q}<"
45
- pp row
46
- exit 1
47
- end
48
-
49
- accessories = []
50
- accessories_q.each do |acc_q|
51
- acc = Metadata::Accessory.find( acc_q )
52
- if acc.nil?
53
- puts "!! ERROR - punk data assertion failed - unknown punk accessory type >#{acc_q}<"
54
- pp row
55
- exit 1
56
- end
57
- accessories << acc
58
- end
59
-
60
- punks << Metadata.new( id, type, accessories )
61
- end
62
- punks
63
- end
64
- end # module Dataset
65
- end # module Punk
66
-
67
-
@@ -1,35 +0,0 @@
1
- module Punk
2
-
3
-
4
-
5
- class Image
6
-
7
- def self.read( path ) ## convenience helper
8
- img = ChunkyPNG::Image.from_file( path )
9
- new( img )
10
- end
11
-
12
-
13
-
14
- =begin
15
-
16
- ### keep design & colors keyword args in c'tor here
17
- ## or use parse() like in pixelart - why? why not?
18
-
19
- def initialize( initial=nil, design: nil,
20
- colors: nil )
21
- if initial
22
- ## pass image through as-is
23
- img = initial
24
- else
25
- ## note: unwrap inner image before passing on to super c'tor
26
- img = Pixelart::Image.parse( design, colors: colors ).image
27
- end
28
-
29
- super( img.width, img.height, img )
30
- end
31
- =end
32
-
33
-
34
- end # class Image
35
- end # module Punk
@@ -1,161 +0,0 @@
1
-
2
- module Punk
3
- ### wrap metadata (e.g. punk types, accessories, etc.
4
- ## in structs for easy/easier access)
5
-
6
-
7
-
8
- class Metadata
9
-
10
- ## nested class
11
- class Type ## todo/check: use alias family or such?
12
- attr_reader :name,
13
- :limit
14
- def initialize( name, limit )
15
- @name = name
16
- @limit = limit
17
- end
18
- ## def to_s() @name; end
19
-
20
- def inspect
21
- %Q{<Type "#{@name}", limit: #{@limit}>}
22
- end
23
-
24
-
25
-
26
- def self.build
27
- TYPES.reduce( {} ) do |h, rec|
28
- type = Type.new( rec[:name], rec[:limit ] )
29
- h[ rec[:name].downcase ] = type
30
- h
31
- end
32
- end
33
-
34
- def self.registry
35
- ## auto-build registry (hash table) lookup (by name)
36
- @@types ||= build
37
- @@types
38
- end
39
-
40
- def self.all() registry.values; end
41
-
42
- def self.find( q ) registry[ q.to_s.downcase ]; end
43
- end ## (nested) class Type
44
-
45
-
46
-
47
- ## nested class
48
- class AccessoryType
49
- attr_reader :name,
50
- :accessories
51
- def initialize( name, accessories=[] )
52
- @name = name
53
- @accessories = accessories
54
- end
55
-
56
-
57
-
58
- def self.build
59
- ACCESSORY_TYPES.reduce( {} ) do |h, rec|
60
- type = AccessoryType.new( rec[:name] )
61
- ## add all accessories
62
- rec[:accessories].each do |rec_acc|
63
- type.accessories << Accessory.new( rec_acc[:name],
64
- type,
65
- rec_acc[:limit].to_i )
66
- end
67
- h[ rec[:name].downcase ] = type
68
- h
69
- end
70
- end
71
-
72
- def self.registry
73
- ## auto-build registry (hash table) lookup (by name)
74
- @@types ||= build
75
- @@types
76
- end
77
-
78
- def self.all() registry.values; end
79
-
80
- def self.find( q ) registry[ q.to_s.downcase ]; end
81
- end ## (nested) class AccessoryType
82
-
83
-
84
- ## nested class
85
- class Accessory
86
-
87
- attr_reader :name,
88
- :type,
89
- :limit
90
- def initialize( name, type, limit )
91
- @name = name
92
- @type = type
93
- @limit = limit
94
- end
95
-
96
-
97
- def inspect
98
- %Q{<Accessory "#{@name}", type: "#{@type.name}", limit: #{@limit}>}
99
- end
100
-
101
-
102
-
103
- def self.build
104
- AccessoryType.all.reduce( {} ) do |h, type|
105
- type.accessories.each do |acc|
106
- h[ acc.name.downcase ] = acc
107
- end
108
- h
109
- end
110
- end
111
-
112
- def self.registry
113
- ## auto-build registry (hash table) lookup (by name)
114
- @@types ||= build
115
- @@types
116
- end
117
-
118
- def self.all() registry.values; end
119
-
120
- def self.find( q ) registry[ q.to_s.downcase ]; end
121
- end ## (nested) class Accessory
122
-
123
-
124
-
125
-
126
-
127
-
128
- attr_reader :id,
129
- :type,
130
- :accessories,
131
- :birthday ## todo/check: use minted or such?
132
-
133
- def initialize( id, type, accessories )
134
- @id = id
135
- @type = type
136
- @accessories = accessories
137
- @birthday = Date.new( 2017, 6, 23) ## all 10,000 minted on June 23, 2017
138
- end
139
-
140
- def is_type?( name ) @type.name == name; end
141
- alias_method :is?, :is_type?
142
-
143
- ## convenience helpers for "classic" (5) types
144
- def alien?() is_type?( 'Alien'); end
145
- def ape?() is_type?( 'Ape' ); end
146
- def zombie?() is_type?( 'Zombie' ); end
147
- def female?() is_type?( 'Female' ); end
148
- def male?() is_type?( 'Male' ); end
149
-
150
- ## convenience helpers to lookup attributes
151
- def has_attribute?( name )
152
- accessories.each do |acc|
153
- return true if acc.name == name
154
- end
155
- false
156
- end
157
- alias_method :has?, :has_attribute?
158
- alias_method :include?, :has_attribute?
159
- end # class Metadata
160
-
161
- end # module Punk