[#158545] ideas for an RCR: variable locality — Eric Mahurin <eric_mahurin@...>

I would like to start this thread with end goal being to create

17 messages 2005/10/01

[#158548] Gems is over engineered — "Trans" <transfire@...>

There has been a lot of talk on core about Gems and how it interrelates

23 messages 2005/10/01
[#158553] Re: Gems is over engineered — Austin Ziegler <halostatue@...> 2005/10/01

On 10/1/05, Trans <transfire@gmail.com> wrote:

[#158601] why can't Ruby load .gem files directly? — Joshua Haberman <joshua@...>

I've just been reading the recent threads about gems. I don't have

52 messages 2005/10/02
[#158605] Re: why can't Ruby load .gem files directly? — Ryan Leavengood <leavengood@...> 2005/10/02

On 10/1/05, Joshua Haberman <joshua@reverberate.org> wrote:

[#158608] Re: why can't Ruby load .gem files directly? — Joshua Haberman <joshua@...> 2005/10/02

On Oct 1, 2005, at 9:25 PM, Ryan Leavengood wrote:

[#158641] Re: why can't Ruby load .gem files directly? — Devin Mullins <twifkak@...> 2005/10/02

Joshua Haberman wrote:

[#158645] Re: why can't Ruby load .gem files directly? — Eivind Eklund <eeklund@...> 2005/10/02

On 10/2/05, Devin Mullins <twifkak@comcast.net> wrote:

[#158654] Re: why can't Ruby load .gem files directly? — Devin Mullins <twifkak@...> 2005/10/02

Eivind Eklund wrote:

[#158656] Re: why can't Ruby load .gem files directly? — Kevin Brown <blargity@...> 2005/10/02

On Sunday 02 October 2005 10:42, Devin Mullins wrote:

[#158667] Re: why can't Ruby load .gem files directly? — Devin Mullins <twifkak@...> 2005/10/02

Kevin Brown wrote:

[#158686] Re: why can't Ruby load .gem files directly? — Eivind Eklund <eeklund@...> 2005/10/02

On 10/2/05, Devin Mullins <twifkak@comcast.net> wrote:

[#158699] Re: why can't Ruby load .gem files directly? — Devin Mullins <twifkak@...> 2005/10/02

Eivind Eklund wrote:

[#158723] Re: why can't Ruby load .gem files directly? — Austin Ziegler <halostatue@...> 2005/10/02

On 10/2/05, Devin Mullins <twifkak@comcast.net> wrote:

[#158624] C++ equivs in Ruby — Pascal GUICHARD <pascal.guichard@...>

Hi everybody,

16 messages 2005/10/02

[#158720] state of blocking/nonblocking I/O — Joshua Haberman <joshua@...>

Here is my understanding about the current state of I/O in Ruby.

19 messages 2005/10/02

[#158738] Cannot subclass Class? — "itsme213" <itsme213@...>

irb(main):006:0> class MC < Class

16 messages 2005/10/03

[#158830] Type inference — Eivind Eklund <eeklund@...>

On 10/3/05, Tanner Burson <tanner.burson@gmail.com> wrote:

19 messages 2005/10/03

[#158886] : Lisp partial solution - meta-programming help — Louis J Scoras <louis.j.scoras@...>

Hi all;

18 messages 2005/10/03

[#158967] The definitive GUI for Ruby — "Eustaquio Rangel de Oliveira Jr." <eustaquiorangel@...>

-----BEGIN PGP SIGNED MESSAGE-----

28 messages 2005/10/04

[#159024] OFF Topics :: PC-laptop or Powerbook — Squeak Smalltalk <wallenberg@...>

Hi,

18 messages 2005/10/04

[#159093] Object Orientation — Krekna Mektek <krekna@...>

Hi again,

16 messages 2005/10/05

[#159102] Ruby 1.8.3 breaks Needle's logger? — Dido Sevilla <dido.sevilla@...>

I've been using Ruby and Needle to develop many applications, and in

16 messages 2005/10/05
[#159113] Re: Ruby 1.8.3 breaks Needle's logger? — Dick Davies <rasputnik@...> 2005/10/05

On 05/10/05, Dido Sevilla <dido.sevilla@gmail.com> wrote:

[#159141] Re: Ruby 1.8.3 breaks Needle's logger? — Jamis Buck <jamis@37signals.com> 2005/10/05

On Oct 5, 2005, at 2:49 AM, Dick Davies wrote:

[#159127] select! not present but reject! is — "Geert Fannes" <Geert.Fannes@...>

Hello, is there a reason why I can find the in-place mutator method

44 messages 2005/10/05
[#159211] Re: select! not present but reject! is — "Gene Tani" <gene.tani@...> 2005/10/05

Can you use Enumerable#partition ?

[#159251] Re: select! not present but reject! is — Jacob Fugal <lukfugl@...> 2005/10/05

On 10/5/05, Gene Tani <gene.tani@gmail.com> wrote:

[#159256] Re: select! not present but reject! is — "David A. Black" <dblack@...> 2005/10/05

Hi --

[#159304] Re: select! not present but reject! is — Yukihiro Matsumoto <matz@...> 2005/10/06

Hi,

[#159444] Re: select! not present but reject! is — Rob Rypka <rascal1182@...> 2005/10/06

On 10/6/05, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#159450] Re: select! not present but reject! is — "David A. Black" <dblack@...> 2005/10/06

Hi --

[#159457] Re: select! not present but reject! is — Jacob Fugal <lukfugl@...> 2005/10/07

On 10/6/05, David A. Black <dblack@wobblini.net> wrote:

[#159459] Re: select! not present but reject! is — "David A. Black" <dblack@...> 2005/10/07

Hi --

[#159475] Re: select! not present but reject! is — Rob Rypka <rascal1182@...> 2005/10/07

On 10/6/05, David A. Black <dblack@wobblini.net> wrote:

[#159501] Re: select! not present but reject! is — "David A. Black" <dblack@...> 2005/10/07

Hi --

[#159526] Re: select! not present but reject! is — Jacob Fugal <lukfugl@...> 2005/10/07

On 10/7/05, David A. Black <dblack@wobblini.net> wrote:

[#159568] Re: select! not present but reject! is — Mark Hubbart <discordantus@...> 2005/10/07

On 10/7/05, Jacob Fugal <lukfugl@gmail.com> wrote:

[#159571] Re: select! not present but reject! is — Rob Rypka <rascal1182@...> 2005/10/07

On 10/7/05, Mark Hubbart <discordantus@gmail.com> wrote:

[#159575] Re: select! not present but reject! is — "David A. Black" <dblack@...> 2005/10/07

Hi --

[#159600] Re: select! not present but reject! is — Devin Mullins <twifkak@...> 2005/10/08

David A. Black wrote:

[#159144] Vim/Ruby Configuration Files, 2005.10.05 — Doug Kearns <dougkearns@...>

G'day folks,

14 messages 2005/10/05

[#159220] One-liner removing duplicate lines — Damien Wyart <damien.wyart@...>

Hello,

39 messages 2005/10/05
[#159226] Re: One-liner removing duplicate lines — Ryan Leavengood <leavengood@...> 2005/10/05

On 10/5/05, Damien Wyart <damien.wyart@free.fr> wrote:

[#159266] Can Ruby pop like Lisp? — waterbowl@...

Is it possible to write a method in Ruby that acts like pop does in

16 messages 2005/10/06

[#159287] Can ruby replace c? — cmk128@...

Hi

28 messages 2005/10/06

[#159295] foo= ... the only exception to the implicit-self rule ? — "itsme213" <itsme213@...>

Sorry to ask this again, but...

22 messages 2005/10/06

[#159302] RubyConf video, audio, streams and recordings? — ES <ruby-ml@...>

Sadly, I cannot attend this year (I will send you pictures from my

11 messages 2005/10/06

[#159310] traits question — "itsme213" <itsme213@...>

How does one install traits 0.7?

14 messages 2005/10/06

[#159434] documentation & tutorials for net::ssh — bob <bob@...>

Hi

12 messages 2005/10/06

[#159456] Google Calculator command line tool — "m4dc4p" <jgbailey@...>

I whipped a quick script to send queries to Google and scrape results

13 messages 2005/10/07

[#159510] Text Image (#50) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

30 messages 2005/10/07

[#159520] Going to RubyConf? Please post to RubyConf2005Facebook — Curt Hibbs <curt.hibbs@...>

Francis Hwang had the bright idea, and it really cool to see all the faces

20 messages 2005/10/07

[#159547] Method added hook — "aurelianito" <aurelianocalvo@...>

Hi!

17 messages 2005/10/07

[#159548] EuRuKo, get together on Friday? — Kero <kero@...>

Hi!

12 messages 2005/10/07

[#159549] Code for title-casing (US) snail addresses? — "rpardee@..." <rpardee@...>

Hey All,

16 messages 2005/10/07

[#159624] Save the world from evil code crusade — "aurelianito" <aurelianocalvo@...>

Hello!

44 messages 2005/10/08
[#159626] Re: Save the world from evil code crusade — James Britt <james_b@...> 2005/10/08

aurelianito wrote:

[#159627] Re: Save the world from evil code crusade — Kevin Brown <blargity@...> 2005/10/08

On Saturday 08 October 2005 09:09, James Britt wrote:

[#159631] Re: Save the world from evil code crusade — "aurelianito" <aurelianocalvo@...> 2005/10/08

I want to be able to define different capabilities for different parts

[#159692] using lambda/Proc can prevent a lot of garbage collection — Eric Mahurin <eric_mahurin@...>

Does anybody else think it is a serious issue that a Proc holds

27 messages 2005/10/08
[#159717] Re: using lambda/Proc can prevent a lot of garbage collection — Kero <kero@...> 2005/10/09

> Does anybody else think it is a serious issue that a Proc holds

[#159735] Re: using lambda/Proc can prevent a lot of garbage collection — Eric Mahurin <eric_mahurin@...> 2005/10/09

--- Kero <kero@chello.single-dot.nl> wrote:

[#159738] Re: using lambda/Proc can prevent a lot of garbage collection — "David A. Black" <dblack@...> 2005/10/09

Hi --

[#159768] Re: using lambda/Proc can prevent a lot of garbage collection — Eric Hodel <drbrain@...7.net> 2005/10/09

On Oct 9, 2005, at 8:20 AM, David A. Black wrote:

[#159773] Re: using lambda/Proc can prevent a lot of garbage collection — Joel VanderWerf <vjoel@...> 2005/10/09

Eric Hodel wrote:

[#159745] indent for Ruby, to reformat it — "Phlip" <phlipcpp@...>

Rubies:

23 messages 2005/10/09

[#159839] How to overload Object's methods automagicaly? — "S.Z." <zbl@...>

I am playing with a Synchronized class that automates resource locking

12 messages 2005/10/10

[#159897] Sort pseudo-lists — pete boardman <pete.boardman@...>

Say I've got a string like this:

16 messages 2005/10/10

[#159900] verifying proper vim-ruby install — Mark Volkmann <r.mark.volkmann@...>

On 10/9/05, Jacob Quinn Shenker <jqshenker@gmail.com> wrote:

15 messages 2005/10/10
[#159912] Re: verifying proper vim-ruby install — Nikolai Weibull <mailing-lists.ruby-talk@...> 2005/10/11

Mark Volkmann wrote:

[#159903] pre-Ruby-Conf dinner Thursday night — "Francis Hwang" <sera@...>

Hey everyone,

31 messages 2005/10/10

[#159916] Facebook... only 154 to go? — Hal Fulton <hal9000@...>

I added my own pic just now. You should, too...

16 messages 2005/10/11

[#159952] event based model - best way to implement? — snacktime <snacktime@...>

I am currently using perl's POE to communicate with the asterisk manager

11 messages 2005/10/11

[#159953] my mother wants to code? — Francois Paul <francois@...>

Hi,

35 messages 2005/10/11

[#160039] Default argument values for blocks — Daniel Schierbeck <daniel.schierbeck@...>

Is there a reason why I can't do this?

104 messages 2005/10/11
[#160045] Re: Default argument values for blocks — Yukihiro Matsumoto <matz@...> 2005/10/11

Hi,

[#160046] Re: Default argument values for blocks — Yukihiro Matsumoto <matz@...> 2005/10/11

Hi,

[#160047] Re: Default argument values for blocks — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/11

On Wed, 12 Oct 2005, Yukihiro Matsumoto wrote:

[#160118] Re: Default argument values for blocks — Yukihiro Matsumoto <matz@...> 2005/10/12

Hi,

[#160124] Re: Default argument values for blocks — Eric Mahurin <eric_mahurin@...> 2005/10/12

--- Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#160166] Re: Default argument values for blocks — "Trans" <transfire@...> 2005/10/12

[#160172] Re: Default argument values for blocks — Thomas <sanobast-2005a@...> 2005/10/12

> What of &?

[#160187] Re: Default argument values for blocks — Christophe Grandsire <christophe.grandsire@...> 2005/10/12

Selon Thomas <sanobast-2005a@yahoo.de>:

[#160213] Re: Default argument values for blocks — Yukihiro Matsumoto <matz@...> 2005/10/12

Hi,

[#160338] Re: Default argument values for blocks — "Phil Tomson" <philtomson@...> 2005/10/13

David A. Black wrote:

[#160349] Re: Default argument values for blocks — Caleb Clausen <vikkous@...> 2005/10/13

Ok, this has been bugging me ever since the last time this issue came

[#160376] Re: Default argument values for blocks — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/10/13

Hi,

[#160395] Re: Default argument values for blocks — Eric Mahurin <eric_mahurin@...> 2005/10/13

--- nobuyoshi nakada <nobuyoshi.nakada@ge.com> wrote:

[#160399] Re: Default argument values for blocks — Christophe Grandsire <christophe.grandsire@...> 2005/10/13

Selon Eric Mahurin <eric_mahurin@yahoo.com>:

[#160422] Re: Default argument values for blocks — Austin Ziegler <halostatue@...> 2005/10/13

On 10/13/05, Christophe Grandsire <christophe.grandsire@free.fr> wrote:

[#160458] Re: Default argument values for blocks — "Phil Tomson" <philtomson@...> 2005/10/13

[#160214] ruby in the government - 1.6.x -> 1.8.x woes — "Ara.T.Howard" <Ara.T.Howard@...>

22 messages 2005/10/12
[#160229] Re: ruby in the government - 1.6.x -> 1.8.x woes — mathew <meta@...> 2005/10/12

Ara.T.Howard wrote:

[#160238] Removing blank lines — "basi" <basi_lio@...>

Hello,

26 messages 2005/10/12
[#160241] Re: Removing blank lines — Esteban Manchado Vel痙quez <zoso@...> 2005/10/12

Hello Basi,

[#160353] Problem with IRB and some sample code... — Unnsse Khan <untz@...>

:-) Hello again,

16 messages 2005/10/13
[#160394] Re: Problem with IRB and some sample code... — James Edward Gray II <james@...> 2005/10/13

On Oct 13, 2005, at 2:01 AM, Unnsse Khan wrote:

[#160381] Text Image (#50) — Ruby Quiz <james@...>

I just love it when a totally crazy idea of mine blossoms into a popular quiz.

30 messages 2005/10/13
[#160403] Re: [SUMMARY] Text Image (#50) — "daz" <dooby@...10.karoo.co.uk> 2005/10/13

[#160525] Re: [SUMMARY] Text Image (#50) — James Britt <james_b@...> 2005/10/13

daz wrote:

[#160532] Re: [SUMMARY] Text Image (#50) — James Edward Gray II <james@...> 2005/10/14

On Oct 13, 2005, at 6:39 PM, James Britt wrote:

[#160534] Re: [SUMMARY] Text Image (#50) — James Britt <james_b@...> 2005/10/14

James Edward Gray II wrote:

[#160535] Why Write Ruby Docs? (was Re: [SUMMARY] Text Image (#50)) — James Edward Gray II <james@...> 2005/10/14

On Oct 13, 2005, at 7:27 PM, James Britt wrote:

[#160556] Re: Why Write Ruby Docs? (was Re: [SUMMARY] Text Image (#50)) — James Edward Gray II <james@...> 2005/10/14

I'm sorry, but the more I think about this, the more it bugs me...

[#160561] Re: Why Write Ruby Docs? (was Re: [SUMMARY] Text Image (#50)) — Kev Jackson <kevin.jackson@...> 2005/10/14

[#160456] InstantRails: Configure/database(via phpmyadmin) not working — "basi" <basi_lio@...>

Windows XP SP2

12 messages 2005/10/13

[#160509] Challenging Project ... Need a deep guru to provide enlightenment. — Jeff Wood <jeff.darklight@...>

I think I've got a very challenging project on my hands but here's I'm

27 messages 2005/10/13
[#160524] Re: Challenging Project ... Need a deep guru to provide enlightenment. — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/13

On Fri, 14 Oct 2005, Jeff Wood wrote:

[#160527] Re: Challenging Project ... Need a deep guru to provide enlightenment. — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/13

On Fri, 14 Oct 2005, Ara.T.Howard wrote:

[#160529] Re: Challenging Project ... Need a deep guru to provide enlightenment. — Jeff Wood <jeff.darklight@...> 2005/10/13

These are a good start, but what I'm really trying to do is come up with a

[#160563] Re: Challenging Project ... Need a deep guru to provide enlightenment. — ES <ruby-ml@...> 2005/10/14

Jeff Wood wrote:

[#160582] Re: Challenging Project ... Need a deep guru to provide enlightenment. — Jeff Wood <jeff.darklight@...> 2005/10/14

Actually I wrote a new chunk of code based on Ara's snippet that for direct

[#160664] Factory function like Array() for your own classes — "Sean O'Halpin" <sean.ohalpin@...>

Hi,

13 messages 2005/10/15

[#160697] How to get non-unique elements from an array? — "Sam Kong" <sam.s.kong@...>

Hello!

65 messages 2005/10/15
[#160944] Re: How to get non-unique elements from an array? — "Sam Kong" <sam.s.kong@...> 2005/10/17

Hi!

[#160953] Re: How to get non-unique elements from an array? — "pauldacus@..." <pauldacus@...> 2005/10/17

That is a good one.

[#160968] Re: How to get non-unique elements from an array? — Ryan Leavengood <leavengood@...> 2005/10/17

On 10/17/05, pauldacus@gmail.com <pauldacus@gmail.com> wrote:

[#161007] Re: How to get non-unique elements from an array? — "Sam Kong" <sam.s.kong@...> 2005/10/18

I must confess that I love this group...:-)

[#161119] Re: How to get non-unique elements from an array? — Ryan Leavengood <leavengood@...> 2005/10/18

On 10/17/05, Sam Kong <sam.s.kong@gmail.com> wrote:

[#161135] Re: How to get non-unique elements from an array? — "Ara.T.Howard" <Ara.T.Howard@...> 2005/10/18

On Wed, 19 Oct 2005, Ryan Leavengood wrote:

[#160959] Re: How to get non-unique elements from an array? — Mark Van Holstyn <mvette13@...> 2005/10/17

Hey Sam,

[#160699] Ruby projects — "Me" <narf968@...>

I keep a list of projects I thought would be fun to work on some day

14 messages 2005/10/15

[#160704] Help! define_method leaking procs... — Jamis Buck <jamis@37signals.com>

A plea for help, here... The rails core team is hacking like mad this

31 messages 2005/10/15
[#160710] Re: Help! define_method leaking procs... — Ryan Davis <ryand-ruby@...> 2005/10/15

[#160713] Re: Help! define_method leaking procs... — Eric Mahurin <eric_mahurin@...> 2005/10/15

--- Ryan Davis <ryand-ruby@zenspider.com> wrote:

[#160717] Re: Help! define_method leaking procs... — ES <ruby-ml@...> 2005/10/15

Eric Mahurin wrote:

[#160719] Re: Help! define_method leaking procs... — Eric Mahurin <eric_mahurin@...> 2005/10/15

--- ES <ruby-ml@magical-cat.org> wrote:

[#160723] Re: Help! define_method leaking procs... — Yohanes Santoso <ysantoso-rubytalk@...> 2005/10/16

Eric Mahurin <eric_mahurin@yahoo.com> writes:

[#160728] Re: Help! define_method leaking procs... — Eric Mahurin <eric_mahurin@...> 2005/10/16

--- Yohanes Santoso <ysantoso-rubytalk@dessyku.is-a-geek.org>

[#160729] Re: Help! define_method leaking procs... — Yohanes Santoso <ysantoso-rubytalk@...> 2005/10/16

Eric Mahurin <eric_mahurin@yahoo.com> writes:

[#160730] Re: Help! define_method leaking procs... — Eric Mahurin <eric_mahurin@...> 2005/10/16

--- Yohanes Santoso <ysantoso-rubytalk@dessyku.is-a-geek.org>

[#160709] Anonymous methods, blocks etc. (Cont. 'default block params') — ES <ruby-ml@...>

Listening in on the Roundtable (thanks to the brave recording crew and

79 messages 2005/10/15
[#161077] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Sean O'Halpin" <sean.ohalpin@...> 2005/10/18

On 10/15/05, ES <ruby-ml@magical-cat.org> wrote:

[#161085] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Austin Ziegler <halostatue@...> 2005/10/18

On 10/18/05, Sean O'Halpin <sean.ohalpin@gmail.com> wrote:

[#161101] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/10/18

[#161184] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Eric Mahurin <eric_mahurin@...> 2005/10/18

--- Trans <transfire@gmail.com> wrote:

[#161211] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Sean O'Halpin" <sean.ohalpin@...> 2005/10/18

On 10/18/05, Eric Mahurin <eric_mahurin@yahoo.com> wrote:

[#161263] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Austin Ziegler <halostatue@...> 2005/10/19

On 10/18/05, Sean O'Halpin <sean.ohalpin@gmail.com> wrote:

[#161269] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/10/19

[#161295] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Austin Ziegler <halostatue@...> 2005/10/19

On 10/18/05, Trans <transfire@gmail.com> wrote:

[#161396] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/10/19

[#161405] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Austin Ziegler <halostatue@...> 2005/10/19

On 10/19/05, Trans <transfire@gmail.com> wrote:

[#161487] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/10/19

[#163525] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Zach Dennis <zdennis@...> 2005/10/31

Austin Ziegler wrote:

[#163530] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/10/31

[#163533] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Zach Dennis <zdennis@...> 2005/10/31

Trans wrote:

[#163570] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Yukihiro Matsumoto <matz@...> 2005/11/01

Hi,

[#163576] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — zdennis <zdennis@...> 2005/11/01

Yukihiro Matsumoto wrote:

[#163614] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — Gavin Kistner <gavin@...> 2005/11/01

On Oct 31, 2005, at 9:18 PM, zdennis wrote:

[#163630] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/11/01

This is abit to the side, but maybe it would shed light on the

[#163648] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — gwtmp01@... 2005/11/01

[#163682] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/11/02

Hi--

[#163693] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — gwtmp01@... 2005/11/02

[#163754] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/11/02

[#163763] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — gwtmp01@... 2005/11/02

[#163776] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — "Trans" <transfire@...> 2005/11/02

[#163783] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — mental@... 2005/11/02

Quoting Trans <transfire@gmail.com>:

[#163817] Re: Anonymous methods, blocks etc. (Cont. 'default block params') — gwtmp01@... 2005/11/02

[#160724] ANN: ZenTest 3.4.0 Released — Ryan Davis <ryand-ruby@...>

ZenTest version 2.4.0 has been released!

11 messages 2005/10/16

[#160810] Editing in Ruby — "Shreyas" <sravi2k4@...>

Hi all --

12 messages 2005/10/17

[#160838] Ruby for Python/OO developer — "Achim Domma (SyynX Solutions GmbH)" <achim.domma@...>

Hi,

17 messages 2005/10/17

[#160870] declaratively caching results of a method — Brian Buckley <briankbuckley@...>

Hello

24 messages 2005/10/17
[#160874] Re: declaratively caching results of a method — "Sean O'Halpin" <sean.ohalpin@...> 2005/10/17

On 10/17/05, Brian Buckley <briankbuckley@gmail.com> wrote:

[#160927] Re: declaratively caching results of a method — Brian Buckley <briankbuckley@...> 2005/10/17

> You could check out Daniel Berger's memoize (based on Nobu Nokada's

[#160881] Roxy 0.1 - Remote Proxy Objects w/ type & method signature impersonation and w/ remote block yields. — Jeff Wood <jeff.darklight@...>

Hey folks.

8 messages 2005/10/17

[#160934] gem server horked? — Jeff Wood <jeff.darklight@...>

This morning seems the gem server is having a bit of a fit ... getting

12 messages 2005/10/17
[#160940] Re: gem server horked? — Erik Veenstra <pan@...> 2005/10/17

> > This morning seems the gem server is having a bit of a fit

[#160947] Re: gem server horked? — Jeff Wood <jeff.darklight@...> 2005/10/17

True, my view wasn't geographically sensitive.

[#160957] Re: gem server horked? — Jeff Wood <jeff.darklight@...> 2005/10/17

Has anybody that's part of that project caught this yet ??? I'm surprised

[#160989] A couple of questions/statements from a Ruby neohacker — Dave Bettin <me@...>

I started my programming career off with PHP and ColdFusion. I loved the

17 messages 2005/10/17

[#161043] Unit testing an each function — Peter Hickman <peter@...>

I am testing a new class I have written that has an each method, how do

37 messages 2005/10/18
[#161061] Re: Unit testing an each function — "Kevin Ballard" <kballard@...> 2005/10/18

That sounds fine to me. What's wrong with that method?

[#161064] Re: Unit testing an each function — Peter Hickman <peter@...> 2005/10/18

Kevin Ballard wrote:

[#161090] Re: Unit testing an each function — "Kevin Ballard" <kballard@...> 2005/10/18

Peter Hickman wrote:

[#161098] Re: Unit testing an each function — Peter Hickman <peter@...> 2005/10/18

Kevin Ballard wrote:

[#161116] Re: Unit testing an each function — "Kevin Ballard" <kballard@...> 2005/10/18

[#161122] Re: Unit testing an each function — "Kevin Ballard" <kballard@...> 2005/10/18

[#161128] Re: Unit testing an each function — "Kevin Ballard" <kballard@...> 2005/10/18

class EnumerableProxy < Object

[#161131] Re: Unit testing an each function — Peter Hickman <peter@...> 2005/10/18

Thanks for that, quite an education in that code.

[#161152] Re: Unit testing an each function — "Kevin Ballard" <kballard@...> 2005/10/18

Ok, here's a new version. It now generalizes the wrapping, so it's

[#161205] Re: Unit testing an each function — Ryan Leavengood <leavengood@...> 2005/10/18

On 10/18/05, Kevin Ballard <kballard@gmail.com> wrote:

[#161226] Re: Unit testing an each function — "Kevin Ballard" <kballard@...> 2005/10/18

Ryan Leavengood wrote:

[#161229] Re: Unit testing an each function — "Kevin Ballard" <kballard@...> 2005/10/18

[#161239] Re: Unit testing an each function — James Edward Gray II <james@...> 2005/10/18

On Oct 18, 2005, at 5:41 PM, Kevin Ballard wrote:

[#161065] Ruby and Eclipse — "Carl Asman" <carl.asman@...>

I wanted to be a unfaithful to my emacs and try the Ruby plugin for

14 messages 2005/10/18

[#161176] The Ruby Way to build an object unless nil? — Peter Fitzgibbons <peter.fitzgibbons@...>

Hello all,

17 messages 2005/10/18

[#161230] Killing Threads & Processes on Windows — x1 <caldridge@...>

x = Thread.new { system("c:/program files/internet explorer/iexplore.exe") }

16 messages 2005/10/18

[#161245] Seeking Contributions for O'Reilly's Ruby Cookbook — "Leonard Richardson" <leonard.richardson@...>

Hello, all,

22 messages 2005/10/18
[#161260] Re: Seeking Contributions for O'Reilly's Ruby Cookbook — "luke" <l.d.u.n.c.a.l.f.e@... (dot)> 2005/10/19

i sometimes farm this site for ideas. i think the contributions are

[#161294] Re: Seeking Contributions for O'Reilly's Ruby Cookbook — "Gavin Sinclair" <gsinclair@...> 2005/10/19

[#161301] Re: Seeking Contributions for O'Reilly's Ruby Cookbook — "David A. Black" <dblack@...> 2005/10/19

Hi --

[#161639] Re: Seeking Contributions for O'Reilly's Ruby Cookbook — "Gavin Sinclair" <gsinclair@...> 2005/10/20

David A. Black wrote:

[#161650] Re: Seeking Contributions for O'Reilly's Ruby Cookbook — Peter Hickman <peter@...> 2005/10/20

Well we could start with a couple of chapters for ideas

[#161251] [RCR] Cut-based AOP — "Trans" <transfire@...>

This is to "officially" announce an RCR that I posted to RCR archive

108 messages 2005/10/18
[#161594] Re: [ANN] [RCR] Cut-based AOP — Yukihiro Matsumoto <matz@...> 2005/10/20

Hi,

[#161619] Re: [ANN] [RCR] Cut-based AOP — Alexandru Popescu <the.mindstorm.mailinglist@...> 2005/10/20

Hi!

[#162342] Re: Cut-based AOP — "Trans" <transfire@...> 2005/10/24

[#197129] Re: Cut-based AOP — "Ruby Newbie" <rubynewbie@...> 2006/06/14

Curious about AOP in Ruby, I've downloaded the Cut patch for 1.8.3,

[#197145] Re: Cut-based AOP — "Austin Ziegler" <halostatue@...> 2006/06/14

On 6/13/06, Ruby Newbie <rubynewbie@gmail.com> wrote:

[#197236] Re: Cut-based AOP — transfire@... 2006/06/14

[#197239] Re: Cut-based AOP — "Francis Cianfrocca" <garbagecat10@...> 2006/06/14

>>>Well, saying that is sort-of like programming Turbo Pascal in the 80's

[#197248] Re: Cut-based AOP — transfire@... 2006/06/14

[#161262] How to hire a rubyist? — "jfry" <jeff.fry@...>

Hey there,

15 messages 2005/10/19

[#161329] Byte order reading on windows versus unix in ruby — Robert Evans <robert.evans@...>

I have written some code that reads bytes from a file in bigendian

13 messages 2005/10/19

[#161351] attaching code to run on regular expression match — Eyal Oren <eyal.oren@...>

Hi,

12 messages 2005/10/19

[#161378] Array.sort when it's items are String inheritors with redefined <=> works like if not redefined — MiG <mig@1984.cz>

Hello,

9 messages 2005/10/19

[#161449] Method annotation and anonymous functions — stevetuckner <stevetuckner@...>

I want to start a discussion about two things that Matz talked about at

35 messages 2005/10/19
[#161545] Re: Method annotation and anonymous functions — Yukihiro Matsumoto <matz@...> 2005/10/19

Hi,

[#161550] Re: Method annotation and anonymous functions — Jeff Wood <jeff.darklight@...> 2005/10/19

Most languages define some token that specifically states method attribute...

[#161555] Re: Method annotation and anonymous functions — "David A. Black" <dblack@...> 2005/10/20

Hi --

[#161556] Re: Method annotation and anonymous functions — Jeff Wood <jeff.darklight@...> 2005/10/20

Yes it would, but I don't see another way to do attribution of methods

[#161557] Re: Method annotation and anonymous functions — "Trans" <transfire@...> 2005/10/20

[#161450] Functional with Ruby — "Andreas Semt" <Andreas.Semt@...>

Hello list,

30 messages 2005/10/19

[#161464] Can't type {, }, [ or ] in irb — "rohde" <rohdester@...>

Hi,

13 messages 2005/10/19
[#161497] Re: Can't type {, }, [ or ] in irb — Austin Ziegler <halostatue@...> 2005/10/19

On 10/19/05, rohde <rohdester@gmail.com> wrote:

[#161535] Re: Can't type {, }, [ or ] in irb — "rohde" <rohdester@...> 2005/10/19

Yes, I'm on Windows XP and used the installer, as well as a non-US

[#161469] Rails 1.0: Release Candidate 2 — David Heinemeier Hansson <david.heinemeier@...>

The release of 1.0 is near upon us! It has been a long time in the

13 messages 2005/10/19
[#161493] Re: Rails 1.0: Release Candidate 2 — Caleb Tennis <caleb@...> 2005/10/19

> (The main gem server is pretty over-worked, you may want to do gem

[#161496] Re: Rails 1.0: Release Candidate 2 — Chad Fowler <chadfowler@...> 2005/10/19

On 10/19/05, Caleb Tennis <caleb@aei-tech.com> wrote:

[#161527] DRb Basics — James Edward Gray II <james@...>

I'm finally getting around to playing with DRb and I have some

20 messages 2005/10/19

[#161564] Ruby on Rails version of osCommerce in PHP? — petermichaux@...

Hi,

29 messages 2005/10/20
[#161786] Re: Ruby on Rails version of osCommerce in PHP? — petermichaux@... 2005/10/21

Anyone interested in joining a new open source project to write this? I

[#162294] Re: Ruby on Rails version of osCommerce in PHP? — Corey Lawson <corey.ssf.lawson@...> 2005/10/24

Yes. I'd like to help with the database part at least (to make it non-MySQL

[#162305] Re: Ruby on Rails version of osCommerce in PHP? — Douglas Livingstone <rampant@...> 2005/10/24

2005/10/24, Corey Lawson <corey.ssf.lawson@gmail.com>:

[#162530] Re: Ruby on Rails version of osCommerce in PHP? — Corey Lawson <corey.ssf.lawson@...> 2005/10/25

No. The OpenCommerce database schema isn't very Rails-friendly. Some people

[#162538] Re: Ruby on Rails version of osCommerce in PHP? — petermichaux@... 2005/10/25

[#162608] Re: Ruby on Rails version of osCommerce in PHP? — Corey Lawson <corey.ssf.lawson@...> 2005/10/25

table names...PK field names, but that could be configured around with AR, =

[#162613] Re: Ruby on Rails version of osCommerce in PHP? — "Paul" <paul.vaillant@...> 2005/10/25

Per what a number of others have discussed, auditing/triggers are

[#162787] Re: Ruby on Rails version of osCommerce in PHP? — petermichaux@... 2005/10/26

Here is David Heinemeier Hanson's thoughts about why it is best to keep

[#162798] Re: Ruby on Rails version of osCommerce in PHP? — Austin Ziegler <halostatue@...> 2005/10/26

On 10/26/05, petermichaux@yahoo.com <petermichaux@yahoo.com> wrote:

[#161691] Removing a class for good from ObjectSpace — Florian Weber <csshsh@...>

Hi!

11 messages 2005/10/20

[#161715] New Language — Jim Freeze <jim@...>

I think I am going to start a new language, just so

26 messages 2005/10/20
[#161739] Re: [OT] New Language — Martin DeMello <martindemello@...> 2005/10/20

Ryan Leavengood <leavengood@gmail.com> wrote:

[#161745] Re: [OT] New Language — Tom Copeland <tom@...> 2005/10/20

On Fri, 2005-10-21 at 06:06 +0900, Martin DeMello wrote:

[#161746] Re: [OT] New Language — Brian Mitchell <binary42@...> 2005/10/20

On 10/20/05, Tom Copeland <tom@infoether.com> wrote:

[#161773] Ferret 0.1.0 (Port of Java Lucene) released — David Balmain <dbalmain.ml@...>

Hi Folks,

25 messages 2005/10/21

[#161790] Madeleine, SQLite and multi-platform issues (in ruby :-) — "Assaph Mehr" <assaph@...>

Hi list,

19 messages 2005/10/21
[#161791] Re: Madeleine, SQLite and multi-platform issues (in ruby :-) — Ezra Zygmuntowicz <ezra@...> 2005/10/21

What about using a pure ruby solution like KirbyBase?

[#161808] Re: Madeleine, SQLite and multi-platform issues (in ruby :-) — "Assaph Mehr" <assaph@...> 2005/10/21

[#161792] A comparison by example of keyword argument styles — Brian Mitchell <binary42@...>

Hello fellow rubyists,

73 messages 2005/10/21
[#161805] Re: A comparison by example of keyword argument styles — Daniel Schierbeck <daniel.schierbeck@...> 2005/10/21

I still haven't given up on my own style :)

[#162159] Re: A comparison by example of keyword argument styles — Daniel Schierbeck <daniel.schierbeck@...> 2005/10/23

This is just to get the discussion focused. With named arguments, I'm

[#162182] Re: A comparison by example of keyword argument styles — Eric Mahurin <eric_mahurin@...> 2005/10/23

--- Daniel Schierbeck <daniel.schierbeck@gmail.com> wrote:

[#162199] Re: A comparison by example of keyword argument styles — Yukihiro Matsumoto <matz@...> 2005/10/23

Hi,

[#162299] Re: A comparison by example of keyword argument styles — Eric Mahurin <eric_mahurin@...> 2005/10/24

--- Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#162331] Re: A comparison by example of keyword argument styles — Louis J Scoras <louis.j.scoras@...> 2005/10/24

Right, so this is probably a really dumb idea, but I was just having a

[#161848] Re: A comparison by example of keyword argument styles — "Berger, Daniel" <Daniel.Berger@...>

> -----Original Message-----

17 messages 2005/10/21

[#161917] array in hash... argh!! — Marco <z@...>

hello all.

17 messages 2005/10/21

[#161947] Rubyists into Lojban? — rubyhacker@...

I don't wish to wander OT, but as I have been tinkering

14 messages 2005/10/21

[#162074] combination sums of several arrays — David Vincelli <micologist@...>

I'm writing a little BlackJack program for fun and I'm at the point

12 messages 2005/10/23

[#162178] Why is Ruby a favorite among the Agile set? — Ed Howland <ed.howland@...>

Hi,

15 messages 2005/10/23

[#162221] I want my MOM — swille <sillewille@...>

Err.. :) Can anyone tell me if there's a MOM for Ruby? Anything like

17 messages 2005/10/24

[#162258] can we add a tag like this to all the mail at the ruby talk mail server(s)? — Peter Barry <pbarry@...>

Guys & Gals ,

17 messages 2005/10/24
[#162306] Re: [Ruby-Talk] can we add a tag like this to all the mail at the ruby talk mail server(s)? — Yohanes Santoso <ysantoso-rubytalk@...> 2005/10/24

What is needed here is a change on how we should look at our email

[#162486] Re: [Ruby-Talk] can we add a tag like this to all the mail at the ruby talk mail server(s)? — Michal Suchanek <hramrach@...> 2005/10/25

On 10/24/05, Yohanes Santoso <ysantoso-rubytalk@dessyku.is-a-geek.org> wrote:> What is needed here is a change on how we should look at our email> addresses.>> Do you give your home phone number to a client? Do you give your> business phone number to your parents? If not, then why should you> give your personal email address to a client and your business email> address to your parents?>> Let's expand this further. Why should you be subscribing to a mailing> list with your personal email address? Why should you be the one doing> the routing of incoming emails? And, worse, asking the originator of> the email to, say, prefix the subject.>> Email addresses are much cheaper than phone number. For each> occassion, you can afford to give out new email address. For example,> I use a different email address for ruby-talk mailing list than the> email address I hand out to friends, and to co-workers, and to my> parents.>> This way, I'm not doing the routing of incoming emails; they do by> sending emails to the email address I gave them, their emails will> land on the mailboxes I want without me doing no further configuration> changes.>> I feel sad that email addresses in this age of cyberspace are still> treated as if it is as expensive as a phone number. They are cheap,> dirt cheap.>> Imagine this: work@yourname.yourdomain, friend@yourname.yourdomain,> ruby-talk@yourname.yourdomain, newegg@yourname.yourdomain.>> If your organisation is still in the backwater, giving you only one> email address, instead of a sub-domain, that's OK. That's just for> work, right?>> OTOH, for your personal life, you can get a subdomain for free from> various dyndns providers, and start churning out email addresses.>This is all nice. And I also try to separate the work address and theother address.But even if I use a freemail, I get only one address for personal use.They explicitly disallow registering more (because I could use morespace then). And dealing with several different freemails is terrible.Dyndyns does not work for me. It is only a technical issue to get itworking (recompiling the client for mips or whatever) but there isstill no place where I could receive the emails at home.First the computers eat energy when they are running all the time. Itis waste of electricity and money.Second the computers tend to break. I would probably get much morebounces than with a freemail.

[#162270] How to find all the subclasses of a class? — Horacio Sanson <hsanson@...>

11 messages 2005/10/24

[#162289] WhyRuby? repository has moved to ruby-doc.org — Curt Hibbs <curt.hibbs@...>

WhyRuby? was a project on RubyForge that I started to collect advocacy

12 messages 2005/10/24

[#162372] Oldest Ruby hacker? — "Chris McMahon" <christopher.mcmahon@...>

15 messages 2005/10/24
[#162971] Re: Oldest Ruby hacker? — "Charles Roper" <charles.roper@...> 2005/10/27

Chris McMahon wrote:

[#162393] What's your Ruby Number? (self.to_i) — Hal Fulton <hal9000@...>

I offer this in the spirit of the old "purity test" and the

66 messages 2005/10/25
[#162400] Re: What's your Ruby Number? (self.to_i) — James Edward Gray II <james@...> 2005/10/25

On Oct 24, 2005, at 9:20 PM, Hal Fulton wrote:

[#162520] Re: What's your Ruby Number? (self.to_i) — mathew <meta@...> 2005/10/25

Hal Fulton wrote:

[#162619] Re: What's your Ruby Number? (self.to_i) — rubyhacker@... 2005/10/25

mathew wrote:

[#162627] Re: What's your Ruby Number? (self.to_i) — Jim Freeze <jim@...> 2005/10/25

On 10/25/05, rubyhacker@gmail.com <rubyhacker@gmail.com> wrote:

[#162631] Re: What's your Ruby Number? (self.to_i) — Hal Fulton <hal9000@...> 2005/10/25

Jim Freeze wrote:

[#162637] Re: What's your Ruby Number? (self.to_i) — "David A. Black" <dblack@...> 2005/10/26

Hi --

[#162399] RCR: Array#to_h — "Shannon Fang" <xrfang@...>

Hi there,

19 messages 2005/10/25

[#162456] ruby gives different answer for checksum of files on windows and FreeBSD? — Ralph Smith <ralph@...>

11 messages 2005/10/25

[#162507] Comparing Classes with Case ? — "Warren Seltzer" <warrens@...>

The following failure surprised me:

19 messages 2005/10/25

[#162600] Re: narray and the stdlib — ptkwt@... (Phil Tomson)

In article <dcedf5e20510250919v45bdfdc6iceb8472fc2e56ce2@mail.gmail.com>,

16 messages 2005/10/25

[#162635] The "perfect" ORM? — Hal Fulton <hal9000@...>

For many weeks I have had this at the back of my mind.

53 messages 2005/10/26
[#162910] Re: The "perfect" ORM? — George Moschovitis <george.moschovitis@...> 2005/10/27

> So anyway, this is one of my highest priorities -- to

[#162985] Re: The "perfect" ORM? — rubyhacker@... 2005/10/27

George Moschovitis wrote:

[#162688] help: trouble with ONLamp's cookbook tutorial / mysql — lewcio@...

I haven't yet touched the tutorial app's code except to change the

10 messages 2005/10/26

[#162876] Cleaner syntax for .map (is there already a way, or ruby2 idea?) — Ron M <rm_rails@...>

23 messages 2005/10/27
[#162907] Re: Cleaner syntax for .map (is there already a way, or ruby2 idea?) — "Trans" <transfire@...> 2005/10/27

[#162902] Ruby Quiz for building up Ruby? — Hugh Sasse <hgs@...>

I put this suggestion to James Edward Gray II as a means to an

15 messages 2005/10/27

[#162982] Argument Passing Syntax — gwtmp01@...

Why are arguments to the '[]' method parsed differently

14 messages 2005/10/27

[#163026] "Reflecting" on my self.n00b — swille <sillewille@...>

I'm admittedly quite a novice with programming. I'm sort of playing

12 messages 2005/10/28

[#163094] PARSER for RUBY — puellula@...

Hi,

20 messages 2005/10/28

[#163152] "Readability" inflation — "David A. Black" <dblack@...>

Hi --

69 messages 2005/10/28
[#163276] Re: "Readability" inflation — Martin DeMello <martindemello@...> 2005/10/29

David A. Black <dblack@wobblini.net> wrote:

[#163283] Re: "Readability" inflation — "Trans" <transfire@...> 2005/10/29

[#163209] What would it take to change the behaviour of variable assignment? — Daniel Nugent <nugend@...>

Hello,

11 messages 2005/10/28

[#163210] TumbleDRYer (#53) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

10 messages 2005/10/28

[#163274] determining whether an object is an immediate? — Eric Mahurin <eric_mahurin@...>

This is be best I could come up with for determining whether an

16 messages 2005/10/29

[#163383] Which Ruby Version? — "Trans" <transfire@...>

Okay, since 1.8.3 is smoking, which version should I be using right

15 messages 2005/10/30

[#163393] C# attributes in Ruby? — Stephan Mueller <d454d@...>

Hi,

16 messages 2005/10/30

[#163401] 1.8.4 preview1 win32 error — simonharrison@...

I've downloaded the binary release from garbagecollect.jp and now irb

13 messages 2005/10/30

[#163465] qtruby problems now on linux — "Hans Fugal" <fugalh@...>

Maybe it's related to halloween being tomorrow; all of a sudden qtruby

17 messages 2005/10/31

[#163469] Re: <ANN> TeSLa, a Domain Specific Language for Unit Testing — "Daniel Sheppard" <daniels@...>

>

20 messages 2005/10/31
[#163679] Re: <ANN> TeSLa, a Domain Specific Language for Unit Testing — "obscured by code" <javierg1975@...> 2005/11/01

Well, I think your confusion stems from my use of the word

[#163779] Re: <ANN> TeSLa, a Domain Specific Language for Unit Testing — Ryan Leavengood <leavengood@...> 2005/11/02

On 11/1/05, obscured by code <javierg1975@gmail.com> wrote:

[#163790] Re: <ANN> TeSLa, a Domain Specific Language for Unit Testing — James Britt <james_b@...> 2005/11/02

Ryan Leavengood wrote:

[#163901] Re: <ANN> TeSLa, a Domain Specific Language for Unit Testing — Christian Neukirchen <chneukirchen@...> 2005/11/03

James Britt <james_b@neurogami.com> writes:

[#163920] Re: <ANN> TeSLa, a Domain Specific Language for Unit Testing — Eric Mahurin <eric.mahurin@...> 2005/11/03

On 11/3/05, Christian Neukirchen <chneukirchen@gmail.com> wrote:

[#163528] Trapping errors. — Hugh Sasse <hgs@...>

begin

19 messages 2005/10/31

[#163558] Newbie: How to format a number to always show two decimals? — "i.v.r." <ivanvega@...>

Hi,

19 messages 2005/10/31
[#163559] Re: Newbie: How to format a number to always show two decimals? — James Edward Gray II <james@...> 2005/10/31

On Oct 31, 2005, at 4:47 PM, i.v.r. wrote:

[#163560] Re: Newbie: How to format a number to always show two decimals? — "i.v.r." <ivanvega@...> 2005/10/31

James Edward Gray II wrote:

[#163562] Re: Newbie: How to format a number to always show two decimals? — Harold Hausman <hhausman@...> 2005/11/01

Alternatively there's this code from Phrogz's library (

[ANN] el4r-0.9.2 - EmacsLisp for Ruby

From: rubikitch@...
Date: 2005-10-05 10:01:36 UTC
List: ruby-talk #159119
Hi,

El4r enables you to write Emacs programs in Ruby as well as in EmacsLisp.
I call the Ruby language to manipulate Emacs `EmacsRuby'.

El4r and Test::Unit enables you to test EmacsLisp/EmacsRuby programs automatically.

El4r is available at 
http://www.rubyist.net/~rubikitch/computer/el4r/index.en.html


== What's new

=== 0.9.1 -> 0.9.2

* ~/.el4rrc.rb contains all the el4r setting.
* Automatic configuration.
* Now el4r can be installed in arbitrary directory.
* A block is accepted in El4r::ELMethodsMixin#newbuf .
* New class: ElApp
* Works with Windows(WINE).
* Introduced el4r_load search path.
* New EmacsRuby library in el4r/ directory.


== Download / Install / Setup
El4r currently be installed in your home directory.
If you got error when downloading, you must update Ruby.
Here is the shell commands to download, install and setup.
el4r-rctool setups and updates your dotfiles automatically.

To update older el4r (<= 0.9.1), you must remove these lines from ~/.emacs,
  (add-to-list 'load-path "~/src/el4r/elisp/")
  (require 'el4r)
  (el4r-boot)
and this line from ~/.el4r/init.rb by hand.
  el4r_load "el4r-mode.rb"
In newer el4r, el4r-rctool updates your dotfiles automatically.

  ruby -ropen-uri -e 'URI("http://www.rubyist.net/~rubikitch/archive/el4r-0.9.2.tar.gz").read.display' | tar xzf -
  cd el4r-0.9.2

  ruby el4r-rctool -p
  ruby el4r-rctool -i


The diretory to put EmacsRuby scripts is ~/.el4r by default.
The environment variable EL4R_HOME sets the directory to put EmacsRuby scripts.
  

Here is a test program of el4r.

#    el4r - EmacsLisp for Ruby 
#    Copyright (C) 2005 rubikitch <rubikitch@ruby-lang.org>
#    Version: $Id: test-el4r.rb,v 1.34 2005/10/04 19:33:31 rubikitch Exp $

#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

require 'test/unit'

require 'tempfile'
require 'tmpdir'
require 'pathname'
require 'fileutils'
class << Tempfile
  def path(content, dir=Dir.tmpdir)
    x = Tempfile.open("content", dir)
    x.write content
    x.close
    x.open
    x.path
  end

  def pathname(content, dir=Dir.tmpdir)
    Pathname.new(path(content, dir=Dir.tmpdir))
  end
end


# El4r self test.
class TestEl4r < Test::Unit::TestCase
  # ElMixin is already included/extended.
  # So we can write EmacsRuby in this class.

  # Testing ELListCell#to_ary.
  # This method enables us to multiple assignment.
  def test_to_ary
    list = el4r_lisp_eval(%q((list 1 2)))
    one, two = list

    assert_equal(list.to_a, list.to_ary)
    assert_equal(1, one)
    assert_equal(2, two)
  end

  # Testing with and match-string.
  def test_match_string
    lisp = %q((progn
                (switch-to-buffer "a")

              (save-excursion
                (insert "abcdefg\n")
                (goto-char 1)
                (re-search-forward "^\\\\(.+\\\\)$")
                )
              (match-string 1)))

    ruby = lambda{
##### [with]
      with(:save_excursion) do
        goto_char 1
        re_search_forward('^\\(.+\\)$')
      end
      match_string 1
##### [/with]
    }
    assert_equal(el4r_lisp_eval(lisp), ruby[])

  end


  # helper method:
  # execute a block with temporary buffer.
  # and return the contents of buffer.
  def with_temp_buffer_string(&block)
    with(:with_temp_buffer){
      self.instance_eval(&block)
      buffer_string
    }
  end

  # this test was in test.el
  def test_test_el__debug_ruby_eval_report
    actual = with_temp_buffer_string {
      el4r_lisp_eval %q((progn
(el4r-debug-ruby-eval-report "nil")
(el4r-debug-ruby-eval-report "true")
(el4r-debug-ruby-eval-report "false")
(el4r-debug-ruby-eval-report "1 + 6")
(el4r-debug-ruby-eval-report "\"String\"")
))
    }
    expected = <<EOB
nil
  => nil
true
  => t
false
  => nil
1 + 6
  => 7
"String"
  => "String"
EOB
    assert_equal(expected, actual)
  end

  def test_test_el__condition_case

    # (mode-info-describe-function 'signal 'elisp)
    # (mode-info-describe-function 'condition-case 'elisp)
    el4r_lisp_eval %q((progn
(put 'test-error
     'error-conditions                        
     '(error test-error))
(put 'test-error 'error-message "Test Error")
    ))
    #'
    el4r_lisp_eval %q((progn
(setq error-desc nil)
(condition-case err
    (signal 'test-error '(123))
  (test-error (setq error-desc (format "Error is passed: %s" err)))
  )
))
    #'
    assert_equal("Error is passed: (test-error 123)", elvar.error_desc)

    return
    # FIXME! this form works incorrect even typing `C-x C-e'.
    el4r_lisp_eval %q((progn
(setq error-desc nil)
(condition-case err
    (el4r-ruby-eval "el4r_lisp_eval(\"(signal 'test-error '(123))\")")
  (test-error (setq error-desc (format "Error is passed: %s" err)))
  )
))
    #'
    assert_equal("Error is passed: (test-error 123)", elvar.error_desc)
  end

  # eval test
  def test_el4r_eval
    result = with_temp_buffer_string{
      el4r_lisp_eval(<<'EOF')
        (insert-string (el4r-ruby-eval "\"Hello from ruby from emacs from ruby!\n\""))
EOF
    }
    assert_equal("Hello from ruby from emacs from ruby!\n", result)
    assert_equal(true, el4r_lisp_eval('t'))
  end


  # list: cons, car/cdr
  def test_list
    list = el("'(3 2 1)")
    list = cons(4, list)
    assert_equal("(4 3 2 1)", prin1_to_string(list))

    ary = []
    while list
      ary << car(list)
      list = cdr(list)
    end
    assert_equal("[4, 3, 2, 1]", ary.inspect)
  end

  # pass a Ruby object to Emacs
  def test_object
    obj = Object.new
    assert_equal("Is ruby object passed? ... true",
                 "Is ruby object passed? ... #{car(cons(obj, nil)) == obj}")
  end    

  

  # Using defun ( Proc -> Lambda conversion )
  def test_defun_function
    defun(:my_ruby_func) { |a|
      "String from my_ruby_func: '#{a}'"
    }
    assert_equal("String from my_ruby_func: 'Hello!'", my_ruby_func("Hello!"))
  end

  # defun a command
  def test_defun_command_1
    defun(:my_command, :interactive => true) {
      insert_string("My Interactive command from Ruby."); newline
    }

    assert_equal("My Interactive command from Ruby.\n",
                 with_temp_buffer_string{ call_interactively(:my_command) })

  end

  # defun a command with docstring
  def test_defun_command_2
##### [my_command2]
    defun(:my_command2,
          :interactive => "d", :docstring => "description...") { |point|
      insert_string("Current point is #{point}."); newline
    }
##### [/my_command2]
    assert_equal("d", nth(1, commandp(:my_command2)))
    assert_equal("description...", documentation(:my_command2))
    assert_equal("Current point is 1.\n",
                 with_temp_buffer_string{ call_interactively(:my_command2) })
  end

  # defining odd-named function
  def test_defun_oddname
    # Lisp can define `1+1' function! LOL
    defun("1+1"){2}
    assert_equal(2, funcall("1+1"))
  end

  # Calling lambda
  def test_lambda
    lambda = el4r_lisp_eval("(lambda (i) (+ i 1))")
    assert_equal(2, funcall(lambda, 1))
  end

  # Calling special form like save-excursion
  def test_with
    x = with_temp_buffer_string {
      insert_string("a\n")
      with(:save_excursion) {
        beginning_of_buffer
        insert_string("This is inserted at the beginning of buffer."); newline
      }
    }
    assert_equal("This is inserted at the beginning of buffer.\na\n", x)
  end

  # ELListCell
  def test_ELListCell
    assert_equal([1, 2], cons(1, cons(2, nil)).to_a )
    assert_equal([10,20], el4r_lisp_eval(%((list 1 2))).map{|x| x*10})

    assert_equal({'a'=>1, 'b'=>2}, list(cons("a",1), cons("b", 2)).to_hash)
    assert_raises(TypeError){ list(cons("a",1), "b", "c").to_hash }

  end
  
  # ELVector
  def test_ELVector
    v = el4r_lisp_eval("[1 2]")
    assert( vectorp(v) )
    assert_equal("ELVector[1, 2]", v.inspect)
    assert_equal(1, v[0])
    assert_equal(1, v[-2])
    assert_raises(ArgumentError) { v[2] } # index is too large
    assert_raises(TypeError) { v["X"] }

    assert_equal([1, 2], v[0,2])
    assert_equal([1, 2], v.to_a)

    # Enumerable
    assert_equal(1, v.find{|x| x==1})

    # to_ary
    one, = v
    assert_equal(1, one)

    # aset
    elvar.v = v
    assert_equal(10, v[0]=10)
    assert_equal(10, v[0])
    assert_equal([10,2], v.to_a)
    assert_equal(10, elvar.v[0])
    assert_equal([10,2], elvar.v.to_a)
    assert_raises(ArgumentError) { v[2]=3 } # index is too large
    assert_raises(TypeError) { v["X"]=1 }

    v[-1]=20
    assert_equal([10,20], elvar.v.to_a)
  end

  # Accessing to lisp variables with elvar
  def test_elvar
    elvar.myvar = 123
    assert_equal(123, elvar.myvar)

    elvar["myvar"] = 456
    assert_equal(456, elvar["myvar"])
    
    assert( elvar.myvar == elvar["myvar"] )
  end

  # get/set an odd-named variable
  def test_elvar__oddname
    elvar["*an/odd+variable!*"] = 10
    assert_equal(10, elvar["*an/odd+variable!*"])
  end

  # Error passing
  def test_error
    assert_raises(RuntimeError) {
      el4r_lisp_eval(<<-'EOF')
        (el4r-ruby-eval "raise \"Is error handled correctly?\""))
      EOF
    }
  end

  # let
  def test_let
    elvar.testval = 12
    testval_in_letblock = nil
    let(:testval, 24) {
      testval_in_letblock = elvar.testval
    }

    assert_equal(24, testval_in_letblock)
    assert_equal(12, elvar.testval)
  end

  # Regexp convert: Convert Ruby regexps to MESSY Emacs regexps.
  def test_regexp
#  (find-node "(emacs-ja)Regexps")
    
    conv = lambda{|from,to| assert_equal(to, el4r_conv_regexp(from)) }
    conv[ //, '' ]
    conv[ /a/, 'a' ]
    conv[ /a./, 'a.' ]
    conv[ /a*/, 'a*' ]
    conv[ /a+/, 'a+' ]
    conv[ /a?/, 'a?' ]
    conv[ /[ab]/, '[ab]' ]
    conv[ /[^ab]/, '[^ab]' ]
    conv[ /^ab/, '^ab' ]
    conv[ /ab$/, 'ab$' ]
    conv[ /a|b/, 'a\|b' ]
    conv[ /(ab)/, '\(ab\)' ]
    conv[ /\As/, '\`s' ]
    conv[ /s\Z/, %q[s\'] ]
    # \=
    conv[ /\bball\B/, '\bball\B']
    # \<
    # \>
    conv[ /\w/, '[0-9A-Za-z_]']
    conv[ /\W/, '[^0-9A-Za-z_]']
    # \sC
    # \SC
    # \D (number)
  end

  # Now you can specify a Ruby regexp to string-match, re-search-forward and so on
  def test_string_match
    s = "a"
    assert_equal(0, string_match("a", s))
    assert_equal(0, string_match(/a/, s))
    assert_equal(0, string_match('\(a\|\b\)', s))
    assert_equal(0, string_match(/a|b/, s))
    assert_equal(0, string_match(/^a/, s))
    assert_equal(0, string_match(/a$/, s))
    assert_equal(0, string_match(/.*/, s))
    assert_equal(nil, string_match(/not-match/, s))
    
  end

  # ElMixin: elisp {}
  def test_elmixin
    eval %{
      class ::Foo
        include ElMixin
        def foo
          elisp {
            [self.class, outer.class]
          }
        end

        def one
          1
        end
      end

    }

    el4r, outer = Foo.new.foo
    assert_equal(El4r::ELInstance, el4r)
    assert_equal(Foo, outer)
  end

  # EL error
  def test_elerror
    errormsg = nil
    begin
      el4r_lisp_eval(%q((defun errorfunc0 ())))
      with(:with_current_buffer, "*scratch*"){
        let(:x, 1) {
          with(:save_excursion){
            errorfunc0 1       # wrong number of argument!!
          }
        }
      }
      flunk
    rescue
      errormsg = $!.to_s
    end

    assert_match(/\n\(errorfunc0.+save-excursion.+let.+with-current-buffer.+$/m, errormsg.to_s) 
  end

  # to_s: Implicitly call prin1_to_string
  def test_to_s
    list = list(1)
    assert_equal("(1)", "#{list}")
    assert_equal( prin1_to_string(list), list.to_s)
  end

  # defadvice 1
  def test_defadvice_1
    defun(:adtest1){
      elvar.v = 1
    }
    with(:defadvice, el("adtest1 (after adv activate)")){
      elvar.v = 2
    }
    adtest1

    assert_equal(2, elvar.v)
  end

  # defadvice 2
  def test_defadvice_2
    elvar.w = 0
    elvar.x = 0
    defun(:adtest2){
      elvar.w += 1
      3
    }
    defadvice(:adtest2, :around, :adv2, :activate) {
      ad_do_it
      elvar.x = 10
      ad_do_it
    }
    ret = adtest2()

    assert_equal(2, elvar.w)
    assert_equal(10, elvar.x)
    assert_equal(3, ret)
  end

  # defadvice 3
  def test_defadvice_3
    begin
##### [adtest3]
      # define a function
      defun(:adtest3){ 1 }
##### [/adtest3]
      assert_equal(1, adtest3())
      assert_equal(nil, commandp(:adtest3))

##### [adtest3-advice]
      # now define an advice
      defadvice(:adtest3, :around, :adv3, :activate,
                :docstring=>"test advice", :interactive=>true) {
        ad_do_it
        elvar.ad_return_value = 2
      }
##### [/ad_return_value]
      assert(commandp(:adtest3))
      assert_equal(2, adtest3())
      assert_match(/test advice/, documentation(:adtest3))
    ensure
      ad_deactivate :adtest3
#      fmakunbound :adtest3
    end
  end

  # bufstr
  def test_bufstr
    s = bufstr(newbuf(:name=>"axx", :contents=>"foo!"))
    assert_equal("foo!", s)

    newbuf(:name=>"axxg", :contents=>"bar!", :current=>true)
    s = bufstr 
    assert_equal("bar!", s)
  end

  def xtest_ad_do_it_invalid
    assert_raises(El4r::El4rError){
      ad_do_it
    }
  end

  # el_load
  def test_el_load
    begin
      el = File.expand_path("elloadtest.el")
      open(el, "w"){|w| w.puts(%q((setq elloadtest 100)))}
      el_load(el)
      assert_equal(100, elvar.elloadtest)
    ensure
      File.unlink el
    end
  end

  # equality
  def test_EQUAL
    b1 = current_buffer
    b2 = current_buffer
    assert(b1 == b1)
    assert(b1 == b2)
    assert_equal(b1,b2)
  end

  # test delete-other-windows workaround in xemacs
  def test_delete_other_windows
    w = selected_window
    elvar.window_min_height = 1
    split_window
    split_window 
    delete_other_windows
    assert(one_window_p)
    assert(eq(w, selected_window))
  end

  # Lisp string -> Ruby string  special case
  def test_el4r_lisp2ruby__normal
    cmp = lambda{|str| assert_equal(str, eval(el4r_lisp2ruby(str)))}
# (mode-info-describe-function 'prin1-to-string 'elisp)
# (string= "\021" (el4r-ruby-eval (el4r-lisp2ruby "\021")))

    cmp[ "" ]
    cmp[ "a"*999999 ]
    cmp[ '1' ]
    cmp[ 'a' ]
    cmp[ '\\' ]
    cmp[ '\\\\' ]
    cmp[ '\\\\\\' ]
    cmp[ '""' ]
    cmp[ '"' ]
    cmp[ "''" ]
    cmp[ '#{1}' ]
    cmp[ '\#{1}' ]
    cmp[ '#{\'1\'}' ]
    cmp[ '#@a' ]
    cmp[ "\306\374\313\334\270\354" ]  # NIHONGO in EUC-JP
  end

  def test_el4r_lisp2ruby__treat_ctrl_codes
    cmp = lambda{|str| assert_equal(str, eval(el4r_lisp2ruby(str)))}
    el4r_treat_ctrl_codes { 
      cmp[ "" ]
      cmp[ "a"*999999 ]
      cmp[ '1' ]
      cmp[ 'a' ]
      cmp[ '\\' ]
      cmp[ '\\\\' ]
      cmp[ '\\\\\\' ]
      cmp[ '""' ]
      cmp[ '"' ]
      cmp[ "''" ]
      cmp[ '#{1}' ]
      cmp[ '\#{1}' ]
      cmp[ '#{\'1\'}' ]
      cmp[ '#@a' ]
      cmp[ "\306\374\313\334\270\354" ]  # NIHONGO in EUC-JP

      cmp[ "\ca" ]
      cmp[ "\cb" ]
      cmp[ "\cc" ]
      cmp[ "\cd" ]
      cmp[ "\ce" ]
      cmp[ "\cf" ]
      cmp[ "\cg" ]
      cmp[ "\ch" ]
      cmp[ "\ci" ]
      cmp[ "\cj" ]
      cmp[ "\ck" ]
      cmp[ "\cl" ]
      # C-m
      # cmp[ "\cn" ]  failed on xemacs
      # cmp[ "\co" ]  failed on xemacs
      cmp[ "\cp" ]
      cmp[ "\cq" ]
      # C-r
      cmp[ "\cs" ]
      cmp[ "\ct" ]
      cmp[ "\cu" ]
      cmp[ "\cv" ]
      cmp[ "\cw" ]
      cmp[ "\cx" ]
      # cmp[ "\cy" ]
      cmp[ "\cz" ]
    }
  end

  
  def el4r_load_test_helper(dir)
    begin
      $loaded = nil
      tmpscript = "#{dir}/__testtmp__.rb"
      "$loaded = true".writef(tmpscript)
      el4r_load "__testtmp__.rb"
      assert_equal(true, $loaded)
    ensure
      FileUtils.rm_f tmpscript
    end
  end

  def test_el4r_load__load_path
    load_path = el4r.conf.el4r_load_path
    load_path.each do |dir|
      FileUtils.mkdir_p dir
      el4r_load_test_helper dir
    end
  end

  def test_el4r_load__not_exist
    assert_raises(LoadError) { el4r_load "__not_exist.rb" }
    assert_equal(false,  el4r_load("__not_exist.rb", true))
  end

  def test_el4r_load__order
    begin 
      $loaded = nil
      load_path = el4r.conf.el4r_load_path = [ el4r_homedir, el4r.site_dir ]
      FileUtils.mkdir_p load_path
      rb = "__testtmp__.rb"
      home_rb = File.expand_path(rb, el4r_homedir)
      site_rb = File.expand_path(rb, el4r.site_dir)
      "$loaded = :OK".writef(home_rb)
      "$loaded = :NG".writef(site_rb)
      el4r_load rb
      assert_equal(:OK, $loaded)
    ensure
      FileUtils.rm_f [home_rb, site_rb]
    end
  end

  def test_stdlib_loaded
    assert_equal(true, fboundp(:winconf_push))
  end

  def test_winconf
    # make a winconf
    switch_to_buffer "a buffer"
    insert "string"
    pt = point
    # current_window_configuration does not works with xemacs -batch. I do not know why.
    assert( one_window_p )
    buf = current_buffer

    winconf_push

    # alter the winconf
    goto_char 1
    split_window

    winconf_pop

    # revive the winconf
    assert( one_window_p )
    assert_equal(buf, current_buffer)
    assert_equal(pt, point)
  end
# end of TestEl4r
end

# newbuf examples
class TestNewbuf < Test::Unit::TestCase
  include ElMixin

  def setup
    @bufname = "buffer-does-not-exist!!!"
  end

  def teardown
    kill_buffer(@bufname) if get_buffer(@bufname)
  end

  def setbuf
    set_buffer @x
  end

  def test_create
    @x = newbuf(:name=>@bufname)
    setbuf
    assert_equal(true, bufferp(@x))
    assert_equal(@bufname, buffer_name(@x))
    assert_equal("", buffer_string)

    y = newbuf(:name=>@bufname)
    assert(eq(@x,y))
  end

  def test_contents
    @x = newbuf(:name=>@bufname, :contents=>"foo")
    setbuf
    assert_equal("foo", buffer_string)
    assert_equal(4, "foo".length+1)
    assert_equal(4, point)

    # buffer is erased
    @x = newbuf(:name=>@bufname, :contents=>"bar")
    setbuf
    assert_equal("bar", buffer_string)
  end

  def test_file
    begin
      file = Tempfile.path("abcd")
      @x = newbuf(:file=>file)
      setbuf
      assert_equal(file, buffer_file_name)
      assert_equal("abcd", buffer_string)
    ensure
      kill_buffer nil
      File.unlink file
    end
  end

  def test_name_and_file
    begin
      file1 = Tempfile.path("abcd")
      @x = newbuf(:name=>@bufname, :file=>file1)
      setbuf
      assert_equal(nil, buffer_file_name)
      assert_equal("abcd", buffer_string)

      # buffer is erased
      file2 = Tempfile.path("abcde")
      @x = newbuf(:name=>@bufname, :file=>file2)
      setbuf
      assert_equal("abcde", buffer_string)
 
    ensure
      kill_buffer nil
      File.unlink file1
      File.unlink file2
    end
  end
    

  def test_argerror
    assert_raises(ArgumentError){ newbuf }
    assert_raises(ArgumentError){ newbuf(:name=>nil) }
    assert_raises(ArgumentError){ newbuf(1) }
    assert_raises(ArgumentError){ newbuf("1") } # hmm.
    assert_raises(ArgumentError){ newbuf(:name=>@bufname, :line=>"a") }
    assert_raises(ArgumentError){ newbuf(:name=>@bufname, :point=>"a") }
  end

  def test_current_line
    @x = newbuf(:name=>@bufname, :contents=>"a\nb\nc\nd", :line=>2)
    setbuf
    assert_equal("b", char_to_string(char_after))
  end

  def test_point
    @x = newbuf(:name=>@bufname, :contents=>"abcde", :point=>2)
    setbuf
    assert_equal("b", char_to_string(char_after))
  end

  def test_display
    elvar.pop_up_windows = true
    @x = newbuf(:name=>@bufname, :display=>true)
    assert(get_buffer_window(@x))
    assert_nil(one_window_p)
    assert_nil(eq(selected_window, get_buffer_window(@x)))
  end

  def test_display_pop
    elvar.pop_up_windows = true
    @x = newbuf(:name=>@bufname, :display=>:pop)
    assert(get_buffer_window(@x))
    assert_nil(one_window_p)
    assert(eq(selected_window, get_buffer_window(@x)))
  end

  def test_display_only
    elvar.pop_up_windows = true
    @x = newbuf(:name=>@bufname, :display=>:only)
    assert(get_buffer_window(@x))
    assert(one_window_p)
    assert(eq(selected_window, get_buffer_window(@x)))
  end

  def test_current
    @x = newbuf(:name=>@bufname, :current=>true)
    assert_nil(get_buffer_window(@x))
    assert(eq(current_buffer, @x))
  end

  def test_read_only
    b1 = newbuf(:name=>@bufname, :current=>true, :read_only=>true, :contents=>"a")
    assert(eq(elvar.buffer_read_only, true))
    assert_equal("a", buffer_string)

    b2 = newbuf(:name=>@bufname, :current=>true, :read_only=>true, :contents=>"c")
    assert(eq(b1,b2))
    assert(eq(elvar.buffer_read_only, true))
    assert_equal("c", buffer_string)
  end

  def test_bury
    buf = newbuf(:name=>@bufname, :display=>:pop, :bury=>true)
    assert(eq(buf, (buffer_list nil)[-1]))
  end

  def test_block
    buf = newbuf(:name=>@bufname, :current=>true) {
      text_mode
    }
    mode = with(:with_current_buffer,buf){elvar.major_mode}.to_s
    assert_equal("text-mode", mode)
  end
end

class TestDefunWithinClass < Test::Unit::TestCase

  class Foo
    include ElMixin

    def initialize(x)
      elvar.v = x[:value]
      defun(:twice_v) do
        elvar.v *= 2
      end

      defun(:str0) do
        do_str0 x[:str]
      end
    end

    def do_str0(str)
      (str*2).upcase
    end
  end

  def test0
    Foo.new(:value=>10, :str=>"ab")
    twice_v
    assert_equal(20, elvar.v)
    assert_equal("ABAB", str0)
  end
end

class TestElApp < Test::Unit::TestCase

  class Foo < ElApp
    def initialize(x)
      elvar.v = x[:value]
      defun(:twice_v) do
        elvar.v *= 2
      end

      defun(:str0) do
        do_str0 x[:str]
      end
    end

    def do_str0(str)
      (str*2).capitalize
    end
  end

  def test0
    Foo.run(:value=>10, :str=>"ab")
    twice_v
    assert_equal(20, elvar.v)
    assert_equal("Abab", str0)
  end
end



--
rubikitch
http://www.rubyist.net/~rubikitch/index.en.html

In This Thread

Prev Next