readymades 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43cb3cfcff230eb0fc32988e684471b6613fc079ea245f93a3f078eaa25ac799
4
- data.tar.gz: ddfd9dceede005734ba433a219c8d579428c3fb70c448d61cce7c254e9ee5fac
3
+ metadata.gz: db3b90d1d365d4b15221780eaddfc07e9a97911de8f86d022f8b01a39ed0816c
4
+ data.tar.gz: '08e2f8d4c9b772dc2210202615964787d5f797e4557df4b87def02a88e3d32ab'
5
5
  SHA512:
6
- metadata.gz: cf4159a05348707805bbb20e8a132ecfe6ed10aec6cea82b05639d4e793c2f9eeba57dfaa957aeb49812f48edad558498f0453460e62f5a7e2eb8fccae14aed4
7
- data.tar.gz: 1fd3c9432cf46dc07cf37d89df7dbb50aef16f59b1bbff2e15221288805fcddc48c1e6d7be9e64ff73b18e7b09674eedaa5f4b3bf2038cd01d5f97fb2fe5d292
6
+ metadata.gz: d7d5cbc45fb646bd1e5764541b28449c5c25e0c337fd40f9cdf07e92394bfb34218ab5b1680dc5f0bec55ebf1c347a8f0c5f07690f75ebcc4baa7b3dc43a07f5
7
+ data.tar.gz: c77e67c616cf6ec0d0f5b49aa1b2545ed7c4d7f52c27b64895305154d81ce54e571391843ed5504545908e209c9340106078e3ed351bbd979efa211270fcd9ac
data/Rakefile CHANGED
@@ -27,7 +27,7 @@ Hoe.spec 'readymades' do
27
27
 
28
28
  self.extra_deps = [
29
29
  ['cryptopunks'],
30
- ['backgrounds'],
30
+ ['backgrounds', '>= 0.2.0'],
31
31
  ]
32
32
 
33
33
  self.licenses = ['Public Domain']
@@ -4,7 +4,7 @@ module Readymades
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 1
7
- PATCH = 2
7
+ PATCH = 3
8
8
  VERSION = [MAJOR,MINOR,PATCH].join('.')
9
9
 
10
10
  def self.version
data/lib/readymades.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  ## 3rd party
2
2
  require 'cryptopunks' ### todo - add/change to cryptopunks/base !!!
3
- require 'backgrounds' ## note: incl. backgrounds for now
4
- ## (may get pulled in by cryptopunks later with update)
3
+ require 'backgrounds/base' ## note: incl. backgrounds for now
4
+ ## (may get pulled in by cryptopunks later with update)
5
5
 
6
6
 
7
7
  ## our own code
@@ -34,35 +34,38 @@ module Readymades
34
34
 
35
35
 
36
36
 
37
-
38
37
  class Image < Pixelart::Image
39
- def self.generate( *values, background: nil )
40
38
 
41
- name = values[0]
42
- attribute_names = values[1..-1]
39
+ def self.generate( *names )
40
+ name = names[0]
41
+ more_names = names[1..-1]
43
42
 
44
43
  base = Readymade::Sheet.find_by( name: name )
45
44
 
46
- img = Image.new( 24, 24 )
45
+ img = new( base.width, base.height ) ## make base a Readymade::Image copy
47
46
  img.compose!( base )
48
47
 
49
- attribute_names.each do |attribute_name|
50
- attribute = Punk::Sheet.find_by( name: attribute_name,
51
- gender: 'm' )
52
- img.compose!( attribute )
53
- end
54
-
55
- if background
56
- img = if background.is_a?( Array ) ## support multiple background
57
- img.background( *background )
58
- else
59
- img.background( background )
60
- end
61
- end
62
-
63
- ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
64
- new( 24, 24, img.image )
65
- end # method Image.generate
48
+ img.add!( *more_names )
49
+ img
50
+ end # method Image.generate
51
+
52
+
53
+ def add!( *names )
54
+ names.each do |name|
55
+ attribute = Punk::Sheet.find_by( name: name,
56
+ gender: 'm' )
57
+ compose!( attribute )
58
+ end
59
+ self
60
+ end
61
+
62
+ def add( *names ) ### todo/check: find a better name/alternate names - why? why not?
63
+ img = self.class.new( width, height ) ## make a Readymade::Image copy
64
+ img.compose!( self )
65
+
66
+ img.add!( *names)
67
+ img
68
+ end
66
69
  end # class Image
67
70
  end # module Readymades
68
71
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readymades
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
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-09 00:00:00.000000000 Z
11
+ date: 2022-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cryptopunks
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
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: '0'
40
+ version: 0.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement