Project

General

Profile

Actions

Feature #5666

closed

Make rb_path2class public

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

Status:
Closed
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 1 (0 open1 closed)

Related to Ruby master - Feature #5690: Module#qualified_const_getClosedtenderlovemaking (Aaron Patterson)Actions

Updated by wycats (Yehuda Katz) almost 13 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) almost 13 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) almost 13 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) over 12 years ago

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

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

--
Yusuke Endoh

Updated by tenderlovemaking (Aaron Patterson) over 12 years ago

  • Status changed from Assigned to Closed

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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0