
Ruby Hacking Guide
lissanwen
这个作者很懒,什么都没留下…
展开
-
Structure of VALUE and objects
[code="java"]#define R_CAST(st) (struct st*)#define RBASIC(obj) (R_CAST(RBasic)(obj))#define ROBJECT(obj) (R_CAST(RObject)(obj))#define RCLASS(obj) (R_CAST(RClass)(obj))#define RMODULE(obj...原创 2010-05-24 16:25:12 · 109 阅读 · 0 评论 -
struct RClass
In Ruby, classes exist as objects during the execution. Of course. So there must be a structure for class objects. That structure is struct RClass. Its structure type flag is T_CLASS.As class and ...原创 2010-05-24 19:12:39 · 98 阅读 · 0 评论 -
struct RNode
[code="java"]typedef struct RNode { unsigned long flags; char *nd_file; union { struct RNode *node; ID id; VALUE value; VALUE (*cfunc)(ANYARGS); ID *tbl; } u1; union...原创 2010-05-25 11:19:00 · 155 阅读 · 0 评论 -
Methods search
With classes structured like this, you can easily imagine the method call process. The m_tbl of the object’s class is searched, and if the method was not found, the [b]m_tbl[/b] of super is searched, ...原创 2010-05-25 11:28:23 · 122 阅读 · 0 评论 -
rb_ivar_set()
[b]rb_ivar_set()[/b] [code="java"] /* write val in the id instance of obj */ 984 VALUE 985 rb_ivar_set(obj, id, val) 986 VALUE obj; 987 ID id; 988 VALUE val; 989 ...原创 2010-05-26 12:30:12 · 109 阅读 · 0 评论 -
ruby syntax
(1..5).inject([], :原创 2011-05-09 01:12:11 · 84 阅读 · 0 评论 -
virtualbox tip
sudo apt-get install libqt4-opengldkpg -i then run "virtualbox"原创 2011-06-05 23:41:03 · 90 阅读 · 0 评论 -
ruby tips
$LOAD_PATHautoload __LINE__ 行号原创 2011-08-03 12:10:04 · 82 阅读 · 0 评论 -
fucking ruby trap
a = $LOAD_PATHrequire 'bundler/setup' #will change the value of $LOAD_PATHb = $LOAD_PATHa == b #fuck!require "xsd/qname" 后$LOAD_PATH里会多一个"/home/wenbo/.rvm/gems/ruby-1.9.2-p180/gems/soap4r...原创 2011-08-03 15:05:51 · 201 阅读 · 0 评论