wxruby3 0.9.7 → 0.9.8
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 +4 -4
- data/INSTALL.md +161 -42
- data/README.md +28 -22
- data/ext/mkrf_conf_ext.rb +68 -0
- data/lib/wx/core/secret_store.rb +38 -0
- data/lib/wx/doc/extra/02_lifecycles.md +4 -4
- data/lib/wx/doc/extra/14_config.md +1 -1
- data/lib/wx/doc/secret_store.rb +55 -0
- data/lib/wx/version.rb +1 -1
- data/lib/wx/wxruby/base.rb +3 -5
- data/lib/wx/wxruby/cmd/check.rb +182 -0
- data/lib/wx/wxruby/cmd/sampler.rb +1 -1
- data/lib/wx/wxruby/cmd/setup.rb +6 -3
- data/lib/wx/wxruby/cmd/test.rb +1 -1
- data/rakelib/configure.rb +60 -52
- data/rakelib/gem.rake +97 -67
- data/rakelib/gem.rb +293 -41
- data/rakelib/install.rb +3 -3
- data/rakelib/lib/config/{cygwin.rb → freebsd.rb} +1 -1
- data/rakelib/lib/config/linux.rb +3 -1
- data/rakelib/lib/config/macosx.rb +42 -11
- data/rakelib/lib/config/mingw.rb +2 -2
- data/rakelib/lib/config/pkgman/{base.rb → linux.rb} +36 -61
- data/rakelib/lib/config/pkgman/macosx.rb +17 -78
- data/rakelib/lib/config/unixish.rb +11 -1
- data/rakelib/lib/config/{netbsd.rb → unknown.rb} +3 -2
- data/rakelib/lib/config.rb +49 -29
- data/rakelib/lib/director/aui_manager.rb +1 -1
- data/rakelib/lib/director/dialog.rb +8 -0
- data/rakelib/lib/director/grid_ctrl.rb +2 -2
- data/rakelib/lib/director/richtext_composite_object.rb +2 -4
- data/rakelib/lib/director/secret_store.rb +117 -0
- data/rakelib/lib/director/tree_event.rb +2 -2
- data/rakelib/lib/generate/doc/secret_store.yaml +55 -0
- data/rakelib/lib/generate/doc.rb +1 -1
- data/rakelib/lib/specs/interfaces.rb +1 -0
- data/rakelib/lib/typemap/common.rb +10 -0
- data/rakelib/prepost.rake +8 -1
- data/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +4 -0
- data/samples/sampler/sample.rb +2 -0
- data/tests/lib/wxapp_runner.rb +1 -1
- data/tests/test_config.rb +7 -4
- data/tests/test_secret_store.rb +83 -0
- metadata +41 -22
- data/rakefile +0 -14
- data/rakelib/lib/config/pkgman/arch.rb +0 -53
- data/rakelib/lib/config/pkgman/debian.rb +0 -66
- data/rakelib/lib/config/pkgman/rhel.rb +0 -54
- data/rakelib/lib/config/pkgman/suse.rb +0 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c45580184f8f7ee466f9ec158bcb9f28702f6674ab42abc735f7235cc3482bd
|
4
|
+
data.tar.gz: f22f78e25c135b2583bfd60a7712c1084b8be8b3550d695e1acf65eac19b2223
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 401ff95651f766ac947eba8a1a58a77be718182a473549f49eeee5b361a019051da88f529aec58bfe88dd46b5104dbae64a96eba5fa14d6a3e446fcece35c6f0
|
7
|
+
data.tar.gz: fe9f01627e61ddc1ff5c18936dbf71f1cf09fd7d6ce372b6cc25062051a3807b3e6a0fe59179753ce0a1f9577f856eefca58c0564d0860a6e607d14bba428606
|
data/INSTALL.md
CHANGED
@@ -8,25 +8,26 @@
|
|
8
8
|
|
9
9
|
The wxRuby3 gem provides a **worry-free** installation for all supported platforms.
|
10
10
|
|
11
|
-
The default gem installation
|
11
|
+
The default gem installation command
|
12
|
+
|
12
13
|
```shell
|
13
14
|
gem install wxruby3
|
14
15
|
```
|
15
16
|
|
16
|
-
|
17
|
+
and the setup command
|
17
18
|
|
18
19
|
```shell
|
19
|
-
|
20
|
+
wxruby setup
|
20
21
|
```
|
21
|
-
|
22
|
-
should always result in a successfully installed wxRuby3 version
|
23
|
-
Just follow the (very few and in some cases none) prompts at the start of the setup procedure and sit back and relax.
|
22
|
+
|
23
|
+
for installations without prebuilt binary packages should always result in a successfully installed wxRuby3 version.
|
24
24
|
|
25
25
|
> **NOTE**<br>
|
26
26
|
> Currently installing the wxRuby3 gem for the system supplied Ruby on MacOSX systems does not work.<br>
|
27
27
|
> The user is therefor required to install a Ruby interpreter using either [MacPorts](https://www.macports.org/) (both
|
28
28
|
> privileged and user installations are supported) or [Homebrew](https://brew.sh/) or Ruby installers/version managers
|
29
|
-
> like [ruby-install](https://github.com/postmodern/ruby-install) or [RVM](https://rvm.io) (only user installations
|
29
|
+
> like [ruby-install](https://github.com/postmodern/ruby-install) or [RVM](https://rvm.io) (only user installations
|
30
|
+
> supported) .
|
30
31
|
|
31
32
|
[Below](INSTALL.md#installing-software-requirements) more details regarding the software requirements for wxRuby3, the
|
32
33
|
setup procedure and various options to tweak and customize the installation (including platform specific details for
|
@@ -36,16 +37,65 @@ Linux, Windows and MacOSX) are described.
|
|
36
37
|
|
37
38
|
Installing the wxRuby3 gem will also install the bundled `wxruby` CLI binary.
|
38
39
|
|
39
|
-
For source gem installations the CLI will initially only provide the
|
40
|
+
For source gem installations the CLI will initially only provide the `check` and `setup` commands.
|
40
41
|
|
41
|
-
For
|
42
|
+
For finalized installations (either from binary packages or source builds) the *setup* command is replaced by other
|
42
43
|
utility commands providing the ability to run the bundled regression tests and access (run or copy) the bundled examples.<br>
|
43
44
|
Run the following command to see the available options at any time:
|
44
45
|
|
45
46
|
```shell
|
46
|
-
wxruby
|
47
|
+
wxruby -h
|
47
48
|
```
|
48
49
|
|
50
|
+
## Binary packages
|
51
|
+
|
52
|
+
The wxRuby3 gem installation process will by default attempt to match the current platform to any standard available
|
53
|
+
binary packages and if found install the matched package.
|
54
|
+
|
55
|
+
Binary packages are archives (custom format) containing prebuilt (extension) library artifacts for a single specific
|
56
|
+
platform. Any such platform is identified by:
|
57
|
+
|
58
|
+
- CPU architecture (x86_64, ARM64, etc.)
|
59
|
+
- Operating system type (linux, darwin, windows, etc.)
|
60
|
+
- OS distribution and release number (except for windows)
|
61
|
+
- Ruby ABI version (i.e. {major}.{minor})
|
62
|
+
|
63
|
+
The standard available binary packages provide both the wxRuby3 extension libraries as well as the embedded wxWidgets
|
64
|
+
libraries the extension libraries were built for.<br>
|
65
|
+
This is however not mandatory. User created binary packages can be built for separately installed (either distribution
|
66
|
+
or user provided) wxWidgets libraries.
|
67
|
+
|
68
|
+
### Standard packages
|
69
|
+
|
70
|
+
The standard release artifacts at [Github](https://github.com/mcorino/wxRuby3/releases) provide a selection of binary
|
71
|
+
packages for all supported OS platforms which are automatically built and uploaded for every release.<br>
|
72
|
+
The following tables lists the packages provided by the current wxRuby3 release process:
|
73
|
+
|
74
|
+
| OS | Distributions | Architectures | Rubies |
|
75
|
+
|---------|-------------------------------|-------------------------|----------------------------------------------------|
|
76
|
+
| Linux | OpenSuSE Leap (latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
|
77
|
+
| Linux | Fedora (latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
|
78
|
+
| Linux | Debian (latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
|
79
|
+
| Linux | Ubuntu (latest stable) | x86_64 <b>and</b> ARM64 | Distro provided Ruby <b>and</b> Latest stable Ruby |
|
80
|
+
| Windows | NA | x86_64 | Latest stable Ruby |
|
81
|
+
| OSX | MacOSX 12 | x86_64 <b>and</b> ARM64 | Latest stable Ruby |
|
82
|
+
| OSX | MacOSX 13 | x86_64 <b>and</b> ARM64 | Latest stable Ruby |
|
83
|
+
| OSX | MacOSX 14 | ARM64 | Latest stable Ruby |
|
84
|
+
|
85
|
+
### User created packages
|
86
|
+
|
87
|
+
Users can create their own wxRuby3 binary packages by building from source ([see here](#building-from-source)) and after
|
88
|
+
successfully having built the wxWidgets extension libraries execute the `rake binpkg` command.<br>
|
89
|
+
This creates two files in the `pkg` folder with names like<br>
|
90
|
+
`wxruby3_{distribution}_ruby{abi version}_v{wxruby version}_{os}_{arch}.pkg`<br>
|
91
|
+
and<br>
|
92
|
+
`wxruby3_{distribution}_ruby{abi version}_v{wxruby version}_{os}_{arch}.sha`<br>
|
93
|
+
where the `.pkg` file is the actual binary archive and the `.sha` file is the associated SHA256 digest signature of the
|
94
|
+
archive contents.
|
95
|
+
|
96
|
+
Both files are required for installation and should be located at the same path (either local path or http(s) url).<br>
|
97
|
+
[See here](#the-package-option) for information on how to use user created binary packages with the wxRuby3 gem installation process.
|
98
|
+
|
49
99
|
## Software requirements for wxRuby3
|
50
100
|
|
51
101
|
The software requirements for setting up a wxRuby3 runtime environment are:
|
@@ -90,63 +140,129 @@ wxRuby3 can be built and installed for 3 different types of wxWidgets installati
|
|
90
140
|
In this case the libraries and development files are most likely not found in standard locations and the wxRuby3
|
91
141
|
installation procedure will require specific options to have these locations provided.
|
92
142
|
3. An 'embedded' installation of wxWidgets setup by the wxRuby3 installation procedure.<br>
|
93
|
-
This is the default when
|
94
|
-
option has been provided explicitly specifying to install an
|
143
|
+
This is the default when using a standard binary package or when installing from source and the setup procedure does
|
144
|
+
not detect a (compatible!) system installation or if an option has been provided explicitly specifying to install an
|
145
|
+
embedded wxWidgets version.
|
95
146
|
|
96
147
|
Please note that in case of option **2** the user is responsible to make sure the wxWidgets shared libraries can be
|
97
148
|
found by the system's dynamic loader at runtime.
|
98
149
|
|
99
|
-
As described with option **3** a wxWidgets system installation must be compatible (>= version 3.2) to be selected
|
100
|
-
the installed version does not meet this requirement it is ignored as if not installed.
|
150
|
+
As described with option **3** a wxWidgets system installation must be compatible (>= version 3.2) to be selected for
|
151
|
+
source installation. In case the installed version does not meet this requirement it is ignored as if not installed.
|
101
152
|
|
102
153
|
For more information on how to install wxWidgets see the [Installing software requirements](INSTALL.md#installing-software-requirements) section below.
|
103
154
|
|
104
155
|
## wxRuby3 gem installation details
|
105
156
|
|
106
|
-
The wxRuby3 project provides
|
157
|
+
The wxRuby3 project provides a gem on [RubyGems](https://rubygems.org) which can be installed with the
|
107
158
|
standard `gem install` command line this:
|
108
159
|
|
109
160
|
```shell
|
110
161
|
gem install wxruby3
|
111
162
|
```
|
112
163
|
|
113
|
-
|
114
|
-
|
115
|
-
On Windows systems a prebuilt binary gem is available for the latest stable release(s) of [RubyInstaller](https://rubyinstaller.org)
|
116
|
-
installed rubies that will be installed by default if installing for that platform (including an embedded, latest
|
117
|
-
stable version, wxWidgets installation).<br>
|
118
|
-
Alternatively the source gem can be installed on Windows by installing with an explicit platform specification like this:
|
164
|
+
Alternatively the gem can be downloaded from the [Github release assets](https://github.com/mcorino/wxRuby3/releases) and
|
165
|
+
stored locally. This local gem can than be installed like this:
|
119
166
|
|
120
167
|
```shell
|
121
|
-
gem install wxruby3
|
168
|
+
gem install /path/to/local/wxruby3.gem
|
122
169
|
```
|
123
170
|
|
124
|
-
|
171
|
+
This default installation command will allow the wxRuby3 installation process to scan available standard binary packages
|
172
|
+
([see here](#standard-packages)) for a match to the platform being installed on and install any matched package or revert
|
173
|
+
to a source install if none matched.<br>
|
174
|
+
This command will therefor succeed if:
|
175
|
+
- a matching binary package could be successfully downloaded and installed;
|
176
|
+
- the installation reverted to source install.
|
177
|
+
|
178
|
+
This command only fails when:
|
179
|
+
- a matching digest signature for the downloaded binary package could not be downloaded;
|
180
|
+
- the digest signature did not match the downloaded package contents.
|
181
|
+
|
182
|
+
> The result of successfully installing the gem on a Linux platform should be something like this:
|
125
183
|
> ```
|
126
184
|
> $ gem install wxruby3
|
185
|
+
> Building native extensions. This could take a while...
|
127
186
|
>
|
128
|
-
> The wxRuby3 Gem has been successfully installed.
|
129
|
-
> Before being able to use wxRuby3 you need to run the post-install setup process
|
130
|
-
> by executing the command 'wxruby setup'.
|
187
|
+
> The wxRuby3 Gem has been successfully installed including the 'wxruby' utility.
|
131
188
|
>
|
132
|
-
>
|
133
|
-
>
|
134
|
-
>
|
135
|
-
>
|
136
|
-
>
|
137
|
-
>
|
189
|
+
> In case no suitable binary release package was available for your platform you
|
190
|
+
> will need to run the post-install setup process by executing:
|
191
|
+
>
|
192
|
+
> $ wxruby setup
|
193
|
+
>
|
194
|
+
> To check whether wxRuby3 is ready to run or not you can at any time execute the
|
195
|
+
> following command:
|
196
|
+
>
|
197
|
+
> $ wxruby check
|
198
|
+
>
|
199
|
+
> Run 'wxruby check -h' for more information.
|
200
|
+
>
|
201
|
+
> When the wxRuby3 setup has been fully completed you can start using wxRuby3.
|
202
|
+
>
|
203
|
+
> You can run the regression tests to verify the installation by executing:
|
204
|
+
>
|
205
|
+
> $ wxruby test
|
206
|
+
>
|
207
|
+
> The wxRuby3 sample explorer can be run by executing:
|
208
|
+
>
|
209
|
+
> $ wxruby sampler
|
210
|
+
>
|
211
|
+
> Have fun using wxRuby3.
|
212
|
+
>
|
213
|
+
> Run 'wxruby -h' to see information on the available commands.
|
214
|
+
>
|
215
|
+
> Successfully installed wxruby3-0.9.8
|
216
|
+
> Parsing documentation for wxruby3-0.9.8
|
217
|
+
> Installing ri documentation for wxruby3-0.9.8
|
218
|
+
> Done installing documentation for wxruby3 after 2 seconds
|
138
219
|
> 1 gem installed
|
139
220
|
> ```
|
140
221
|
|
141
|
-
|
142
|
-
|
222
|
+
### Gem installation options
|
223
|
+
|
224
|
+
Two options are available to control the wxRuby3 gem installation process.
|
225
|
+
|
226
|
+
#### The `prebuilt` option
|
227
|
+
|
228
|
+
The `prebuilt=none|only` option can be used to either prevent binary package matching and installation (`prebuilt=none`)
|
229
|
+
or make binary package installation mandatory (`prebuilt=only`).
|
230
|
+
|
231
|
+
The following command therefor forces a wxRuby3 source installation and will never fail:
|
232
|
+
|
233
|
+
```shell
|
234
|
+
gem install wxruby3 -- prebuilt=none
|
235
|
+
```
|
236
|
+
|
237
|
+
And the following command will force binary package installation and fails if no matching package could be installed:
|
238
|
+
|
239
|
+
```shell
|
240
|
+
gem install wxruby3 -- prebuilt=only
|
241
|
+
```
|
242
|
+
|
243
|
+
#### The `package` option
|
244
|
+
|
245
|
+
The `package=URL` option can be used to explicitly specify a binary package to install. This option implies `prebuilt=only`.
|
246
|
+
No package matching will be performed so mismatched binary packages will cause wxRuby3 to fail after installation.<br>
|
247
|
+
The `URL` can be specified as:
|
248
|
+
- an <b>absolute</b> local path like `/path/to/binary/package.pkg`
|
249
|
+
- an absolute `file://` URI like `file:///path/to/binary/package.pkg`
|
250
|
+
- an `http://` or `https://` URL
|
251
|
+
|
252
|
+
In all cases the associated `.sha` file <b>must</b> be located at the same path as the package file itself. If not the
|
253
|
+
installation will fail as well as when the signature does not match the digest of the package contents.
|
254
|
+
|
255
|
+
### Gem source setup
|
256
|
+
|
257
|
+
As said a gem-based source installation requires an additional command is to build the actual wxRuby3 extension libraries
|
258
|
+
for the platform installing on which is a wxRuby3 CLI command installed by the gem:
|
143
259
|
|
144
260
|
```shell
|
145
261
|
wxruby setup
|
146
262
|
```
|
147
263
|
|
148
264
|
The wxRuby3 CLI `wxruby` is installed by all wxRuby3 gems. In case of the source gem initially the CLI will provide only
|
149
|
-
|
265
|
+
the commands `wxruby setup` (to finish wxRuby3 extension installation) and `wxruby check`.
|
150
266
|
|
151
267
|
For most (user) installations the default setup command as shown above will suffice nicely. In this case the setup
|
152
268
|
(or installation) procedure will analyze the system to see if it meets the software requirements described above and if not
|
@@ -184,7 +300,7 @@ The initial message shown (between lines starting with '---' ) is indicative of
|
|
184
300
|
on options passed to the setup command.<br>
|
185
301
|
Building the wxRuby3 native extensions and generating reference documentation will always happen.
|
186
302
|
|
187
|
-
|
303
|
+
#### Disable prompting for automatic install
|
188
304
|
|
189
305
|
To prevent having the setup procedure asking consent the setup procedure can be started with the `--autoinstall` option
|
190
306
|
like this:
|
@@ -195,7 +311,7 @@ wxruby setup --autoinstall
|
|
195
311
|
|
196
312
|
Note that on Linux that may still present a prompt in case the `sudo` command requires a password.
|
197
313
|
|
198
|
-
|
314
|
+
#### Prevent automatic installation of software requirements
|
199
315
|
|
200
316
|
To prevent the setup procedure from considering to automatically install (with or without prompting) any missing software
|
201
317
|
requirements the setup procedure can be started with the `--no-autoinstall` option like this:
|
@@ -207,7 +323,7 @@ wxruby setup --no-autoinstall
|
|
207
323
|
The setup procedure will still analyze the system for available software requirements and if it finds any missing it
|
208
324
|
will end the procedure and show a message of what it found missing.
|
209
325
|
|
210
|
-
|
326
|
+
#### Force embedded wxWidgets installation
|
211
327
|
|
212
328
|
To prevent the setup procedure of using any system installed wxWidgets version the setup procedure can be started with
|
213
329
|
the `--with-wxwin` option like this:
|
@@ -218,7 +334,7 @@ wxruby setup --with-wxwin
|
|
218
334
|
|
219
335
|
This will force the setup procedure to build and install an embedded wxWidgets version for wxRuby3.
|
220
336
|
|
221
|
-
|
337
|
+
#### Setup with user installed wxWidgets
|
222
338
|
|
223
339
|
In case of a (custom) user installation of wxWidgets the `--wxwin` (and optionally `--wxxml`) option(s) can be used to
|
224
340
|
start the setup procedure to build for this installation like this:
|
@@ -241,7 +357,7 @@ wxruby setup --wxwin=/my/custom/wxWidgets --wxxml=/my/alternate/wxWidgets/xml
|
|
241
357
|
> responsible for making sure the wxRuby3 extension library can find the wxWidgets libraries at runtime (normally this
|
242
358
|
> requires updating the standard shared library search path for the platform).
|
243
359
|
|
244
|
-
|
360
|
+
#### Setup with customized tool paths
|
245
361
|
|
246
362
|
If for whatever reason the required development tools `doxygen`, `swig` and/or `git` have been installed in a location
|
247
363
|
not in the standard executable search path the full path to these tools can be passed on the setup procedure using the
|
@@ -251,7 +367,7 @@ not in the standard executable search path the full path to these tools can be p
|
|
251
367
|
wxruby setup --doxygen=/my/path/to/doxygen
|
252
368
|
```
|
253
369
|
|
254
|
-
|
370
|
+
#### Redirect log to customized path
|
255
371
|
|
256
372
|
The setup procedure will log full build results to a file setup.log at the location where the gem contents is stored.
|
257
373
|
If the setup fails the error message will display the log file location and by default if the setup succeeds the log
|
@@ -364,7 +480,7 @@ Checkout the wxRuby3 sources from [GitHub](https://github.com/mcorino/wxRuby3) o
|
|
364
480
|
Requirements are the same as for installing the source gem. Gem dependencies are listed in the Gemfile in the root
|
365
481
|
of the wxRuby3 tree and should be installed by executing `bundle install`.<br>
|
366
482
|
To be able to generate HTML documentation the optional `:documentation` group should be included.<br>
|
367
|
-
To be able to run the Rake memory check task the
|
483
|
+
To be able to run the Rake memory check task the optional `:develop` group should be included.
|
368
484
|
|
369
485
|
The wxRuby3 project provides a Rake based build system. Call `rake help` to get an overview of the available commands.
|
370
486
|
As mentioned there the `rake configure` command is required as the very first command. Call `rake configure[--help]` to
|
@@ -376,4 +492,7 @@ commands are executed using parallel task execution by default.
|
|
376
492
|
|
377
493
|
When the build has finished without errors the regression tests can be run by calling `rake test`.
|
378
494
|
|
495
|
+
After successfully building the wxRuby3 extension libraries (and possibly embedded wxWidgets libraries) a binary package
|
496
|
+
can be created by call `rake binpkg`.
|
497
|
+
|
379
498
|
For more details concerning the wxRuby3 development strategy and build options see [here](TODO).
|
data/README.md
CHANGED
@@ -96,11 +96,11 @@ of these products.
|
|
96
96
|
|
97
97
|
Currently the following are fully supported:
|
98
98
|
|
99
|
-
| Platform
|
100
|
-
|
101
|
-
| Windows 10 (tested)<br>(most likely also Windows 11)
|
102
|
-
| Linux (tested; all major
|
103
|
-
| MacOS >= 10.10 using Cocoa (tested on
|
99
|
+
| Platform | Ruby version(s) | wxWidgets version(s) |
|
100
|
+
|------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|----------------------|
|
101
|
+
| Windows 10 (tested)<br>(most likely also Windows 11) | Ruby >= 2.5<br>(RubyInstaller MSYS2-DevKit) | wxWidgets >= 3.2 |
|
102
|
+
| Linux (tested; all major AMD64 and ARM64 distributions: Ubuntu, Debian, Fedora, OpenSuSE and ArchLinux)<br>(most likely also i686) | Ruby >= 2.5 | wxWidgets >= 3.2 |
|
103
|
+
| MacOS >= 10.10 using Cocoa (tested on AMD64 and ARM64 M1/M2 Chip) | Ruby >= 2.5 (MacPorts, Homebrew, ruby-install, RVM) | wxWidgets >= 3.2 |
|
104
104
|
|
105
105
|
Support for other platforms is not being actively developed at present,
|
106
106
|
but patches are welcome. It is likely to be much simpler to get wxRuby
|
@@ -109,43 +109,49 @@ on legacy systems (eg Windows 98, Mac OS 9).
|
|
109
109
|
|
110
110
|
### How can I install wxRuby3?
|
111
111
|
|
112
|
-
wxRuby3 is distributed as a Ruby gem on [RubyGems](https://rubygems.org)
|
113
|
-
|
114
|
-
latest stable Ruby release at the time of publishing) which includes an embedded wxWidgets installation (also latest
|
115
|
-
stable version).
|
112
|
+
wxRuby3 is distributed as a Ruby gem on [RubyGems](https://rubygems.org). This gem can also be downloaded from the release
|
113
|
+
assets on [Github](https://github.com/mcorino/wxRuby3/releases).
|
116
114
|
|
117
115
|
The wxRuby3 gem provides a **worry-free** installation procedure for all supported platforms.
|
118
116
|
|
119
|
-
Installing the
|
120
|
-
|
121
|
-
version of the Ruby interpreter. So for this platform the following command is all it takes to get up and running:
|
117
|
+
Installing the gem requires no additional installation steps and/or additional software to be installed except for a
|
118
|
+
supported version of the Ruby interpreter. So the following command is all it takes to install:
|
122
119
|
|
123
120
|
```shell
|
124
121
|
gem install wxruby3
|
125
122
|
```
|
126
123
|
|
127
|
-
|
128
|
-
|
129
|
-
|
124
|
+
The wxRuby3 installation procedure will check the availability of a, prebuilt, binary package matching the platform
|
125
|
+
being installed on and if found will download and install that package resulting in a ready-to-run wxRuby3 installation.<br>
|
126
|
+
If no matching package is found the installation reverts to a source installation which will require an additional setup
|
127
|
+
step to finalize the wxRuby3 installation by executing the following command:
|
130
128
|
|
131
129
|
```shell
|
132
|
-
|
130
|
+
wxruby setup
|
133
131
|
```
|
134
132
|
|
135
|
-
|
136
|
-
|
137
|
-
requirements and build the wxRuby3 extension libraries (including a embedded copy of wxWidgets if necessary). It may
|
138
|
-
quite a while depending on your system but you can mostly sit back and relax.
|
133
|
+
This last command is a fully automated setup procedure provided by the wxRuby3 **CLI** installed with the gem. This
|
134
|
+
procedure (by default) will analyze your system and install (after asking your consent) any missing software
|
135
|
+
requirements and build the wxRuby3 extension libraries (including a embedded copy of wxWidgets if necessary). It may
|
136
|
+
take quite a while depending on your system but you can mostly sit back and relax.
|
139
137
|
|
140
138
|
> **NOTE**<br>
|
141
139
|
> A source based installation requires the availability of the Ruby development headers. User installed Rubies in most cases
|
142
140
|
> will already include those but (especially on Linux) system installed Rubies may require having an additional '-dev/-devel'
|
143
|
-
> package installed
|
141
|
+
> package installed (although actually you may already have needed those to install the gems that the wxRuby3 gem depends
|
142
|
+
> on like the nokogiri gem).
|
143
|
+
|
144
|
+
The wxRuby3 CLI also provides a 'check' command with which the runtime status of the wxRuby3 installation can be checked
|
145
|
+
at any time. By default running `wxruby check` will display a message reporting the runtime and suggestions on finalizing
|
146
|
+
the installation if not finalized yet. No message is displayed if wxRuby3 is ready to run. Run `wxruby check -h` for
|
147
|
+
details concerning this command.
|
148
|
+
|
149
|
+
A selection of (prebuilt) binary packages is provided as release assets on [Github](https://github.com/mcorino/wxRuby3/releases).
|
150
|
+
See the [INSTALL](INSTALL.md#binary-packages) document for more details.
|
144
151
|
|
145
152
|
This install procedure can of course be tweaked and customized with commandline arguments.
|
146
153
|
See the [INSTALL](INSTALL.md) document for more details.
|
147
154
|
|
148
|
-
|
149
155
|
### Where can I ask a question, or report a bug?
|
150
156
|
|
151
157
|
Use GitHUb Issues.
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
2
|
+
#
|
3
|
+
# This software is released under the MIT license.
|
4
|
+
|
5
|
+
###
|
6
|
+
# wxRuby3 extension configuration file for gems
|
7
|
+
###
|
8
|
+
|
9
|
+
OPTIONS = {
|
10
|
+
}
|
11
|
+
|
12
|
+
until ARGV.empty?
|
13
|
+
switch = ARGV.shift
|
14
|
+
case switch
|
15
|
+
when /^prebuilt=(none|only)$/
|
16
|
+
OPTIONS[:prebuilt] = $1 == 'only'
|
17
|
+
when /^package=(.+)$/
|
18
|
+
OPTIONS[:package] = $1
|
19
|
+
when 'help'
|
20
|
+
puts <<~__INFO_TXT
|
21
|
+
wxRuby3 extension build script
|
22
|
+
|
23
|
+
Usage: gem install wxruby3 -- help OR gem install wxruby3 [-- options [...]]
|
24
|
+
|
25
|
+
options:
|
26
|
+
|
27
|
+
prebuilt=OPT Specifies to either require (OPT == 'only') or avoid (OPT == 'none') installing prebuilt
|
28
|
+
binary packages. If not specified installing a prebuilt package will be attempted reverting
|
29
|
+
to source install if none found.
|
30
|
+
|
31
|
+
package=URL Specifies the http(s) url or absolute path to the prebuilt binary package to install.
|
32
|
+
Implies 'prebuilt=only'.
|
33
|
+
|
34
|
+
help Show this message.
|
35
|
+
__INFO_TXT
|
36
|
+
puts
|
37
|
+
exit(1)
|
38
|
+
else
|
39
|
+
$stderr.puts "ERROR: Invalid option [#{switch}] for wxRuby3 extension build script."
|
40
|
+
exit(1)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
task_args = ''
|
45
|
+
unless OPTIONS[:prebuilt].nil?
|
46
|
+
task_args << "'#{(OPTIONS[:prebuilt] ? '--prebuilt' : '--no-prebuilt')}'"
|
47
|
+
end
|
48
|
+
if OPTIONS[:package]
|
49
|
+
task_args << ', ' unless task_args.empty?
|
50
|
+
pkg = RUBY_PLATFORM =~ /mingw/ ? OPTIONS[:package].gsub('\\', '/') : OPTIONS[:package] # make sure the path is URI compatible
|
51
|
+
task_args << "'--package', " << "'#{pkg}'"
|
52
|
+
end
|
53
|
+
|
54
|
+
# generate new rakefile with appropriate default task (calls actual task in rakelib)
|
55
|
+
File.open('../Rakefile', 'w') do |f|
|
56
|
+
f.puts <<EOF__
|
57
|
+
###
|
58
|
+
# wxRuby3 rake file
|
59
|
+
# Copyright (c) M.J.N. Corino, The Netherlands
|
60
|
+
###
|
61
|
+
|
62
|
+
unless File.file?(File.join('lib', 'wx', 'wxruby_core.so'))
|
63
|
+
task :default do
|
64
|
+
Rake::Task['wxruby:gem:install'].invoke(#{task_args})
|
65
|
+
end
|
66
|
+
end
|
67
|
+
EOF__
|
68
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
2
|
+
#
|
3
|
+
# This software is released under the MIT license.
|
4
|
+
|
5
|
+
module Wx
|
6
|
+
|
7
|
+
class SecretStore
|
8
|
+
|
9
|
+
# Wipes the secret data.
|
10
|
+
def self.wipe(secret)
|
11
|
+
if ::String === secret
|
12
|
+
secret.bytesize.times { |i| secret.setbyte(i, 0) }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
class SecretValue
|
19
|
+
|
20
|
+
# Redefine the initialize method to auto-convert UTF-16/-32 strings to UTF-8 if possible.
|
21
|
+
wx_init = self.instance_method(:initialize)
|
22
|
+
define_method(:initialize) do | *args |
|
23
|
+
if args.size == 1 && ::String === args.first
|
24
|
+
unless args.first.encoding == ::Encoding::UTF_8 || args.first.encoding == ::Encoding::ASCII_8BIT
|
25
|
+
# convert in place unless frozen
|
26
|
+
if !args.first.frozen?
|
27
|
+
args.first.encode!(::Encoding::UTF_8) rescue nil
|
28
|
+
else # create converted copy
|
29
|
+
(args = [args.first.encode(::Encoding::UTF_8)]) rescue nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
wx_init.bind(self).call(*args)
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -155,12 +155,12 @@ There are however quite a lot of wrapped native objects in wxRuby for which *obj
|
|
155
155
|
object tracking has been disabled for their classes. This means these kind of classes/object should **not** be derived from
|
156
156
|
(if even possible and/or useful) to add functionality/information or their identity used as key to link other information.<br>
|
157
157
|
These classes include:
|
158
|
-
|
158
|
+
- classes considered POD types like Wx::Size, Wx::Point, Wx::RealPoint, Wx::Rect, Wx::GBSpan, Wx::GBPosition, Wx::BusyInfoFlags,
|
159
159
|
Wx::AboutDialogInfo
|
160
|
-
|
160
|
+
- final non-instantiatable classes like the Wx::DC (Device Context) class family, Wx::GraphicsContext, Wx::WindowsDisabler,
|
161
161
|
Wx::EventBlocker, Wx::BusyInfo
|
162
|
-
|
163
|
-
|
162
|
+
- classes with native singleton objects like Wx::Clipboard
|
163
|
+
- the reference counted GDI objects like Wx::Pen, Wx::Brush, Wx::Colour, Wx::Cursor, Wx::Bitmap, Wx::Icon and similar
|
164
164
|
reference counted objects like Wx::Font
|
165
165
|
|
166
166
|
The reference documentation will note untracked object classes.
|
@@ -87,7 +87,7 @@ Another difference is that {Wx::Config} will not automatically create missing gr
|
|
87
87
|
happen when writing configuration values.
|
88
88
|
|
89
89
|
A last difference is that the default support is by default backed up by persistent storage (windows registry or file) and
|
90
|
-
the wxRuby enhanced support only provides in-memory storage (`Hash` instance) by default
|
90
|
+
the wxRuby enhanced support only provides in-memory storage (`Hash` instance) by default.<br>
|
91
91
|
Persisting configuration data from {Wx::Config} will require coding customized storage and retrieval operations (which is
|
92
92
|
trivial using standard YAML or JSON support).
|
93
93
|
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# :stopdoc:
|
2
|
+
# Copyright (c) 2023 M.J.N. Corino, The Netherlands
|
3
|
+
#
|
4
|
+
# This software is released under the MIT license.
|
5
|
+
# :startdoc:
|
6
|
+
|
7
|
+
|
8
|
+
module Wx
|
9
|
+
|
10
|
+
class SecretStore
|
11
|
+
|
12
|
+
# Wipes the secret data.
|
13
|
+
# @param [String] secret string containing secret data
|
14
|
+
# @return [void]
|
15
|
+
def self.wipe(secret); end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
class SecretValue
|
20
|
+
|
21
|
+
# @overload initialize()
|
22
|
+
# Creates an empty secret value (not the same as an empty password).
|
23
|
+
# @return [Wx::SecretValue]
|
24
|
+
# @overload initialize(secret)
|
25
|
+
# Creates a secret value from the given string.
|
26
|
+
# The secret argument may contain NUL bytes.
|
27
|
+
# Any UTF-8 encoded (or encodable; wxRuby will attempt re-encoding as UTF-8 for any string not encoded UTF-8 or ASCII-8BIT) string will be stored as UTF-8 encoded string.
|
28
|
+
# In these cases use {#get_as_string} if needing to compare the original string to a restored string.
|
29
|
+
# Otherwise the string will be stored as ASCII-8BIT encoded string.
|
30
|
+
# In these cases use {#get_data} if needing to compare the original string to a restored string.
|
31
|
+
# See {#==} for comparing secret values opaquely.
|
32
|
+
# @param secret [String]
|
33
|
+
# @return [Wx::SecretValue]
|
34
|
+
# @overload initialize(other)
|
35
|
+
# Creates a copy of an existing secret.
|
36
|
+
# @param other [Wx::SecretValue]
|
37
|
+
# @return [Wx::SecretValue]
|
38
|
+
def initialize(*args) end
|
39
|
+
|
40
|
+
# Returns a copy of the secret data as an ASCII-8BIT encoded String.
|
41
|
+
# Be aware this could be binary data and may contain embedded NUL characters.
|
42
|
+
# For more security {Wx::SecretStore.wipe} should be used to wipe the secret data after use.
|
43
|
+
# @return [String] secret data
|
44
|
+
def get_data; end
|
45
|
+
|
46
|
+
# Returns a copy of the secret data as an UTF-8 encoded String.
|
47
|
+
# Make sure to use this method only if sure that the secret originally stored was indeed
|
48
|
+
# UTF-8 data as otherwise the returned string will not match the stored data.
|
49
|
+
# For more security {Wx::SecretStore.wipe} should be used to wipe the secret data after use.
|
50
|
+
# @return [String] secret data
|
51
|
+
def get_as_string; end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
data/lib/wx/version.rb
CHANGED