goblins 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8934478ccb4e270df14b0e9d19823390d2bc3f36b0e531dbf5c263160a63980b
4
+ data.tar.gz: 4c46a7c81a5da2a9b44a6d5c375e32f7c5f9b5aad679113b77b42a11f2f60b5e
5
+ SHA512:
6
+ metadata.gz: 894506428229bf434f555607a98f5b93d0f5887eaf59905b631c852b3f5039f61eac21a5fca3b4ab70f4c909f613a16ad00a36e7955f9672a93373aa58996d85
7
+ data.tar.gz: 18307df6470dce85964c8b90a731cac1c61cb403acc0ae7fdf14f9298c0300255c501685c4598a7a616b52f92bd56846d7b98fefbde3a1a21d3b9218001ed624
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ### 0.0.1 / 2021-06-03
2
+
3
+ * Everything is new. First release
data/Manifest.txt ADDED
@@ -0,0 +1,6 @@
1
+ CHANGELOG.md
2
+ Manifest.txt
3
+ README.md
4
+ Rakefile
5
+ lib/goblins.rb
6
+ lib/goblins/version.rb
data/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # Goblins (Pixel Avatars)
2
+
3
+ goblins - generate your own 20×20 goblins (pixel avatars) images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more
4
+
5
+
6
+
7
+ * home :: [github.com/pixelartexchange/pixelart](https://github.com/pixelartexchange/pixelart)
8
+ * bugs :: [github.com/pixelartexchange/pixelart/issues](https://github.com/pixelartexchange/pixelart/issues)
9
+ * gem :: [rubygems.org/gems/goblins](https://rubygems.org/gems/goblins)
10
+ * rdoc :: [rubydoc.info/gems/goblins](http://rubydoc.info/gems/goblins)
11
+
12
+
13
+
14
+
15
+ ## Usage
16
+
17
+ Let's generate some super-rare never-before-seen
18
+ goblins (pixel avatars)...
19
+
20
+
21
+
22
+
23
+ ## Questions? Comments?
24
+
25
+ Post them on the [CryptoPunksDev reddit](https://old.reddit.com/r/CryptoPunksDev). Thanks.
data/Rakefile ADDED
@@ -0,0 +1,38 @@
1
+ require 'hoe'
2
+ require './lib/goblins/version.rb'
3
+
4
+ ###
5
+ # hack/ quick fix for broken intuit_values - overwrite with dummy
6
+ class Hoe
7
+ def intuit_values( input ); end
8
+ end
9
+
10
+
11
+
12
+ Hoe.spec 'goblins' do
13
+
14
+ self.version = Goblins::VERSION
15
+
16
+ self.summary = "goblins - generate your own 20×20 goblin (pixel avatar) images (off chain) from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger sizes and more"
17
+ self.description = summary
18
+
19
+ self.urls = { home: 'https://github.com/pixelartexchange/pixelart' }
20
+
21
+ self.author = 'Gerald Bauer'
22
+ self.email = 'wwwmake@googlegroups.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
+ ['pixelart', '>= 1.3.1'],
30
+ ]
31
+
32
+ self.licenses = ['Public Domain']
33
+
34
+ self.spec_extras = {
35
+ required_ruby_version: '>= 2.3'
36
+ }
37
+
38
+ end
@@ -0,0 +1,23 @@
1
+
2
+
3
+ module Goblins
4
+
5
+ MAJOR = 0
6
+ MINOR = 0
7
+ PATCH = 1
8
+ VERSION = [MAJOR,MINOR,PATCH].join('.')
9
+
10
+ def self.version
11
+ VERSION
12
+ end
13
+
14
+ def self.banner
15
+ "goblins/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
16
+ end
17
+
18
+ def self.root
19
+ File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
20
+ end
21
+
22
+ end # module Goblins
23
+
data/lib/goblins.rb ADDED
@@ -0,0 +1,65 @@
1
+ ## 3rd party
2
+ require 'pixelart/base'
3
+
4
+
5
+
6
+ ## our own code
7
+ require 'goblins/version' # note: let version always go first
8
+
9
+
10
+ ## forward define superclass for image
11
+ module Goblins
12
+ class Image < Pixelart::Image; end
13
+ end
14
+
15
+ ###
16
+ ## add convenience pre-configurated generatored with build-in spritesheet (see config)
17
+
18
+ module Goblins
19
+
20
+ def self.generator
21
+ @generator ||= Pixelart::Generator.new( "#{root}/config/spritesheet.png",
22
+ "#{root}/config/spritesheet.csv",
23
+ width: 20,
24
+ height: 20 )
25
+ end
26
+
27
+
28
+ class Image
29
+ def self.generate( *values, background: nil )
30
+ img = Goblins.generator.generate( *values, background: background )
31
+ ## note: unwrap inner image before passing on to c'tor (requires ChunkyPNG image for now)
32
+ new( 20, 20, img.image )
33
+ end # method Image.generate
34
+ end # class Image
35
+
36
+
37
+ class Spritesheet
38
+ ## note: for now class used for "namespace" only
39
+ def self.find_by( name: ) ## return archetype/attribute image by name
40
+ # note: pass along name as q (query string)
41
+ Goblins.generator.find( name )
42
+ end
43
+ end # class Spritesheet
44
+ ## add convenience (alternate spelling) alias - why? why not?
45
+ SpriteSheet = Spritesheet
46
+ Sheet = Spritesheet
47
+ Sprite = Spritesheet
48
+ end # module Goblins
49
+
50
+
51
+ ### add some convenience shortcuts
52
+ Goblinz = Goblins
53
+ ## add singular too -why? why not?
54
+ Goblin = Goblins
55
+
56
+
57
+
58
+
59
+ ###
60
+ # note: for convenience auto include Pixelart namespace!!! - why? why not?
61
+ include Pixelart
62
+
63
+
64
+
65
+ puts Goblins.banner # say hello
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: goblins
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: 2022-06-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pixelart
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.3.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 1.3.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '4.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '7'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '4.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '7'
47
+ - !ruby/object:Gem::Dependency
48
+ name: hoe
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.23'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.23'
61
+ description: goblins - generate your own 20×20 goblin (pixel avatar) images (off chain)
62
+ from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger
63
+ sizes and more
64
+ email: wwwmake@googlegroups.com
65
+ executables: []
66
+ extensions: []
67
+ extra_rdoc_files:
68
+ - CHANGELOG.md
69
+ - Manifest.txt
70
+ - README.md
71
+ files:
72
+ - CHANGELOG.md
73
+ - Manifest.txt
74
+ - README.md
75
+ - Rakefile
76
+ - lib/goblins.rb
77
+ - lib/goblins/version.rb
78
+ homepage: https://github.com/pixelartexchange/pixelart
79
+ licenses:
80
+ - Public Domain
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options:
84
+ - "--main"
85
+ - README.md
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '2.3'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubygems_version: 3.3.7
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: goblins - generate your own 20×20 goblin (pixel avatar) images (off chain)
103
+ from text attributes (via built-in spritesheet); incl. 2x/4x/8x zoom for bigger
104
+ sizes and more
105
+ test_files: []