From 90c56c84b527201a3707be8e59fe3ae5e699bda1 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 4 Feb 2024 15:53:56 +0100 Subject: [PATCH 1/6] fix core version doc gen --- rakelib/lib/core/package.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rakelib/lib/core/package.rb b/rakelib/lib/core/package.rb index 8318471b..c0de71cc 100644 --- a/rakelib/lib/core/package.rb +++ b/rakelib/lib/core/package.rb @@ -615,16 +615,16 @@ def generate_core_doc module Wx # wxRuby version string - Wx::WXRUBY_VERSION = '\#{Wx::WXRUBY_VERSION}' + WXRUBY_VERSION = '\#{Wx::WXRUBY_VERSION}' # wxRuby version release type (alpha, beta, rc) - Wx::WXRUBY_RELEASE_TYPE = '\#{Wx::WXRUBY_RELEASE_TYPE}' + WXRUBY_RELEASE_TYPE = '\#{Wx::WXRUBY_RELEASE_TYPE}' # wxRuby major version number - Wx::WXRUBY_MAJOR = \#{Wx::WXRUBY_MAJOR} + WXRUBY_MAJOR = \#{Wx::WXRUBY_MAJOR} # wxRuby minor version number - Wx::WXRUBY_MINOR = \#{Wx::WXRUBY_MINOR} + WXRUBY_MINOR = \#{Wx::WXRUBY_MINOR} # wxRuby release number - Wx::WXRUBY_RELEASE = \#{Wx::WXRUBY_RELEASE} + WXRUBY_RELEASE = \#{Wx::WXRUBY_RELEASE} # Convenience string for WxWidgets version info WXWIDGETS_VERSION = '\#{Wx::WXWIDGETS_VERSION}' From 6cede412cf4dc3220df21cf3d895d97037c12e9f Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 4 Feb 2024 16:14:49 +0100 Subject: [PATCH 2/6] plug another yardoc hole --- rakelib/yard/templates/default/fulldoc/html/setup.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rakelib/yard/templates/default/fulldoc/html/setup.rb b/rakelib/yard/templates/default/fulldoc/html/setup.rb index 9ec31364..8aa7b487 100644 --- a/rakelib/yard/templates/default/fulldoc/html/setup.rb +++ b/rakelib/yard/templates/default/fulldoc/html/setup.rb @@ -1,19 +1,19 @@ # frozen_string_literal: true def init - # It seems YARD messes things up so that a number of classes are not properly + # It seems YARD messes things up so that a lot of classes and constants are not properly # registered in their enclosing namespaces. # This hack makes sure that if that is the case we fix that here. - all_classes = Registry.all(:class) + all_classes = Registry.all(:class, :constant) all_classes.each do |c| if (ns = c.namespace) unless ns.children.any? { |nsc| nsc.path == c.path } - ns.children << c # class missing from child list of enclosing namespace -> add here + ns.children << c # class/constant missing from child list of enclosing namespace -> add here end end if (ns = Registry[c.namespace.path]) unless ns.children.any? { |nsc| nsc.path == c.path } - ns.children << c # class missing from child list of enclosing namespace -> add here + ns.children << c # class/constant missing from child list of enclosing namespace -> add here end end end From a198f052c85986ce9215fbb09a7d76d39789c7b8 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 4 Feb 2024 16:37:31 +0100 Subject: [PATCH 3/6] plug another yardoc hole --- rakelib/yard/templates/default/fulldoc/html/setup.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rakelib/yard/templates/default/fulldoc/html/setup.rb b/rakelib/yard/templates/default/fulldoc/html/setup.rb index 8aa7b487..b875a5e3 100644 --- a/rakelib/yard/templates/default/fulldoc/html/setup.rb +++ b/rakelib/yard/templates/default/fulldoc/html/setup.rb @@ -1,19 +1,19 @@ # frozen_string_literal: true def init - # It seems YARD messes things up so that a lot of classes and constants are not properly + # It seems YARD messes things up so that a lot of classes, modules and constants are not properly # registered in their enclosing namespaces. # This hack makes sure that if that is the case we fix that here. - all_classes = Registry.all(:class, :constant) - all_classes.each do |c| + all_objects = Registry.all(:class, :constant, :module) + all_objects.each do |c| if (ns = c.namespace) unless ns.children.any? { |nsc| nsc.path == c.path } - ns.children << c # class/constant missing from child list of enclosing namespace -> add here + ns.children << c # class/module/constant missing from child list of enclosing namespace -> add here end end if (ns = Registry[c.namespace.path]) unless ns.children.any? { |nsc| nsc.path == c.path } - ns.children << c # class/constant missing from child list of enclosing namespace -> add here + ns.children << c # class/module/constant missing from child list of enclosing namespace -> add here end end end From cfef054715c4fec4c70cf708685e558bb28a6050 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 4 Feb 2024 16:37:56 +0100 Subject: [PATCH 4/6] generate proper module namespacing --- rakelib/lib/generate/doc.rb | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/rakelib/lib/generate/doc.rb b/rakelib/lib/generate/doc.rb index 958ce67b..c8fe645a 100644 --- a/rakelib/lib/generate/doc.rb +++ b/rakelib/lib/generate/doc.rb @@ -701,15 +701,22 @@ def run # at least 2 newlines to make Yard skip/forget the header comment fdoc.puts fdoc.puts - fdoc.puts "module #{package.fullname}" - fdoc.puts - fdoc.indent do + mod_indent = 0 + package.all_modules.each do |modnm| + fdoc.iputs("module #{package.fullname}", mod_indent) + fdoc.puts + mod_indent += 1 + end + fdoc.indent(mod_indent) do gen_constants_doc(fdoc) gen_functions_doc(fdoc) unless no_gen?(:functions) gen_class_doc(fdoc) unless no_gen?(:classes) end - fdoc.puts - fdoc.puts 'end' + package.all_modules.each do |_| + fdoc.puts + fdoc.iputs('end', mod_indent) + mod_indent -= 1 + end end end From 71c6954324ba7a32c53f6af439f373610ceb4df5 Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 4 Feb 2024 18:35:00 +0100 Subject: [PATCH 5/6] remove the need for gui server --- rakelib/lib/core/package.rb | 96 ++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/rakelib/lib/core/package.rb b/rakelib/lib/core/package.rb index c0de71cc..3c32060d 100644 --- a/rakelib/lib/core/package.rb +++ b/rakelib/lib/core/package.rb @@ -604,55 +604,53 @@ class EvtHandler def generate_core_doc script = <<~__SCRIPT require 'wx' - Wx::App.run do - STDOUT.puts \<<~__HEREDOC - # ---------------------------------------------------------------------------- - # This file is automatically generated by the WXRuby3 documentation - # generator. Do not alter this file. - # ---------------------------------------------------------------------------- - - - module Wx - - # wxRuby version string - WXRUBY_VERSION = '\#{Wx::WXRUBY_VERSION}' - - # wxRuby version release type (alpha, beta, rc) - WXRUBY_RELEASE_TYPE = '\#{Wx::WXRUBY_RELEASE_TYPE}' - # wxRuby major version number - WXRUBY_MAJOR = \#{Wx::WXRUBY_MAJOR} - # wxRuby minor version number - WXRUBY_MINOR = \#{Wx::WXRUBY_MINOR} - # wxRuby release number - WXRUBY_RELEASE = \#{Wx::WXRUBY_RELEASE} - - # Convenience string for WxWidgets version info - WXWIDGETS_VERSION = '\#{Wx::WXWIDGETS_VERSION}' - - # Integer constant reflecting the major version of the wxWidgets release used to build wxRuby - WXWIDGETS_MAJOR_VERSION = \#{Wx::WXWIDGETS_MAJOR_VERSION} - - # Integer constant reflecting the minor version of the wxWidgets release used to build wxRuby - WXWIDGETS_MINOR_VERSION = \#{Wx::WXWIDGETS_MINOR_VERSION} - - # Integer constant reflecting the release number of the wxWidgets release used to build wxRuby - WXWIDGETS_RELEASE_NUMBER = \#{Wx::WXWIDGETS_RELEASE_NUMBER} - - # Integer constant reflecting the sub-release number of the wxWidgets release used to build wxRuby - WXWIDGETS_SUBRELEASE_NUMBER = \#{Wx::WXWIDGETS_SUBRELEASE_NUMBER} - - # Integer constant reflecting the wxWidgets wxDEBUG_LEVEL - WXWIDGETS_DEBUG_LEVEL = \#{Wx::WXWIDGETS_DEBUG_LEVEL} - - # Boolean constant indicating if wxRuby was build in debug (true) or release (false) mode - DEBUG = \#{Wx::DEBUG} - - # Platform id of the wxWidgets port used to build wxRuby - PLATFORM = '\#{Wx::PLATFORM}' - - end - __HEREDOC - end + STDOUT.puts \<<~__HEREDOC + # ---------------------------------------------------------------------------- + # This file is automatically generated by the WXRuby3 documentation + # generator. Do not alter this file. + # ---------------------------------------------------------------------------- + + + module Wx + + # wxRuby version string + WXRUBY_VERSION = '\#{Wx::WXRUBY_VERSION}' + + # wxRuby version release type (alpha, beta, rc) + WXRUBY_RELEASE_TYPE = '\#{Wx::WXRUBY_RELEASE_TYPE}' + # wxRuby major version number + WXRUBY_MAJOR = \#{Wx::WXRUBY_MAJOR} + # wxRuby minor version number + WXRUBY_MINOR = \#{Wx::WXRUBY_MINOR} + # wxRuby release number + WXRUBY_RELEASE = \#{Wx::WXRUBY_RELEASE} + + # Convenience string for WxWidgets version info + WXWIDGETS_VERSION = '\#{Wx::WXWIDGETS_VERSION}' + + # Integer constant reflecting the major version of the wxWidgets release used to build wxRuby + WXWIDGETS_MAJOR_VERSION = \#{Wx::WXWIDGETS_MAJOR_VERSION} + + # Integer constant reflecting the minor version of the wxWidgets release used to build wxRuby + WXWIDGETS_MINOR_VERSION = \#{Wx::WXWIDGETS_MINOR_VERSION} + + # Integer constant reflecting the release number of the wxWidgets release used to build wxRuby + WXWIDGETS_RELEASE_NUMBER = \#{Wx::WXWIDGETS_RELEASE_NUMBER} + + # Integer constant reflecting the sub-release number of the wxWidgets release used to build wxRuby + WXWIDGETS_SUBRELEASE_NUMBER = \#{Wx::WXWIDGETS_SUBRELEASE_NUMBER} + + # Integer constant reflecting the wxWidgets wxDEBUG_LEVEL + WXWIDGETS_DEBUG_LEVEL = \#{Wx::WXWIDGETS_DEBUG_LEVEL} + + # Boolean constant indicating if wxRuby was build in debug (true) or release (false) mode + DEBUG = \#{Wx::DEBUG} + + # Platform id of the wxWidgets port used to build wxRuby + PLATFORM = '\#{Wx::PLATFORM}' + + end + __HEREDOC __SCRIPT begin tmpfile = Tempfile.new('script') From 53f4317a8587ce868f547f3defc5f13ba0581eab Mon Sep 17 00:00:00 2001 From: Martin Corino Date: Sun, 4 Feb 2024 18:35:36 +0100 Subject: [PATCH 6/6] bump version --- lib/wx/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wx/version.rb b/lib/wx/version.rb index b792e3f4..688ce705 100644 --- a/lib/wx/version.rb +++ b/lib/wx/version.rb @@ -3,5 +3,5 @@ # This software is released under the MIT license. module Wx - WXRUBY_VERSION = '0.9.6' + WXRUBY_VERSION = '0.9.7' end