[#121980] SOT gmail invites — Lyndon Samson <lyndon.samson@...>

X % of the people of this list appear to be using GoogleMail, where X

93 messages 2004/12/01
[#122062] Re: SOT gmail invites — Steve Zich <szich@...> 2004/12/01

On 2004-11-30 19:26:08 -0800, Lyndon Samson <lyndon.samson@gmail.com> said:

[#122063] Re: SOT gmail invites — Robert McGovern <robert.mcgovern@...> 2004/12/01

On Thu, 2 Dec 2004 02:17:45 +0900, Steve Zich >

[#122065] Re: SOT gmail invites — tony summerfelt <snowzone5@...> 2004/12/01

i've got 3 left...

[#122066] Re: SOT gmail invites — Pat Eyler <pate@...> 2004/12/01

I'd take one,

[#122072] Re: SOT gmail invites — tony summerfelt <snowzone5@...> 2004/12/01

On Thu, 2 Dec 2004 02:58:33 +0900, you wrote:

[#122073] Re: SOT gmail invites — Mark Hubbart <discordantus@...> 2004/12/01

On Thu, 2 Dec 2004 03:57:19 +0900, tony summerfelt

[#122075] Re: SOT gmail invites — Matt Maycock <ummaycoc@...> 2004/12/01

I've got some, too...

[#122112] Re: SOT gmail invites — Lyndon Samson <lyndon.samson@...> 2004/12/02

Ok, who missed out, I've got a couple left.

[#122120] Re: SOT gmail invites — Jamis Buck <jamis_buck@...> 2004/12/02

Lyndon Samson wrote:

[#122240] Re: SOT gmail invites — Stefan Schmiedl <s@...> 2004/12/02

On Thu, 2 Dec 2004 12:34:29 +0900,

[#122246] Re: SOT gmail invites — Jamis Buck <jamis_buck@...> 2004/12/02

Stefan Schmiedl wrote:

[#122254] Re: SOT gmail invites — Carl Youngblood <carlwork@...> 2004/12/02

Jamis Buck wrote:

[#122397] Re: SOT gmail invites — Hans Fugal <hans@...> 2004/12/03

Carl Youngblood wrote:

[#122400] Re: SOT gmail invites — Carl Youngblood <carlwork@...> 2004/12/03

Hans Fugal wrote:

[#122427] Re: SOT gmail invites — Hans Fugal <hans@...> 2004/12/03

Carl Youngblood wrote:

[#122069] Rails with webrick slow as snails — Sarah Tanembaum <sarahtanembaum@...>

I've followed the sample installation

15 messages 2004/12/01
[#122071] Re: Rails with webrick slow as snails — David Heinemeier Hansson <david@...> 2004/12/01

> BUT

[#122083] Re: Rails with webrick slow as snails — Sarah Tanembaum <sarahtanembaum@...> 2004/12/01

David Heinemeier Hansson wrote:

[#122110] ordered hash ? — "itsme213" <itsme213@...>

Is there a pure-ruby ordered hash? I'm looking for something that will

44 messages 2004/12/02
[#122176] Re: ordered hash ? — Nikolai Weibull <mailing-lists.ruby-talk@...> 2004/12/02

* itsme213 <itsme213@hotmail.com> [Dec 02, 2004 14:00]:

[#122156] Does anyone have benchmark programs for YARV? — SASADA Koichi <ko1@...>

Hi,

18 messages 2004/12/02

[#122177] nested defs, what if... — Hugh Sasse Staff Elec Eng <hgs@...>

This is too half-baked to be an RCR, but here goes...

17 messages 2004/12/02
[#122179] Re: nested defs, what if... — Austin Ziegler <halostatue@...> 2004/12/02

On Thu, 2 Dec 2004 23:44:08 +0900, Hugh Sasse Staff Elec Eng

[#122212] Re: nested defs, what if... — Brian =?ISO-8859-15?Q?Schr=F6der?= <ruby@...> 2004/12/02

On Thu, 2 Dec 2004 23:57:09 +0900

[#122180] Net::SSH 0.6.0 — Jamis Buck <jamis_buck@...>

Here's another release of Net::SSH, your friendly neighborhood pure-Ruby

12 messages 2004/12/02

[#122288] Ruby documentation. — Adam Fabian <afabian@...>

I'm kind of getting the impression that Ruby might not be

31 messages 2004/12/03

[#122350] Crosswords (#10) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

18 messages 2004/12/03

[#122371] GC run at end of script execution - order in which objects are claimed? — Tilman Sauerbeck <tilman@...>

Hi,

13 messages 2004/12/03

[#122416] *sigh* Anyone having wireless working on a linux machine? — "Abraham Vionas" <abe_ml@...>

I've tried something like eight different distributions and the best I've

11 messages 2004/12/03

[#122444] Using yield — "Joe Van Dyk" <joe.vandyk@...>

I come from a heavy C++ background, discovered Ruby a few months ago and

26 messages 2004/12/04

[#122475] Ruby 2.0 — "Joe Van Dyk" <joe.vandyk@...>

When is Ruby 2.0 due? Or estimated due date?

44 messages 2004/12/04
[#122544] Re: Ruby 2.0 — w_a_x_man@... (William James) 2004/12/04

Brian Mitchell <binary42@gmail.com> wrote

[#122549] Re: Ruby 2.0 — Florian Gross <flgr@...> 2004/12/04

William James wrote:

[#122554] Re: Ruby 2.0 — Giovanni Intini <intinig@...> 2004/12/04

> 32.times{|y|print" "*(31-y),(0..y).map{|x|~y&x>0?" .":" A"},$/}

[#122604] Re: Ruby 2.0 — Florian Gross <flgr@...> 2004/12/05

Giovanni Intini wrote:

[#122619] patch to "make def return something useful" — Peter <Peter.Vanbroekhoven@...>

In RCR 277 it is proposed to have def return something useful, more

15 messages 2004/12/06

[#122630] Freezing Variable Assignment — Nicholas Van Weerdenburg <vanweerd@...>

Hi,

62 messages 2004/12/06
[#122740] Re: Freezing Variable Assignment — "itsme213" <itsme213@...> 2004/12/06

[#122762] Re: Freezing Variable Assignment — "itsme213" <itsme213@...> 2004/12/07

[#122766] Re: Freezing Variable Assignment — Austin Ziegler <halostatue@...> 2004/12/07

On Tue, 7 Dec 2004 12:07:32 +0900, itsme213 <itsme213@hotmail.com>

[#122805] Re: Freezing Variable Assignment — Nicholas Van Weerdenburg <vanweerd@...> 2004/12/07

On Tue, 7 Dec 2004 13:44:09 +0900, Austin Ziegler <halostatue@gmail.com> wrote:

[#122644] Signatures and one liners — Brian Mitchell <binary42@...>

readers.each{|x| puts "Hi #{x},"}

23 messages 2004/12/06

[#122645] Duck images — "Dave Burt" <dave@...>

Hi,

35 messages 2004/12/06
[#122697] Re: Duck images — ptkwt@... (Phil Tomson) 2004/12/06

In article <vcSsd.61264$K7.35690@news-server.bigpond.net.au>,

[#122713] Re: Duck images — "trans. (T. Onoma)" <transami@...> 2004/12/06

On Monday 06 December 2004 12:52 pm, Phil Tomson wrote:

[#122715] Re: Duck images — Michael DeHaan <michael.dehaan@...> 2004/12/06

0>

[#122696] Ruby Article at Linux Journal — pat eyler <pat.eyler@...>

Hey, it looks like our own Ara Howard has been busy. He's got a cool

15 messages 2004/12/06

[#122775] Recommened readings? — "John" <jtrunek@...>

For one of my university courses, I have to complete a paper on Ruby.

13 messages 2004/12/07

[#122782] Ruby Weekly News 29th Nov - 5th Dec 2004 — timsuth@... (Tim Sutherland)

http://www.rubygarden.org/ruby?RubyNews/2004-11-29

12 messages 2004/12/07

[#122798] Idiom for creating hash from two arrays — Jonathan Paisley <jp-www@...>

Hello all,

22 messages 2004/12/07

[#122875] Re: [rcr] String#split behaves odd — "Pe, Botp" <botp@...>

Ryan Davis [mailto:ryand-ruby@zenspider.com] wrote:

30 messages 2004/12/08
[#122886] Re: [rcr] String#split behaves odd — Yukihiro Matsumoto <matz@...> 2004/12/08

Hi,

[#122894] Re: [rcr] String#split behaves odd — "trans. (T. Onoma)" <transami@...> 2004/12/08

On Wednesday 08 December 2004 12:00 am, Yukihiro Matsumoto wrote:

[#122940] Re: [rcr] String#split behaves odd — Florian Frank <flori@...> 2004/12/08

On 2004-12-08 15:56:01 +0900, trans. (T. Onoma) wrote:

[#123046] Re: [rcr] String#split behaves odd — "trans. (T. Onoma)" <transami@...> 2004/12/09

On Wednesday 08 December 2004 10:00 am, Florian Frank wrote:

[#123068] Re: [rcr] String#split behaves odd — Glenn Parker <glenn.parker@...> 2004/12/09

trans. (T. Onoma) wrote:

[#123085] Re: [rcr] String#split behaves odd — "trans. (T. Onoma)" <transami@...> 2004/12/09

On Thursday 09 December 2004 08:19 am, Glenn Parker wrote:

[#123100] Re: String#split behaves odd — Ibraheem Umaru-Mohammed <iumarumohammed@...> 2004/12/09

++ trans. (T. Onoma) [ruby-talk] [10/12/04 00:43 +0900]:

[#123103] Re: String#split behaves odd — "trans. (T. Onoma)" <transami@...> 2004/12/09

On Thursday 09 December 2004 12:29 pm, Ibraheem Umaru-Mohammed wrote:

[#122918] RubyScript2Exe 0.2.0 — "Erik Veenstra" <pan@...>

28 messages 2004/12/08

[#123076] Crosswords (#10) — Ruby Quiz <james@...>

The summary for this week's quiz should be:

11 messages 2004/12/09

[#123137] Want to Write a Book? — Dave Thomas <dave@...>

Gentle Ruby folk:

40 messages 2004/12/10

[#123189] Learning Tic-Tac-Toe (#11) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

58 messages 2004/12/10
[#123196] Re: [QUIZ] Learning Tic-Tac-Toe (#11) — Brian =?ISO-8859-15?Q?Schr=F6der?= <ruby@...> 2004/12/10

On Fri, 10 Dec 2004 23:29:02 +0900

[#123198] Re: [QUIZ] Learning Tic-Tac-Toe (#11) — James Edward Gray II <james@...> 2004/12/10

On Dec 10, 2004, at 9:19 AM, Brian Schrer wrote:

[#123204] Re: [QUIZ] Learning Tic-Tac-Toe (#11) — Brian =?ISO-8859-15?Q?Schr=F6der?= <ruby@...> 2004/12/10

On Sat, 11 Dec 2004 00:42:04 +0900

[#123206] Re: [QUIZ] Learning Tic-Tac-Toe (#11) — James Edward Gray II <james@...> 2004/12/10

On Dec 10, 2004, at 10:11 AM, Brian Schrer wrote:

[#123218] Re: [QUIZ] Learning Tic-Tac-Toe (#11) — Brian =?ISO-8859-15?Q?Schr=F6der?= <ruby@...> 2004/12/10

On Sat, 11 Dec 2004 01:22:30 +0900

[#123313] Re: [QUIZ] Learning Tic-Tac-Toe (#11) — Hans Fugal <fugalh@...> 2004/12/11

It would be good to be able to play against eachother when this is all

[#123195] iconv replacement for windows? — Thomas Leitner <t_leitner@...>

Hi,

17 messages 2004/12/10
[#123205] Re: iconv replacement for windows? — Thomas Leitner <t_leitner@...> 2004/12/10

On Sat, 11 Dec 2004 00:45:11 +0900

[#123222] How to make a deep copy of an object (Searching for Idiom) — Brian =?ISO-8859-15?Q?Schr=F6der?= <ruby@...>

Hello Group,

18 messages 2004/12/10

[#123317] puts / print as method not keyword? — zuzu <sean.zuzu@...>

so, i'm thinking about language design with a particular interest in

23 messages 2004/12/11
[#123319] Re: puts / print as method not keyword? — Ilmari Heikkinen <kig@...> 2004/12/11

[#123321] Re: puts / print as method not keyword? — zuzu <sean.zuzu@...> 2004/12/11

On Sun, 12 Dec 2004 05:23:10 +0900, Ilmari Heikkinen <kig@misfiring.net> wrote:

[#123351] Find every location of "th" in string. — "William James" <w_a_x_man@...>

Find location of every "th" in "the thin man thinks".

14 messages 2004/12/12

[#123426] Any bug/issue trackers written in Ruby? — "J. D." <jd@...>

Hi,

12 messages 2004/12/12

[#123454] Abstracts and Interfaces in Ruby? — Miles Keaton <mileskeaton@...>

What's the recommended Ruby way to do abstract classes and abstract methods?

12 messages 2004/12/13

[#123590] wxRuby and other GUI toolkits — Nick <devel@...>

24 messages 2004/12/14
[#123616] Re: wxRuby and other GUI toolkits — "itsme213" <itsme213@...> 2004/12/14

Any chance you could provide a simplified interface along the lines

[#123614] Apache2, FastCGI and Rails on Windows — "Williams, Chris" <Chris.Williams@...>

I've been running around in circles trying to enable FastCGI on my rails

20 messages 2004/12/14
[#123630] Re: Apache2, FastCGI and Rails on Windows — Kent Sibilev <ksibilev@...> 2004/12/14

I'm running my rails application on the same environment and it works

[#123825] Re: Apache2, FastCGI and Rails on Windows — Sarah Tanembaum <sarahtanembaum@...> 2004/12/16

Kent Sibilev wrote:

[#123831] Re: Apache2, FastCGI and Rails on Windows — Kent Sibilev <ksibilev@...> 2004/12/16

Oh, This is quite easy. I assume you have Ruby and RubyForApache

[#123626] Ruby Wiki engine w/ability to upload files — Bil Kleb <Bil.Kleb@...>

Hello again,

12 messages 2004/12/14

[#123661] rand.rb 0.9: Random access methods for Enumerables — Ilmari Heikkinen <kig@...>

Hello all, here's a little convenience library we whipped up a couple

17 messages 2004/12/15

[#123694] Re: [BUG] unknown node type 0 - SERIOUS ENOUGH TO MIGRATE AWAY FROM RUBY? — Andrew Walrond <andrew@...>

This is a long standing bug in Ruby, and has been reported hundreds of times

16 messages 2004/12/15

[#123740] P2P application in 15 lines of Python posted on slashdot — slonik AZ <slonik.az@...>

Hi Everybody,

16 messages 2004/12/15

[#123815] Ruby Cocoa (OS X) questions: deployment & interface builder — Michael DeHaan <michael.dehaan@...>

Folks,

13 messages 2004/12/16

[#123852] Rails 0.9: Fast development, breakpoints, validations... — David Heinemeier Hansson <david@...>

Another huge upgrade with again close to 100 changes, additions, and

10 messages 2004/12/16

[#123898] Scrabble Stems (#12) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

22 messages 2004/12/17

[#123983] OT: vi useability question — Lothar Scholz <mailinglists@...>

Hello ruby-talk,

30 messages 2004/12/18
[#124013] Re: OT: vi useability question — Roeland Moors <roelandmoors@...> 2004/12/19

On Sun, Dec 19, 2004 at 08:07:28AM +0900, Lothar Scholz wrote:

[#124130] Re: OT: vi useability question — Hans Fugal <fugalh@...> 2004/12/20

Roeland Moors wrote:

[#124131] A RDoc template without frames — David Heinemeier Hansson <david@...>

Despite the snazzy look of the new default RDoc templates with three

21 messages 2004/12/20
[#124171] Re: A RDoc template without frames — "John W. Long" <ng@...> 2004/12/21

I did a design up once for something without frames:

[#124176] Re: A RDoc template without frames — why the lucky stiff <ruby-talk@...> 2004/12/21

John W. Long wrote:

[#124140] Is there any ruby compatible graphics/imaging utilities ... — Sarah Tanembaum <sarahtanembaum@...>

that works under native mswin323232 or at least with Cygwin X windows

16 messages 2004/12/20

[#124175] Text::Hyphen 1.0.0 — Austin Ziegler <halostatue@...>

I just told you that I'm releasing Text::Hyphen 1.0.0, and here it is

14 messages 2004/12/21

[#124182] curses - how to use unicode — Simon Strandgaard <neoneye@...>

Yesterday I got xterm working with UTF-8. I had made an oneliner that

13 messages 2004/12/21

[#124198] Re: OT: vi useability question — "Pe, Botp" <botp@...>

Mikael Brockman [mailto:mikael@phubuh.org] wrote:

28 messages 2004/12/21
[#124200] Re: OT: vi useability question — Dick Davies <rasputnik@...> 2004/12/21

* "Pe?a, Botp" <botp@delmonte-phil.com> [1210 11:10]:

[#124290] Re: OT: vi useability question — Fredrik Jagenheim <jagenheim@...> 2004/12/22

On Tue, 21 Dec 2004 20:16:14 +0900, Dick Davies

[#124329] All I want to do is move a directory :( — "trans. (T. Onoma)" <transami@...>

Very frustrated. I have just spent well over an hour trying to do the simplest

16 messages 2004/12/22
[#124339] Re: All I want to do is move a directory :( — Gennady Bystritksy <gfb@...> 2004/12/22

trans. (T. Onoma) wrote:

[#124343] Re: All I want to do is move a directory :( — "trans. (T. Onoma)" <transami@...> 2004/12/22

On Wednesday 22 December 2004 04:25 pm, Gennady Bystritksy wrote:

[#124344] Re: All I want to do is move a directory :( — "trans. (T. Onoma)" <transami@...> 2004/12/23

I think the problem may be that the :force option isn't working correctly on

[#124391] Merry Christmas — Christian Neukirchen <chneukirchen@...>

20 messages 2004/12/24
[#124397] Re: Merry Christmas — "trans. (T. Onoma)" <transami@...> 2004/12/24

:( I get

[#124400] Re: Merry Christmas — CT <demerzel@...> 2004/12/24

> On Friday 24 December 2004 08:21 am, Christian Neukirchen wrote:

[#124433] Re: Merry Christmas — Michael Neumann <mneumann@...> 2004/12/25

CT wrote:

[#124413] ruby 1.8.2 — Yukihiro Matsumoto <matz@...>

Merry Christmas,

25 messages 2004/12/25

[#124439] HTML and CSS validation — Bil Kleb <Bil.Kleb@...>

What's the best method to automate the validation

17 messages 2004/12/25

[#124502] Ri bug in new 1.8.2 release — jim@...

Hi

13 messages 2004/12/26

[#124562] split on '' (and another for split -1) — "trans. (T. Onoma)" <transami@...>

Here's a generic routine I'm working on:

11 messages 2004/12/27

[#124591] Ruby Philosophy — Darren Crotchett <rubylang@...>

I'm trying to get a feel for the philosophical differences between Smalltalk,

19 messages 2004/12/28

[#124596] Best ways to accelerate Ruby's popularity — Thursday <nospam@...>

I think Ruby's popularity is growing, but I can't help but wonder what

196 messages 2004/12/28
[#127081] Re: Best ways to accelerate Ruby's popularity — Ben Giddings <bg-rubytalk@...> 2005/01/19

Hi all, I got to this discussion really late, but I have some ideas.

[#127100] Re: Best ways to accelerate Ruby's popularity — Joel VanderWerf <vjoel@...> 2005/01/19

Ben Giddings wrote:

[#127162] Re: Best ways to accelerate Ruby's popularity — Ben Giddings <bg-rubytalk@...> 2005/01/19

Joel VanderWerf wrote:

[#127180] Re: Best ways to accelerate Ruby's popularity — Yukihiro Matsumoto <matz@...> 2005/01/19

Hi,

[#127191] Re: Best ways to accelerate Ruby's popularity — Ben Giddings <bg-rubytalk@...> 2005/01/19

Yukihiro Matsumoto wrote:

[#127207] Re: Best ways to accelerate Ruby's popularity — ruby talk <ruby.talk.list@...> 2005/01/19

On Thu, 20 Jan 2005 03:14:28 +0900, Ben Giddings

[#127228] Re: Best ways to accelerate Ruby's popularity — Ben Giddings <bg-rubytalk@...> 2005/01/19

ruby talk (AKA James Britt) wrote:

[#127232] Re: Best ways to accelerate Ruby's popularity — why the lucky stiff <ruby-talk@...> 2005/01/19

Ben Giddings (bg-rubytalk@infofiend.com) wrote:

[#127255] Re: Best ways to accelerate Ruby's popularity — gabriele renzi <rff_rff@...> 2005/01/19

why the lucky stiff ha scritto:

[#127315] Re: Best ways to accelerate Ruby's popularity — "zimba.tm@..." <zimba.tm@...> 2005/01/20

I think it's cool to have community-driven websites,

[#127353] Re: Best ways to accelerate Ruby's popularity — Ben Giddings <bg-rubytalk@...> 2005/01/20

zimba.tm@gmail.com wrote:

[#127360] Re: Best ways to accelerate Ruby's popularity — "David A. Black" <dblack@...> 2005/01/20

HI --

[#127369] Re: Best ways to accelerate Ruby's popularity — Ben Giddings <bg-rubytalk@...> 2005/01/20

David A. Black wrote:

[#127674] Re: Best ways to accelerate Ruby's popularity — "David A. Black" <dblack@...> 2005/01/22

Hi --

[#127984] Re: Best ways to accelerate Ruby's popularity — Ben Giddings <bg-rubytalk@...> 2005/01/25

David A. Black wrote:

[#128748] Re: Best ways to accelerate Ruby's popularity — Ian Hobson <Ian.Hobson@...> 2005/01/28

In message <41F58CEF.70807@infofiend.com>, Ben Giddings

[#127424] Re: Best ways to accelerate Ruby's popularity — James Britt <jamesUNDERBARb@...> 2005/01/20

David A. Black wrote:

[#127431] Re: Best ways to accelerate Ruby's popularity — "Curt Hibbs" <curt@...> 2005/01/20

James Britt wrote:

[#127435] Re: Best ways to accelerate Ruby's popularity — James Britt <jamesUNDERBARb@...> 2005/01/21

Curt Hibbs wrote:

[#124652] Re: Best ways to accelerate Ruby's popularity — gabriele renzi <rff_rff@...> 2004/12/28

Thursday ha scritto:

[#124672] Re: Best ways to accelerate Ruby's popularity — Tom Copeland <tom@...> 2004/12/28

On Tue, 2004-12-28 at 11:36, gabriele renzi wrote:

[#124674] Re: Best ways to accelerate Ruby's popularity — Premshree Pillai <premshree.pillai@...> 2004/12/28

On Wed, 29 Dec 2004 05:54:01 +0900, Tom Copeland <tom@infoether.com> wrote:

[#124675] Re: Best ways to accelerate Ruby's popularity — Tom Copeland <tom@...> 2004/12/28

On Tue, 2004-12-28 at 16:00, Premshree Pillai wrote:

[#125257] Re: Best ways to accelerate Ruby's popularity — timsuth@... (Tim Sutherland) 2005/01/06

In article <41D44401.4060104@mktec.com>, Zach Dennis wrote:

[#124607] help on making ruby code faster — David Garamond <lists@...6.isreserved.com>

I use 128bit GUID values a lot, and on my Guid class there's the

17 messages 2004/12/28

[#124612] verifying a network connection — Thomas Metz <metz@...>

Hi,

13 messages 2004/12/28

[#124746] #send and private methods — Brian Palmer <brian@...>

I apologize if this has been discussed before and I missed it...

12 messages 2004/12/29

[#124805] Inheritance of class variables — "Eustaquio Rangel de Oliveira Jr." <eustaquiorangel@...>

Hello there.

18 messages 2004/12/30

[#124899] Ruby and Smalltalk like environment?

Hi there,

14 messages 2004/12/31

Re: Best way to debug ruby+fastcgi?

From: Florian Gross <flgr@...>
Date: 2004-12-07 18:27:36 UTC
List: ruby-talk #122826
J. D. wrote:

> What is the best way to debug fastcgi scripts?

Remote breakpoints might be a good option here -- they let you connect 
an irb shell to any given point of your application meaning you can just 
use Ruby's regular introspection facilities to have a look at local 
variables, instance variables, call traces, methods and modify Object 
altogether. Attached to this mail you will find the latest mostly stable 
version which will turn into a release soon. If everything goes well 
this should be merged back into dev-utils and be available in Ruby On 
Rails with a few nice goodies (a link to  launch a breakpoint from the 
error page you get in your browser when an uncaught exception of your 
application occurs) very soon.

Attachments (3)

binding_of_caller.rb (2.65 KB, text/x-ruby)
begin
  require 'simplecc'
rescue LoadError
  def Continuation.create(*args, &block)
    cc = nil; result = callcc {|c| cc = c; block.call(cc) if block and args.empty?}
    result ||= args
    return *[cc, *result]
  end
end

# This method returns the binding of the method that called your
# method. It will raise an Exception when you're not inside a method.
#
# It's used like this:
#   def inc_counter(amount = 1)
#     Binding.of_caller do |binding|
#       # Create a lambda that will increase the variable 'counter'
#       # in the caller of this method when called.
#       inc = eval("lambda { |arg| counter += arg }", binding)
#       # We can refer to amount from inside this block safely.
#       inc.call(amount)
#     end
#     # No other statements can go here. Put them inside the block.
#   end
#   counter = 0
#   2.times { inc_counter }
#   counter # => 2
#
# Binding.of_caller must be the last statement in the method.
# This means that you will have to put everything you want to
# do after the call to Binding.of_caller into the block of it.
# This should be no problem however, because Ruby has closures.
# If you don't do this an Exception will be raised. Because of
# the way that Binding.of_caller is implemented it has to be
# done this way.
def Binding.of_caller(&block)
  old_critical = Thread.critical
  Thread.critical = true
  count = 0
  cc, result, error, extra_data = Continuation.create(nil, nil)
  error.call if error

  tracer = lambda do |*args|
    type, context, extra_data = args[0], args[4], args
    if type == "return"
      count += 1
      # First this method and then calling one will return --
      # the trace event of the second event gets the context
      # of the method which called the method that called this
      # method.
      if count == 2
        # It would be nice if we could restore the trace_func
        # that was set before we swapped in our own one, but
        # this is impossible without overloading set_trace_func
        # in current Ruby.
        set_trace_func(nil)
        cc.call(eval("binding", context), nil, extra_data)
      end
    elsif type == "line" then
      nil
    elsif type == "c-return" and extra_data[3] == :set_trace_func then
      nil
    else
      set_trace_func(nil)
      error_msg = "Binding.of_caller used in non-method context or " +
        "trailing statements of method using it aren't in the block."
      cc.call(nil, lambda { raise(ArgumentError, error_msg) }, nil)
    end
  end

  unless result
    set_trace_func(tracer)
    return nil
  else
    Thread.critical = old_critical
    case block.arity
      when 1 then yield(result)
      else yield(result, extra_data)        
    end
  end
end
breakpoint.rb (14.6 KB, text/x-ruby)
# The Breakpoint library provides the convenience of
# being able to inspect and modify state, diagnose
# bugs all via IRB by simply setting breakpoints in
# your applications by the call of a method.
#
# This library was written and is supported by me,
# Florian Gross. I can be reached at flgr@ccan.de
# and enjoy getting feedback about my libraries.
#
# The whole library (including breakpoint_client.rb
# and binding_of_caller.rb) is licensed under the
# same license that Ruby uses. (Which is currently
# either the GNU General Public License or a custom
# one that allows for commercial usage.) If you for
# some good reason need to use this under another
# license please contact me.

require 'irb'
require 'binding_of_caller'
require 'drb'
require 'drb/acl'

module Breakpoint
  extend self

  # This will pop up an interactive ruby session at a
  # pre-defined break point in a Ruby application. In
  # this session you can examine the environment of
  # the break point.
  #
  # You can get a list of variables in the context using
  # local_variables via +local_variables+. You can then
  # examine their values by typing their names.
  #
  # You can have a look at the call stack via +caller+.
  #
  # The source code around the location where the breakpoint
  # was executed can be examined via +source_lines+. Its
  # argument specifies how much lines of context to display.
  # The default amount of context is 5 lines. Note that
  # the call to +source_lines+ can raise an exception when
  # it isn't able to read in the source code.
  #
  # breakpoints can also return a value. They will execute
  # a supplied block for getting a default return value.
  # A custom value can be returned from the session by doing
  # +throw(:debug_return, value)+.
  #
  # You can also give names to break points which will be
  # used in the message that is displayed upon execution 
  # of them.
  #
  # Here's a sample of how breakpoints should be placed:
  #
  #   class Person
  #     def initialize(name, age)
  #       @name, @age = name, age
  #       breakpoint("Person#initialize")
  #     end
  #
  #     attr_reader :age
  #     def name
  #       breakpoint("Person#name") { @name }
  #     end
  #   end
  #
  #   person = Person.new("Random Person", 23)
  #   puts "Name: #{person.name}"
  #
  # And here is a sample debug session:
  #
  #   Executing break point "Person#initialize" at file.rb:4 in `initialize'
  #   irb(#<Person:0x292fbe8>):001:0> local_variables
  #   => ["name", "age", "_", "__"]
  #   irb(#<Person:0x292fbe8>):002:0> [name, age]
  #   => ["Random Person", 23]
  #   irb(#<Person:0x292fbe8>):003:0> [@name, @age]
  #   => ["Random Person", 23]
  #   irb(#<Person:0x292fbe8>):004:0> self
  #   => #<Person:0x292fbe8 @age=23, @name="Random Person">
  #   irb(#<Person:0x292fbe8>):005:0> @age += 1; self
  #   => #<Person:0x292fbe8 @age=24, @name="Random Person">
  #   irb(#<Person:0x292fbe8>):006:0> exit
  #   Executing break point "Person#name" at file.rb:9 in `name'
  #   irb(#<Person:0x292fbe8>):001:0> throw(:debug_return, "Overriden name")
  #   Name: Overriden name
  #
  # Breakpoint sessions will automatically have a few
  # convenience methods available. See Breakpoint::CommandBundle
  # for a list of them.
  #
  # Breakpoints can also be used remotely over sockets.
  # This is implemented by running part of the IRB session
  # in the application and part of it in a special client.
  # You have to call Breakpoint.activate_drb to enable
  # support for remote breakpoints and then run
  # breakpoint_client.rb which is distributed with this
  # library. See the documentation of Breakpoint.activate_drb
  # for details.
  def breakpoint(id = nil, context = nil, &block)
    callstack = caller
    callstack.slice!(0, 3) if callstack.first["breakpoint"]
    file, line, method = *callstack.first.match(/^(.+?):(\d+)(?::in `(.*?)')?/).captures

    message = "Executing break point " + (id ? "#{id.inspect} " : "") +
              "at #{file}:#{line}" + (method ? " in `#{method}'" : "")

    if context then
      return handle_breakpoint(context, message, file, line, &block)
    end

    Binding.of_caller do |binding_context|
      handle_breakpoint(binding_context, message, file, line, &block)
    end
  end

  module CommandBundle
    # Proxy to a Breakpoint client. Lets you directly execute code
    # in the context of the client.
    class Client
      def initialize(eval_handler) # :nodoc:
        @eval_handler = eval_handler
      end

      instance_methods.each do |method|
        next if method[/^__.+__$/]
        undef_method method
      end

      # Executes the specified code at the client.
      def eval(code)
        @eval_handler.call(code)
      end

      # Will execute the specified statement at the client.
      def method_missing(method, *args)
        if args.empty?
          result = eval("#{method}")
        else
          result = eval("#{method}(*Marshal.load(#{Marshal.dump(args).inspect}))")
        end

        unless [true, false, nil].include?(result)
          result.extend(DRbUndumped) rescue nil
        end

        return result
      end
    end

    # Returns the source code surrounding the location where the
    # breakpoint was issued.
    def source_lines(context = 5, return_line_numbers = false)
      lines = File.readlines(@__bp_file).map { |line| line.chomp }

      break_line = @__bp_line
      start_line = [break_line - context, 1].max
      end_line = break_line + context

      result = lines[(start_line - 1) .. (end_line - 1)]

      if return_line_numbers then
        return [start_line, break_line, result]
      else
        return result
      end
    end

    # Lets an object that will forward method calls to the breakpoint
    # client. This is useful for outputting longer things at the client
    # and so on. You can for example do these things:
    #
    #   client.puts "Hello" # outputs "Hello" at client console
    #   # outputs "Hello" into the file temp.txt at the client
    #   client.File.open("temp.txt", "w") { |f| f.puts "Hello" } 
    def client()
      if Breakpoint.use_drb? then
        Client.new(Breakpoint.drb_service.eval_handler)
      else
        Client.new(lambda { |code| eval(code, TOPLEVEL_BINDING) })
      end
    end
  end

  def handle_breakpoint(context, message, file = "", line = "", &block) # :nodoc:
    catch(:debug_return) do |value|
      eval(%{
        @__bp_file = #{file.inspect}
        @__bp_line = #{line}
        extend Breakpoint::CommandBundle
        extend DRbUndumped
      }, context) rescue nil

      if not use_drb? then
        puts message
        IRB.start(nil, IRB::WorkSpace.new(context))
      else
        @drb_service.add_breakpoint(context, message)
      end

      block.call if block
    end
  end

  # These exceptions will be raised on failed asserts
  # if Breakpoint.asserts_cause_exceptions is set to
  # true.
  class FailedAssertError < RuntimeError
  end

  # This asserts that the block evaluates to true.
  # If it doesn't evaluate to true a breakpoint will
  # automatically be created at that execution point.
  #
  # You can disable assert checking in production
  # code by setting Breakpoint.optimize_asserts to
  # true. (It will still be enabled when Ruby is run
  # via the -d argument.)
  #
  # Example:
  #   person_name = "Foobar"
  #   assert { not person_name.nil? }
  #
  # Note: If you want to use this method from an
  # unit test, you will have to call it by its full
  # name, Breakpoint.assert.
  def assert(context = nil, &condition)
    return if Breakpoint.optimize_asserts and not $DEBUG
    return if yield

    callstack = caller
    callstack.slice!(0, 3) if callstack.first["assert"]
    file, line, method = *callstack.first.match(/^(.+?):(\d+)(?::in `(.*?)')?/).captures

    message = "Assert failed at #{file}:#{line}#{" in `#{method}'" if method}."

    if Breakpoint.asserts_cause_exceptions and not $DEBUG then
      raise(Breakpoint::FailedAssertError, message)
    end

    message += " Executing implicit breakpoint."

    if context then
      return handle_breakpoint(context, message, file, line)
    end

    Binding.of_caller do |context|
      handle_breakpoint(context, message, file, line)
    end
  end

  # Whether asserts should be ignored if not in debug mode.
  # Debug mode can be enabled by running ruby with the -d
  # switch or by setting $DEBUG to true.
  attr_accessor :optimize_asserts
  self.optimize_asserts = false

  # Whether an Exception should be raised on failed asserts
  # in non-$DEBUG code or not. By default this is disabled.
  attr_accessor :asserts_cause_exceptions
  self.asserts_cause_exceptions = false
  @use_drb = false

  attr_reader :drb_service # :nodoc:

  class DRbService # :nodoc:
    include DRbUndumped

    def initialize
      @handler = @eval_handler = @collision_handler = nil

      IRB.instance_eval { @CONF[:RC] = true }
      IRB.run_config
    end

    def collision
      sleep(0.5) until @collision_handler

      @collision_handler.call
    end

    def ping; end

    def add_breakpoint(context, message)
      workspace = IRB::WorkSpace.new(context)
      workspace.extend(DRbUndumped)

      sleep(0.5) until @handler

      @handler.call(workspace, message)
    end

    def register_handler(&block)
      @handler = block
    end

    def unregister_handler
      @handler = nil
    end

    attr_reader :eval_handler

    def register_eval_handler(&block)
      @eval_handler = block
    end

    def unregister_eval_handler
      @eval_handler = lambda { }
    end

    def register_collision_handler(&block)
      @collision_handler = block
    end

    def unregister_collision_handler
      @collision_handler = lambda { }
    end
  end

  # Will run Breakpoint in DRb mode. This will spawn a server
  # that can be attached to via the breakpoint-client command
  # whenever a breakpoint is executed. This is useful when you
  # are debugging CGI applications or other applications where
  # you can't access debug sessions via the standard input and
  # output of your application.
  #
  # You can specify an URI where the DRb server will run at.
  # This way you can specify the port the server runs on. The
  # default URI is druby://localhost:42531.
  #
  # Please note that breakpoints will be skipped silently in
  # case the DRb server can not spawned. (This can happen if
  # the port is already used by another instance of your
  # application on CGI or another application.)
  #
  # Also note that by default this is not secure. You can
  # however specify a list of allowed hosts. But that will
  # still not protect you from somebody reading the data
  # as it goes through the net.
  #
  # A good approach for getting security is setting up an SSH
  # tunnel between the DRb service and the client. This is
  # usually done like this:
  #
  # $ ssh -L20000:127.0.0.1:20000 -R10000:127.0.0.1:10000 example.com
  # (This will connect port 20000 at the client side to port
  # 20000 at the server side, and port 10000 at the server
  # side to port 10000 at the client side.)
  #
  # After that do this on the server side: (the code being debugged)
  # Breakpoint.activate_drb("druby://127.0.0.1:20000", "localhost")
  #
  # And at the client side:
  # ruby breakpoint_client.rb -c druby://127.0.0.1:10000 -s druby://127.0.0.1:20000
  #
  # Running through such a SSH proxy will also let you use 
  # breakpoint.rb in case you are behind a firewall.
  #
  # Detailed information about running DRb through firewalls is
  # available at http://www.rubygarden.org/ruby?DrbTutorial
  def activate_drb(uri = 'druby://localhost:42531',
    allowed_hosts = '127.0.0.1')

    return false if @use_drb

    if allowed_hosts then
      acl = ["deny", "all"]

      Array(allowed_hosts).each do |host|
        acl += ["allow", host]
      end

      DRb.install_acl(ACL.new(acl))
    end

    @use_drb = true
    @drb_service = DRbService.new
    did_collision = false
    begin
      DRb.start_service(uri, @drb_service)
    rescue Errno::EADDRINUSE
      # The port is already occupied by another
      # Breakpoint service. We will try to tell
      # the old service that we want its port.
      # It will then forward that request to the
      # user and retry.
      unless did_collision then
        DRbObject.new(nil, uri).collision
        did_collision = true
      end
      sleep(10)
      retry
    end

    return true
  end

  # Returns true when Breakpoints are used over DRb.
  # Breakpoint.activate_drb causes this to be true.
  def use_drb?
    @use_drb == true
  end
end

module IRB # :nodoc:
  class << self; remove_method :start; end
  def self.start(ap_path = nil, main_context = nil, workspace = nil)
    $0 = File::basename(ap_path, ".rb") if ap_path

    # suppress some warnings about redefined constants
    old_verbose, $VERBOSE = $VERBOSE, nil
    IRB.setup(ap_path)
    $VERBOSE = old_verbose

    if @CONF[:SCRIPT] then
      irb = Irb.new(main_context, @CONF[:SCRIPT])
    else
      irb = Irb.new(main_context)
    end

    if workspace then
      irb.context.workspace = workspace
    end

    @CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
    @CONF[:MAIN_CONTEXT] = irb.context

    old_sigint = trap("SIGINT") do
      irb.signal_handle
    end
    
    catch(:IRB_EXIT) do
      irb.eval_input
    end
  ensure
    trap("SIGINT", old_sigint)
  end

  class << self
    alias :old_CurrentContext :CurrentContext
    remove_method :CurrentContext
  end
  def IRB.CurrentContext
    if old_CurrentContext.nil? and Breakpoint.use_drb? then
      result = Object.new
      def result.last_value; end
      return result
    else
      old_CurrentContext
    end
  end

  class Context
    alias :old_evaluate :evaluate
    def evaluate(line, line_no)
      if line.chomp == "exit" then
        exit
      else
        old_evaluate(line, line_no)
      end
    end
  end

  class WorkSpace
    alias :old_evaluate :evaluate

    def evaluate(*args)
      if Breakpoint.use_drb? then
        result = old_evaluate(*args)
        if args[0] != :no_proxy and
          not [true, false, nil].include?(result)
        then
          result.extend(DRbUndumped) rescue nil
        end
        return result
      else
        old_evaluate(*args)
      end
    end
  end

  module InputCompletor
    def self.eval(code, context, *more)
      # Big hack, this assumes that InputCompletor
      # will only call eval() when it wants code
      # to be executed in the IRB context.
      IRB.conf[:MAIN_CONTEXT].workspace.evaluate(:no_proxy, code, *more)
    end
  end
end

module DRb # :nodoc:
  class DRbObject
    undef :inspect
    undef :clone
  end
end

# See Breakpoint.breakpoint
def breakpoint(id = nil, &block)
  Binding.of_caller do |context|
    Breakpoint.breakpoint(id, context, &block)
  end
end

# See Breakpoint.assert
def assert(&block)
  Binding.of_caller do |context|
    Breakpoint.assert(context, &block)
  end
end
breakpoint_client.rb (3.51 KB, text/x-ruby)
require 'breakpoint'
require 'optparse'

options = {
  :ClientURI  => nil,
  :ServerURI  => "druby://localhost:42531",
  :RetryDelay => 10
}

ARGV.options do |opts|
  script_name = File.basename($0)
  opts.banner = [
    "Usage: ruby #{script_name} [options] [server uri]",
    "",
    "This tool lets you connect to a breakpoint service ",
    "which was started via Breakpoint.activate_drb.",
    "",
    "The server uri defaults to druby://localhost:42531"
  ].join("\n")

  opts.separator ""

  opts.on("-c", "--client-uri=uri",
    "Run the client on the specified uri.",
    "This can be used to specify the port",
    "that the client uses to allow for back",
    "connections from the server.",
    "Default: Find a good URI automatically.",
    "Example: -c druby://localhost:12345"
  ) { |options[:ClientURI]| }

  opts.on("-s", "--server-uri=uri",
    "Connect to the server specified at the",
    "specified uri.",
    "Default: druby://localhost:42531"
  ) { |options[:ServerURI]| }

  opts.on("-R", "--retry-delay=delay", Integer,
    "Automatically try to reconnect to the",
    "server after delay seconds when the",
    "connection failed or timed out.",
    "A value of 0 disables automatical",
    "reconnecting completely.",
    "Default: 10"
  ) { |options[:RetryDelay]| }

  opts.separator ""

  opts.on("-h", "--help",
    "Show this help message."
  ) { puts opts; exit }

  opts.parse!
end

options[:ServerURI] = ARGV[0] if ARGV[0]

DRb.start_service(options[:ClientURI])

begin
  service = DRbObject.new(nil, options[:ServerURI])

  begin
    service.register_eval_handler do |code|
      result = eval(code, TOPLEVEL_BINDING)
      result.extend(DRb::DRbUndumped) rescue nil
      result
    end

    service.register_collision_handler do
      msg = [
        "  *** Breakpoint service collision ***",
        "  Another Breakpoint service tried to use the",
        "  port already occupied by this one. It will",
        "  keep waiting until this Breakpoint service",
        "  is shut down.",
        "  ",
        "  If you are using the Breakpoint library for",
        "  debugging a Rails or other CGI application",
        "  this likely means that this Breakpoint",
        "  session belongs to an earlier, outdated",
        "  request and should be shut down via 'exit'."
      ].join("\n")

      if RUBY_PLATFORM["win"] then
        # This sucks. Sorry, I'm not doing this because
        # I like funky message boxes -- I need to do this
        # because on Windows I have no way of displaying
        # my notification via puts() when gets() is still
        # being performed on STDIN. I have not found a
        # better solution.
        begin
          require 'tk'
          root = TkRoot.new { withdraw }
          Tk.messageBox('message' => msg, 'type' => 'ok')
          root.destroy
        rescue Exception
          puts "", msg, ""
        end
      else
        puts "", msg, ""
      end
    end

    service.register_handler do |workspace, message|
      puts message
      IRB.start(nil, nil, workspace)
    end

    loop do
      begin
        service.ping
      rescue DRb::DRbConnError => error
        puts "Server exited. Exiting..."
        exit!
      end

      sleep(0.5)
    end
  ensure
    service.unregister_handler
  end
rescue Exception => error
  if options[:RetryDelay] > 0 then
    puts "No connection to breakpoint service at #{options[:ServerURI]}:",
         "  (#{error})",
         "  Reconnecting in #{options[:RetryDelay]} seconds..."
 
    sleep options[:RetryDelay]
    retry
  else
    raise
  end
end

In This Thread

Prev Next