[#211889] Rails newbie: why is my partial template not rendering? — dan.caugherty@...

Hi there,

10 messages 2006/09/01

[#211908] Off topic: What is "top posting" ?? — Brad Peek <brad_peek@...>

82 messages 2006/09/01
[#211973] Re: Off topic: What is "top posting" ?? — floyd@... (Floyd L. Davidson) 2006/09/01

William Crawford <wccrawford@gmail.com> wrote:

[#211988] Re: Off topic: What is "top posting" ?? — William Crawford <wccrawford@...> 2006/09/01

unknown wrote:

[#212082] Re: Off topic: What is "top posting" ?? — "Austin Ziegler" <halostatue@...> 2006/09/01

On 9/1/06, Floyd L. Davidson <floyd@apaflo.com> wrote:

[#211971] Joel Spolsky on languages for web programming — "Dido Sevilla" <dido.sevilla@...>

http://www.joelonsoftware.com/items/2006/09/01.html

140 messages 2006/09/01
[#212008] Re: Joel Spolsky on languages for web programming — "Rob Sanheim" <rsanheim@...> 2006/09/01

On 9/1/06, Dido Sevilla <dido.sevilla@gmail.com> wrote:

[#212009] Re: Joel Spolsky on languages for web programming — James Edward Gray II <james@...> 2006/09/01

On Sep 1, 2006, at 9:20 AM, Rob Sanheim wrote:

[#212012] Re: Joel Spolsky on languages for web programming — Yukihiro Matsumoto <matz@...> 2006/09/01

Hi,

[#212020] Re: Joel Spolsky on languages for web programming — James Edward Gray II <james@...> 2006/09/01

On Sep 1, 2006, at 9:36 AM, Yukihiro Matsumoto wrote:

[#213612] Re: Joel Spolsky on languages for web programming — "Phlip" <phlipcpp@...> 2006/09/09

Joel Spolsky wrote:

[#213613] Re: Joel Spolsky on languages for web programming — "M. Edward (Ed) Borasky" <znmeb@...> 2006/09/09

Phlip wrote:

[#213618] Re: Joel Spolsky on languages for web programmingr — Chad Perrin <perrin@...> 2006/09/09

On Sun, Sep 10, 2006 at 04:35:49AM +0900, M. Edward (Ed) Borasky wrote:

[#213616] Re: Joel Spolsky on languages for web programming — "Phlip" <phlipcpp@...> 2006/09/09

M. Edward (Ed) Borasky wrote:

[#213638] Re: Joel Spolsky on languages for web programming — "M. Edward (Ed) Borasky" <znmeb@...> 2006/09/09

Phlip wrote:

[#213922] Re: Joel Spolsky on languages for web programming — "Austin Ziegler" <halostatue@...> 2006/09/11

On 9/9/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

[#213996] Re: Joel Spolsky on languages for web programming — "Rob Sanheim" <rsanheim@...> 2006/09/12

On 9/11/06, Austin Ziegler <halostatue@gmail.com> wrote:

[#214040] Re: Joel Spolsky on languages for web programming — "Austin Ziegler" <halostatue@...> 2006/09/12

On 9/12/06, Rob Sanheim <rsanheim@gmail.com> wrote:

[#214096] Re: Joel Spolsky on languages for web programming — Keith Gaughan <kmgaughan@...> 2006/09/12

On Tue, Sep 12, 2006 at 09:08:44PM +0900, Austin Ziegler wrote:

[#214098] Re: Joel Spolsky on languages for web programming — "Austin Ziegler" <halostatue@...> 2006/09/12

On 9/12/06, Keith Gaughan <kmgaughan@eircom.net> wrote:

[#212177] Re: Joel Spolsky on languages for web programming — "Squeamizh" <squeamz@...> 2006/09/01

[#212377] Re: Joel Spolsky on languages for web programming — "Alvin Ryder" <alvin321@...> 2006/09/02

Dido Sevilla wrote:

[#212455] Re: Joel Spolsky on languages for web programming — David Vallner <david@...> 2006/09/03

Utter pants. I mean, you used the word "bloat", which should make people

[#211987] Happy Numbers (#93) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

71 messages 2006/09/01
[#212060] Re: Happy Numbers (#93) — Paul Lutus <nospam@...> 2006/09/01

Peter Hickman wrote:

[#212083] When clever is stupid — khaines@...

Some time in the past, I wrote a line of code.

27 messages 2006/09/01
[#212106] Re: When clever is stupid [RANT] — David Vallner <david@...> 2006/09/01

khaines@enigo.com wrote:

[#212175] File.ctime for detecting directory modifications? — Eero Saynatkari <eero.saynatkari@...>

Hi!

11 messages 2006/09/01

[#212232] Using RubyInline for Optimization — Eric Hodel <drbrain@...7.net>

I wrote an article on using RubyInline for optimization where I take

29 messages 2006/09/02
[#213747] Re: Using RubyInline for Optimization — Mike Berrow <mberrow1@...> 2006/09/10

Eric Hodel wrote:

[#213748] Re: Using RubyInline for Optimization — Eric Hodel <drbrain@...7.net> 2006/09/10

On Sep 10, 2006, at 1:51 PM, Mike Berrow wrote:

[#213811] Re: Using RubyInline for Optimization — Mike Berrow <mberrow1@...> 2006/09/11

Eric Hodel wrote:

[#213881] Re: Using RubyInline for Optimization — Eric Hodel <drbrain@...7.net> 2006/09/11

On Sep 11, 2006, at 12:46 AM, Mike Berrow wrote:

[#213884] Re: Using RubyInline for Optimization — ara.t.howard@... 2006/09/11

On Tue, 12 Sep 2006, Eric Hodel wrote:

[#212267] A better syntax highlighting color scheme for Ruby code on Vim? — "Alder Green" <alder.green@...>

I've been migrating to Vim recently. It has impressive Ruby/Rails

30 messages 2006/09/02
[#212309] Re: A better syntax highlighting color scheme for Ruby code on Vim? — Paul Lutus <nospam@...> 2006/09/02

Alder Green wrote:

[#212316] Re: A better syntax highlighting color scheme for Ruby code on Vim? — "Michal Suchanek" <hramrach@...> 2006/09/02

On 9/2/06, Paul Lutus <nospam@nosite.zzz> wrote:

[#212320] Ordered contrast for String or Array — "Trans" <transfire@...>

I have two strings: "aabc" and "aacd". I want to get an "ordered

12 messages 2006/09/02

[#212442] How to properly bind context menus to canvas in Ruby/Tk? — Josef Wolf <jw@...>

Hello!

13 messages 2006/09/03

[#212554] concurrent input from GUI *and * from irb — "Joachim (Mchen)" <wuttke1@...>

I am currently redesigning a program that shall accept input

14 messages 2006/09/04
[#212719] Re: concurrent input from GUI *and * from irb — Paul Lutus <nospam@...> 2006/09/05

Joachim (M端nchen) wrote:

[#212560] Setting font path ? for Ruby and/or Ruby/Graphviz ??? — pere.noel@... (Une b騅ue)

i've used rdoc with the option -d, i get the graphviz output images

11 messages 2006/09/04

[#212564] Compiling Regexp only once — "singsang" <tomsingsang@...>

Dear all,

16 messages 2006/09/04
[#212567] Re: Compiling Regexp only once — Robert Klemme <shortcutter@...> 2006/09/04

On 04.09.2006 14:11, singsang wrote:

[#212655] Re: Compiling Regexp only once — "Rick DeNatale" <rick.denatale@...> 2006/09/04

On 9/4/06, Robert Klemme <shortcutter@googlemail.com> wrote:

[#212588] times is a method? — "gaurav bagga" <gaurav.v.bagga@...>

Fixnum.ancestors.each do |x|

14 messages 2006/09/04

[#212632] run only one test case? — "Phlip" <phlipcpp@...>

Rubies:

19 messages 2006/09/04

[#212658] similar resources for Lisp/Scheme — Chad Perrin <perrin@...>

I know this is terribly off-topic, but . . .

12 messages 2006/09/04

[#212768] Ultimate programmer's reference - Quickref.org launches — robby.walker@...

QuickRef.org : AJAX-powered site searches for documentation on Ruby,

11 messages 2006/09/05

[#212815] Cross-platform standalone Ruby apps ? — Pieter Kubben <pieter@...>

Hi,

14 messages 2006/09/05

[#212880] One line infinite for loop in Ruby? — "Anil Wadghule" <anildigital@...>

Hi all,

12 messages 2006/09/06

[#212943] Newbie help, please: cannot execute Tk under Windows XP — "James Calivar" <amheiserbush@...>

Hello,

11 messages 2006/09/06
[#212945] Re: Newbie help, please: cannot execute Tk under Windows XP — "王东" <beforewin@...> 2006/09/06

The tcltklib.so is not included in the latest oneclick installer.

[#212948] Re: Newbie help, please: cannot execute Tk under Windows XP — "James Calivar" <amheiserbush@...> 2006/09/06

Hi 王东 -

[#212994] Re: A little idiom I like — "Berger, Daniel" <Daniel.Berger@...>

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

13 messages 2006/09/06

[#213053] calling scp from ruby — Seid Rudy <seidom@...>

I have a problem using "scp" from a ruby scrip. It copies my sql file to

17 messages 2006/09/07

[#213068] Installing ROR with Darwin Ports — "shane.pinnell@..." <shane.pinnell@...>

First let me say that I just got a new MacBook Pro and am looking

11 messages 2006/09/07

[#213169] Chronic-0.1.0 — Tom Werner <tom@...>

I am pleased to announce the FIRST release of Chronic.

14 messages 2006/09/07

[#213255] what is the best non-rails web/ruby development environment for windows? — "Edward" <edward@...>

So I want to develop ruby sites locally like I do PHP5 sites.

15 messages 2006/09/08

[#213278] better alias_method — ara.t.howard@...

25 messages 2006/09/08

[#213282] Sun hires JRuby developers. — Ola Bini <ola.bini@...>

19 messages 2006/09/08
[#213341] Re: Sun hires JRuby developers. — James Edward Gray II <james@...> 2006/09/08

On Sep 8, 2006, at 1:27 AM, Ola Bini wrote:

[#213365] Re: Sun hires JRuby developers. — "Charles O Nutter" <headius@...> 2006/09/08

And it's worth saying that everyone I've spoken with about Ruby,

[#213306] Wirble 0.1.1: Irb Enhancements for the Masses — Paul Duncan <pabs@...>

Hi All,

28 messages 2006/09/08

[#213339] Puzzling bug with yielded array — "A. S. Bradbury" <asbradbury@...>

I have a Node class, children are stored in a hash with the node's name as the

11 messages 2006/09/08

[#213410] state machine in ruby — snacktime <snacktime@...>

So I'm refactoring a very ugly piece of client code that needs to

22 messages 2006/09/08
[#213429] Re: state machine in ruby — Francis Cianfrocca <garbagecat10@...> 2006/09/08

snacktime wrote:

[#213445] Re: state machine in ruby — snacktime <snacktime@...> 2006/09/08

Some quick examples of what I'm dealing with. There are about 10error scenarios in all, this is just a couple.

[#213451] Combine @item.foo.nil? || @item.foo.empty? ? — Joe Ruby <joeat303@...>

I have code like this in my (Markaby) templates:

11 messages 2006/09/08

[#213514] DRAW 1280, 1024 — Benjohn Barnes <benjohn@...>

20 years ago, the subject line would have drawn me a line across one

33 messages 2006/09/09

[#213659] Real World Scalability and Ruby - Top 20 — "Joseph" <jlhurtado@...>

Folks,

25 messages 2006/09/10

[#213690] How about Enumerable#find_pattern? — "A. S. Bradbury" <asbradbury@...>

Ignore the name, I don't really know what it's best to call it. Basically I've

12 messages 2006/09/10

[#213693] patching strings together to make a variable — "Sy Ali" <sy1234@...>

I'm curious to know if I can patch multiple things together to make a variable.

19 messages 2006/09/10

[#213721] Re: Struggling with Blocks — Paul Lutus <nospam@...>

Newbie wrote:

35 messages 2006/09/10
[#213789] Re: Struggling with Blocks — Paul Lutus <nospam@...> 2006/09/11

Hal Fulton wrote:

[#213727] Matrix — "v.srikrishnan@..." <v.srikrishnan@...>

Hi all,

51 messages 2006/09/10

[#213809] anti-advocacy advocacy — "Martin DeMello" <martindemello@...>

http://www.perl.com/pub/a/2000/12/advocacy.html

32 messages 2006/09/11
[#214463] Re: anti-advocacy advocacy — Jeremy Henty <jeremy@...> 2006/09/14

On 2006-09-14, John Johnson <johnatl@mac.com> wrote:

[#214568] Re: anti-advocacy advocacy — Tom Allison <tallison@...> 2006/09/15

Jeremy Henty wrote:

[#214574] Re: anti-advocacy advocacy — Chad Perrin <perrin@...> 2006/09/15

On Fri, Sep 15, 2006 at 07:47:39PM +0900, Tom Allison wrote:

[#213949] The economics of a slow but productive Ruby — "Jacob Fugal" <lukfugl@...>

[NOTE: I'm trying to present the facts and be objective in this post.

35 messages 2006/09/12
[#213950] Re: The economics of a slow but productive Ruby — Carl Lerche <carl.lerche@...> 2006/09/12

1) It doesn't take 5 times more boxes for a ruby app than a .NET app,

[#214039] Browser applications (applets, flash...) with Ruby? — francis.rammeloo@...

Howdy,

12 messages 2006/09/12

[#214045] New Ruby Web Site is Officially Launched — "Curt Hibbs" <curt.hibbs@...>

I just posted this to the O'Reilly Ruby

11 messages 2006/09/12

[#214061] Maximum value of hash — Bart Braem <bart.braem@...>

A very simple question: what's the best way to get the maximum value of a

13 messages 2006/09/12

[#214182] Re: Joel Spolsky on languages for web programmingr — "Frank Davis" <Fdavis@...>

Ah, yes, the increasingly blurry line between Languages and their

17 messages 2006/09/13
[#214183] Re: Joel Spolsky on languages for web programmingr — Chad Perrin <perrin@...> 2006/09/13

On Wed, Sep 13, 2006 at 11:14:41AM +0900, Frank Davis wrote:

[#214234] Re: Joel Spolsky on languages for web programmingr — "Richard Conroy" <richard.conroy@...> 2006/09/13

Bringing the debate back on topic,

[#214237] Re: Joel Spolsky on languages for web programmingr — Bira <u.alberton@...> 2006/09/13

On 9/13/06, Richard Conroy <richard.conroy@gmail.com> wrote:

[#214239] Re: Joel Spolsky on languages for web programmingr — "Richard Conroy" <richard.conroy@...> 2006/09/13

On 9/13/06, Bira <u.alberton@gmail.com> wrote:

[#214221] Metaruby, BFTS, Cardinal and Rubicon - State of play? — "Chris Roos" <chrisjroos@...>

Hi,

30 messages 2006/09/13
[#214224] Re: Metaruby, BFTS, Cardinal and Rubicon - State of play? — Ryan Davis <ryand-ruby@...> 2006/09/13

[#214251] Re: Metaruby, BFTS, Cardinal and Rubicon - State of play? — "M. Edward (Ed) Borasky" <znmeb@...> 2006/09/13

Ryan Davis wrote:

[#214259] Re: Metaruby, BFTS, Cardinal and Rubicon - State of play? — "pat eyler" <pat.eyler@...> 2006/09/13

On 9/13/06, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

[#214269] Re: Metaruby, BFTS, Cardinal and Rubicon - State of play? — "Austin Ziegler" <halostatue@...> 2006/09/13

On 9/13/06, pat eyler <pat.eyler@gmail.com> wrote:

[#214487] Re: Metaruby, BFTS, Cardinal and Rubicon - State of play? — Ryan Davis <ryand-ruby@...> 2006/09/14

[#214491] Re: Metaruby, BFTS, Cardinal and Rubicon - State of play? — "Austin Ziegler" <halostatue@...> 2006/09/14

On 9/14/06, Ryan Davis <ryand-ruby@zenspider.com> wrote:

[#214283] Regular expression question. — "L7" <jesse.r.brown@...>

In trying to parse a C source file I have the following section of

15 messages 2006/09/13

[#214318] Assembling team for Ruby window manager — Robin Linthorst <robinl1@...4all.nl>

Hey all. I am a Ruby coder with average skills (can code almost

12 messages 2006/09/13

[#214321] building extension modules, and linking — "John Gabriele" <jmg3000@...>

When you load an extension module, what's the mechanism that makes

14 messages 2006/09/13

[#214370] Question about 'unless' (negated if) — Lincoln Anderson <ayblinkin@...>

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

13 messages 2006/09/14

[#214419] codeforpeople's rubyforge 0.2.0 released — Ryan Davis <ryand-ruby@...>

I'm proud to announce that codeforpeople's rubyforge 0.2.0 has been

16 messages 2006/09/14

[#214445] Re: arbitrary indexes — "Gavin Kistner" <gavin.kistner@...>

From: Jason Nordwick [mailto:jason@adapt.com]

12 messages 2006/09/14

[#214499] Benchmark for Ruby — "Robert Dober" <robert.dober@...>

Ok let us get off our nice host thread, which is much better of course.

21 messages 2006/09/14
[#214542] Re: Benchmark for Ruby — "M. Edward (Ed) Borasky" <znmeb@...> 2006/09/15

Robert Dober wrote:

[#214575] File Merge help request from Newbie — Snoopy Dog <snoopy.pa30@...>

First let me say that I am an absolute Newbie to Ruby. So please be

21 messages 2006/09/15

[#214605] Regular expression for string.anotherstring — Bart Braem <bart.braem@...>

I'm trying to validate a user mail address for a fixed domain with the rule

15 messages 2006/09/15

[#214634] readline() with editing and history? — Josef Wolf <jw@...>

Hello!

18 messages 2006/09/15
[#214636] Re: readline() with editing and history? — "Kent Sibilev" <ksruby@...> 2006/09/15

On 9/15/06, Josef Wolf <jw@raven.inka.de> wrote:

[#214647] Re: readline() with editing and history? — Josef Wolf <jw@...> 2006/09/15

On Sat, Sep 16, 2006 at 01:58:27AM +0900, Kent Sibilev wrote:

[#214686] Re: readline() with editing and history? — "Rick DeNatale" <rick.denatale@...> 2006/09/15

On 9/15/06, Josef Wolf <jw@raven.inka.de> wrote:

[#214733] Re: readline() with editing and history? — Josef Wolf <jw@...> 2006/09/16

On Sat, Sep 16, 2006 at 06:42:24AM +0900, Rick DeNatale wrote:

[#214754] Re: readline() with editing and history? — Marc Heiler <shevegen@...> 2006/09/16

"If you installed ruby from source, then readline probably didn't build

[#214719] Nested threading? implications to timeout() — Geff Geff <boing@...>

All,

22 messages 2006/09/16
[#214756] Re: Nested threading? implications to timeout() — "Francis Cianfrocca" <garbagecat10@...> 2006/09/16

On 9/15/06, Geff Geff <boing@boing.com> wrote:

[#214803] Re: Nested threading? implications to timeout() — Geff Geff <boing@...> 2006/09/16

Francis Cianfrocca wrote:

[#214805] Re: Nested threading? implications to timeout() — "Francis Cianfrocca" <garbagecat10@...> 2006/09/17

On 9/16/06, Geff Geff <boing@boing.com> wrote:

[#214806] Re: Nested threading? implications to timeout() — Geff Geff <boing@...> 2006/09/17

Francis Cianfrocca wrote:

[#214828] Re: Nested threading? implications to timeout() — "Francis Cianfrocca" <garbagecat10@...> 2006/09/17

On 9/16/06, Geff Geff <boing@boing.com> wrote:

[#214782] the future of Ruby — Joan Iglesias <joan.iglesias@...>

Hello

41 messages 2006/09/16
[#214792] Re: the future of Ruby — Daniel Schierbeck <daniel.schierbeck@...> 2006/09/16

Joan Iglesias wrote:

[#214816] Re: the future of Ruby — Marc Heiler <shevegen@...> 2006/09/17

In practise you will really quickly adapt to make modifications also

[#214820] Re: the future of Ruby — Joan Iglesias <joan.iglesias@...> 2006/09/17

Marc Heiler wrote:

[#214837] Re: the future of Ruby — "Francis Cianfrocca" <garbagecat10@...> 2006/09/17

On 9/17/06, Joan Iglesias <joan.iglesias@yahoo.es> wrote:

[#214843] Re: the future of Ruby — "Alexandru Popescu" <the.mindstorm.mailinglist@...> 2006/09/17

On 9/17/06, Francis Cianfrocca <garbagecat10@gmail.com> wrote:

[#214848] Re: the future of Ruby — "Francis Cianfrocca" <garbagecat10@...> 2006/09/17

On 9/17/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com> wrote:

[#214878] what is the best ruby editor? — "Edward" <edward@...>

I downloaded both the EasyEclipse for Ruby and the EasyEclipse for

21 messages 2006/09/17

[#214897] Splat, #to_ary and #to_a — Eero Saynatkari <eero.saynatkari@...>

Hi!

26 messages 2006/09/18
[#214901] Re: Splat, #to_ary and #to_a — Yukihiro Matsumoto <matz@...> 2006/09/18

Hi,

[#214906] Re: Splat, #to_ary and #to_a — "Rick DeNatale" <rick.denatale@...> 2006/09/18

On 9/17/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#214954] Code Golf Challenge : 1,000 Digits Of Pi — Carl Drinkwater <carl@...>

Hi all,

16 messages 2006/09/18

[#215035] Why not a Ruby 1.8 to 2.x Code Convertor? — "Joseph" <jlhurtado@...>

Having read the long discussion on the advantages and disadvantages of

15 messages 2006/09/18

[#215070] Binary-file module? (also, rubychess) — "Glenn M. Lewis" <noSpam@...>

In Ruby, do we have a module that makes reading/parsing/writing

17 messages 2006/09/19

[#215170] What's the ruby way to sort string with cases in mind — "Sam Kong" <sam.s.kong@...>

Hi,

11 messages 2006/09/19

[#215196] Mr. Neighborly's Humble Little Ruby Book is now available — "Jeremy McAnally" <jeremymcanally@...>

Hello everyone,

9 messages 2006/09/19

[#215213] piping input when shelling out — Caio Chassot <lists@...2studio.com>

Hi all,

21 messages 2006/09/20

[#215274] Re: [ANN] Ducktator - A Duck Type Validator — Robert Klemme <shortcutter@...>

On 19.09.2006 21:12, Ola Bini wrote:

22 messages 2006/09/20
[#215354] Re: Ducktator - A Duck Type Validator — "Austin Ziegler" <halostatue@...> 2006/09/20

On 9/20/06, Ola Bini <ola.bini@ki.se> wrote:

[#215419] Re: Ducktator - A Duck Type Validator — Joel VanderWerf <vjoel@...> 2006/09/20

Austin Ziegler wrote:

[#215280] the point of omitting parentheses — Henrik Schmidt <nospam@...>

Hi there,

26 messages 2006/09/20

[#215292] Something strange in ruby or I'm a newbie? — Hussachai Puripunpinyo <siberhus@...>

Question 1:

16 messages 2006/09/20

[#215294] Hoe 1.0 released — Ryan Davis <ryand-ruby@...>

Farmer Ted came to me the other day with a problem. He has about 10

21 messages 2006/09/20

[#215353] Re: [ANN] Ducktator - A Duck Type Validator — "Austin Ziegler" <halostatue@...>

On 9/19/06, Ola Bini <ola.bini@ki.se> wrote:

38 messages 2006/09/20
[#215466] Re: [ANN] Ducktator - A Duck Type Validator — Hal Fulton <hal9000@...> 2006/09/20

Ola Bini wrote:

[#215478] Re: [ANN] Ducktator - A Duck Type Validator — Yukihiro Matsumoto <matz@...> 2006/09/21

Hi,

[#215377] super simple serving of ruby pages — "zerohalo" <zerohalo@...>

Hi. I apologize in advance if this is a dumb question, but though I've

35 messages 2006/09/20

[#215388] Creating a reference to a ruby variable in a C extension. — Christer Sandberg <chrsan@...>

Hi!

13 messages 2006/09/20
[#215418] Re: Creating a reference to a ruby variable in a C extension. — Vincent Fourmond <vincent.fourmond@9online.fr> 2006/09/20

[#215511] Re: Creating a reference to a ruby variable in a C extension — Christer Sandberg <chrsan@...> 2006/09/21

Vincent Fourmond wrote:

[#215534] Re: Creating a reference to a ruby variable in a C extension — "David Balmain" <dbalmain.ml@...> 2006/09/21

On 9/21/06, Christer Sandberg <chrsan@gmail.com> wrote:

[#215529] Assistance wanted for integrating existing C-API into Ruby — "Feurio" <noname4me@...>

Hello,

13 messages 2006/09/21

[#215596] Rejected Ruby book ideas by O'Reilly — "Berger, Daniel" <Daniel.Berger@...>

Hi all,

87 messages 2006/09/21
[#215613] Re: [OT] Rejected Ruby book ideas by O'Reilly — Paul Lutus <nospam@...> 2006/09/21

Berger, Daniel wrote:

[#215616] Re: [OT] Rejected Ruby book ideas by O'Reilly — "Berger, Daniel" <Daniel.Berger@...> 2006/09/21

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

[#215623] Re: [OT] Rejected Ruby book ideas by O'Reilly — Robert Klemme <shortcutter@...> 2006/09/21

On 21.09.2006 18:07, Berger, Daniel wrote:

[#215625] Re: [OT] Rejected Ruby book ideas by O'Reilly — "Berger, Daniel" <Daniel.Berger@...> 2006/09/21

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

[#215640] Re: [OT] Rejected Ruby book ideas by O'Reilly — Gene Venable <geneven@...> 2006/09/21

"This communication is the property of Qwest and may

[#215720] Re: [OT] Rejected Ruby book ideas by O'Reilly — Paul Lutus <nospam@...> 2006/09/21

Matt Todd wrote:

[#215728] Re: [OT] Rejected Ruby book ideas by O'Reilly — "Adelle Hartley" <adelle@...> 2006/09/22

When I saw the title of this thread, I was expecting a funny list.

[#215731] Re: [OT] Rejected Ruby book ideas by O'Reilly — "M. Edward (Ed) Borasky" <znmeb@...> 2006/09/22

Adelle Hartley wrote:

[#215741] Re: [OT] Rejected Ruby book ideas by O'Reilly — Joel VanderWerf <vjoel@...> 2006/09/22

Adelle Hartley wrote:

[#215776] Re: [OT] Rejected Ruby book ideas by O'Reilly — Jonas Hartmann <Mail@...> 2006/09/22

10. Ruby: Makes you try to be funny, very hard.

[#215801] Re: [OT] Rejected Ruby book ideas by O'Reilly — James Edward Gray II <james@...> 2006/09/22

On Sep 22, 2006, at 3:02 AM, Jonas Hartmann wrote:

[#215676] Calculate last day of month — Hunter Walker <walkerhunter@...>

This is probably an easy one for somebody, but I couldn't figure it out

20 messages 2006/09/21

[#215789] RAD ( Rapid Application Development) — Luiz Macchi <gugui_sarubi_macchi@...>

Hi all ! is there a tool like a Glade, Delphi, Qt3 Design to work with

11 messages 2006/09/22

[#215829] Would people use a rubyforge apt-get repository? — John Turner <xennocide@...>

Just an idea that's been bouncing around my head...

11 messages 2006/09/22

[#215833] 64-bit integers in network byte-order — Francis Cianfrocca <garbagecat10@...>

All,

12 messages 2006/09/22

[#215905] Code to S-Exp (#95) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

37 messages 2006/09/22
[#215918] Re: [QUIZ] Code to S-Exp (#95) — Ryan Davis <ryand-ruby@...> 2006/09/23

[#215920] Re: [QUIZ] Code to S-Exp (#95) — James Edward Gray II <james@...> 2006/09/23

On Sep 22, 2006, at 8:04 PM, Ryan Davis wrote:

[#215909] Please define these terms — "Trans" <transfire@...>

(And add any you think might be missing from the set)

27 messages 2006/09/22

[#215940] How do I instantiate a class who's name is dynamic? — Ben Harper <rogojin@...>

I want to do the following, where 'somefile' is a dynamic value:

11 messages 2006/09/23

[#215956] Ruby, Analysis, and Tons of RAM — ben@...

Does anyone have experience with using Ruby for analysis (*lots* of

13 messages 2006/09/23

[#215975] Cookbook example - uninitialized constant — Max Russell <thedossone@...>

Cross posting this from Ubuntu forums

14 messages 2006/09/23

[#215987] catching process output (Kernel#system) — Chris Donhofer <c.donhofer@...>

hi!

13 messages 2006/09/23

[#216011] Riddle me this (a question about expressions) — Patrick Toomey <ptoomey3@...>

Hello all,

32 messages 2006/09/23
[#216092] Re: Riddle me this (a question about expressions) — "Robert Klemme" <shortcutter@...> 2006/09/24

Others have commented this already. Just another bit: once you think about

[#216140] Re: Riddle me this (a question about expressions) — Patrick Toomey <ptoomey3@...> 2006/09/24

[#216150] Re: Riddle me this (a question about expressions) — Robert Klemme <shortcutter@...> 2006/09/24

Patrick Toomey wrote:

[#216157] Re: Riddle me this (a question about expressions) — Logan Capaldo <logancapaldo@...> 2006/09/24

On Mon, Sep 25, 2006 at 05:10:18AM +0900, Robert Klemme wrote:

[#216160] Re: Riddle me this (a question about expressions) — Hal Fulton <hal9000@...> 2006/09/24

>>

[#216162] Re: Riddle me this (a question about expressions) — dblack@... 2006/09/24

Hi --

[#216206] Re: Riddle me this (a question about expressions) — "Rick DeNatale" <rick.denatale@...> 2006/09/25

On 9/24/06, dblack@wobblini.net <dblack@wobblini.net> wrote:

[#216055] Array shift bug — Bob Hutchison <hutch@...>

22 messages 2006/09/24
[#216068] Re: Array shift bug — Devin Mullins <twifkak@...> 2006/09/24

Bob Hutchison wrote:

[#216087] Re: Array shift bug — Nobuyoshi Nakada <nobu@...> 2006/09/24

Hi,

[#216115] Re: Array shift bug — "Eric Mahurin" <eric.mahurin@...> 2006/09/24

On 9/24/06, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:

[#216073] undefined method `recvfrom_nonblock' — "Michael P. Soulier" <msoulier@...>

Hey,

16 messages 2006/09/24

[#216080] Help w/ Codegolf Total Triangles- reading input — Drew Olson <olsonas@...>

Hello all -

12 messages 2006/09/24

[#216229] ruby wizards, help me beautify skanky code — "Giles Bowkett" <gilesb@...>

here it is:

13 messages 2006/09/25

[#216310] How to copy a method from one class to another — "Sam Kong" <sam.s.kong@...>

Hi Rubyists,

15 messages 2006/09/25

[#216314] Re: How to copy a method from one class to another — "Gavin Kistner" <gavin.kistner@...>

From: Sam Kong [mailto:sam.s.kong@gmail.com]

12 messages 2006/09/25
[#216437] Re: How to copy a method from one class to another — "Robert Dober" <robert.dober@...> 2006/09/26

On 9/25/06, Gavin Kistner <gavin.kistner@anark.com> wrote:

[#216396] Rails for the Rubyist — "Phrogz" <gavin@...>

It's very nice that DAB has written "Ruby for Rails", which (as I

21 messages 2006/09/25

[#216431] GUI programming for WinXP/Linux/OSX? — Roman Hausner <roman.hausner@...>

I am planning a project that has the following main requirements:

43 messages 2006/09/26

[#216483] Ruby's equivalent of PHP explode — voipfc@...

16 messages 2006/09/26

[#216617] Computer Language Popularity Trend — xah@...

This page gives a visual report of computer languages's popularity, as

32 messages 2006/09/27

[#216675] String starts? and ends? methods — George <none@...>

This comes up every now and again, and lots of frameworks implement their own versions. I'm thinking

52 messages 2006/09/27
[#216680] Re: String starts? and ends? methods — ts <decoux@...> 2006/09/27

>>>>> "G" == George <none@none.com> writes:

[#216681] Re: String starts? and ends? methods — dblack@... 2006/09/27

Hi --

[#216683] Re: String starts? and ends? methods — ts <decoux@...> 2006/09/27

>>>>> "d" == dblack <dblack@wobblini.net> writes:

[#216685] Re: String starts? and ends? methods — dblack@... 2006/09/27

Hi --

[#216687] Re: String starts? and ends? methods — Yukihiro Matsumoto <matz@...> 2006/09/27

Hi,

[#216712] Re: String starts? and ends? methods — Devin Mullins <twifkak@...> 2006/09/27

Yukihiro Matsumoto wrote:

[#216715] Re: String starts? and ends? methods — dblack@... 2006/09/27

Hi --

[#216718] Re: String starts? and ends? methods — Yukihiro Matsumoto <matz@...> 2006/09/27

Hi,

[#216720] Re: String starts? and ends? methods — Jonas Hartmann <Mail@...> 2006/09/27

Yukihiro Matsumoto wrote:

[#216728] Re: String starts? and ends? methods — Yukihiro Matsumoto <matz@...> 2006/09/27

Hi,

[#216693] Code Golf Challenge : Oblongular Number Spirals — Carl Drinkwater <carl@...>

Hi all,

20 messages 2006/09/27
[#216963] Re: [ANN] Code Golf Challenge : Oblongular Number Spirals — Michael Ulm <michael.ulm@...> 2006/09/28

Carl Drinkwater wrote:

[#217033] Re: [ANN] Code Golf Challenge : Oblongular Number Spirals — James Edward Gray II <james@...> 2006/09/28

On Sep 28, 2006, at 1:23 AM, Michael Ulm wrote:

[#216699] Ruby with Qt or GTK ? — Luiz Macchi <gugui_sarubi_macchi@...>

Hi all ! I卒m learning Ruby and need to develop in GUI interfaces !

23 messages 2006/09/27

[#216759] how to determine if pipe is given — "greg" <eegreg@...>

To retrieve piped input to my program I can use something like

38 messages 2006/09/27
[#216762] Re: how to determine if pipe is given — ara.t.howard@... 2006/09/27

On Thu, 28 Sep 2006, greg wrote:

[#216819] Re: how to determine if pipe is given — "greg" <eegreg@...> 2006/09/27

thanks, a

[#216828] Re: how to determine if pipe is given — gwtmp01@... 2006/09/27

[#216848] Re: how to determine if pipe is given — ara.t.howard@... 2006/09/27

On Thu, 28 Sep 2006 gwtmp01@mac.com wrote:

[#216907] Re: how to determine if pipe is given — gwtmp01@... 2006/09/28

[#216791] Bonjour and Socket::getaddrinfo — "obrien.andrew@..." <obrien.andrew@...>

I was having a problem with DRb coming from Socket::getaddrinfo not

14 messages 2006/09/27

[#216896] Is object[x](y,z) always invalid? — Alex Gutteridge <alexg@...>

I'm working on converting a Python module (RPy) to Ruby and am trying

12 messages 2006/09/28

[#216993] New magical version of Symbol.to_proc — Dr Nic <drnicwilliams@...>

[Posted at

46 messages 2006/09/28
[#216997] Re: New magical version of Symbol.to_proc — dblack@... 2006/09/28

Hi --

[#217002] Re: New magical version of Symbol.to_proc — "Robert Dober" <robert.dober@...> 2006/09/28

<snip>

[#217004] Re: New magical version of Symbol.to_proc — dblack@... 2006/09/28

Hi --

[#217104] Re: New magical version of Symbol.to_proc — Hal Fulton <hal9000@...> 2006/09/28

dblack@wobblini.net wrote:

[#217007] Re: New magical version of Symbol.to_proc — Dr Nic <drnicwilliams@...> 2006/09/28

Robert Dober wrote:

[#217205] Re: New magical version of Symbol.to_proc — "Charles O Nutter" <headius@...> 2006/09/29

On 9/28/06, Dr Nic <drnicwilliams@gmail.com> wrote:

[#217055] "Succinctness is Power", by Paul Graham — Rich Morin <rdm@...>

This is probably old news to many here, but I found it

49 messages 2006/09/28
[#217326] Re: "Succinctness is Power", by Paul Graham — "gregarican" <greg.kujawa@...> 2006/09/30

Agreed. The only way that I consider Ruby as being more succinct

[#217401] Re: "Succinctness is Power", by Paul Graham — Pete Yandell <pete@...> 2006/09/30

[#217421] Re: "Succinctness is Power", by Paul Graham — "Giles Bowkett" <gilesb@...> 2006/09/30

I think he's onto something but that there's more to the picture.

[#217493] Re: "Succinctness is Power", by Paul Graham — Dr Nic <drnicwilliams@...> 2006/10/01

Giles Bowkett wrote:

[#217497] Re: "Succinctness is Power", by Paul Graham — "M. Edward (Ed) Borasky" <znmeb@...> 2006/10/01

Dr Nic wrote:

[#217507] Re: "Succinctness is Power", by Paul Graham — Martin Coxall <pseudo.meta@...> 2006/10/01

>

[#217511] Re: "Succinctness is Power", by Paul Graham — "M. Edward (Ed) Borasky" <znmeb@...> 2006/10/01

Martin Coxall wrote:

[#217633] Re: "Succinctness is Power", by Paul Graham — Tim Smith <reply_in_group@...> 2006/10/02

In article <29577979-9E2C-4C38-A7D6-14670ADE42D9@gmail.com>,

[#217093] Re: "Succinctness is Power", by Paul Graham — "Rick DeNatale" <rick.denatale@...>

On 9/28/06, Rich Morin <rdm@cfcl.com> wrote:

26 messages 2006/09/28
[#217097] Re: "Succinctness is Power", by Paul Graham — Reprisal <nepenthereprisal@...> 2006/09/28

I don't think you are particularly in disagreement with what he is

[#217252] Re: "Succinctness is Power", by Paul Graham — "Rick DeNatale" <rick.denatale@...> 2006/09/29

On 9/28/06, Reprisal <nepenthereprisal@aol.com> wrote:

[#217147] Regexp help — "Marcus Bristav" <marcus.bristav@...>

Hello everyone,

16 messages 2006/09/29

[#217173] Use Perl modules from Ruby ? — Markus Brosch <mb.spam@...>

Hi Ruby-Community :)

16 messages 2006/09/29

[#217183] Story Generator (#96) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

30 messages 2006/09/29
[#217189] Re: [QUIZ] Story Generator (#96) — "Robert Dober" <robert.dober@...> 2006/09/29

On 9/29/06, Ruby Quiz <james@grayproductions.net> wrote:

[#217220] Hot new programming languages - according to the TIOBE index — "vasudevram" <vasudevram@...>

13 messages 2006/09/29

[#217242] test/spec 0.1, a BDD interface for Test::Unit — Christian Neukirchen <chneukirchen@...>

Hello,

11 messages 2006/09/29

[#217338] Integer division with / - request explanation of behavior — Wes Gamble <weyus@...>

Today I discovered the difference in the meaning of the / (arithmetic

23 messages 2006/09/30

[#217391] How to get a character from keyboard? — "Luo Yong" <cyberblue.yong@...>

Hi all,

18 messages 2006/09/30

[#217406] getting the name of the script in use — pere.noel@... (Une b騅ue)

18 messages 2006/09/30

[ANN] el4r-1.0.4 - EmacsLisp for Ruby

From: rubikitch@...
Date: 2006-09-21 08:45:13 UTC
List: ruby-talk #215536
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 unit-test EmacsLisp/EmacsRuby programs automatically.

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


== What's new

=== [2006/09/21] 1.0.4 released
* Smart-defun: defun within ElApp subclass.

=== [2006/03/12] 1.0.3 released

* Interactive specification by Proc objects
* .xemacs/init.el support.
* manpages.

=== [2005/12/11] 1.0.2 released
* Fixed `el4r-rctool' bug on Windows. No changes except installer.

=== [2005/12/02] 1.0.1 released
* Adjusted to Emacs-snapshot.

=== [2005/12/01] 1.0.0 released

* Installer.
* Packaging policy.
* Fixed fatal error bug.
* Fixed defun-GC problem.
* Renamed: el4r-runtest.rb -> el4r-runtest
* New command: el4r
* New EmacsRuby functions.
  * define_minor_mode
  * define_derived_mode
  * eval_after_load


== Download / Install / Setup
Since version 1.0.0, el4r introduced installer.
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-1.0.4.tar.gz").read.display' > el4r-1.0.4.tar.gz
  tar xzf el4r-1.0.4.tar.gz
  cd el4r-1.0.4
  ruby setup.rb

  ruby -S el4r-rctool -p
  ruby -S 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.
  
* ((<el4r-1.0.4.tar.gz|URL:http://www.rubyist.net/~rubikitch/archive/el4r-1.0.4.tar.gz>))

Victor Borja created ((<Gentoo ebuild|URL:http://darcs.thehatcher.com/vic/erebor-ebuilds/app-emacs/>)). Thanks.

Boris Daix created ((<Debian package|URL:http://alysse.dyndns.org/~bdaix/debian/>)). Thanks.
Put the following to your /etc/apt/sources.list:
  deb http://alysse.dyndns.org/~bdaix/debian/packages unstable/
  deb-src http://alysse.dyndns.org/~bdaix/debian/packages unstable/



Here is a test program of el4r.

#    el4r - EmacsLisp for Ruby 
#    Copyright (C) 2005 rubikitch <rubikitch@ruby-lang.org>
#    Version: $Id: test-el4r.rb 1328 2006-08-14 21:10:57Z rubikitch $

#    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.
## (eevnow "cat `buffer-file-name` | awk '/  def test_/{print $2}'|result-long")
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)

    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|
      0
    }
    # redefine
    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

  # defun a command with lambda
  def test_defun_command_3
    sum = nil
##### [my_command3]
    interactive_proc = lambda { [1+1, 1] }
    defun(:my_command3,
          :interactive => interactive_proc) { |a, b|
      sum = a + b
    }
##### [/my_command3]
    assert_equal nil, sum
    call_interactively :my_command3
    assert_equal 3, sum
  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 }

    assert_equal("ELListCell[1]", list(1).inspect)
    assert_equal("ELListCell[1, 2]", list(1,2).inspect)
  end
  
  # ELConsCell
  def test_ELConsCell
    assert_equal([1,2], el4r_cons_to_rubyary(cons(1,2)))
    assert_equal("ELConsCell[1, 2]", cons(1,2).inspect)

    assert_equal("ELListCell[1, 2, ELConsCell[3, 4]]", list(1,2,cons(3,4)).inspect)
    assert_equal("ELListCell[1, 2]", cons(1, list(2)).inspect)
  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 = funcall(: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(:adtest_2){
      elvar.w += 1
      3
    }
    defadvice(:adtest_2, :around, :adv2, :activate) {
      ad_do_it
      elvar.x = 10
      ad_do_it
    }
    ret = adtest_2()

    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"*9999 ]
    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)))}
    elvar.coding_system_for_write :binary
    elvar.coding_system_for_write :binary
    set_buffer_file_coding_system :binary
    el4r_treat_ctrl_codes { 
      cmp[ "" ]
      cmp[ "a"*9999 ]
      cmp[ '1' ]
      cmp[ 'a' ]
      cmp[ '\\' ]
      cmp[ '\\\\' ]
      cmp[ '\\\\\\' ]
      cmp[ '""' ]
      cmp[ '"' ]
      cmp[ "''" ]
      cmp[ '#{1}' ]
      cmp[ '\#{1}' ]
      cmp[ '#{\'1\'}' ]
      cmp[ '#@a' ]

      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" ]
      cmp[ "\306\374\313\334\270\354" ]  # NIHONGO in EUC-JP
    }
  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
    begin
      load_path_orig = el4r.conf.el4r_load_path
      tmp = Dir.tmpdir
      load_path = [ tmp, "#{tmp}/a" ]
      el4r.conf.el4r_load_path = load_path
      load_path.each do |dir|
        FileUtils.mkdir_p dir
        el4r_load_test_helper dir
      end
    ensure
      el4r.conf.el4r_load_path = load_path_orig
      FileUtils.rm_rf "#{tmp}/a"
    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

  def test_el4r_output
    printf("\t\n\ca!%s!","a")
    print(1)
    assert_equal("\t\n\ca!a!1", bufstr("*el4r:output*"))
  end

  def test_process_autoloads
    begin
      tmp = Dir.tmpdir
      autoload_dir = "#{tmp}/autoload"
      FileUtils.mkdir_p autoload_dir
      $ary = []
      %w[01first.rb 02second.rb 03third.rb].each_with_index do |fn, i|
        open(File.join(autoload_dir, fn), "w"){|f| f.write "$ary << #{i}" }
      end
      el4r_process_autoloads autoload_dir

      assert_equal [0,1,2], $ary
    ensure
      FileUtils.rm_rf autoload_dir
    end
  end

  def test_eval_after_load
    begin
      tmp = Dir.tmpdir
      add_to_list :load_path, tmp
      el = "#{tmp}/hoge.el"
      open(el, "w"){|f| f.write "(setq hoge 100)" }

      elvar.hoge = 1
      eval_after_load("hoge") do
        elvar.hoge = 200
      end
      assert_equal 1, elvar.hoge

      el_load "hoge"
      assert_equal 200, elvar.hoge
    ensure
      FileUtils.rm_f el
    end
  end

  def test_define_derived_mode
    @passed = false
##### [derived]
    define_derived_mode(:foo_mode, :fundamental_mode, "FOO", "doc") do
      @passed = true
    end
##### [/derived]
    assert_equal false, @passed
    foo_mode
    assert_equal true, @passed
    assert_equal "foo-mode", elvar.major_mode.to_s

    @passed = false
    define_derived_mode("bar-mode", el(:foo_mode), "Bar") do
      @passed = true
    end
    assert_equal false, @passed
    bar_mode
    assert_equal true, @passed

    define_derived_mode("baz-mode", el(:bar_mode), "Baz")
    baz_mode
    assert_equal "baz-mode", elvar.major_mode.to_s

  end

  def test_define_minor_mode
    @passed = false
##### [minor-mode]
    define_minor_mode(:a_minor_mode, "test minor mode") do
      @passed = true
    end
##### [/minor-mode]
    assert_equal false, @passed
    a_minor_mode
    assert_equal true, @passed
    assert_equal true, elvar.a_minor_mode
  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

##### [ElApp]
  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
##### [/ElApp]

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

class TestSmartDefun < Test::Unit::TestCase
##### [smart_defun]
  class SmartDefunSample < ElApp
    def my_square(x)
      x*x
    end

    defun(:testdefun, :interactive=>true) do |x|
      # This block is evaluated within a context of the SmartDefunSample INSTANCE.
      # Not a context of the SmartDefunSample class!!
      x ||= 16
      elvar.val = my_square(x)  # call an instance method.
    end
  end
##### [/smart_defun]

  def test_defun
    SmartDefunSample.run
    elvar.val = 0
    testdefun(10)
    assert_equal(100, elvar.val)
    call_interactively(:testdefun)
    assert_equal(256, elvar.val)
  end


  class DefvarSample < ElApp
    defvar(:blah_blah, 2)
    defun(:setblah) {|x| elvar.blah_blah = x }
  end

  def test_blah
    DefvarSample.run
    assert_equal 2, el4r_lisp_eval("blah-blah")
    setblah(20)
    assert_equal 20, el4r_lisp_eval("blah-blah")
  end


  class LispEvalSample < ElApp
    el4r_lisp_eval %((setq lisp-eval-sample 9999))
  end

  def test_lisp_eval_sample
    LispEvalSample.run
    assert_equal 9999, elvar.lisp_eval_sample
  end

end


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

In This Thread

Prev Next