[#309764] The Rubyist -- a semi-monthly magazine for Rubyists AVAILABLE NOW — "Jeremy McAnally" <jeremymcanally@...>

Hello all,

9 messages 2008/08/01

[#309802] Using array.select with grep — Milo Thurston <knirirr@...>

Using irb I set up the following arrays:

16 messages 2008/08/01

[#309821] About circular dependencies in RubyGems (the library). And about the order in $". — "Erik Veenstra" <erikveen@...>

Hi,

13 messages 2008/08/01

[#309824] Determining MAC address — "Glen Holcomb" <damnbigman@...>

What would be the best (clean, cross-platform) way of determining the MAC

12 messages 2008/08/01

[#309867] Capturing shell command output and success? — "Kyle Schmitt" <kyleaschmitt@...>

I know shell commands have beaten to death on this list, but searching

10 messages 2008/08/01

[#309878] Help finding this syntax error — Patrick Li <patrickli_2001@...>

<code>

14 messages 2008/08/01

[#309903] unit testing advice — Shadowfirebird <shadowfirebird@...>

Forgive me if this is a stupid question.

58 messages 2008/08/01
[#309905] Re: unit testing advice — "Gregory Brown" <gregory.t.brown@...> 2008/08/01

On Fri, Aug 1, 2008 at 5:31 PM, Shadowfirebird <shadowfirebird@gmail.com> wrote:

[#309907] Re: unit testing advice — Shadowfirebird <shadowfirebird@...> 2008/08/01

Many thanks. Clearly I'm going to have to go back to research mode on

[#309916] Re: unit testing advice — Phlip <phlip2005@...> 2008/08/02

Shadowfirebird wrote:

[#309947] Re: unit testing advice — "David A. Black" <dblack@...> 2008/08/02

Hi --

[#309948] Re: unit testing advice — Phlip <phlip2005@...> 2008/08/02

David A. Black wrote:

[#309949] Re: unit testing advice — "David A. Black" <dblack@...> 2008/08/02

Hi --

[#309960] Re: unit testing advice — Shadowfirebird <shadowfirebird@...> 2008/08/02

I certainly "get" the idea that it's better to write the tests first.

[#309966] Re: unit testing advice — "David A. Black" <dblack@...> 2008/08/02

Hi --

[#309979] Re: unit testing advice — James Britt <james.britt@...> 2008/08/02

David A. Black wrote:

[#309983] Re: unit testing advice — "David A. Black" <dblack@...> 2008/08/02

Hi --

[#310011] Re: unit testing advice — James Britt <james.britt@...> 2008/08/03

David A. Black wrote:

[#310018] Re: unit testing advice — "David A. Black" <dblack@...> 2008/08/03

Hi --

[#310050] RubyConf 2008 call for talk proposals — Richard Kilmer <rich@...>

Ruby Central is pleased to announce that we are accepting

11 messages 2008/08/04

[#310127] hash code reference - this only returns 'nil' please help me — Mmcolli00 Mom <mmc_collins@...>

Please tell me what I am doing wrong. i thought h[ErrFieldID] would work

12 messages 2008/08/04
[#310128] Re: hash code reference - this only returns 'nil' please help me — Sebastian Hungerecker <sepp2k@...> 2008/08/04

Mmcolli00 Mom wrote:

[#310131] Re: hash code reference - this only returns 'nil' please help me — Mmcolli00 Mom <mmc_collins@...> 2008/08/04

Sebastian Hungerecker wrote:

[#310154] Matrix class: How to set a single element ? — Marcio Braga <mbraga0001@...>

simple code:

11 messages 2008/08/05

[#310159] State of the Onion — "M. Edward (Ed) Borasky" <znmeb@...>

http://www.gcn.com/online/vol1_no1/46724-1.html

36 messages 2008/08/05
[#310179] Re: State of the Onion — "Michael T. Richter" <ttmrichter@...> 2008/08/05

On Tue, 2008-08-05 at 11:05 +0900, M. Edward (Ed) Borasky wrote:

[#310190] Re: State of the Onion — "Martin DeMello" <martindemello@...> 2008/08/05

On Mon, Aug 4, 2008 at 8:48 PM, Michael T. Richter <ttmrichter@gmail.com> wrote:

[#310217] perl and the culture of libraries — "Martin DeMello" <martindemello@...>

http://blog.jrock.us/articles/You%20are%20missing%20the%20point%20of%20Perl.pod

60 messages 2008/08/05
[#310219] Re: perl and the culture of libraries — "Peter Fitzgibbons" <peter.fitzgibbons@...> 2008/08/05

I'm on board.

[#310223] Re: perl and the culture of libraries — "Martin DeMello" <martindemello@...> 2008/08/05

On Tue, Aug 5, 2008 at 6:04 AM, Peter Fitzgibbons

[#310228] Re: perl and the culture of libraries — "Peter Fitzgibbons" <peter.fitzgibbons@...> 2008/08/05

Sounds like some changes to rubygems and it's toolset.

[#310232] Re: perl and the culture of libraries — "Martin DeMello" <martindemello@...> 2008/08/05

On Tue, Aug 5, 2008 at 6:31 AM, Peter Fitzgibbons

[#310237] Re: perl and the culture of libraries — "Peter Fitzgibbons" <peter.fitzgibbons@...> 2008/08/05

Isn't it true, though, that rubygems are the defacto distribution model for

[#310240] Re: perl and the culture of libraries — "Martin DeMello" <martindemello@...> 2008/08/05

On Tue, Aug 5, 2008 at 7:05 AM, Peter Fitzgibbons

[#310249] Re: perl and the culture of libraries — Shadowfirebird <shadowfirebird@...> 2008/08/05

I don't wish to be critical (I really don't! That's not just a way of

[#310312] Re: perl and the culture of libraries — David Masover <ninja@...> 2008/08/06

On Tuesday 05 August 2008 07:56:22 Martin DeMello wrote:

[#310339] Re: perl and the culture of libraries — Shadowfirebird <shadowfirebird@...> 2008/08/06

I've seen some things posted in this thread (overnight for me) that I

[#310295] State of Ruby 1.8.6? — Jeff <cohen.jeff@...>

Can anyone provide an update to the state of Ruby 1.8.6?

19 messages 2008/08/05
[#310305] Re: State of Ruby 1.8.6? — Alex Fenton <alex@...> 2008/08/06

Jeff wrote:

[#310314] is there a way to AutoParse a string to another type - e.g. if a Date format then date, else if integer than Integer etc ????? — "Greg Hauptmann" <greg.hauptmann.ruby@...>

Hi,

7 messages 2008/08/06

[#310358] Threaded IO trouble — "Michal Suchanek" <hramrach@...>

Hello

13 messages 2008/08/06

[#310393] An introduction, in about 50 lines of Ruby. — Alexei Broner <lahgyk@...>

Hi, I'm Lex. I've been Rubying for a few months now and can't get

47 messages 2008/08/06
[#310582] Re: An introduction, in about 50 lines of Ruby. — Alexei Broner <lahgyk@...> 2008/08/08

You guys are no fun. I didn't even get "that's not really recursive,

[#310584] Re: An introduction, in about 50 lines of Ruby. — Yukihiro Matsumoto <matz@...> 2008/08/08

Hi,

[#310591] Re: An introduction, in about 50 lines of Ruby. — Trans <transfire@...> 2008/08/08

[#310639] Re: An introduction, in about 50 lines of Ruby. — James Britt <james.britt@...> 2008/08/08

Trans wrote:

[#310731] Re: An introduction, in about 50 lines of Ruby. — Trans <transfire@...> 2008/08/10

[#310740] Re: An introduction, in about 50 lines of Ruby. — James Britt <james.britt@...> 2008/08/10

Trans wrote:

[#310745] Re: An introduction, in about 50 lines of Ruby. — Trans <transfire@...> 2008/08/10

[#310413] Need help detecting overlapping ranges — Bryan Richardson <btrichardson@...>

Hello all,

18 messages 2008/08/06
[#310429] Re: Need help detecting overlapping ranges — "Martin DeMello" <martindemello@...> 2008/08/06

On Wed, Aug 6, 2008 at 11:48 AM, Bryan Richardson

[#310518] Most compact command for associate array 'totalling'? — John Pritchard-williams <monojohnny@...>

Ok - in 'awk' you can do this: (Where 'array' is empty initially)

10 messages 2008/08/07

[#310531] Ruby 1.8.7-p71 / 1.8.6-p286 released (Security Fix) — Urabe Shyouhei <shyouhei@...>

At last.

13 messages 2008/08/08

[#310540] Ruby IDE — "Mayuresh Kathe" <kathe.mayuresh@...>

Hello,

52 messages 2008/08/08
[#310600] Re: Ruby IDE — "Jayson Williams" <williams.jayson@...> 2008/08/08

I like working in NetBeans, but even on the Quad processor computer at

[#310603] Re: Ruby IDE — Dana Merrick <dmerrick@...> 2008/08/08

Jayson Williams wrote:

[#310610] Re: Ruby IDE — "Eric Schulte" <schulte.eric@...> 2008/08/08

To piggy-back on and emphasize the importance of Dana's point,

[#310719] Re: Ruby IDE — "Piyush Ranjan" <piyush.pr@...> 2008/08/09

I second emacs

[#310725] Re: Ruby IDE — "M. Edward (Ed) Borasky" <znmeb@...> 2008/08/09

On Sun, 2008-08-10 at 05:25 +0900, Piyush Ranjan wrote:

[#310726] Re: Ruby IDE — Matt Lawrence <matt@...> 2008/08/09

On Sun, 10 Aug 2008, M. Edward (Ed) Borasky wrote:

[#310733] Re: Ruby IDE — Joshua Ballanco <jballanc@...> 2008/08/10

Matt Lawrence wrote:

[#310814] Re: Ruby IDE — "Martin DeMello" <martindemello@...> 2008/08/11

On 8/9/08, Joshua Ballanco <jballanc@gmail.com> wrote:

[#310580] Non-Threaded Timeout? — Bryan Richardson <btrichardson@...>

Hell all,

30 messages 2008/08/08

[#310837] gem (update ?) problem — Peter Krieg <pk.hot@...>

Hello,

21 messages 2008/08/11

[#310865] Sort array by two attributes? (like sql "order by A, B") — Max Williams <toastkid.williams@...>

IN sql we can pass two arguments to the 'order by' component, and it

9 messages 2008/08/11

[#310921] Problems with accessing directory defined in ENV variables — Thomas Luedeke <thomas.luedeke@...>

Ruby is giving me pure hell trying to access directories on a mounted

10 messages 2008/08/11

[#310947] Sigh! I'm depressed. Debian vs Ruby and the backtick and subshells — John Carter <john.carter@...>

I have just strace'd weird bug to it's root cause.

20 messages 2008/08/12

[#310950] Ruby 1.9: What to Expect by Sam Ruby @ OSCON 2008 Slide Deck Adapted S6/S9 (Single-Web Page) Version — "Gerald Bauer" <geraldbauer2007@...>

Hello,

15 messages 2008/08/12
[#311073] Re: Ruby 1.9: What to Expect by Sam Ruby @ OSCON 2008 Slide Deck Adapted S6/S9 (Single-Web Page) Version — Iki Baz Castillo <ibc@...> 2008/08/12

El Martes, 12 de Agosto de 2008, Gerald Bauer escribi=F3:

[#311080] Re: Ruby 1.9: What to Expect by Sam Ruby @ OSCON 2008 Slide Deck Adapted S6/S9 (Single-Web Page) Version — "Jeremy Kemper" <jeremy@...> 2008/08/12

On Tue, Aug 12, 2008 at 1:36 PM, I=F1aki Baz Castillo <ibc@aliax.net> wrote=

[#311085] Re: Ruby 1.9: What to Expect by Sam Ruby @ OSCON 2008 Slide Deck Adapted S6/S9 (Single-Web Page) Version — Iki Baz Castillo <ibc@...> 2008/08/12

El Martes, 12 de Agosto de 2008, Jeremy Kemper escribi=F3:

[#311086] Re: Ruby 1.9: What to Expect by Sam Ruby @ OSCON 2008 Slide Deck Adapted S6/S9 (Single-Web Page) Version — Iki Baz Castillo <ibc@...> 2008/08/12

El Martes, 12 de Agosto de 2008, I=F1aki Baz Castillo escribi=F3:

[#310988] what do you think of this code? — "Ben Aurel" <ben.aurel@...>

hi

16 messages 2008/08/12
[#310992] Re: what do you think of this code? — Stefano Crocco <stefano.crocco@...> 2008/08/12

On Tuesday 12 August 2008, Ben Aurel wrote:

[#311235] Mutithreading to implement near 7000 to 10000 mssage per min — Kaja Mohaideen <kajamohaideen_2003@...>

Hello,

10 messages 2008/08/14

[#311256] Idiom of removing a particular character from a String? — "Lorenzo E. Danielsson" <danielsson.lorenzo@...>

Hi all,

12 messages 2008/08/14

[#311390] Not So Random (#173) — "Matthew Moss" <matthew.moss@...>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

20 messages 2008/08/15

[#311427] BDD and TDD - What are they for? — "Clinton D. Judy" <cdj@...>

I'd like someone to give me very basic reasons for why I need Behavior

42 messages 2008/08/15
[#311655] Re: BDD and TDD - What are they for? — paron <rphillips@...> 2008/08/18

On Aug 16, 11:27=A0am, Eleanor McHugh <elea...@games-with-brains.com>

[#311469] firefox html, my downloaded html and firebug html different? — Adam Akhtar <adamtemporary@...>

Hi Im a relatively new rubyist and programmer in general and currently

10 messages 2008/08/16

[#311517] I wish to learn Ruby ,can anyone teach me??? — Amitanshu Gour <amitanshu_gour@...>

I am a beginner in Programming and don't have much idea about any

10 messages 2008/08/16

[#311523] writing if statement in one line with elsif condition — "Luiz Vitor Martinez Cardoso" <grabber@...>

I'm trying to convert it:

10 messages 2008/08/17

[#311553] Matrix: Need help to understand this behavior — Marcio Braga <mbraga0001@...>

a=[1]

10 messages 2008/08/17

[#311571] Security in use of contants — Kless <jonas.esp@...>

Is secure use constants?

40 messages 2008/08/17

[#311668] Hash#each vs Hash#each_pair — "Patrick Doyle" <wpdster@...>

Sorry if this is a FAQ, but I'm curious to learn the rationale behind

12 messages 2008/08/18

[#311803] Cut a string if length > n — Pål Bergström <pal@...>

What's the best way to cut a string if the length is above n characters?

15 messages 2008/08/19

[#311843] Shortest Ruby crash #49 — Limo Driver <melezov@...>

My contribution to the contest:

15 messages 2008/08/19

[#311937] A Mascot... — "Mayuresh Kathe" <kathe.mayuresh@...>

Hi,

100 messages 2008/08/20
[#311969] Re: A Mascot... — Phlip <phlip2005@...> 2008/08/20

Mayuresh Kathe wrote:

[#311979] Re: A Mascot... — "Mayuresh Kathe" <kathe.mayuresh@...> 2008/08/20

On Wed, Aug 20, 2008 at 5:51 PM, Phlip <phlip2005@gmail.com> wrote:

[#311980] Re: A Mascot... — "Michal Suchanek" <hramrach@...> 2008/08/20

On 20/08/2008, Mayuresh Kathe <kathe.mayuresh@gmail.com> wrote:

[#311983] Re: A Mascot... — "Clinton D. Judy" <cdj@...> 2008/08/20

V2hpY2ggaXMgd2h5IGEgZ3JlYXQgZ3JhcGhpYyBkZXNpZ25lciBjb3VsZCBjb21lIHVwIHdpdGgg

[#311984] Re: A Mascot... — "Mayuresh Kathe" <kathe.mayuresh@...> 2008/08/20

Clinton, what's your opinion about http://www.hexley.com/

[#312284] Re: A Mascot... — Karl von Laudermann <doodpants@...> 2008/08/22

On Aug 21, 8:26=A0pm, Joshua Ballanco <jball...@gmail.com> wrote:

[#312302] Re: A Mascot... — "Pablo Q." <paqs140482@...> 2008/08/22

I like it! :D, but If you haven=B4t read all post before please do it,

[#312305] Re: A Mascot... — "Gregory Brown" <gregory.t.brown@...> 2008/08/22

On Fri, Aug 22, 2008 at 1:22 PM, Pablo Q. <paqs140482@gmail.com> wrote:

[#311950] array of hashes - need to iterate and calulate stats but how — Adam Akhtar <adamtemporary@...>

I making a script which generates some basic stats for completed

19 messages 2008/08/20
[#311952] Re: array of hashes - need to iterate and calulate stats but how — Lex Williams <etaern@...> 2008/08/20

something like this :

[#311962] Re: array of hashes - need to iterate and calulate stats but how — "David A. Black" <dblack@...> 2008/08/20

Hi --

[#312026] Iterating through a hash — "Brian Ross" <p.brian.ross@...>

How can I iterate through a hash so that each key is modified and saved into

13 messages 2008/08/20

[#312048] unintuitive language feature (exclamation functions) — Nick Brown <ruby-forum.com@...>

I was surprised to discover that the code

20 messages 2008/08/20
[#312050] Re: unintuitive language feature (exclamation functions) — "F. Senault" <fred@...> 2008/08/20

Le 20 ao皦 2008 21:45, Nick Brown a 馗rit :

[#312054] Re: unintuitive language feature (exclamation functions) — Nick Brown <ruby-forum.com@...> 2008/08/20

F. Senault wrote:

[#312068] "num in [1,2,3,4]" in a cool way? — Iñaki Baz Castillo <ibc@...>

Hi, AFAIK in Ruby the only (or the "coolest") way to do something as:

17 messages 2008/08/20

[#312360] DoS vulnerability in REXML — Shugo Maeda <shugo@...>

Hello,

16 messages 2008/08/23
[#312384] Re: [ANN] DoS vulnerability in REXML — James Britt <james.britt@...> 2008/08/23

Shugo Maeda wrote:

[#312391] Re: [ANN] DoS vulnerability in REXML — "Christopher Dicely" <cmdicely@...> 2008/08/23

On Sat, Aug 23, 2008 at 9:28 AM, James Britt <james.britt@gmail.com> wrote:

[#312411] Re: [ANN] DoS vulnerability in REXML — James Britt <james.britt@...> 2008/08/23

Christopher Dicely wrote:

[#312378] Uptime Since... (#174) — "Matthew Moss" <matthew.moss@...>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

26 messages 2008/08/23

[#312388] Why 'if 0' succeeds in Ruby — Phlip <phlip2005@...>

Rubiods:

21 messages 2008/08/23

[#312401] Open file, get first line, delete first line close file — Richard Schneeman <thedickster@...>

Hey, i'm trying to open a file, get the first line of the file, delete

17 messages 2008/08/23

[#312482] Moving all files in a folder to another hard drive — SpringFlowers AutumnMoon <summercoolness@...>

I have some code below to move all files in a folder to another hard

14 messages 2008/08/24

[#312573] Regular Expressions — Newb Newb <hema@...>

I have a image url like this <img src

16 messages 2008/08/25

[#312655] Unraveling binary data out of the proc filesystem on Solaris — Daniel Berger <djberg96@...>

Hi all,

13 messages 2008/08/25
[#312679] Re: Unraveling binary data out of the proc filesystem on Solaris — "Heesob Park" <phasis@...> 2008/08/26

Hi,

[#312734] Passing a block with define_method — "James Coglan" <jcoglan@...>

Hi list,

14 messages 2008/08/26

[#312739] MissingSourceFile: no such file to load -- sqlite3/database — Jo縊 Maca兊a <joao.macaiba@...>

Hi,

11 messages 2008/08/26

[#312792] Chris Pine Tutorial 99 Bottles of Beer Program — danielj <sleepingindian@...>

Just a beginner with a question about this:

15 messages 2008/08/26

[#312795] Deaf Grandma — danielj <sleepingindian@...>

Also from the Chris Pine tutorial for beginners:

20 messages 2008/08/27

[#312825] how to avoid passing by reference and how to copy objects — Adam Akhtar <adamtemporary@...>

Hi after a bit of searching and reading im quite confused by this.

12 messages 2008/08/27

[#312839] Difficult Inheritance Problem — Toby Clemson <tobyclemson@...>

Hi all,

15 messages 2008/08/27

[#312875] encrypting password on form submit? — "Amanda .." <a.etherton@...>

Hi there, I'm trying to use a form to create a user for a site. All the

19 messages 2008/08/27

[#312906] Having a difficult time with Case statements. — Chris Bailey <christopher.sean.bailey@...>

I am trying to implement a simple frontend for a text adventure that

12 messages 2008/08/27

[#312989] specifying a network interface, with a http get request — Andrew Parlane <ajp97@...>

Hi all, I'm fairly new to Ruby but have learnt a lot in the last month

13 messages 2008/08/28
[#313071] Re: specifying a network interface, with a http get request — John Pritchard-williams <monojohnny@...> 2008/08/28

Hi Andy,

[#313182] Re: specifying a network interface, with a http get request — Andrew Parlane <ajp97@...> 2008/08/29

Hey John,

[#312990] Beginner help: Problem installing sqlite3 on Windows XP — Kasper Frederiksen <kasper@...>

Hi Everyone,

11 messages 2008/08/28

[#313031] A general doubt — Rock Roll <karoljouis@...>

If I am developing a Windows application in Ruby using FxRuby or WxRuby,

28 messages 2008/08/28
[#313038] Re: A general doubt — Michael Morin <uzimonkey@...> 2008/08/28

Rock Roll wrote:

[#313070] Use a string as a method call — Chris Bailey <christopher.sean.bailey@...>

I'm trying to come up with an efficient way of using user input as a

16 messages 2008/08/28

[#313098] Please don't flame me...why is there no "++" in Ruby again ? — John Pritchard-williams <monojohnny@...>

There's must be very good simple reason why there is no 'x++' method

24 messages 2008/08/28
[#313100] Re: Please don't flame me...why is there no "++" in Ruby again ? — Joel VanderWerf <vjoel@...> 2008/08/28

John Pritchard-williams wrote:

[#313164] Re: Please don't flame me...why is there no "++" in Ruby again ? — David Masover <ninja@...> 2008/08/29

On Thursday 28 August 2008 16:25:59 Joel VanderWerf wrote:

[#313131] Class === — "RubyTalk@..." <rubytalk@...>

I need help with === and Objects

20 messages 2008/08/29
[#313135] Re: Class === — "Patrick Doyle" <wpdster@...> 2008/08/29

and I would also like to know why

[#313196] Computing folder size - do you have something cleaner than this ? — Thibaut Barr鑽e <thibaut.barrere@...>

Hi guys,

11 messages 2008/08/29

[#313242] Where the Required Things Are (#175) — "Matthew Moss" <matthew.moss@...>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

21 messages 2008/08/29

[#313379] instance_eval/class_eval including/extending modules — Pedro Silva <ei04065@...>

Consider the following example:

14 messages 2008/08/30
[#313401] Re: instance_eval/class_eval including/extending modules — "David A. Black" <dblack@...> 2008/08/31

HI --

[#313428] Re: instance_eval/class_eval including/extending modules — Pedro Silva <ei04065@...> 2008/08/31

David, thanks for your reply.

[#313432] Re: instance_eval/class_eval including/extending modules — "David A. Black" <dblack@...> 2008/08/31

Hi --

[#313399] Difference between dir/**/* and dir/*? — Ben Johnson <bjohnson@...>

I've noticed the following when specifying a wildcard array of files:

14 messages 2008/08/31

Re: Readline and conditional tab results based on input

From: Takao Kouji <kouji@...7.net>
Date: 2008-08-12 08:17:57 UTC
List: ruby-talk #310955
Hi,

On 2008/08/11, at 13:42, Takao Kouji wrote:
>> And with Readline.completion_proc i have code that will return only dirs
>> in this directory. But I would like to invoke this specific code part
>> only
>> when a user typed in i.e. "cd "
>>
>> So if i have a directory called "foobar" it should work here:
>>
>>
>> "cd foo<TAB>"  # completed to foobar
>>
>> but if the user would type
>>
>> "blabalblabla foo<TAB>" # there should be no result
>
> I want to add some methods that satisfy the Marc Heiler's demands.
> The patch contributed to the RubyForge is taken. 
>
>  [#3212] Readline does not provide enough context to the completion_proc
>  http://rubyforge.org/tracker/index.php?func=detail&aid=3212&group_id=426&atid=1698
>
> First of all, I will take it into ruby 1.9. Afterwards, backport to 1.8.

I will add the follows methods.
* line_buffer: Returns the full line that is being edited.
  (same as rl_line_buffer)
* point: Returns the index of the current cursor position 
  in Readline.line_buffer. (same as rl_point)

The match_start is computed by subtracting the length of input-string
from Readline.point.
The match_end and Readline.line_buffer are same.

Attached the patch for ruby 1.9 (r18525).

Thanks, TAKAO Kouji.
-----

Index: ext/readline/readline.c
===================================================================
--- ext/readline/readline.c	(revision 18525)
+++ ext/readline/readline.c	(working copy)
@@ -367,6 +367,56 @@
     return rb_attr_get(mReadline, completion_case_fold);
 }
 
+/*
+ * call-seq:
+ *   Readline.line_buffer -> string
+ *
+ * Returns the full line that is being edited. This is useful from
+ * within the complete_proc for determining the context of the
+ * completion request.
+ *
+ * The length of +Readline.line_buffer+ and GNU Readline's rl_end are
+ * same.
+ */
+static VALUE
+readline_s_get_line_buffer(VALUE self)
+{
+#ifdef HAVE_RL_LINE_BUFFER
+    rb_secure(4);
+    if (rl_line_buffer == NULL)
+	return Qnil;
+    return rb_tainted_str_new2(rl_line_buffer);
+#else
+    rb_notimplement();
+    return Qnil; /* not reached */
+#endif /* HAVE_RL_LINE_BUFFER */
+}
+
+/*
+ * call-seq:
+ *   Readline.point -> int
+ *
+ * Returns the index of the current cursor position in
+ * +Readline.line_buffer+.
+ *
+ * The index in +Readline.line_buffer+ which matches the start of
+ * input-string passed to completion_proc is computed by subtracting
+ * the length of input-string from +Readline.point+.
+ *
+ *   start = (the length of input-string) - Readline.point
+ */
+static VALUE
+readline_s_get_point(VALUE self)
+{
+#ifdef HAVE_RL_POINT
+    rb_secure(4);
+    return INT2NUM(rl_point);
+#else
+    rb_notimplement();
+    return Qnil; /* not reached */
+#endif /* HAVE_RL_POINT */
+}
+
 static char **
 readline_attempted_completion_function(const char *text, int start, int end)
 {
@@ -1196,6 +1246,10 @@
 			       readline_s_set_completion_case_fold, 1);
     rb_define_singleton_method(mReadline, "completion_case_fold",
 			       readline_s_get_completion_case_fold, 0);
+    rb_define_singleton_method(mReadline, "line_buffer",
+			       readline_s_get_line_buffer, 0);
+    rb_define_singleton_method(mReadline, "point",
+			       readline_s_get_point, 0);
     rb_define_singleton_method(mReadline, "vi_editing_mode",
 			       readline_s_vi_editing_mode, 0);
     rb_define_singleton_method(mReadline, "vi_editing_mode?",
Index: ext/readline/extconf.rb
===================================================================
--- ext/readline/extconf.rb	(revision 18525)
+++ ext/readline/extconf.rb	(working copy)
@@ -59,6 +59,8 @@
 have_readline_var("rl_attempted_completion_over")
 have_readline_var("rl_library_version")
 have_readline_var("rl_editing_mode")
+have_readline_var("rl_line_buffer")
+have_readline_var("rl_point")
 # workaround for native windows.
 /mswin|bccwin|mingw/ !~ RUBY_PLATFORM && have_readline_var("rl_event_hook")
 have_readline_func("rl_cleanup_after_signal")
Index: test/readline/test_readline.rb
===================================================================
--- test/readline/test_readline.rb	(revision 18525)
+++ test/readline/test_readline.rb	(working copy)
@@ -3,6 +3,8 @@
 =begin
   class << Readline
     [
+     "line_buffer",
+     "point",
      "vi_editing_mode",
      "emacs_editing_mode",
      "completion_append_character=",
@@ -61,6 +63,8 @@
        ["completer_quote_characters"],
        ["filename_quote_characters=", "\\"],
        ["filename_quote_characters"],
+       ["line_buffer"],
+       ["point"],
       ]
     method_args.each do |method_name, *args|
       assert_raises(SecurityError, NotImplementedError,
@@ -74,41 +78,83 @@
     end
   end
 
-  def test_readline
-    stdin = Tempfile.new("test_readline_stdin")
-    stdout = Tempfile.new("test_readline_stdout")
-    begin
-      stdin.write("hello\n")
-      stdin.close
-      stdout.close
-      line = replace_stdio(stdin.path, stdout.path) {
-        Readline.readline("> ", true)
-      }
-      assert_equal("hello", line)
-      assert_equal(true, line.tainted?)
-      stdout.open
-      assert_equal("> ", stdout.read(2))
-      assert_equal(1, Readline::HISTORY.length)
-      assert_equal("hello", Readline::HISTORY[0])
-      assert_raises(SecurityError) do
-        Thread.start {
-          $SAFE = 1
-          replace_stdio(stdin.path, stdout.path) do
-            Readline.readline("> ".taint)
-          end
-        }.join
+  if !/EditLine/n.match(Readline::VERSION)
+    def test_readline
+      stdin = Tempfile.new("test_readline_stdin")
+      stdout = Tempfile.new("test_readline_stdout")
+      begin
+        stdin.write("hello\n")
+        stdin.close
+        stdout.close
+        line = replace_stdio(stdin.path, stdout.path) {
+          Readline.readline("> ", true)
+        }
+        assert_equal("hello", line)
+        assert_equal(true, line.tainted?)
+        stdout.open
+        assert_equal("> ", stdout.read(2))
+        assert_equal(1, Readline::HISTORY.length)
+        assert_equal("hello", Readline::HISTORY[0])
+        assert_raises(SecurityError) do
+          Thread.start {
+            $SAFE = 1
+            replace_stdio(stdin.path, stdout.path) do
+              Readline.readline("> ".taint)
+            end
+          }.join
+        end
+        assert_raises(SecurityError) do
+          Thread.start {
+            $SAFE = 4
+            replace_stdio(stdin.path, stdout.path) { Readline.readline("> ") }
+          }.join
+        end
+      ensure
+        stdin.close(true)
+        stdout.close(true)
       end
-      assert_raises(SecurityError) do
-        Thread.start {
-          $SAFE = 4
-          replace_stdio(stdin.path, stdout.path) { Readline.readline("> ") }
-        }.join
+    end 
+
+    # line_buffer
+    # point
+    def test_line_buffer__point
+      begin
+        Readline.line_buffer
+        Readline.point
+      rescue NotImplementedError
+        return
       end
-    ensure
-      stdin.close(true)
-      stdout.close(true)
+
+      stdin = Tempfile.new("test_readline_stdin")
+      stdout = Tempfile.new("test_readline_stdout")
+      begin
+        actual_text = nil
+        actual_line_buffer = nil
+        actual_point = nil
+        Readline.completion_proc = proc { |text|
+          actual_text = text
+          actual_point = Readline.point
+          actual_buffer_line = Readline.line_buffer
+          stdin.write(" finish\n")
+          stdin.close
+          stdout.close
+          return ["complete"]
+        }
+        stdin.write("first second\t")
+        stdin.flush
+        line = replace_stdio(stdin.path, stdout.path) {
+          Readline.readline("> ", false)
+        }
+        assert_equal("first second", actual_line_buffer)
+        assert_equal(12, actual_point)
+        assert_equal("first complete finish", Readline.line_buffer)
+        assert_equal(21, Readline.point)
+      ensure
+        stdin.close(true)
+        stdout.close(true)
+      end
     end
-  end if !/EditLine/n.match(Readline::VERSION)
+  end
 
   def test_input=
     assert_raise(TypeError) do


In This Thread