cryptopunks-gui 0.0.5 → 0.0.6

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: d349e8c9967a50ce0c6af942f6cc3c3673f65a3daffcad18f9bd237ec70958d2
4
- data.tar.gz: 25ed4d8548aad51cc5dba533ed70edc42032e4850bddbbed3e659e2b1ebe9ca1
3
+ metadata.gz: 41332d4eb8f4427149280fd075b456ace5f882ec6acd9d794a052d66747b5ab4
4
+ data.tar.gz: b52e82c7789dd198ee4925db7b1f59cfc99fae0e11b7d1d577ffa1e7190ddd6c
5
5
  SHA512:
6
- metadata.gz: 4d06d0a8c6c1c4a8f65290e85f7d645a0b19206d58c53b7ed365827a4ba46a99d14db0a41d8bf774abb07e8bc7e43ec008233e3f8b241ccf305ecb341f5bacb0
7
- data.tar.gz: 4ba66061f49bb601ccf0bebb5e8712526ec081831dc3a792af57b967d769d4c75212184636114999396ae43d48632b2f2ed34d1566c43eb4a5fa8fb63fb236f5
6
+ metadata.gz: 50ead25c82393bfb068c411b17edd7a64bf5eb943fae3f74094ae25766e5600d07949f85f283c4869777645a2b05bc85efce4a3d3e0eb241c218e5d063cc0341
7
+ data.tar.gz: 4f18e99c50b31cb823ea68e8239c78a30d0ed6428b9199aa8300eaf747a503499a2c321dd552ff3d0f039c525babb6d9b832066da5ff200774160b65f8f742ef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.6
4
+
5
+ - Provide option to change output location
6
+ - Update default output location not to be a hidden location, switching `~/.cryptopunks` to `~/cryptopunks`
7
+ - Remember last selected output location upon app start
8
+ - Avoid hardcoding punk count in code (change 9999 to size of `@punks` array)
9
+
3
10
  ## 0.0.5
4
11
 
5
12
  - Led style spacing option
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.5
1
+ # <img src="https://raw.githubusercontent.com/AndyObtiva/cryptopunks-gui/master/icons/cryptopunks-gui.png" height=85 /> CryptoPunks GUI 0.0.6
2
2
  ## Simplified Minting
3
3
  [![Gem Version](https://badge.fury.io/rb/cryptopunks-gui.svg)](http://badge.fury.io/rb/cryptopunks-gui)
4
4
 
@@ -25,7 +25,7 @@ You can use CryptoPunks GUI via gem or via cloning repository.
25
25
  Run:
26
26
 
27
27
  ```
28
- gem install cryptopunks-gui -v0.0.5
28
+ gem install cryptopunks-gui -v0.0.6
29
29
  ```
30
30
 
31
31
  Afterwards, run app via:
@@ -125,7 +125,7 @@ Change style to get different punk looks.
125
125
 
126
126
  ### Mirror/Flip
127
127
 
128
- Check mirror and/or flip to apply punk transformation. Can combine with different palettes and styles.
128
+ Check mirror and/or flip to apply punk transformations. Can be combined with different palettes and styles.
129
129
 
130
130
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-no-mirror-no-flip.png)
131
131
 
@@ -137,6 +137,12 @@ Check mirror and/or flip to apply punk transformation. Can combine with differen
137
137
 
138
138
  ![Screenshot](/screenshots/cryptopunks-gui-screenshot-palette-false-style-led-mirror-flip.png)
139
139
 
140
+ ### Output Location
141
+
142
+ You may select a new output location by clicking on the `...` button.
143
+
144
+ ![Screenshot](/screenshots/cryptopunks-gui-screenshot-output-location.png)
145
+
140
146
  ## TODO
141
147
 
142
148
  [TODO.md](TODO.md)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -5,6 +5,7 @@ require 'fileutils'
5
5
  require 'net/http'
6
6
  require 'uri'
7
7
  require 'glimmer/data_binding/observer'
8
+ require 'yaml'
8
9
  require 'puts_debuggerer'
9
10
 
10
11
  class CryptopunksGui
@@ -17,6 +18,7 @@ class CryptopunksGui
17
18
 
18
19
  def initialize
19
20
  initialize_punks
21
+ load_config
20
22
  initialize_defaults
21
23
  observe_image_attribute_changes
22
24
  create_gui
@@ -33,13 +35,24 @@ class CryptopunksGui
33
35
  end
34
36
 
35
37
  def initialize_punks
36
- @punk_directory = File.join(Dir.home, '.cryptopunks')
38
+ @punk_directory = File.join(Dir.home, 'cryptopunks')
37
39
  FileUtils.mkdir_p(@punk_directory)
38
40
  @punk_file = File.join(@punk_directory, 'punks.png')
39
41
  File.write(@punk_file, Net::HTTP.get(URI('https://raw.githubusercontent.com/larvalabs/cryptopunks/master/punks.png'))) unless File.exist?(@punk_file)
40
42
  @punks = Punks::Image::Composite.read(@punk_file)
41
43
  end
42
44
 
45
+ def load_config
46
+ @punk_config_file = File.join(@punk_directory, 'cryptopunks.yml')
47
+ FileUtils.touch(@punk_config_file)
48
+ @punk_config = YAML.load(File.read(@punk_config_file)) || {punk_directory: @punk_directory}
49
+ @punk_directory = @punk_config[:punk_directory]
50
+ end
51
+
52
+ def save_config
53
+ File.write(@punk_config_file, YAML.dump(@punk_config))
54
+ end
55
+
43
56
  def initialize_defaults
44
57
  @zoom = 12
45
58
  @palette = PALETTES.first
@@ -65,7 +78,7 @@ class CryptopunksGui
65
78
  end
66
79
 
67
80
  def generate_image
68
- return if @punk_index.to_i > 9999
81
+ return if @punk_index.to_i > @punks.size
69
82
  image_location = File.join(@punk_directory, "punk-#{@punk_index}#{"x#{@zoom}" if @zoom.to_i > 1}#{"-#{@palette.underscore}" if @palette != PALETTES.first}#{"-#{@style.underscore}" if @style != STYLES.first}.png")
70
83
  puts "Writing punk image to #{image_location}"
71
84
  selected_punk = @punks[@punk_index.to_i]
@@ -87,7 +100,7 @@ class CryptopunksGui
87
100
  selected_punk = selected_punk.zoom(@zoom.to_i) if @style == STYLES.first
88
101
  selected_punk.save(image_location)
89
102
  @image_label.image = image_location
90
- @message_entry.text = image_location
103
+ @output_location_entry.text = image_location
91
104
  @previous_style = @style
92
105
  notify_observers(:zoom) if @zoom != @original_zoom
93
106
  end
@@ -98,11 +111,6 @@ class CryptopunksGui
98
111
  iconphoto File.expand_path('../icons/cryptopunks-gui.png', __dir__)
99
112
 
100
113
  frame {
101
- label {
102
- text 'Select Punk Index and Zoom To Mint Cryptopunk'
103
- font weight: 'bold'
104
- }
105
-
106
114
  label {
107
115
  text 'Punk Index:'
108
116
  }
@@ -174,8 +182,26 @@ class CryptopunksGui
174
182
  label {
175
183
  text 'Output Location:'
176
184
  }
177
- @message_entry = entry {
178
- readonly true
185
+ frame {
186
+ padding 0
187
+
188
+ @output_location_entry = entry {
189
+ grid row: 0, column: 0
190
+ readonly true
191
+ width 35
192
+ }
193
+ button {
194
+ grid row: 0, column: 1
195
+ text '...'
196
+ width 1.1
197
+
198
+ on('command') do
199
+ @punk_directory = choose_directory(parent: @root)
200
+ @punk_config[:punk_directory] = @punk_directory
201
+ save_config
202
+ generate_image
203
+ end
204
+ }
179
205
  }
180
206
 
181
207
  @image_label = label {
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: cryptopunks-gui 0.0.5 ruby app
5
+ # stub: cryptopunks-gui 0.0.6 ruby app
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "cryptopunks-gui".freeze
9
- s.version = "0.0.5"
9
+ s.version = "0.0.6"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["app".freeze]
13
13
  s.authors = ["Andy Maleh".freeze]
14
- s.date = "2021-10-25"
14
+ s.date = "2021-10-28"
15
15
  s.description = "CryptoPunks GUI for Simplified Minting - Built with Glimmer DSL for Tk (requires ActiveTcl to run cryptopunks-gui command)".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["cryptopunks-gui".freeze]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptopunks-gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-25 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer-dsl-tk