Feature #5658

Wrap mkmf.rb in a module to clean up documentation

Added by Eric Hodel over 3 years ago. Updated over 3 years ago.

[ruby-core:41187]
Status:Closed
Priority:Normal
Assignee:Eric Hodel

Description

=begin
Currently all of the methods in mkmf.rb exist at the top-level. This causes methods from mkmf.rb to show up in Object in ((%ri%)).

The attached patch wraps the functionality of mkmf.rb in a module MakeMakefile which is then included at top-level.

This preserves the existing functionality while separating the documentation.

The patch survives make clean; make on OS X 10.7
=end

mkmf.rb.in_a_module.patch Magnifier (132 KB) Eric Hodel, 11/22/2011 11:42 AM

mkmf.rb.in_a_module.2.patch Magnifier - Corrected patch (132 KB) Eric Hodel, 11/23/2011 07:46 AM

mkmf.rb.in_a_module.no_whitespace.patch Magnifier - svn diff -x -w lib/mkmf.rb (2.81 KB) Eric Hodel, 11/23/2011 07:48 AM

Associated revisions

Revision 33890
Added by Eric Hodel over 3 years ago

  • lib/mkmf.rb: Wrap mkmf.rb in module MakeMakefile to clean up Object documentation. [Ruby 1.9 - Feature #5658]
  • ext/extmk.rb: Use MakeMakefile::CONFIG instead of Object::CONFIG
  • test/mkmf/base.rb: ditto

Revision 33890
Added by Eric Hodel over 3 years ago

  • lib/mkmf.rb: Wrap mkmf.rb in module MakeMakefile to clean up Object documentation. [Ruby 1.9 - Feature #5658]
  • ext/extmk.rb: Use MakeMakefile::CONFIG instead of Object::CONFIG
  • test/mkmf/base.rb: ditto

History

#1 Updated by Nobuyoshi Nakada over 3 years ago

=begin
I agree the concept, and have planned for it.

But, the patch reverts (({try_func})) partially (and
unintentionally?), and (({try_header})) should be defined in the
module not only in (({Object})).

Also, since (({mkmf_failed})) should not be registered more than once,
(({END})) block should not be moved?
=end

#2 Updated by Eric Hodel over 3 years ago

I merged the try_func change and thought I got it right, but obviously not. I will check it again.

I will define try_header in MakeMakefile and restore the END behavior.

What do you think of the name "MakeMakefile"? I do not know if a name like "Mkmf" or "MkMf" would be better.

#3 Updated by Eric Hodel over 3 years ago

I fixed the accidental reversion of try_func and placed try_header in the module. I also fixed the tests.

I restored the position of the END block outside the module.

#4 Updated by Eric Hodel over 3 years ago

Here is a separate patch of lib/mkmf.rb without whitespace changes for verification purposes

#5 Updated by Nobuyoshi Nakada over 3 years ago

  • Assignee set to Eric Hodel

It seems same as mine.
Let's try it.

#6 Updated by Eric Hodel over 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r33890.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • lib/mkmf.rb: Wrap mkmf.rb in module MakeMakefile to clean up Object documentation. [Ruby 1.9 - Feature #5658]
  • ext/extmk.rb: Use MakeMakefile::CONFIG instead of Object::CONFIG
  • test/mkmf/base.rb: ditto

Also available in: Atom PDF