cryptopunks-gui 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: 638f51a380dd6b45383886ed659fc66f4c1c1146cc077f6ac0730df1091a0f76
4
+ data.tar.gz: faebbbfbe3b248634efb2778c7d489263eea2eebc199537cd1fc6d952fac8a04
5
+ SHA512:
6
+ metadata.gz: 41603636b0e506f8c2d2fc72a94503238c2175b83ef09646bfbcfd1fb3b30af281cbe868521e0c76282758b9b0f2c5fd9592305d334411cbb626f42aa48d925a
7
+ data.tar.gz: 34b378495780b241c5a123da56e249c775286e6f5aed81a300b7f07b860fa2beb1dccb3964efad2b1e91294af28b671d45bbd24841fadd95df95d05dbbae1b87
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Change Log
2
+
3
+ ## 0.0.1
4
+
5
+ - Initial CryptoPunks GUI with support for punk index and zoom
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2021 Andy Maleh
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,96 @@
1
+ # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.1
2
+ ## Simplified Minting
3
+ [![Gem Version](https://badge.fury.io/rb/cryptopunks-gui.svg)](http://badge.fury.io/rb/cryptopunks-gui)
4
+
5
+ This is a Graphical User Interface for the famous [cryptopunks Ruby gem](https://github.com/cryptopunksnotdead/cryptopunks/tree/master/cryptopunks).
6
+
7
+ It automatically downloads `punks.png` from https://github.com/larvalabs/cryptopunks on first use.
8
+
9
+ Minted cryptopunks are stored at `~/.cryptopunks/`.
10
+
11
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot.png)
12
+
13
+ ## Prerequities
14
+
15
+ - [Tcl/Tk (ActiveTcl)](https://tkdocs.com/tutorial/install.html)
16
+ - [RVM](https://rvm.io/) (unless you are on Windows)
17
+ - [Ruby 3.0.2 compiled with RVM for Tk](https://rvm.io/integration/tk#tk) (unless you are on Windows for which Tcl/Tk instructions include installation of Ruby)
18
+
19
+ ## Setup
20
+
21
+ You can use CryptoPunks GUI via gem or via cloning repository.
22
+
23
+ ### Gem
24
+
25
+ Run:
26
+
27
+ ```
28
+ gem install cryptopunks-gui -v0.0.1
29
+ ```
30
+
31
+ Afterwards, run app via:
32
+
33
+ ```
34
+ cryptopunks-gui
35
+ ```
36
+
37
+ ### Repository
38
+
39
+ Clone repository:
40
+
41
+ ```
42
+ git clone https://github.com/AndyObtiva/cryptopunks-gui.git
43
+ ```
44
+
45
+ Enter directory:
46
+
47
+ ```
48
+ cd cryptopunks-gui
49
+ ```
50
+
51
+ Run:
52
+
53
+ ```
54
+ gem install bundler
55
+ bundle
56
+ ```
57
+
58
+ Afterwards, run app via:
59
+
60
+ ```
61
+ bin/cryptopunks-gui
62
+ ```
63
+
64
+ Alternatively, run app manually via:
65
+
66
+ ```
67
+ ruby app/cryptopunks_gui.rb
68
+ ```
69
+
70
+ ## TODO
71
+
72
+ [TODO.md](TODO.md)
73
+
74
+ ## Change Log
75
+
76
+ [CHANGELOG.md](CHANGELOG.md)
77
+
78
+ ## Contributing
79
+
80
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
81
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
82
+ * Fork the project.
83
+ * Start a feature/bugfix branch.
84
+ * Commit and push until you are happy with your contribution.
85
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
86
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
87
+
88
+ ## License
89
+
90
+ [MIT](LICENSE.txt)
91
+
92
+ Copyright (c) 2021 - Cryptopunks GUI by [Andy Maleh](https://github.com/AndyObtiva)
93
+
94
+ --
95
+
96
+ [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 />](https://github.com/AndyObtiva/glimmer) Built with [Glimmer DSL for Tk](https://github.com/AndyObtiva/glimmer-dsl-tk) (MRI Ruby Desktop Development GUI Library)
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,87 @@
1
+ require 'glimmer-dsl-tk'
2
+ require 'cryptopunks'
3
+ require 'fileutils'
4
+ require 'net/http'
5
+ require 'uri'
6
+ require 'glimmer/data_binding/observer'
7
+ require 'puts_debuggerer'
8
+
9
+ class CryptopunksGui
10
+ include Glimmer
11
+
12
+ attr_accessor :punk_index, :zoom
13
+
14
+ def initialize
15
+ @punk_directory = File.join(Dir.home, '.cryptopunks')
16
+ FileUtils.mkdir_p(@punk_directory)
17
+ @punk_file = File.join(@punk_directory, 'punks.png')
18
+ File.write(@punk_file, Net::HTTP.get(URI('https://raw.githubusercontent.com/larvalabs/cryptopunks/master/punks.png'))) unless File.exist?(@punk_file)
19
+ @punks = Punks::Image::Composite.read(@punk_file)
20
+ @zoom = 12
21
+
22
+ observer = Glimmer::DataBinding::Observer.proc do
23
+ generate_image
24
+ end
25
+ observer.observe(self, :punk_index)
26
+ observer.observe(self, :zoom)
27
+
28
+ create_gui
29
+ self.punk_index = 0
30
+ @root.open
31
+ end
32
+
33
+ def generate_image
34
+ image_location = File.join(@punk_directory, "punk-#{@punk_index}#{"x#{@zoom}" if @zoom.to_i > 1}.png")
35
+ puts "Writing punk image to #{image_location}"
36
+ selected_punk = @punks[@punk_index.to_i]
37
+ selected_punk = selected_punk.zoom(@zoom.to_i)
38
+ selected_punk.save(image_location)
39
+ @image_label.image = image_location
40
+ @message_entry.text = image_location
41
+ end
42
+
43
+ def create_gui
44
+ @root = root {
45
+ title 'CryptoPunks GUI'
46
+ iconphoto File.expand_path('../icons/cryptopunks-gui.png', __dir__)
47
+
48
+ frame {
49
+ label {
50
+ text 'Select Punk Index and Zoom To Mint Cryptopunk'
51
+ font weight: 'bold'
52
+ }
53
+
54
+ label {
55
+ text 'Punk Index:'
56
+ }
57
+ spinbox {
58
+ from 0
59
+ to @punks.size - 1
60
+ text <=> [self, :punk_index]
61
+ }
62
+
63
+ label {
64
+ text 'Zoom:'
65
+ }
66
+ spinbox {
67
+ from 1
68
+ to 72
69
+ text <=> [self, :zoom]
70
+ }
71
+
72
+ label {
73
+ text 'Output Location:'
74
+ }
75
+ @message_entry = entry {
76
+ readonly true
77
+ }
78
+
79
+ @image_label = label {
80
+ grid row_weight: 1
81
+ }
82
+ }
83
+ }
84
+ end
85
+ end
86
+
87
+ CryptopunksGui.new.launch
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../app/cryptopunks_gui.rb'
@@ -0,0 +1,61 @@
1
+ # Generated by juwelier
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: cryptopunks-gui 0.0.1 ruby app
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "cryptopunks-gui".freeze
9
+ s.version = "0.0.1"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["app".freeze]
13
+ s.authors = ["Andy Maleh".freeze]
14
+ s.date = "2021-10-25"
15
+ s.description = "Cryptopunks GUI for simplified minting built with Glimmer DSL for Tk (requires ActiveTcl to run cryptopunks-gui command)".freeze
16
+ s.email = "andy.am@gmail.com".freeze
17
+ s.executables = ["cryptopunks-gui".freeze]
18
+ s.extra_rdoc_files = [
19
+ "CHANGELOG.md",
20
+ "LICENSE.txt",
21
+ "README.md"
22
+ ]
23
+ s.files = [
24
+ "CHANGELOG.md",
25
+ "LICENSE.txt",
26
+ "README.md",
27
+ "VERSION",
28
+ "app/cryptopunks_gui.rb",
29
+ "bin/cryptopunks-gui",
30
+ "cryptopunks-gui.gemspec",
31
+ "icons/cryptopunks-gui.png"
32
+ ]
33
+ s.homepage = "http://github.com/AndyObtiva/cryptopunks-gui".freeze
34
+ s.licenses = ["MIT".freeze]
35
+ s.post_install_message = "To launch CryptoPunks GUI, run command: cryptopunks-gui".freeze
36
+ s.rubygems_version = "3.2.22".freeze
37
+ s.summary = "Cryptopunks GUI for Simplified Minting".freeze
38
+
39
+ if s.respond_to? :specification_version then
40
+ s.specification_version = 4
41
+ end
42
+
43
+ if s.respond_to? :add_runtime_dependency then
44
+ s.add_runtime_dependency(%q<glimmer-dsl-tk>.freeze, ["~> 0.0.30"])
45
+ s.add_runtime_dependency(%q<cryptopunks>.freeze, ["~> 2.0.1"])
46
+ s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
47
+ s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12"])
48
+ s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
49
+ s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
50
+ s.add_development_dependency(%q<rake-tui>.freeze, [">= 0"])
51
+ else
52
+ s.add_dependency(%q<glimmer-dsl-tk>.freeze, ["~> 0.0.30"])
53
+ s.add_dependency(%q<cryptopunks>.freeze, ["~> 2.0.1"])
54
+ s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
55
+ s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
56
+ s.add_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
57
+ s.add_dependency(%q<simplecov>.freeze, [">= 0"])
58
+ s.add_dependency(%q<rake-tui>.freeze, [">= 0"])
59
+ end
60
+ end
61
+
Binary file
metadata ADDED
@@ -0,0 +1,153 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cryptopunks-gui
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andy Maleh
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-10-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: glimmer-dsl-tk
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.30
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.30
27
+ - !ruby/object:Gem::Dependency
28
+ name: cryptopunks
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.0.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.5.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.5.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rdoc
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.12'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.12'
69
+ - !ruby/object:Gem::Dependency
70
+ name: juwelier
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 2.1.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 2.1.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake-tui
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Cryptopunks GUI for simplified minting built with Glimmer DSL for Tk
112
+ (requires ActiveTcl to run cryptopunks-gui command)
113
+ email: andy.am@gmail.com
114
+ executables:
115
+ - cryptopunks-gui
116
+ extensions: []
117
+ extra_rdoc_files:
118
+ - CHANGELOG.md
119
+ - LICENSE.txt
120
+ - README.md
121
+ files:
122
+ - CHANGELOG.md
123
+ - LICENSE.txt
124
+ - README.md
125
+ - VERSION
126
+ - app/cryptopunks_gui.rb
127
+ - bin/cryptopunks-gui
128
+ - cryptopunks-gui.gemspec
129
+ - icons/cryptopunks-gui.png
130
+ homepage: http://github.com/AndyObtiva/cryptopunks-gui
131
+ licenses:
132
+ - MIT
133
+ metadata: {}
134
+ post_install_message: 'To launch CryptoPunks GUI, run command: cryptopunks-gui'
135
+ rdoc_options: []
136
+ require_paths:
137
+ - app
138
+ required_ruby_version: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ required_rubygems_version: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ requirements: []
149
+ rubygems_version: 3.2.22
150
+ signing_key:
151
+ specification_version: 4
152
+ summary: Cryptopunks GUI for Simplified Minting
153
+ test_files: []