227873-235334 subjects 228273-229508

Redefine a module function in a method
228060 [michel.casab] ...
228064 [robert.feldt] module M

specifying a gem version
228071 [brianpdoyle@] I'm new to ruby so I have no clue what I'm doing yet here.  I downloaded
228123 [david@va ln ] Do you -need- the newer version of AS or are you just chasing higher

help, my  'case/when' code doesn't work
228075 [cremes.devli] def case_test(obj)
+ 228077 [shortcutter@] Make that "case obj" instead.
+ 228080 [stefano.croc] Your code will call Array===obj.class. According to ri aClass===anObject
  228082 [cremes.devli] Sheesh! I *knew* it was something easy. I feel like a dope...
  + 228084 [nospam@no it] / ...
  + 228135 [hal9000@hy e] Don't feel like a dope. That is fairly subtle.

How to use a String obj both in Proc.new and for puts
228081 [RichardDummy] In the appended code I duplicate the text so I can both display it and
+ 228083 [nospam@no it] Are you asking how to create a string that can serve for display and also
+ 228131 [RichardDummy] Thank you very much for your responses.  You were both great. The code

Tool for Program Visualization ?
228085 [mailforgilbe] coming to Ruby from Java i'm lookin for a tool
+ 228090 [benjohn@fy h] I'm afraid I don't know of anything like that, but others may.
| 228096 [mailforgilbe] it's helpful to see what's going on. also great for
+ 228128 [snail@ob me ] <mailforgilbert@gmx.de> writes
| 228242 [mailforgilbe] Thanks for the tip, but i prefer a free tool,
+ 228161 [rubyzbibd@ub] That looks pretty cool.  Although, it is text based you can use the
  228240 [mailforgilbe] ok, thanks didn't know of that.

Re: [QUIZ] Turtle Graphics (#104) [SOLUTION]
228089 [m_goldberg@a] Quiz 104 -- Solution
228097 [nospam@no it] / ...
+ 228107 [psyonic@gm i] ...
+ 228125 [m_goldberg@a] Good catch. I had forgotten that %= existed.

ruby web servers, threads and sessions
228098 [bingopajama@] Is there a pure ruby web server that can start a thread that performs
+ 228099 [drbrain@se m] WEBrick + your custom code.
| 228103 [bingopajama@] Ah, looks pretty straight forward, thanks.
| 228109 [nospam@no it] Yes, you can do this, but if the purpose is to govern the behavior of remote
| 228111 [bingopajama@] Thanks for the responses.  It's all over the LAN, so security isn't a
+ 228100 [nospam@no it] Your question isn't crystal clear, but look at webrick, see if it's what you

classes in WIN32OLE
228106 [chen_li3@ya ] There are so many pre-assumptions when using  WIN32OLE
228950 [nlloyds@gm i] WIN32OLE basically provides an interface to the OLE type libraries in
228977 [chen_li3@ya ] When I read the document about this library I see several classes as

Swig, Ruby, C++ question
228108 [djberg96@gm ] Solaris 10
228112 [jan.svitok@g] You need to include the header in the interface file. In fact, you
228120 [djberg96@gm ] This works, thanks!
228129 [jan.svitok@g] - - -

[SCIRUBY] dangerous speed skating
228110 [ara.t.howard] if any of you guys are planning on running redlights on your roller blades you
228430 [Bil.Kleb@NA ] Atta boy!  Honestly, I can't see how one can claim to be
228432 [ara.t.howard] shock and awe baby, shock and awe!

Threads and class variables
228113 [ac251404@oh ] I am trying to run 3 threads of a process using 3 sets of data. The
+ 228118 [shortcutter@] You need to use a block parameter for "period" otherwise you will run
+ 228119 [coder68@ya o] < snip>

How do I catch a missing method on a passed block?
228127 [james2mccart] I would like to invoke method_missing on baz in this code;
+ 228132 [ara.t.howard] but block __will__ respond_to? 'call' - ergo your method_missing hook will
| 228209 [james2mccart] I want to catch a missing method (baz) inside the passed block.
| 228231 [ara.t.howard] class Foo
| 228300 [james2mccart] -a ! Thanks, I will give this a shot. I really appreciate your help.
+ 228133 [logancapaldo] You'd want to define the method_missing
| 228210 [james2mccart] Thanks Logan, that is what I ended up doing, I just wanted to avoid
+ 228211 [daniel.schie] class Foo
| 228213 [logancapaldo] If ruby were common lisp, that could actually work. But it's not and our
| 228359 [twoggle@gm i] class Foo
| 228398 [martindemell] irb(main):008:0> a = Foo.new
| 228411 [twoggle@gm i] Ah, see what you mean now :)
| 229274 [james2mccart] This is what I finally ended up with - which I think is quite elegant
| 229275 [dblack@wo bl] I'm curious where args_to_attributes is defined.  Is it a top-level
| 229296 [james2mccart] I just include it into the singleton class, I just chopped it out here!
| 229299 [dblack@wo bl] You may be right; I didn't demo it because I couldn't figure out
| 229306 [james2mccart] You are right David, I chopped the lambda and it still works ;-/
| 229311 [dblack@wo bl] I'd have to see the current version of the code to be sure, but
| 229320 [james2mccart] class Foo
| 229327 [dblack@wo bl] @@return is going to be a new variable each time you call bar with a
| 229354 [james2mccart] Whoops, that wasn't actually my code :-/ Just to restore a little
+ 229363 [erikveen@gm ] I've some comments, on almost all code in this thread. Feel
  + 229375 [james2mccart] Erik, thank you for pre-empting my next challenge and giving me a good
  + 229382 [dblack@wo bl] I guess "polluted" is relative.  I admit I've never understood the
    + 229420 [james2mccart] This is a useful summary of the key concepts that moved me forward. I
    | 229446 [dblack@wo bl] Definitely.  I think breaking the code down is fine (I might avoid
    + 229505 [dblack@wo bl] If they're not of practical value, then they're not of value.  So I'll
      229561 [dblack@wo bl] All the singleton method definitions of that class object, yes.  It's
      229825 [dblack@wo bl] Cool -- on all counts: the advertising of course :-)  but particularly

how do I "unrequire" a file ?
228137 [tuka@yo n. e] In using migrate manually, I "require" the file containing the migration
228145 [david@va ln ] Use load (ri Kernel#load) instead of require. I -think- you need to use
228152 [kbloom@gm il] Yes, you do need to use the .rb extension with load.
228182 [tuka@yo n. e] Thanks,

hpricot 0.4.76 chokes on empty comment.
228140 [rm_rails@ch ] Hpricot's choking on some pages complaining about nil
228220 [why@ru y- an] It's in.  Way to be, Ron!

Registration open for erubycon
228146 [joe@th ed ec] Registration is open for erubycon (http://erubycon.com), the first
228147 [joe@th ed ec] Sorry, mistake on the feed url.  It's

Xcode 3 and Ruby?
228149 [gcarcass@gm ] I've heard more than rumours that the new Xcode 3 development
228269 [rf.oodanaw@s] It's not a rumor, it's published on Apple's site, Leopard will come with

Testing scheme flawed;  correction plan OK?
228151 [RichardDummy] My Setup

Method Namespace
228153 [transfire@gm] I have need for a general purpose simple namespace construction. Not
228261 [pit@ca it in] Tom, could you try this version?
228338 [transfire@gm] Bloody hek, that's a clever solution. Works like a charm. Pit Captain,

doubt with positive lookaround
228160 [gethemant@gm] chunked_data = "DIVex>##ECHO=b698fd4cc1ea4c7a4b5c4e1d1c402911##"
+ 228162 [martindemell] No, but lookahead assertions are zero-width, so if your assertion
| 228164 [gethemant@gm] Holy cat...thanks
+ 228243 [danfinnie@op] ...
  228244 [james@gr yp ] The regex engine in Ruby 1.8 does not support look-behind
  228340 [gethemant@gm] Yup James I am aware of that. I was blind enough to not see my silly mistake.

Rake 0.7.1 aborted! Test failures
228170 [davek@dk y. ] 1. gem install --remote rake
228188 [james.adam@g] It sounds like your environment.rb is expecting the engines plugin to
228218 [davek@dk y. ] James,

looping through & downloading web page - WATIR codes
228172 [csamigroup@g] What I am trying to realize through code below is to read a line by
228181 [nospam@no it] 1. Always close the opened file handle when the write is completed. You are
228183 [csamigroup@g] I found out what the problem is..
228187 [nospam@no it] Sorry, I don't know enough about Watir to answer this question.

Send over raw socket?
228173 [ben@ia u. et] This should be simple, but it doesn't seem to be documented anywhere I
228175 [vjoel@pa h. ] Just use #send. It's documented in the BasicSocket part of the appendix

Integer#to_s(2) works on x86, fails on x86_64
228176 [ snk@gn .o g] Can anyone explain why this is happening?
+ 228179 [nospam@no it] It's way too large to fit into an old-style integer of 32 bits, but it fits
| 228190 [stefan@ma li] The same Exception is thrown on my machine.
+ 228180 [patrick@er b] patrick@Dragon:~$ irb
+ 228197 [invalid@gm .] => "1.9.0 x86_64-linux 2006-10-16"
  228207 [mihai.vlad@a] Seems on 1.8.5 is ok aswell, so the problem is < 1.8.4
  228208 [kbloom@gm il] Yep. Here are the relevant changelog entries.

ie.link(:text, "Next").click
228185 [csamigroup@g] is there anyway to proceed with the WATIR code below after checking
228186 [nospam@no it] What is your program's goal, what did you expect to happen, and what

before 'click' in WATIR..
228189 [csamigroup@g] I am using code below to click in a page when it finds "Next" link.
228238 [ezmobius@gm ] Curious-
228245 [djmj12@gm il] Assuming the variable containing the Watir::IE controller is called

Starting XMLRPC server on virtual host returns EADDRNOTAVAIL
228193 [ruby@ts hi l] Dear ruby experts,
+ 228194 [caleb@ae -t ] Try a port number below 65536.
| 228195 [ruby@ts hi l] reserved ports below 1023, and ports between 1024 and 64k. This all
+ 228200 [michel.casab] ...
| 228371 [ruby@ts hi l] Yes, I have tried this, too. Same result.
+ 228250 [drbrain@se m] For a WEBrick virtual host you need to pass :DoNotListen => true in
  228372 [ruby@ts hi l] I'm not very sure if I did get this right.

TDD/unit testing question
228196 [peter@ru yr ] Slightly OT, but since I think Unit testing/TDD is a commonly accepted
+ 228199 [michel.casab] ...
+ 228205 [jamesmead44@] It's difficult to give specific comments without actually seeing the
| 228246 [drbrain@se m] When I was new to TDD and unit testing this was my biggest problem,
| 228426 [Bil.Kleb@NA ] I had a similar experience.  TDD reveals design smells in your code.
+ 228334 [transfire@gm] I sympthize. I think TDD makes more sense for applications in which the
  + 228336 [rsanheim@gm ] The problem with this approach is that when you go back to try and add
  + 228425 [Bil.Kleb@NA ] I respectfully disagree.  I find TDD beneficial even when

String#crypt first 8 characters
228198 [patrick@er b] i had a problem with str.crypt - i got every time the same result. The
+ 228203 [vincent.four] ...
| 228581 [patrick@er b] Thanks for all the ideas and suggestions. I understand how crypt works
+ 228219 [chris.hulan@] On Dec 5, 8:08 am, Patrick Plattes
+ 228222 [fred@la av .] There are workarounds, but I think that's dependent on the OS.

A true Ruby compiler (for Linux)
228201 [phil@pr co .] People,
+ 228202 [twifkak@co c] I think you're confusing demand and supply. :P
| 228212 [jameskilton@] ...
+ 228229 [Joerg.Mittag] XRuby is a Ruby compiler that compiles Ruby to Java Bytecode.  You can
  228235 [wilsonb@gm i] Rubinius also has this feature (saving portable, intermediate bytecode
  228258 [Joerg.Mittag] Great!  I didn't know that.
  228259 [jameskilton@] ...
  228262 [david@va ln ] able

[ANN] Cerberus 0.3.2 released. Now with Perforce and BJam support.
228206 [anatol.pomoz] New version of lightweight and powerful Build Integration tool for Ruby

Rinjdael (AES) encryption in Ruby
228214 [fightinjoe@g] I've got a quick general question about encryption.
228308 [support@ch l] To sum it up, these input parameters must match between encryptor and

Using Relax NG as a grammar
228215 [djberg96@gm ] Random thought of the day...
+ 228226 [james.britt@] Do you mean instead of BNF, for example?
| 228321 [djberg96@gm ] Yes.
+ 228237 [vidar.hoksta] It _is_ meant to be used for language specification, so that's why it
  228388 [dido.sevilla] Ah, but after you're done tokenizing and have generated an abstract
  + 228488 [james@gr yp ] I'm sure I will be shot for this, but that almost strikes me as a fun
  | 228497 [danfinnie@op] ...
  + 228565 [dido.sevilla] Yes, it is madness, and yes, unfortunately, it has been done. There's

Unexpected scope range
228216 [andreas.warb] I am new to Ruby but have a strong java background.
+ 228221 [nospam@no it] example   # method local
| + 228224 [gwtmp01@ma .] This doesn't seem like standard terminology to me.  Usually these
| | + 228267 [nospam@no it] Yes, this is only a matter of terminology. My term "class instance" is the
| | | 228310 [drbrain@se m] There is no such thing as a "class instance variable" in Ruby.
| | | 228327 [nospam@no it] / ...
| | | + 228401 [dblack@wo bl] No, that's wrong.  Classes are unambiguously and unequivocally
| | | | 228442 [nospam@no it] Yes, no dispute about that. I ought to have said that class definitions are
| | | + 228409 [dblack@wo bl] No; the discussion is about instance variable that belong to class
| | | + 228458 [drbrain@se m] I'm sorry if you've spent your time trapped in crappy OO languages
| | + 228313 [dblack@wo bl] Sometimes people say "class instance variable" to mean "instance
| + 228264 [o.renaud@la ] As a Java programmer, you are used to declare any attribute (ie instance
+ 228239 [dblack@wo bl] def starts a new local scope, so local variables defined outside it
  228263 [andreas.warb] Thanks for your replies.

Passing the module name into the method definition
228217 [thedossone@g] I've been building a harness for running watir tests it looks lke this
228367 [damphyr@fr e] You're defining a class method (e.g. static in other regions of the
228749 [thedossone@g] I don't believe I am defining a class at all... I had a look at the

ruby / irb don't match up?
228223 [ummaycoc@gm ] I have the following versions of ruby / irb (from the rubyforge
228225 [ummaycoc@gm ] I just found this, which might shed light on the situation (the

problem running mongrel on win32
228227 [adam.blum@gm] mongrel fails to start with the error below on my win32 box (needs

problem running mongrel on win32
228228 [adam.blum@gm] mongrel fails to start with the error below on my win32 box (needs

problem running mongrel on win32
228230 [adam.blum@gm] mongrel fails to start with the error below on my win32 box (needs

Invoking a Method
228233 [ghotrapa@ya ] How do i invoke a method in belonging to a module?
+ 228234 [ghotrapa@ya ] so i think i'm ok for now.
+ 228236 [james@gr yp ] module_function
+ 228241 [danfinnie@op] ...

228247 [stone1549@gm] I'm trying to build an WebFTP application in Rails for some practice.
228248 [stone1549@gm] Sorry, I thought I submitted this in the "Rails" forum.  I'll post it

Re: Can't sort array
228249 [renard@nc rr] I want to print all the methods in excel OLE object
228257 [chris.hulan@] p m.sort{|a| a.name <=> b.name}
228301 [chen_li3@ya ] The line above doesn't work but it will work if change to the follows
228523 [jos@ca no k.] p m.sort_by {|a| a.name}

Tk::ScrollFrame fails on windows
228252 [fkc_email-ne] Wondering if anyone has seen this?  The scrollframe.rb sample file exits on windows when I use the horizontal scrollbar, though seems to work fine on X.
228600 [nagai@ai ky ] Hmmm...

SAP GUI Automation
228253 [mail@ch is -] for my diploma I have to automate the SAP GUI with ruby. So a ruby

"Filing out" irb prototyping sessions?
228254 [grettke@gm i] It looks like you can use irb as a rapid prototyping environment by
+ 228255 [james@gr yp ] irb
+ 228256 [drbrain@se m] require 'rubygems'

md5 function in Ruby
228266 [dyakhnenko@l] I've been having trouble with Ruby's md5 function... The following code
+ 228268 [dyakhnenko@l] I get Application error (Rails) if I try to include the file as
| 228270 [dyakhnenko@l] MD5 tools output...
+ 228271 [shyouhei@ru ] You're on Windows? perhaps you are dancing with text mode...
| 228272 [dyakhnenko@l] Yes I am on Windows. Can you please elaborate on that?
| 228278 [rforum@gm il] Windows has a notion of "text files" and "binary files"; for the former
+ 228274 [halostatue@g] File.read is a bad choice on Windows. It should be avoided if at all
| + 228279 [dyakhnenko@l] Yup, that did it... thanks.
| + 326258 [stuart.clark] Can i just confirm whats going on here. You are loading the contents of
+ 228276 [vincent.four] For me, on a Linux box, with a random file, it works fine. Are you
+ 228277 [ara.t.howard] maybe only part of your data ??
+ 228281 [no@sp m. le ] ruby -e 'require "digest/md5"; p Digest::MD5.hexdigest(File.read("C:\\dc.log", "rb"))'
  245918 [abonchen@gm ] I'm transforming a string.
  245933 [no.spam@pl a] You don't need to, it's always a simple binary sequence.