Forum: Ruby-core [ruby-trunk - Feature #8846][Open] Publicize Module#include

76a777ff80f30bd3b390e275cce625bc?d=identicon&s=25 matsuda (Akira Matsuda) (Guest)
on 2013-08-31 07:16
(Received via mailing list)
Issue #8846 has been reported by matsuda (Akira Matsuda).

----------------------------------------
Feature #8846: Publicize Module#include
https://bugs.ruby-lang.org/issues/8846

Author: matsuda (Akira Matsuda)
Status: Open
Priority: Low
Assignee:
Category: core
Target version: current: 2.1.0


I propose changing Module#include to a public method.

* Background
Module#include is currently a private method.
However, the method is actually quite often used (particularly by gem
library authors) for appending some features from outside of the target
module, such as:

  ActiveRecord::Base.send :include, MyPagination

* Use case
% cd rails
% git grep "send[ (]:include," | wc -l
45
76a777ff80f30bd3b390e275cce625bc?d=identicon&s=25 matsuda (Akira Matsuda) (Guest)
on 2013-08-31 07:18
(Received via mailing list)
Issue #8846 has been updated by matsuda (Akira Matsuda).

File public_include.pdf added


----------------------------------------
Feature #8846: Publicize Module#include
https://bugs.ruby-lang.org/issues/8846#change-41463

Author: matsuda (Akira Matsuda)
Status: Open
Priority: Low
Assignee:
Category: core
Target version: current: 2.1.0


I propose changing Module#include to a public method.

* Background
Module#include is currently a private method.
However, the method is actually quite often used (particularly by gem
library authors) for appending some features from outside of the target
module, such as:

  ActiveRecord::Base.send :include, MyPagination

* Use case
% cd rails
% git grep "send[ (]:include," | wc -l
45
0ec4920185b657a03edf01fff96b4e9b?d=identicon&s=25 matz (Yukihiro Matsumoto) (Guest)
on 2013-08-31 08:06
(Received via mailing list)
Issue #8846 has been updated by matz (Yukihiro Matsumoto).


The basic motivation behind #include (and #prepend) being private is we
didn't assume that kind of coding style.
As it turned out, that coding style became popular, I'd accept make them
public.

Matz.

----------------------------------------
Feature #8846: Publicize Module#include
https://bugs.ruby-lang.org/issues/8846#change-41469

Author: matsuda (Akira Matsuda)
Status: Open
Priority: Low
Assignee:
Category: core
Target version: current: 2.1.0


I propose changing Module#include to a public method.

* Background
Module#include is currently a private method.
However, the method is actually quite often used (particularly by gem
library authors) for appending some features from outside of the target
module, such as:

  ActiveRecord::Base.send :include, MyPagination

* Use case
% cd rails
% git grep "send[ (]:include," | wc -l
45
0e610136db92027148906c92d57fdb36?d=identicon&s=25 marcandre (Marc-Andre Lafortune) (Guest)
on 2013-08-31 21:21
(Received via mailing list)
Issue #8846 has been updated by marcandre (Marc-Andre Lafortune).


Great :-)

Taking Rails as an example, I find that the next in line are
`define_method`, `remove_const`, `alias_method` and `attr_*`

As I stated in #6539, I believe these should be public also.
----------------------------------------
Feature #8846: Publicize Module#include
https://bugs.ruby-lang.org/issues/8846#change-41506

Author: matsuda (Akira Matsuda)
Status: Open
Priority: Low
Assignee:
Category: core
Target version: current: 2.1.0


I propose changing Module#include to a public method.

* Background
Module#include is currently a private method.
However, the method is actually quite often used (particularly by gem
library authors) for appending some features from outside of the target
module, such as:

  ActiveRecord::Base.send :include, MyPagination

* Use case
% cd rails
% git grep "send[ (]:include," | wc -l
45
76a777ff80f30bd3b390e275cce625bc?d=identicon&s=25 matsuda (Akira Matsuda) (Guest)
on 2013-09-03 19:02
(Received via mailing list)
Issue #8846 has been updated by matsuda (Akira Matsuda).

Status changed from Open to Closed

Implemented in r42809.
----------------------------------------
Feature #8846: Publicize Module#include
https://bugs.ruby-lang.org/issues/8846#change-41584

Author: matsuda (Akira Matsuda)
Status: Closed
Priority: Low
Assignee:
Category: core
Target version: current: 2.1.0


I propose changing Module#include to a public method.

* Background
Module#include is currently a private method.
However, the method is actually quite often used (particularly by gem
library authors) for appending some features from outside of the target
module, such as:

  ActiveRecord::Base.send :include, MyPagination

* Use case
% cd rails
% git grep "send[ (]:include," | wc -l
45
F52e87b92cafb1e8c6d155076b56ecff?d=identicon&s=25 "Martin J. Dürst" <duerst@it.aoyama.ac.jp> (Guest)
on 2013-09-09 09:05
(Received via mailing list)
Hello Marc-Andre,

On 2013/09/01 4:20, marcandre (Marc-Andre Lafortune) wrote:
>
> Issue #8846 has been updated by marcandre (Marc-Andre Lafortune).
>
>
> Great :-)
>
> Taking Rails as an example, I find that the next in line are `define_method`,
`remove_const`, `alias_method` and `attr_*`
>
> As I stated in #6539, I believe these should be public also.

#6539 is marked closed. Best to open a new issue.    Regards,   Martin.
This topic is locked and can not be replied to.