zui 0.0.8 → 0.0.9

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: ea2305d12a3ec2d53ad0edb93e6b87e3933b3ba84df4a694e08218598e9fc207
4
- data.tar.gz: 4dd9ab11ce4db9e34f29f22e1c3831f28e1efbba1f8d33015e093a504f05be08
3
+ metadata.gz: 42bdb62a57c863cdc40283e45b894097dc811f23f3d8d081ae05bc1e6619aece
4
+ data.tar.gz: 7da4bafa4b0efa12cc5c2b89f88210044154dec373e5f0b419f900dae471727d
5
5
  SHA512:
6
- metadata.gz: ed270c4a23c21f39f84659bdbdfcdc3ec20bf498b2199a19926d2a9105a95d696aec76802183a1fd5037878ee732043a81827a6e865991cf0861c8df9f7776f7
7
- data.tar.gz: 900bd4d8baca403284a9fabd3bc29c2bd263542cdd60184f2df9f1b117706d378bc0db5698628545abdbcbedbfd769ba4fe4b5947c27cda4c242a21c21b7adbe
6
+ metadata.gz: 5f8016e274b0cec1f2a8614327e7c7ab95762a836a7d55fe2a1e716d231fe6ef2c12a56f28de3df09b907471a6fe2156a42d25a897a80ab483f66337c3a47ad9
7
+ data.tar.gz: 033e22d2907f8c0fa66badd46eaec2f1636e1388c272c16210b0ede3dad7a561fc185b7372b2952ee14273c97e36ccbbe85b364b664481448175e438d13f1956
data/README.md CHANGED
@@ -188,7 +188,7 @@ uses a system Qt installation, or downloads an asset for a different platform. S
188
188
 
189
189
  ## Component catalog
190
190
 
191
- Zui 0.0.8 registers **241 built-in components**. Every entry has a named Ruby builder method,
191
+ Zui 0.0.9 registers **241 built-in components**. Every entry has a named Ruby builder method,
192
192
  property and event schema, native QML renderer, reactive patch support, and contract tests.
193
193
 
194
194
  | Category | Count | Representative components |
@@ -62,6 +62,7 @@ module Zui
62
62
  FileUtils.cp(@ruby, target)
63
63
  FileUtils.chmod(0o755, target) unless platform.windows?
64
64
  strip_binary(target)
65
+ sign_binary(target)
65
66
  File.join("bin", name).tr(File::SEPARATOR, "/")
66
67
  end
67
68
 
@@ -228,6 +229,17 @@ module Zui
228
229
  system(*arguments, out: File::NULL, err: File::NULL)
229
230
  end
230
231
 
232
+ def sign_binary(path)
233
+ return unless platform.macos?
234
+
235
+ codesign = find_command(%w[codesign])
236
+ raise ArgumentError, "codesign is required to build a macOS full runtime" unless codesign
237
+
238
+ signed = system(codesign, "--force", "--sign", "-", "--timestamp=none", path,
239
+ out: File::NULL, err: File::NULL)
240
+ raise ArgumentError, "failed to sign the bundled Ruby executable" unless signed
241
+ end
242
+
231
243
  def find_command(names)
232
244
  @environment.fetch("PATH", "").split(File::PATH_SEPARATOR).each do |directory|
233
245
  names.each do |name|
data/lib/zui/generator.rb CHANGED
@@ -4,9 +4,12 @@ require "fileutils"
4
4
 
5
5
  module Zui
6
6
  class Generator
7
+ DEFAULT_ASSETS = File.expand_path("generator_assets", __dir__)
8
+ RELEASE_ICONS = %w[ruby.png ruby.icns ruby.ico].freeze
9
+
7
10
  def initialize(path:, name: nil)
8
11
  @path = File.expand_path(path)
9
- @name = name || File.basename(@path).split(/[-_]/).map(&:capitalize).join(" ")
12
+ @name = display_name(name || File.basename(@path))
10
13
  end
11
14
 
12
15
  def create
@@ -17,8 +20,9 @@ module Zui
17
20
  File.write(File.join(@path, "Gemfile"), gemfile)
18
21
  File.write(File.join(@path, "components", "welcome.rb"), welcome_component)
19
22
  File.write(File.join(@path, "config.rb"), distribution_config)
20
- FileUtils.mkdir_p(File.join(@path, "assets"))
21
- File.write(File.join(@path, "assets", "README.md"), icon_readme)
23
+ assets = File.join(@path, "assets")
24
+ FileUtils.mkdir_p(assets)
25
+ RELEASE_ICONS.each { |name| FileUtils.cp(File.join(DEFAULT_ASSETS, name), assets) }
22
26
  File.write(File.join(@path, "README.md"), readme)
23
27
  @path
24
28
  rescue StandardError
@@ -86,7 +90,7 @@ module Zui
86
90
  zui doctor --fix # once for each Zui version
87
91
  zui run main.rb
88
92
  zui bundle
89
- zui bundle --dist # after adding the icons declared in config.rb
93
+ zui bundle --dist
90
94
  ```
91
95
  MARKDOWN
92
96
  end
@@ -97,27 +101,24 @@ module Zui
97
101
 
98
102
  Zui::Dist.configure do
99
103
  name #{@name.dump}
100
- identifier #{"com.example.#{slug_name}".dump}
104
+ identifier #{"dev.zui.#{slug_name}".dump}
101
105
  version "0.1.0"
102
- publisher "Your Name <you@example.com>"
106
+ publisher "Zui Project"
103
107
  description #{"A native #{@name} desktop application.".dump}
104
- license "Proprietary"
105
- icon linux: "assets/icon.png",
106
- macos: "assets/icon.icns",
107
- windows: "assets/icon.ico"
108
- categories "Utility"
108
+ license "MIT"
109
+ homepage "https://github.com/AdamMusa/zui"
110
+
111
+ icon linux: "assets/ruby.png",
112
+ macos: "assets/ruby.icns",
113
+ windows: "assets/ruby.ico"
114
+
115
+ categories "Utility", "Development"
109
116
  end
110
117
  RUBY
111
118
  end
112
119
 
113
- def icon_readme
114
- <<~MARKDOWN
115
- Add the release icons referenced by `config.rb` here:
116
-
117
- - `icon.png` for Linux
118
- - `icon.icns` for macOS
119
- - `icon.ico` for Windows
120
- MARKDOWN
120
+ def display_name(value)
121
+ value.to_s.split(/[-_\s]+/).map { |part| part[0].upcase + part[1..].to_s }.join(" ")
121
122
  end
122
123
 
123
124
  def constant_name
Binary file
Binary file
Binary file
data/lib/zui.rb CHANGED
@@ -28,7 +28,7 @@ require_relative "zui/distribution"
28
28
  require_relative "zui/dist_packager"
29
29
 
30
30
  module Zui
31
- VERSION = "0.0.8"
31
+ VERSION = "0.0.9"
32
32
  FRAMEWORK_ROOT = File.expand_path("..", __dir__)
33
33
 
34
34
  def self.app(&definition)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Moussa Ali
@@ -332,6 +332,9 @@ files:
332
332
  - lib/zui/distribution.rb
333
333
  - lib/zui/full_runtime.rb
334
334
  - lib/zui/generator.rb
335
+ - lib/zui/generator_assets/ruby.icns
336
+ - lib/zui/generator_assets/ruby.ico
337
+ - lib/zui/generator_assets/ruby.png
335
338
  - lib/zui/host.rb
336
339
  - lib/zui/lite_entry.rb
337
340
  - lib/zui/lite_runtime.rb
@@ -368,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
368
371
  - !ruby/object:Gem::Version
369
372
  version: '0'
370
373
  requirements: []
371
- rubygems_version: 4.0.18
374
+ rubygems_version: 4.0.11
372
375
  specification_version: 4
373
376
  summary: Build beautiful native desktop applications in pure Ruby
374
377
  test_files: []