Skip to content

Commit

Permalink
Merge pull request #245 from mcorino/develop
Browse files Browse the repository at this point in the history
doc gen bugfix release
  • Loading branch information
mcorino committed Feb 5, 2024
2 parents 71e0853 + 53f4317 commit 315fe3d
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 60 deletions.
2 changes: 1 addition & 1 deletion lib/wx/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
96 changes: 47 additions & 49 deletions rakelib/lib/core/package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Wx::WXRUBY_VERSION = '\#{Wx::WXRUBY_VERSION}'
# wxRuby version release type (alpha, beta, rc)
Wx::WXRUBY_RELEASE_TYPE = '\#{Wx::WXRUBY_RELEASE_TYPE}'
# wxRuby major version number
Wx::WXRUBY_MAJOR = \#{Wx::WXRUBY_MAJOR}
# wxRuby minor version number
Wx::WXRUBY_MINOR = \#{Wx::WXRUBY_MINOR}
# wxRuby release number
Wx::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')
Expand Down
17 changes: 12 additions & 5 deletions rakelib/lib/generate/doc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions rakelib/yard/templates/default/fulldoc/html/setup.rb
Original file line number Diff line number Diff line change
@@ -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, 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)
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 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 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
Expand Down

0 comments on commit 315fe3d

Please sign in to comment.