wxruby3 0.9.5 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/INSTALL.md +315 -78
  3. data/README.md +31 -20
  4. data/lib/wx/core/ext.rb +22 -3
  5. data/lib/wx/version.rb +1 -1
  6. data/lib/wx/wxruby/base.rb +6 -4
  7. data/lib/wx/wxruby/cmd/sampler.rb +39 -29
  8. data/lib/wx/wxruby/cmd/setup.rb +122 -0
  9. data/lib/wx/wxruby/cmd/test.rb +56 -6
  10. data/rakefile +14 -0
  11. data/rakelib/bin.rake +48 -0
  12. data/rakelib/bin.rb +62 -0
  13. data/rakelib/build.rb +11 -7
  14. data/rakelib/config.rake +3 -1
  15. data/rakelib/configure.rb +28 -8
  16. data/rakelib/doc.rake +3 -1
  17. data/rakelib/gem.rake +169 -0
  18. data/rakelib/gem.rb +82 -0
  19. data/rakelib/install.rb +2 -0
  20. data/rakelib/lib/config/linux.rb +24 -2
  21. data/rakelib/lib/config/macosx.rb +16 -0
  22. data/rakelib/lib/config/mingw.rb +133 -9
  23. data/rakelib/lib/config/pkgman/arch.rb +53 -0
  24. data/rakelib/lib/config/pkgman/base.rb +169 -0
  25. data/rakelib/lib/config/pkgman/debian.rb +66 -0
  26. data/rakelib/lib/config/pkgman/macosx.rb +183 -0
  27. data/rakelib/lib/config/pkgman/rhel.rb +54 -0
  28. data/rakelib/lib/config/pkgman/suse.rb +54 -0
  29. data/rakelib/lib/config/unixish.rb +36 -19
  30. data/rakelib/lib/config.rb +254 -61
  31. data/rakelib/lib/core/package.rb +47 -49
  32. data/rakelib/lib/director/gdicommon.rb +1 -2
  33. data/rakelib/lib/generate/doc.rb +29 -14
  34. data/rakelib/lib/generate/interface.rb +4 -2
  35. data/rakelib/lib/swig_runner.rb +11 -11
  36. data/rakelib/prepost.rake +9 -4
  37. data/rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css +14 -0
  38. data/rakelib/yard/templates/default/fulldoc/html/setup.rb +5 -5
  39. data/rakelib/yard/yard/relative_markdown_links.rb +7 -1
  40. metadata +21 -17
  41. data/ext/mkrf_conf_srcgem.rb +0 -67
  42. data/rakelib/run.rake +0 -52
@@ -43,24 +43,23 @@ module WXRuby3
43
43
  @swig_version
44
44
  end
45
45
 
46
-
47
46
  def check_swig
48
47
  begin
49
48
  @swig_version = `#{WXRuby3::Config.get_config('swig')} -version`[/\d+\.\d+\.\d+/]
50
49
  rescue Exception
51
- STDERR.puts "ERROR: Could not run SWIG (#{WXRuby3::Config.get_config('swig')})"
50
+ $stderr.puts "ERROR: Could not run SWIG (#{WXRuby3::Config.get_config('swig')})"
52
51
  exit(1)
53
52
  end
54
53
 
55
- # Very old versions put --version on STDERR, not STDOUT
54
+ # Very old versions put --version on $stderr, not $stdout
56
55
  unless @swig_version
57
- STDERR.puts "Could not get version info from SWIG; " +
56
+ $stderr.puts "Could not get version info from SWIG; " +
58
57
  "is a very old version installed?.\n"
59
58
  exit(1)
60
59
  end
61
60
 
62
61
  if @swig_version < SWIG_MINIMUM_VERSION
63
- STDERR.puts "SWIG version #{@swig_version} is installed, " +
62
+ $stderr.puts "SWIG version #{@swig_version} is installed, " +
64
63
  "minimum version required is #{SWIG_MINIMUM_VERSION}.\n"
65
64
  exit(1)
66
65
  end
@@ -72,11 +71,12 @@ module WXRuby3
72
71
  check_swig unless swig_state
73
72
  inc_paths = "-I#{config.wxruby_dir} -I#{config.swig_dir}/custom"
74
73
  inc_paths << " -I#{config.swig_dir}/custom/swig#{swig_major}"
75
- sh "#{config.get_config('swig')} #{config.wx_cppflags.join(' ')} " +
76
- "#{config.extra_cppflags.join(' ')} #{config.verbose_flag} #{inc_paths} " +
77
- #"-w401 -w801 -w515 -c++ -ruby " +
78
- "-w801 -c++ -ruby " +
79
- "-o #{target} #{source}"
74
+ WXRuby3.config.sh "#{config.get_config('swig')} #{config.wx_cppflags.join(' ')} " +
75
+ "#{config.extra_cppflags.join(' ')} #{config.verbose_flag} #{inc_paths} " +
76
+ #"-w401 -w801 -w515 -c++ -ruby " +
77
+ "-w801 -c++ -ruby " +
78
+ "-o #{target} #{source}",
79
+ fail_on_error: true
80
80
  end
81
81
 
82
82
  end
@@ -205,7 +205,7 @@ module WXRuby3
205
205
  end
206
206
 
207
207
  def self.run(pid, director, target)
208
- puts "Processor.#{pid}: #{target}"
208
+ Config.instance.log_progress("Processor.#{pid}: #{target}")
209
209
  const_get(camelize(pid.to_s)).new(director, target).run
210
210
  end
211
211
 
data/rakelib/prepost.rake CHANGED
@@ -23,16 +23,21 @@ namespace 'wxruby' do
23
23
 
24
24
  namespace 'post' do
25
25
 
26
- task :srcgem => %w[gem:wxwin gem:install wxruby:doc] do
26
+ task :srcgem => %w[gem:wxwin gem:install] do
27
+ $stdout.print "Generating wxRuby3 reference documentation..." if WXRuby3.config.run_silent?
28
+ Rake::Task['wxruby:doc'].invoke
29
+ $stdout.puts 'done!' if WXRuby3.config.run_silent?
27
30
  # cleanup
28
- rm_rf('rakelib')
29
- rm_rf('ext/wxruby3')
30
- rm_rf('ext/wxWidgets') if File.exist?('ext/wxWidgets')
31
+ rm_rf('rakelib', verbose: !WXRuby3.config.run_silent?)
32
+ rm_rf('ext/wxruby3', verbose: !WXRuby3.config.run_silent?)
33
+ WXRuby3.config.cleanup_bootstrap
34
+ File.open(File.join(WXRuby3::Config.wxruby_root, 'ext', 'wxruby.setup.done'), 'w') { |f| f << '1' }
31
35
  end
32
36
 
33
37
  task :bingem => 'gem:install' do
34
38
  # cleanup
35
39
  rm_rf('rakelib')
40
+ File.open(File.join(WXRuby3::Config.wxruby_root, 'ext', 'wxruby.setup.done'), 'w') { |f| f << '1' }
36
41
  end
37
42
 
38
43
  namespace 'gem' do
@@ -77,3 +77,17 @@ div.wxrb-logo table td {
77
77
  font-weight: bold;
78
78
  font-size: 0.9em;
79
79
  }
80
+
81
+ #filecontents {
82
+ margin-right: 340px;
83
+ }
84
+
85
+ #filecontents blockquote {
86
+ border-left: .5em solid #e0e0e0;
87
+ margin: 10px;
88
+ padding-left: 10px;
89
+ }
90
+
91
+ #toc {
92
+ position: fixed;
93
+ }
@@ -1,19 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  def init
4
- # It seems YARD messes things up so that a number of classes are not properly
4
+ # It seems YARD messes things up so that a lot of classes, modules and constants are not properly
5
5
  # registered in their enclosing namespaces.
6
6
  # This hack makes sure that if that is the case we fix that here.
7
- all_classes = Registry.all(:class)
8
- all_classes.each do |c|
7
+ all_objects = Registry.all(:class, :constant, :module)
8
+ all_objects.each do |c|
9
9
  if (ns = c.namespace)
10
10
  unless ns.children.any? { |nsc| nsc.path == c.path }
11
- ns.children << c # class missing from child list of enclosing namespace -> add here
11
+ ns.children << c # class/module/constant missing from child list of enclosing namespace -> add here
12
12
  end
13
13
  end
14
14
  if (ns = Registry[c.namespace.path])
15
15
  unless ns.children.any? { |nsc| nsc.path == c.path }
16
- ns.children << c # class missing from child list of enclosing namespace -> add here
16
+ ns.children << c # class/module/constant missing from child list of enclosing namespace -> add here
17
17
  end
18
18
  end
19
19
  end
@@ -31,12 +31,18 @@ module YARD # rubocop:disable Style/Documentation
31
31
  if fnames.include?(href.path)
32
32
  link.replace "{file:#{href} #{link.inner_html}}"
33
33
  elsif href.path.end_with?('_md.html') && (fname = fnames.find {|fnm| fnm.end_with?(href.path.sub(/_md.html\Z/, '.md')) })
34
- link.replace "{file:#{fname} #{link.inner_html}}"
34
+ link.replace "{file:#{fname}#{href.fragment ? "##{fragment_to_yard(href.fragment)}" : ''} #{link.inner_html}}"
35
35
  end
36
36
  end
37
37
  end
38
38
  super(html.to_s)
39
39
  end
40
+
41
+ # this does not work with mixed case labels but is good enough for us
42
+ def fragment_to_yard(s)
43
+ s.start_with?('label-') ? s : "label-#{s.gsub('-', '+').capitalize}"
44
+ end
45
+
40
46
  end
41
47
 
42
48
  Templates::Template.extra_includes << RelativeMarkdownLinks
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.7
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-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -71,8 +71,7 @@ description: wxRuby3 is a Ruby library providing an extension for the wxWidgets
71
71
  email: mcorino@m2c-software.nl
72
72
  executables:
73
73
  - wxruby
74
- extensions:
75
- - ext/mkrf_conf_srcgem.rb
74
+ extensions: []
76
75
  extra_rdoc_files: []
77
76
  files:
78
77
  - ".yardopts"
@@ -96,7 +95,6 @@ files:
96
95
  - assets/logo.xcf
97
96
  - assets/repo-social-preview.png
98
97
  - bin/wxruby
99
- - ext/mkrf_conf_srcgem.rb
100
98
  - ext/wxruby3/include/wxRubyApp.h
101
99
  - ext/wxruby3/include/wxruby-ClientData.h
102
100
  - ext/wxruby3/include/wxruby-ComboPopup.h
@@ -398,13 +396,19 @@ files:
398
396
  - lib/wx/version.rb
399
397
  - lib/wx/wxruby/base.rb
400
398
  - lib/wx/wxruby/cmd/sampler.rb
399
+ - lib/wx/wxruby/cmd/setup.rb
401
400
  - lib/wx/wxruby/cmd/test.rb
401
+ - rakefile
402
+ - rakelib/bin.rake
403
+ - rakelib/bin.rb
402
404
  - rakelib/build.rake
403
405
  - rakelib/build.rb
404
406
  - rakelib/config.rake
405
407
  - rakelib/configure.rb
406
408
  - rakelib/doc.rake
407
409
  - rakelib/doc.rb
410
+ - rakelib/gem.rake
411
+ - rakelib/gem.rb
408
412
  - rakelib/install.rake
409
413
  - rakelib/install.rb
410
414
  - rakelib/lib/config.rb
@@ -413,6 +417,12 @@ files:
413
417
  - rakelib/lib/config/macosx.rb
414
418
  - rakelib/lib/config/mingw.rb
415
419
  - rakelib/lib/config/netbsd.rb
420
+ - rakelib/lib/config/pkgman/arch.rb
421
+ - rakelib/lib/config/pkgman/base.rb
422
+ - rakelib/lib/config/pkgman/debian.rb
423
+ - rakelib/lib/config/pkgman/macosx.rb
424
+ - rakelib/lib/config/pkgman/rhel.rb
425
+ - rakelib/lib/config/pkgman/suse.rb
416
426
  - rakelib/lib/config/unixish.rb
417
427
  - rakelib/lib/core/include/client_data.inc
418
428
  - rakelib/lib/core/include/enum.inc
@@ -788,7 +798,6 @@ files:
788
798
  - rakelib/lib/util/string.rb
789
799
  - rakelib/prepost.rake
790
800
  - rakelib/prepost.rb
791
- - rakelib/run.rake
792
801
  - rakelib/yard/templates/default/fulldoc/html/css/wxruby3.css
793
802
  - rakelib/yard/templates/default/fulldoc/html/full_list.erb
794
803
  - rakelib/yard/templates/default/fulldoc/html/setup.rb
@@ -1135,19 +1144,14 @@ metadata:
1135
1144
  source_code_uri: https://github.com/mcorino/wxRuby3
1136
1145
  documentation_uri: https://mcorino.github.io/wxRuby3
1137
1146
  homepage_uri: https://github.com/mcorino/wxRuby3
1138
- post_install_message: |2
1147
+ post_install_message: |2+
1139
1148
 
1140
- wxRuby3 has been successfully installed including the 'wxruby' utility.
1149
+ The wxRuby3 Gem has been successfully installed.
1150
+ Before being able to use wxRuby3 you need to run the post-install setup process
1151
+ by executing the command 'wxruby setup'.
1141
1152
 
1142
- You can run the regression tests to verify the installation by executing:
1153
+ Run 'wxruby setup -h' to see information on the available commandline options.
1143
1154
 
1144
- $ ./wxruby test
1145
-
1146
- The wxRuby3 sample selector can be run by executing:
1147
-
1148
- $ ./wxruby sampler
1149
-
1150
- Have fun using wxRuby3.
1151
1155
  rdoc_options:
1152
1156
  - "--exclude=\\.dll"
1153
1157
  - "--exclude=\\.so"
@@ -1167,7 +1171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1167
1171
  - !ruby/object:Gem::Version
1168
1172
  version: '0'
1169
1173
  requirements: []
1170
- rubygems_version: 3.4.10
1174
+ rubygems_version: 3.4.19
1171
1175
  signing_key:
1172
1176
  specification_version: 4
1173
1177
  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'