wxruby3 0.9.5 → 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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +440 -84
  3. data/README.md +40 -23
  4. data/ext/mkrf_conf_ext.rb +68 -0
  5. data/lib/wx/core/ext.rb +22 -3
  6. data/lib/wx/core/secret_store.rb +38 -0
  7. data/lib/wx/doc/extra/02_lifecycles.md +4 -4
  8. data/lib/wx/doc/extra/14_config.md +1 -1
  9. data/lib/wx/doc/secret_store.rb +55 -0
  10. data/lib/wx/version.rb +1 -1
  11. data/lib/wx/wxruby/base.rb +8 -8
  12. data/lib/wx/wxruby/cmd/check.rb +182 -0
  13. data/lib/wx/wxruby/cmd/sampler.rb +39 -29
  14. data/lib/wx/wxruby/cmd/setup.rb +125 -0
  15. data/lib/wx/wxruby/cmd/test.rb +56 -6
  16. data/rakelib/bin.rake +48 -0
  17. data/rakelib/bin.rb +62 -0
  18. data/rakelib/build.rb +11 -7
  19. data/rakelib/config.rake +3 -1
  20. data/rakelib/configure.rb +63 -35
  21. data/rakelib/doc.rake +3 -1
  22. data/rakelib/gem.rake +199 -0
  23. data/rakelib/gem.rb +334 -0
  24. data/rakelib/install.rb +5 -3
  25. data/rakelib/lib/config/{cygwin.rb → freebsd.rb} +1 -1
  26. data/rakelib/lib/config/linux.rb +26 -2
  27. data/rakelib/lib/config/macosx.rb +58 -11
  28. data/rakelib/lib/config/mingw.rb +134 -10
  29. data/rakelib/lib/config/pkgman/linux.rb +144 -0
  30. data/rakelib/lib/config/pkgman/macosx.rb +122 -0
  31. data/rakelib/lib/config/unixish.rb +47 -20
  32. data/rakelib/lib/config/{netbsd.rb → unknown.rb} +3 -2
  33. data/rakelib/lib/config.rb +301 -88
  34. data/rakelib/lib/core/package.rb +47 -49
  35. data/rakelib/lib/director/aui_manager.rb +1 -1
  36. data/rakelib/lib/director/dialog.rb +8 -0
  37. data/rakelib/lib/director/gdicommon.rb +1 -2
  38. data/rakelib/lib/director/grid_ctrl.rb +2 -2
  39. data/rakelib/lib/director/richtext_composite_object.rb +2 -4
  40. data/rakelib/lib/director/secret_store.rb +117 -0
  41. data/rakelib/lib/director/tree_event.rb +2 -2
  42. data/rakelib/lib/generate/doc/secret_store.yaml +55 -0
  43. data/rakelib/lib/generate/doc.rb +29 -14
  44. data/rakelib/lib/generate/interface.rb +4 -2
  45. data/rakelib/lib/specs/interfaces.rb +1 -0
  46. data/rakelib/lib/swig_runner.rb +11 -11
  47. data/rakelib/lib/typemap/common.rb +10 -0
  48. data/rakelib/prepost.rake +17 -5
  49. data/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +18 -0
  50. data/rakelib/yard/templates/default/fulldoc/html/setup.rb +5 -5
  51. data/rakelib/yard/yard/relative_markdown_links.rb +7 -1
  52. data/samples/sampler/sample.rb +2 -0
  53. data/tests/lib/wxapp_runner.rb +1 -1
  54. data/tests/test_config.rb +7 -4
  55. data/tests/test_secret_store.rb +83 -0
  56. metadata +46 -23
  57. data/ext/mkrf_conf_srcgem.rb +0 -67
  58. data/rakelib/run.rake +0 -52
@@ -0,0 +1,83 @@
1
+ # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
+ #
3
+ # This software is released under the MIT license.
4
+
5
+ require_relative './lib/wxapp_runner'
6
+
7
+ require 'digest'
8
+
9
+ class TestSecretStore < Test::Unit::TestCase
10
+
11
+ unless is_ci_build?
12
+
13
+ def test_store
14
+ if Wx.has_feature?(:USE_SECRETSTORE)
15
+ state, err = Wx::SecretStore.get_default.ok?
16
+ if state
17
+ puts "SecretStore OK"
18
+
19
+ if Wx::WXWIDGETS_VERSION > '3.2.4'
20
+ password = Digest::SHA256.digest('My Secret Password!')
21
+ else
22
+ password = Digest::SHA256.hexdigest('My Secret Password!') # binary secrets does not work
23
+ end
24
+ secret_val = Wx::SecretValue.new(password)
25
+ assert_true(Wx::SecretStore.get_default.save('My/Service', 'a_user', secret_val))
26
+
27
+ secret_val2 = Wx::SecretValue.new
28
+ rc, user = Wx::SecretStore.get_default.load('My/Service', secret_val2)
29
+ assert_true(rc)
30
+ assert_equal('a_user', user)
31
+ assert_equal(secret_val, secret_val2)
32
+ assert_equal(password, secret_val2.get_data)
33
+
34
+ password = 'My Secret Password!'
35
+ secret_val = Wx::SecretValue.new(password)
36
+ assert_true(Wx::SecretStore.get_default.save('My/Service', 'a_user', secret_val))
37
+
38
+ secret_val2 = Wx::SecretValue.new
39
+ rc, user = Wx::SecretStore.get_default.load('My/Service', secret_val2)
40
+ assert_true(rc)
41
+ assert_equal('a_user', user)
42
+ assert_equal(secret_val, secret_val2)
43
+ assert_equal(password, secret_val2.get_as_string)
44
+
45
+ password = 'My Secret Password!'.encode('UTF-16')
46
+ secret_val = Wx::SecretValue.new(password)
47
+ assert_true(Wx::SecretStore.get_default.save('My/Service', 'a_user', secret_val))
48
+
49
+ secret_val2 = Wx::SecretValue.new
50
+ rc, user = Wx::SecretStore.get_default.load('My/Service', secret_val2)
51
+ assert_true(rc)
52
+ assert_equal('a_user', user)
53
+ assert_equal(secret_val, secret_val2)
54
+ assert_equal(password, secret_val2.get_as_string)
55
+ assert_not_equal('My Secret Password!'.encode('UTF-16'), secret_val2.get_as_string)
56
+ assert_equal('My Secret Password!'.encode('UTF-16'), secret_val2.get_as_string.encode('UTF-16'))
57
+
58
+ password = 'My Secret Password!'.encode('UTF-32')
59
+ secret_val = Wx::SecretValue.new(password)
60
+ assert_true(Wx::SecretStore.get_default.save('My/Service', 'a_user', secret_val))
61
+
62
+ secret_val2 = Wx::SecretValue.new
63
+ rc, user = Wx::SecretStore.get_default.load('My/Service', secret_val2)
64
+ assert_true(rc)
65
+ assert_equal('a_user', user)
66
+ assert_equal(secret_val, secret_val2)
67
+ assert_equal(password, secret_val2.get_as_string)
68
+ assert_not_equal('My Secret Password!'.encode('UTF-32'), secret_val2.get_as_string)
69
+ assert_equal('My Secret Password!'.encode('UTF-32'), secret_val2.get_as_string.encode('UTF-32'))
70
+
71
+ assert_true(Wx::SecretStore.get_default.delete('My/Service'))
72
+
73
+ else
74
+ puts "Default SecretStore not usable : #{err}"
75
+ end
76
+ else
77
+ puts 'Wx::SecretStore not available'
78
+ end
79
+ end
80
+
81
+ end
82
+
83
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wxruby3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.5
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Corino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-15 00:00:00.000000000 Z
11
+ date: 2024-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -66,13 +66,27 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: plat4m
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.0'
69
83
  description: wxRuby3 is a Ruby library providing an extension for the wxWidgets C++
70
84
  UI framework
71
85
  email: mcorino@m2c-software.nl
72
86
  executables:
73
87
  - wxruby
74
88
  extensions:
75
- - ext/mkrf_conf_srcgem.rb
89
+ - ext/mkrf_conf_ext.rb
76
90
  extra_rdoc_files: []
77
91
  files:
78
92
  - ".yardopts"
@@ -96,7 +110,7 @@ files:
96
110
  - assets/logo.xcf
97
111
  - assets/repo-social-preview.png
98
112
  - bin/wxruby
99
- - ext/mkrf_conf_srcgem.rb
113
+ - ext/mkrf_conf_ext.rb
100
114
  - ext/wxruby3/include/wxRubyApp.h
101
115
  - ext/wxruby3/include/wxruby-ClientData.h
102
116
  - ext/wxruby3/include/wxruby-ComboPopup.h
@@ -201,6 +215,7 @@ files:
201
215
  - lib/wx/core/real_point.rb
202
216
  - lib/wx/core/rect.rb
203
217
  - lib/wx/core/region_iterator.rb
218
+ - lib/wx/core/secret_store.rb
204
219
  - lib/wx/core/simplehelpprovider.rb
205
220
  - lib/wx/core/size.rb
206
221
  - lib/wx/core/sizer.rb
@@ -320,6 +335,7 @@ files:
320
335
  - lib/wx/doc/rtc/richtext_style_sheet.rb
321
336
  - lib/wx/doc/scaled_dc.rb
322
337
  - lib/wx/doc/screen_dc.rb
338
+ - lib/wx/doc/secret_store.rb
323
339
  - lib/wx/doc/sizer.rb
324
340
  - lib/wx/doc/static_bitmap.rb
325
341
  - lib/wx/doc/stc/styled_text_ctrl.rb
@@ -397,23 +413,31 @@ files:
397
413
  - lib/wx/stc/styled_text_ctrl.rb
398
414
  - lib/wx/version.rb
399
415
  - lib/wx/wxruby/base.rb
416
+ - lib/wx/wxruby/cmd/check.rb
400
417
  - lib/wx/wxruby/cmd/sampler.rb
418
+ - lib/wx/wxruby/cmd/setup.rb
401
419
  - lib/wx/wxruby/cmd/test.rb
420
+ - rakelib/bin.rake
421
+ - rakelib/bin.rb
402
422
  - rakelib/build.rake
403
423
  - rakelib/build.rb
404
424
  - rakelib/config.rake
405
425
  - rakelib/configure.rb
406
426
  - rakelib/doc.rake
407
427
  - rakelib/doc.rb
428
+ - rakelib/gem.rake
429
+ - rakelib/gem.rb
408
430
  - rakelib/install.rake
409
431
  - rakelib/install.rb
410
432
  - rakelib/lib/config.rb
411
- - rakelib/lib/config/cygwin.rb
433
+ - rakelib/lib/config/freebsd.rb
412
434
  - rakelib/lib/config/linux.rb
413
435
  - rakelib/lib/config/macosx.rb
414
436
  - rakelib/lib/config/mingw.rb
415
- - rakelib/lib/config/netbsd.rb
437
+ - rakelib/lib/config/pkgman/linux.rb
438
+ - rakelib/lib/config/pkgman/macosx.rb
416
439
  - rakelib/lib/config/unixish.rb
440
+ - rakelib/lib/config/unknown.rb
417
441
  - rakelib/lib/core/include/client_data.inc
418
442
  - rakelib/lib/core/include/enum.inc
419
443
  - rakelib/lib/core/include/funcall.inc
@@ -623,6 +647,7 @@ files:
623
647
  - rakelib/lib/director/scroll_bar.rb
624
648
  - rakelib/lib/director/scrolled_t.rb
625
649
  - rakelib/lib/director/searchctrl.rb
650
+ - rakelib/lib/director/secret_store.rb
626
651
  - rakelib/lib/director/sizer.rb
627
652
  - rakelib/lib/director/sizer_item.rb
628
653
  - rakelib/lib/director/slider.rb
@@ -743,6 +768,7 @@ files:
743
768
  - rakelib/lib/generate/doc/scrolled_canvas.yaml
744
769
  - rakelib/lib/generate/doc/scrolled_control.yaml
745
770
  - rakelib/lib/generate/doc/scrolled_window.yaml
771
+ - rakelib/lib/generate/doc/secret_store.yaml
746
772
  - rakelib/lib/generate/doc/sizer.yaml
747
773
  - rakelib/lib/generate/doc/splash_screen.yaml
748
774
  - rakelib/lib/generate/doc/static_box.yaml
@@ -788,7 +814,6 @@ files:
788
814
  - rakelib/lib/util/string.rb
789
815
  - rakelib/prepost.rake
790
816
  - rakelib/prepost.rb
791
- - rakelib/run.rake
792
817
  - rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css
793
818
  - rakelib/yard/templates/default/fulldoc/html/full_list.erb
794
819
  - rakelib/yard/templates/default/fulldoc/html/setup.rb
@@ -1117,6 +1142,7 @@ files:
1117
1142
  - tests/test_pg.rb
1118
1143
  - tests/test_proof_check.rb
1119
1144
  - tests/test_richtext.rb
1145
+ - tests/test_secret_store.rb
1120
1146
  - tests/test_sizer.rb
1121
1147
  - tests/test_std_controls.rb
1122
1148
  - tests/test_styled_text_ctrl.rb
@@ -1132,22 +1158,19 @@ licenses:
1132
1158
  - MIT
1133
1159
  metadata:
1134
1160
  bug_tracker_uri: https://github.com/mcorino/wxRuby3/issues
1135
- source_code_uri: https://github.com/mcorino/wxRuby3
1136
- documentation_uri: https://mcorino.github.io/wxRuby3
1137
1161
  homepage_uri: https://github.com/mcorino/wxRuby3
1138
- post_install_message: |2
1139
-
1140
- wxRuby3 has been successfully installed including the 'wxruby' utility.
1141
-
1142
- You can run the regression tests to verify the installation by executing:
1143
-
1144
- $ ./wxruby test
1145
-
1146
- The wxRuby3 sample selector can be run by executing:
1147
-
1148
- $ ./wxruby sampler
1149
-
1150
- Have fun using wxRuby3.
1162
+ documentation_uri: https://mcorino.github.io/wxRuby3
1163
+ github_repo: https://github.com/mcorino/wxRuby3
1164
+ post_install_message: "\nThe wxRuby3 Gem has been successfully installed including
1165
+ the 'wxruby' utility.\n\nIn case no suitable binary release package was available
1166
+ for your platform you \nwill need to run the post-install setup process by executing:\n\n$
1167
+ wxruby setup\n\nTo check whether wxRuby3 is ready to run or not you can at any time
1168
+ execute the \nfollowing command:\n\n$ wxruby check\n\nRun 'wxruby check -h' for
1169
+ more information.\n\nWhen the wxRuby3 setup has been fully completed you can start
1170
+ using wxRuby3.\n\nYou can run the regression tests to verify the installation by
1171
+ executing:\n\n$ wxruby test\n\nThe wxRuby3 sample explorer can be run by executing:\n\n$
1172
+ wxruby sampler\n\nHave fun using wxRuby3.\n\nRun 'wxruby -h' to see information
1173
+ on the available commands.\n\n"
1151
1174
  rdoc_options:
1152
1175
  - "--exclude=\\.dll"
1153
1176
  - "--exclude=\\.so"
@@ -1167,7 +1190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1167
1190
  - !ruby/object:Gem::Version
1168
1191
  version: '0'
1169
1192
  requirements: []
1170
- rubygems_version: 3.4.10
1193
+ rubygems_version: 3.5.3
1171
1194
  signing_key:
1172
1195
  specification_version: 4
1173
1196
  summary: wxWidgets extension for Ruby
@@ -1,67 +0,0 @@
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 source gem
7
- ###
8
-
9
- # generate Rakefile with appropriate default task (all actual task in rakelib)
10
- File.open('../Rakefile', 'w') do |f|
11
- f.puts <<EOF__
12
- ###
13
- # wxRuby3 rake file
14
- # Copyright (c) M.J.N. Corino, The Netherlands
15
- ###
16
-
17
- task :default => 'wxruby:build' do
18
- Rake::Task['wxruby:post:srcgem'].invoke
19
- end
20
- EOF__
21
- end
22
-
23
- require 'rbconfig'
24
- if defined? ::RbConfig
25
- RB_CONFIG = ::RbConfig
26
- else
27
- RB_CONFIG = ::Config
28
- end unless defined? RB_CONFIG
29
- RB_CONFIG::MAKEFILE_CONFIG['TRY_LINK'] = "$(CXX) #{RB_CONFIG::MAKEFILE_CONFIG['OUTFLAG']}conftest#{$EXEEXT} $(INCFLAGS) $(CPPFLAGS) " \
30
- "$(CFLAGS) $(src) $(LIBPATH) $(LDFLAGS) $(ARCH_FLAG) $(LOCAL_LIBS) $(LIBS)"
31
- require 'mkmf'
32
- if defined?(MakeMakefile)
33
- MakeMakefile::COMMON_HEADERS.clear
34
- elsif defined?(COMMON_HEADERS)
35
- COMMON_HEADERS.slice!(/./)
36
- end
37
-
38
- usage_txt =<<-__EOT
39
- Please make sure you have a valid build environment either by having a system provided wxWidgets
40
- development package installed (>= 3.2.0) or provide the paths to a locally built and installed
41
- wxWidgets release (>= 3.2.0) by setting the WXWIN environment variable (and optionally WXXML)
42
- for the 'gem install' command.
43
- Installed versions of SWIG (>= 3.0.12) and (if no WXXML path is provided) doxygen and git are
44
- also required.
45
- Checkout the documentation at https://github.com/mcorino/wxRuby3 for more information.
46
- __EOT
47
-
48
- wxwin = ENV['WXWIN']
49
- wxxml = ENV['WXXML']
50
- with_wxwin = !!ENV['WITH_WXWIN']
51
-
52
- # run configure with appropriate settings
53
- cfgargs = ''
54
- if wxwin || with_wxwin
55
- cfgargs = ["--wxwin=#{wxwin}"]
56
- cfgargs << "--wxxml=#{wxxml}" if wxxml
57
- cfgargs << '--with-wxwin' if with_wxwin
58
- cfgargs = "[#{cfgargs.join(',')}]"
59
- end
60
- Dir.chdir('..') do
61
- puts "Running 'rake #{ARGV.join(' ')} configure#{cfgargs}'"
62
- unless system("rake #{ARGV.join(' ')} configure#{cfgargs}")
63
- puts 'Failed to configure wxRuby3'
64
- puts usage_txt
65
- exit(1)
66
- end
67
- end
data/rakelib/run.rake DELETED
@@ -1,52 +0,0 @@
1
- # Copyright (c) 2023 M.J.N. Corino, The Netherlands
2
- #
3
- # This software is released under the MIT license.
4
-
5
- ###
6
- # wxRuby3 rake file
7
- ###
8
-
9
- require_relative './configure'
10
-
11
- namespace :wxruby do
12
-
13
- task :run, [:app] => 'config:bootstrap' do |t, args|
14
- Rake::Task[:build].invoke
15
- WXRuby3.config.run args[:app]
16
- end
17
-
18
- task :debug, [:app] => 'config:bootstrap' do |t, args|
19
- Rake::Task[:build].invoke
20
- WXRuby3.config.debug args[:app]
21
- end
22
-
23
- task :test => 'config:bootstrap' do |t, args|
24
- Rake::Task[:build].invoke
25
- tests = args.extras - [':nodep']
26
- tests << ENV['TEST'] if ENV['TEST']
27
- WXRuby3.config.test *tests
28
- end
29
-
30
- task :irb => 'config:bootstrap' do |t, args|
31
- Rake::Task[:build].invoke
32
- WXRuby3.config.irb
33
- end
34
-
35
- task :exec => 'config:bootstrap' do |t, args|
36
- WXRuby3.config.execute args.extras
37
- end
38
-
39
- end
40
-
41
- desc "Run wxRuby tests"
42
- task :test => 'wxruby:test'
43
-
44
- task :tests => 'wxruby:test'
45
-
46
- desc 'Run wxRuby (sample) app'
47
- task :run, [:app] => 'wxruby:run'
48
-
49
- desc 'Debug wxRuby (sample) app'
50
- task :debug, [:app] => 'wxruby:debug'
51
-
52
- task :irb => 'wxruby:irb'