Project

General

Profile

Feature #5666

Make rb_path2class public

Added by tenderlovemaking (Aaron Patterson) over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-core:41262]

Description

I would like to make rb_path2class public C api. I've attached a patch to make it happen along with updates to README.EXT and README.EXT.ja.


Files

path2class.patch (2.05 KB) path2class.patch header update tenderlovemaking (Aaron Patterson), 11/24/2011 06:53 AM

Related issues

Related to Ruby trunk - Feature #5690: Module#qualified_const_getClosedActions

History

Updated by wycats (Yehuda Katz) over 7 years ago

While we're at it, can we create a version of this exposed to Ruby?

Something like Module#path_to_module would be great. We already have a bunch of code in Rails to handle it, but I always wished it was just exposed directly into Ruby.

Updated by kosaki (Motohiro KOSAKI) over 7 years ago

If we expose rb_path2class(char*), we maybe need to expose rb_path_to_class(VALUE) too. because rb_path2class() is convenient and M17N unaware function, and rb_path_to_class() has full power.

Plus, I don't think your proposed doc is very clear.

To look up a constant by a C string, use the function below:

  1. Why constant, not class?
  2. Which string should be passed?

btw, I also don't think path2class() is good name because `path' has unclear meaning and many people imagine it's directory path. but we can't change it anymore....

Updated by naruse (Yui NARUSE) over 7 years ago

Yehuda Katz wrote:

While we're at it, can we create a version of this exposed to Ruby?

Something like Module#path_to_module would be great. We already have a bunch of code in Rails to handle it, but I always wished it was just exposed directly into Ruby.

Could you make a ticket about it?
It is another issue.

Updated by mame (Yusuke Endoh) about 7 years ago

  • Status changed from Open to Assigned
  • Assignee set to tenderlovemaking (Aaron Patterson)

Aaron-san, could you answer Kosaki's comment?

--
Yusuke Endoh mame@tsg.ne.jp

Updated by tenderlovemaking (Aaron Patterson) almost 7 years ago

  • Status changed from Assigned to Closed

This is a dup of #5690, so I'm closing it.

Also available in: Atom PDF