From f989f7c7ea89bb0b4a120666f5e85c0a81c9b44c Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 30 Jan 2011 04:01:58 +0000 Subject: * 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 --- ext/-test-/string/ellipsize.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ext/-test-/string/ellipsize.c (limited to 'ext/-test-/string/ellipsize.c') 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); +} -- cgit v1.2.3