diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-30 04:01:58 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-30 04:01:58 +0000 |
commit | f989f7c7ea89bb0b4a120666f5e85c0a81c9b44c (patch) | |
tree | 4103aa778fddb2ac2c431b1c555fe51be7b7fa0c /ext/-test-/string/ellipsize.c | |
parent | 4dcc883d06cdc0f933fe83f307c7c6a5c1e41d05 (diff) | |
download | ruby-f989f7c7ea89bb0b4a120666f5e85c0a81c9b44c.tar.gz |
* string.c (rb_str_ellipsize): new function to ellipsize a string.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/-test-/string/ellipsize.c')
-rw-r--r-- | ext/-test-/string/ellipsize.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/-test-/string/ellipsize.c b/ext/-test-/string/ellipsize.c new file mode 100644 index 0000000000..0451519492 --- /dev/null +++ b/ext/-test-/string/ellipsize.c @@ -0,0 +1,13 @@ +#include "ruby.h" + +static VALUE +bug_str_ellipsize(VALUE str, VALUE len) +{ + return rb_str_ellipsize(str, NUM2LONG(len)); +} + +void +Init_ellipsize(VALUE klass) +{ + rb_define_method(klass, "ellipsize", bug_str_ellipsize, 1); +} |