Project

General

Profile

Actions

Feature #5658

closed

Wrap mkmf.rb in a module to clean up documentation

Added by drbrain (Eric Hodel) almost 13 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
[ruby-core:41187]

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


Files

mkmf.rb.in_a_module.patch (132 KB) mkmf.rb.in_a_module.patch drbrain (Eric Hodel), 11/22/2011 11:42 AM
mkmf.rb.in_a_module.2.patch (132 KB) mkmf.rb.in_a_module.2.patch Corrected patch drbrain (Eric Hodel), 11/23/2011 07:46 AM
mkmf.rb.in_a_module.no_whitespace.patch (2.81 KB) mkmf.rb.in_a_module.no_whitespace.patch svn diff -x -w lib/mkmf.rb drbrain (Eric Hodel), 11/23/2011 07:48 AM

Updated by nobu (Nobuyoshi Nakada) almost 13 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

Updated by drbrain (Eric Hodel) almost 13 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.

Updated by drbrain (Eric Hodel) almost 13 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.

Updated by drbrain (Eric Hodel) almost 13 years ago

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

Updated by nobu (Nobuyoshi Nakada) almost 13 years ago

  • Assignee set to drbrain (Eric Hodel)

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

Actions #6

Updated by drbrain (Eric Hodel) almost 13 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
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0