punkme 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +3 -0
- data/Manifest.txt +6 -0
- data/README.md +34 -0
- data/Rakefile +42 -0
- data/lib/punkme/version.rb +25 -0
- data/lib/punkme.rb +84 -0
- metadata +145 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e1b9fba89223cebbc829b8bb6f777edbf9a50faa1276056471657628a7db38cc
|
4
|
+
data.tar.gz: 5b032dc479f636c7ec60564f3e03bb51e0e05666efe61c42b8c8c376917c945c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ca65a2c5643cf742f1b13fac0bde5cc8416b26f0660df41fbdc60afcd4bce210232ff3b80b98310928d601f113861044b33f91a53c2c9d30307d6a83be79ea5f
|
7
|
+
data.tar.gz: bd03510f41399268329ca86cc3389ed662c3134422ffa16c7344ee7f85f2164b4f74722c240ec23191ae82c93c79718d5ea5bcee613cea984ef79c22245ac39e
|
data/CHANGELOG.md
ADDED
data/Manifest.txt
ADDED
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# punk me
|
2
|
+
|
3
|
+
punkme gem - generate your own (pixel) punk characters / heads - using your own skintone, eye color, hair & hair color, and much more
|
4
|
+
|
5
|
+
|
6
|
+
* home :: [github.com/cryptopunksnotdead/punkart.sandbox](https://github.com/cryptopunksnotdead/punkart.sandbox)
|
7
|
+
* bugs :: [github.com/cryptopunksnotdead/punkart.sandbox/issues](https://github.com/cryptopunksnotdead/punkart.sandbox/issues)
|
8
|
+
* gem :: [rubygems.org/gems/punkme](https://rubygems.org/gems/punkme)
|
9
|
+
* rdoc :: [rubydoc.info/gems/punkme](http://rubydoc.info/gems/punkme)
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
|
16
|
+
to be done
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
## License
|
22
|
+
|
23
|
+
The scripts are dedicated to the public domain.
|
24
|
+
Use it as you please with no restrictions whatsoever.
|
25
|
+
|
26
|
+
|
27
|
+
## Questions? Comments?
|
28
|
+
|
29
|
+
Join us in the [Punk Art discord (chat server)](https://discord.gg/FE3HeXNKRa). Yes you can.
|
30
|
+
Your questions and commentary welcome.
|
31
|
+
|
32
|
+
Or post them over at the [Help & Support](https://github.com/geraldb/help) page. Thanks.
|
33
|
+
|
34
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'hoe'
|
2
|
+
require './lib/punkme/version.rb'
|
3
|
+
|
4
|
+
|
5
|
+
###
|
6
|
+
# hack/ quick fix for broken intuit_values - overwrite with dummy
|
7
|
+
# class Hoe
|
8
|
+
# def intuit_values( input ); end
|
9
|
+
# end
|
10
|
+
|
11
|
+
|
12
|
+
Hoe.spec 'punkme' do
|
13
|
+
|
14
|
+
self.version = Pixelart::Module::Punkme::VERSION
|
15
|
+
|
16
|
+
self.summary = 'punkme gem - generate your own (pixel) punk characters / heads - using your own skintone, eye color, hair & hair color, and much more'
|
17
|
+
self.description = summary
|
18
|
+
|
19
|
+
self.urls = { home: 'https://github.com/cryptopunksnotdead/punkart.sandbox' }
|
20
|
+
|
21
|
+
self.author = 'Gerald Bauer'
|
22
|
+
self.email = 'gerald.bauer@gmail.com'
|
23
|
+
|
24
|
+
# switch extension to .markdown for gihub formatting
|
25
|
+
self.readme_file = 'README.md'
|
26
|
+
self.history_file = 'CHANGELOG.md'
|
27
|
+
|
28
|
+
self.extra_deps = [
|
29
|
+
['punkmaker'],
|
30
|
+
['barbershop'],
|
31
|
+
['hairsalon'],
|
32
|
+
['punks'],
|
33
|
+
]
|
34
|
+
|
35
|
+
self.licenses = ['Public Domain']
|
36
|
+
|
37
|
+
self.spec_extras = {
|
38
|
+
required_ruby_version: '>= 2.3'
|
39
|
+
}
|
40
|
+
|
41
|
+
end
|
42
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
module Pixelart
|
3
|
+
module Module
|
4
|
+
module Punkme
|
5
|
+
|
6
|
+
MAJOR = 0
|
7
|
+
MINOR = 0
|
8
|
+
PATCH = 1
|
9
|
+
VERSION = [MAJOR,MINOR,PATCH].join('.')
|
10
|
+
|
11
|
+
def self.version
|
12
|
+
VERSION
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.banner
|
16
|
+
"punkme/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.root
|
20
|
+
File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
|
21
|
+
end
|
22
|
+
|
23
|
+
end # module Punkme
|
24
|
+
end # module Module
|
25
|
+
end # module Pixelart
|
data/lib/punkme.rb
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
## 3rd party
|
2
|
+
require 'punkmaker'
|
3
|
+
require 'barbershop' ## men's hair styles & more
|
4
|
+
require 'hairsalon' ## women's hair styles & more
|
5
|
+
|
6
|
+
require 'punks' ## more accessories
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## our own code
|
11
|
+
require_relative 'punkme/version' # note: let version always go first
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
module Punkme
|
16
|
+
|
17
|
+
SKINTONE_DARK = 0x713f1dff
|
18
|
+
|
19
|
+
|
20
|
+
class Image < Pixelart::Image
|
21
|
+
|
22
|
+
|
23
|
+
## change/rename generate to make - why? why not?
|
24
|
+
## or add/use alias - why? why not?
|
25
|
+
##
|
26
|
+
## names (attributes) MUST go first -
|
27
|
+
## check if possible after keyword args ???
|
28
|
+
def self.generate(
|
29
|
+
skintone: SKINTONE_DARK,
|
30
|
+
gender: 'm' )
|
31
|
+
|
32
|
+
skintone = Color.parse( skintone ) unless skintone.is_a?( Integer )
|
33
|
+
|
34
|
+
punk = if gender == 'm'
|
35
|
+
Punk::Human.make( skintone, gender: 'm' )
|
36
|
+
else ## assume f/female
|
37
|
+
Punk::Human.make( skintone, gender: 'f' )
|
38
|
+
end
|
39
|
+
## wrap as Punkme image (keeps metadata) - why? why not?
|
40
|
+
new( punk.image, gender: gender,
|
41
|
+
skintone: skintone )
|
42
|
+
end # method self.generate
|
43
|
+
|
44
|
+
|
45
|
+
attr_reader :gender,
|
46
|
+
:skintone,
|
47
|
+
:accessories
|
48
|
+
|
49
|
+
def initialize( img, gender:,
|
50
|
+
skintone: nil )
|
51
|
+
@gender = gender
|
52
|
+
@skintone = skintone
|
53
|
+
@accessories = []
|
54
|
+
super( nil, nil, img ) ### fix Image#initialze to accept "raw" image only
|
55
|
+
end
|
56
|
+
|
57
|
+
def add( *names )
|
58
|
+
punk = Image.new( Pixelart::Image.new( width, height ).image,
|
59
|
+
gender: @gender,
|
60
|
+
skintone: @skintone )
|
61
|
+
punk.compose!( self ) ## add ourselves (that is, base punk) here
|
62
|
+
|
63
|
+
## add (optional) attributes
|
64
|
+
names.each do |name|
|
65
|
+
img = if gender == 'm'
|
66
|
+
Punk::Sheet.find_by( name: name, gender: 'm', size: 'l' )
|
67
|
+
else
|
68
|
+
Punk::Sheet.find_by( name: name, gender: 'f', size: 's' )
|
69
|
+
end
|
70
|
+
punk.compose!( img )
|
71
|
+
@accessories << name
|
72
|
+
end
|
73
|
+
punk
|
74
|
+
end
|
75
|
+
end # class Image
|
76
|
+
end # module Punkme
|
77
|
+
|
78
|
+
|
79
|
+
###
|
80
|
+
# add some convience shortcuts / alternate spelling variants
|
81
|
+
PunkMe = Punkme
|
82
|
+
|
83
|
+
|
84
|
+
puts Pixelart::Module::Punkme.banner # say hello
|
metadata
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: punkme
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gerald Bauer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-08-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: punkmaker
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: barbershop
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: hairsalon
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: punks
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rdoc
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '4.0'
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '7'
|
79
|
+
type: :development
|
80
|
+
prerelease: false
|
81
|
+
version_requirements: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '4.0'
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '7'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: hoe
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '4.0'
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - "~>"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '4.0'
|
103
|
+
description: punkme gem - generate your own (pixel) punk characters / heads - using
|
104
|
+
your own skintone, eye color, hair & hair color, and much more
|
105
|
+
email: gerald.bauer@gmail.com
|
106
|
+
executables: []
|
107
|
+
extensions: []
|
108
|
+
extra_rdoc_files:
|
109
|
+
- CHANGELOG.md
|
110
|
+
- Manifest.txt
|
111
|
+
- README.md
|
112
|
+
files:
|
113
|
+
- CHANGELOG.md
|
114
|
+
- Manifest.txt
|
115
|
+
- README.md
|
116
|
+
- Rakefile
|
117
|
+
- lib/punkme.rb
|
118
|
+
- lib/punkme/version.rb
|
119
|
+
homepage: https://github.com/cryptopunksnotdead/punkart.sandbox
|
120
|
+
licenses:
|
121
|
+
- Public Domain
|
122
|
+
metadata: {}
|
123
|
+
post_install_message:
|
124
|
+
rdoc_options:
|
125
|
+
- "--main"
|
126
|
+
- README.md
|
127
|
+
require_paths:
|
128
|
+
- lib
|
129
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '2.3'
|
134
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
requirements: []
|
140
|
+
rubygems_version: 3.4.10
|
141
|
+
signing_key:
|
142
|
+
specification_version: 4
|
143
|
+
summary: punkme gem - generate your own (pixel) punk characters / heads - using your
|
144
|
+
own skintone, eye color, hair & hair color, and much more
|
145
|
+
test_files: []
|