229159-230849 subjects 229563-366788

how to add a method_missing method into ActiveRecord
229383 [aotianlong.c] ...
+ 229389 [twifkak@co c] when /new stuff/: #your code
| 229390 [aotianlong.c] ...
| 229391 [alexg@ku cr ] You are calling a missing method from within your new method_missing.
| 229392 [aotianlong.c] ...
+ 229503 [pubsub@ru yi] You could alias the existing method_missing, redefine it to capture the

libxml and CDATA
229393 [thomasmuelle] I need to add a CDATA element to an XML document.
229406 [rosco@ro co ] Wow, that's a fairly old version you have there :)

How to overload the operator !=?
229395 [ankyhe@gm il] I overload ==, >, <, >=, <=successfully, however I can't overload != .
+ 229396 [dudu@du u. o] Overloading "==" should do it :)
| 229429 [jan.svitok@g] != is a defined using == i.e. a != b is parsed as !(a == b)
| 229445 [dudu@du u. o] Which is precisely what I meant :)
| 229458 [jan.svitok@g] Right, I just though some clarification would not harm ;-) I should've
+ 229501 [pubsub@ru yi] The != token is not really a method at all and thus cannot be redefined.
  229524 [shortcutter@] It's been a long day and I'm not sure whether my logic fails me here,
  + 229531 [pubsub@ru yi] Half-way related amusing anecdote (from
  + 229576 [sylvain.joye] Well, I remember a thread on ruby-lang where somebody were trying to build

Restricted capture in Regexp
229397 [benjohn@fy h] Is there a regexp feature that lets me require something to be present
+ 229400 [nospam@no it] Neither yes nor no, because of how you have worded your question. Se below.
| 229404 [benjohn@fy h] thanks for the reply. I know I can do this, but it means that the
| 229410 [nospam@no it] / ...
| 229421 [benjohn@fy h] I think this may be what I should use. Also, the sugestion of using word
| + 229449 [neoneye@gm i] s = "sin(x+y)"
| + 229450 [neoneye@gm i] In a language like ruby, its not possible to distinguish between
| + 229483 [nospam@no it] Again, your prose description is not precise enough for a reader to know
|   229693 [benjohn@fy h] I was able to. I had not understood that scan and gsub work
|   229698 [nospam@no it] result = "axb".gsub(/(.)(x)(.)/, "A\\2B" ) # gets what you want.
|   229768 [Rob@Ag le on] If you're not interested in the other groupings you can use (?:) to
+ 229402 [lists@be tr ] /\b[xy]\b/
| 229407 [benjohn@fy h] This seems like the best approach in this case, as it's a good enough
| + 229515 [david@va ln ] The following two aren't supported in the current Ruby regexp engine,
| + 229517 [lists@be tr ] The latter two don't work in Ruby as far as I know.
+ 229567 [w_a_x_man@ya] class String

How to improve my Ruby skills ?
229398 [user@do ai .] using RoR. It's been 10 months now.
+ 229408 [shortcutter@] If you find the quizzes too hard, then try to exercise some self cooked
+ 229413 [neoneye@gm i] Write an article about a specific thing ruby, where you
| 229422 [slamboy@gm i] ...
| 229428 [jan.svitok@g] IIRC, some time ago somebody asked what are the easier quizes. Look up
| 229442 [james@gr yp ] It's been asked multiple times before, yes.  Here is probably the
| 229471 [user@do ai .] Thanks for all the answers. James, this url raise a 404...
| 229487 [slamboy@gm i] ...
| 229495 [james@gr yp ] thread/56715eaf2f9a657/3bfef6ea8868b7f1
+ 229488 [james2mccart] 2 things that really got my Ruby going were 1. creating a project that
+ 229554 [tom@in oe he] It goes into detail about the solutions and is full pretty good quality

hpricot selective text modification
229403 [siddharth.ka] is an answer to most of my requirements, except one.
+ 229409 [nospam@no it] / ... snip lengthy listing of Hpricot error messages
| 229411 [siddharth.ka] Here is the scenario,
| 229415 [nospam@no it] Okay, that sounds a great deal more complex than a typical text extraction
+ 229412 [peter@ru yr ] Sure :).
  229414 [siddharth.ka] Thanks Peter.

Create a Matrix
229418 [christopherl] I was trying to create an n by n zero matrix, by calling the class
229419 [martindemell] You need to require the file - it's in stdlib rather than core.

Is there a class that is equivalent to Properties in Java
229425 [dou_yifan@ya] Is there a class in the ruby lib that is equivalent to Properties class
+ 229437 [shortcutter@] Hash.
+ 229447 [twifkak@co c] If you can read something that can parse and emit Java .properties
+ 229451 [james@gr yp ] I think the following code should cover most of the Properties class

[ANN] RedNails Released
229427 [rubyzbibd@ub] RedNails is template driven data scraping API.

Hpricot html parsing
229430 [mail2sek@ya ] I have the following html fragment
229432 [peter@ru yr ] I did not quite get you. You want the text of the first <p> because it
229436 [mail2sek@ya ] yes, I want the text of the first <p> because it
+ 229439 [peter@ru yr ] ===============================================
| + 229547 [david@va ln ] Which once again makes me wish paragraphs =3D doc/'//p[img]/text()'
| | 229805 [rubytalk@gm ] (doc/"/html/body/div[1]/*/table[0]/tr[0]/*/b[9]/text")
| | 229902 [david@va ln ] Well, it's 'text()' not 'text'. Luckily _why noticed.
| | 229919 [rubytalk@gm ] Sorry, I have been archiving ruby talk at rubytalk@gmail.com since  10/14/04.
| + 230128 [mail2sek@ya ] Thanks Peter ,
|   230137 [peter@ru yr ] Hmm, except of what can be found on the Hpricot page, I am using
|   230144 [david@va ln ] Also, I'd take that in preference to point 3, using an XPath -ish sort of query
+ 229441 [lrlebron@gm ] if p.search("img").length > 0
+ 229474 [nospam@no it] Hpricot might be able to do this, but you can also do it on your own, and

[ANN] Saikuro v0.2 Released
229431 [rubyzbibd@ub] Saikuro is a Ruby cyclomatic complexity analyzer.
229543 [drbrain@se m] Where's the gem?
229558 [rubyzbibd@ub] My attempts to make a gem have failed.  I think because Saikuro wants
229582 [alex@de et m] Take a look at the 'executables' setting within the gemspec
229723 [rubyzbibd@ub] Yes thank you I have already looked into this.

How do I run WEBrick as a daemon?
229443 [work@as le m] I'm trying to make a simple web server to provide decryption to a C#
229452 [gregory.t.br] *blows dust off of gambit*
229453 [gregory.t.br] Here is the whole server, btw. http://tinyurl.com/yjet4l
229456 [work@as le m] Cheers!  I've extracted the important bits out of your code and it's
229465 [gregory.t.br] Great to hear.  Best of luck!

[ANN] Kwala v0.1 Release
229444 [rubyzbibd@ub] This is the first public release of Kwala.
229460 [wilsonb@gm i] Nice! Thanks for making this available.

howw to delete session data
229448 [mba_piyush@y] whenever we login a entry is added in the sessions tableof our database

ruby crashes my boss' desktop
229455 [bitdoger2@ya] To all..my ruby program developed in v182.1
229457 [jan.svitok@g] There were some changes between the versions. For 1.8.4 184-20.exe
229468 [bitdoger2@ya] ...i'm using OCI8 (oracle read-only selects) on my boss' (an older

ri search question
229461 [chen_li3@ya ] I try to find a methed(File.basename) using ri but it doesn't work. Any
229464 [chris.hulan@] You have 2 copies of the docs for File. RI can't differentiate gives
229472 [chen_li3@ya ] I search all the file.rb in my Ruby folder and delete
229484 [chris.hulan@] ri docs are generated from the *.rb files.  They usually reside
229569 [chen_li3@ya ] It works but I have to delete the whole folder which contains the files.

Net::Ldap question
229467 [eduardo.yane] What I want to do is authenticate some user, I don't need to do any queries or
+ 229478 [eduardo.yane] def self.authenticate(identifier, password)
+ 229486 [eduardo.yane] Hehe, sorry again. I've reading documentation of this library and already know
  229514 [garbagecat10] Are you using the latest version of Net::LDAP?
  229589 [eduardo.yane] Yes, I installed 0.0.4 version.
  229605 [garbagecat10] What is the LDAP server? Active Directory often allows you to bind as
  229617 [eduardo.yane] The LDAP server is from Netscape, don't know exactly which version is it.
  + 229649 [garbagecat10] You may have misunderstood how Net::LDAP#bind_as works. Go back and
  + 229682 [dsledge@ap r] On 12/14/06 10:18 AM, "Eduardo Yez Parareda"
    230326 [eduardo.yane] Thanks a lot to Francis and David, finally I got it. Since I don't have an administration account,
    230380 [garbagecat10] David's points are quite true, however the Net::LDAP#bind_as method is
    230394 [eduardo.yane] and it worked right. What I don't understand is why whether you try to 'bind_as'
    230397 [garbagecat10] Thanks. It's possible that either #bind or #bind_as (or both) are

map taking an argument (was: Re: join_with)
229469 [dblack@wo bl] Your point about map re-raised a question that was in my head
+ 229482 [djberg96@gm ] Good question.  One guess is that they wanted a more generic approach,
+ 229485 [ara.t.howard] i think that makes good sense considering ruby's pattern of not auto-magically
| 229496 [djberg96@gm ] I doubt it.  My feeling, based on the posts I've seen on the topic over
| 229497 [dblack@wo bl] I hope you're right.  I dislike it not only for its line-noise
+ 229492 [dblack@wo bl] I screwed up my procmailrc briefly and lost a couple of messages.  So
| 229502 [ara.t.howard] in both cases the arguments types changes the semantics of the method.  in one
| 229506 [dblack@wo bl] "Munged" is a broad enough term that it probably covers both :-)  I
+ 229512 [martindemell] The 1.9 version is nicely orthogonal, though - it hasn't added
| + 229513 [dblack@wo bl] Interesting -- I perceive it as quite magic, maybe because no matter
| + 229525 [chneukirchen] David, do you want to allow  (1..10).map(:*, 2)  ?
|   + 229526 [james@gr yp ] Does the version currently in Ruby 1.9 support arguments?
|   | 229540 [dblack@wo bl] I don't think so.  I'm actually not sure where they'd go, since &:meth
|   | 229556 [mjudge@su ve] A few days ago, I modified Dr. Nic's MapByMethod gem (locally) to
|   + 229538 [dblack@wo bl] I don't particularly want to allow map(:anything) :-)  I was just
|     229545 [ara.t.howard] you confound me david!  ;-)
|     229551 [dblack@wo bl] I didn't say I liked e.map(:m); I said I wondered why it was rejected
|     229604 [martindemell] It hasn't really returned - it's just a small "hack" being officially
+ 229619 [matz@ru y- a] (a) noisier form works not only for map, but also for every method
  229636 [dblack@wo bl] I'll take (a) and (b) :-)  I understand (c) too, though.

#N/A bug segmentation
229473 [wai-kee.chun] I am using ruby with COM objects. On certain COM function calls the
+ 229479 [djberg96@gm ] It could be a bug in win32ole.  Got a code sample?
+ 229519 [udo.froehlin] I cannot explain the details, cause i'm a tester and no programmer but
  229757 [wai-kee.chun] I cant produce an exmaple here since it would require me to upload the
  230208 [bpettichord@] Watir includes a patched win32ole.so library that is compiled to work
  231735 [wai-kee.chun] How does one port the patch to 1.8.5?

[ANN] Milwaukee Ruby Users Group Meeting Tonight 12/13 @ 5:30 - 7:30
229476 [tdjordan@gm ] We will be meeting in the usual place.

How to always write Windows style newlines to a file?
229477 [weyus@at .n ] I need to write a CSV file and I know that I always want Windows style
+ 229480 [weyus@at .n ] I've done this in the past - is this the best way to do it?
+ 229489 [djberg96@gm ] The line endings shouldn't matter.  I write csv files on Linux systems
  + 229528 [shortcutter@] You sure this works?
  | 229529 [halostatue@g] Yeah. You're using the disaster known as cygwin.
  | 229588 [shortcutter@] So far it has served me very well.  The fact that cygwin not generally
  + 229593 [fxn@ha hr f.] That would be $\, the _output_ record separator.
    229625 [weyus@at .n ] So if I open the file using "b" I can write the bytes as I intend using

SVG Canvas
229481 [stevenq1967@] I've been looking for a couple of days now and I can't find a library
+ 229491 [nospam@no it] Most of the available GUI libraries support graphics. I have been using the
| 229493 [neoneye@gm i] Simon Strandgaard
| 229521 [nospam@no it] Thank you -- I managed to overlook the URL content as I collected the data
+ 229498 [listbox@ju i] Julian 'Julik' Tarkhanov
+ 229541 [pete@no ah t] I haven't tried it at all, but there are Ruby bindings for the Cairo
+ 229594 [kou@co mi ng] If you want to only show SVG, the following example will
  229702 [stevenq1967@] Thanks, I'll try these.

Trouble installing Gems
229490 [redgibson@gm] ...
+ 229673 [tim.pease@gm] Could you please give a little more information -- a exact copy of the
+ 229694 [drbrain@se m] Please post the full error from "ruby setup.rb"

Pointers and References?
229507 [chris.colema] Simple question, i come from a C/++ background and i'm just really
+ 229509 [wilsonb@gm i] Everything is being passed by reference, but the references themselves
+ 229510 [dblack@wo bl] a = [1,2,3]   # a is assigned a reference to the array
  229534 [ruby-ml@ki t] =20
  229537 [dblack@wo bl] And yet clearer: the object inside the method IS the original object

Random idea - private, blocks, constants
229511 [djberg96@gm ] What do people think of the idea of private (and protected) taking a
+ 229562 [vjoel@pa h. ] What about putting them in a nested module?
+ 229624 [matz@ru y- a] Hmm, first we have to define how private constants (and class
| 229638 [djberg96@gm ] True.
+ 229648 [peter@se an ] Not wanting to troll you here but is this really a problem?
| 229662 [djberg96@gm ] That's fine.  I'm not concerned with people getting at my constants if
| + 229686 [matz@ru y- a] The demand for private constants are much lower than private methods,
| | + 229705 [ssmoot@gm il] In light of that, might the solution here simply be sub-classing the
| | | 229739 [djberg96@gm ] Most of the time I would, but there are times when you want to redefine
| | + 229843 [transfire@gm] How does method lookup differ from constant lookup? It has always
| |   229865 [matz@ru y- a] foo and foo() are differ when foo is assigned as a local variable.
| + 229755 [peter@se an ] Messy yes but is it a problem? Just open another shell and read the
+ 229746 [twifkak@co c] Hrm... I have no opinion on private constants, but I'm going to borrow
  229818 [djberg96@gm ] This has been proposed before (i.e. have 'def' return a symbol).  I

Re: Kwala v0.1 Release
229516 [andrewroth@g] This looks great!  Will it work in windows?  I'm on XP with 1.8.5.  I
229559 [rubyzbibd@ub] [Snip useful information about environment]

Rails problem with page.replace
229523 [raw@ml ni c.] I'm going to add some functionality to my application. I need to replace
+ 229674 [tim.pease@gm] Try posting this question on the Ruby on Rails maling list. They'll be
+ 229807 [rubytalk@gm ] Try

FasterCSV - Writing to File Question
229527 [olsonas@gm i] Based on a previous thread, I gave FasterCSV a try and I've been very
+ 229530 [olsonas@gm i] snip
+ 229532 [james@gr yp ] Sure.  Should work just fine.  (File a bug if it doesn't!)
| 229535 [olsonas@gm i] James -
+ 229533 [kenosis@gm i] I don't use FCSV but I'd be wouldn't be surprised if it didn't have a

Re: gems cleverness?
229539 [drbrain@se m] spec.full_name } # *
229627 [drbrain@se m] Oh, sorry.
+ 229688 [drbrain@se m] Ok, This will be going in once rubygems is up.  Same interface.
| 229749 [Gemma.Camero] You're all going to be making my head very big.... I'm not all that
+ 229821 [drbrain@se m] Not accurately.  Load path manipulation or require order may cause
  + 229830 [ara.t.howard] and, of course, it can be even more pathalogical
  | 229837 [twifkak@co c] def require; false end
  + 229842 [tomp@ea th i] Granted, but that's not a good reason to not to do what you can.
    229858 [erikveen@gm ] gem.full_name}

[ANN] image_science 1.0.0 Released
229542 [ryand-ruby@z] image_science version 1.0.0 has been released!
229772 [hutch@re ur ] This is just what I was looking for. Perfect timing.
+ 229781 [wbirkett@do ] Tried the latest (1.9) Makefile.osx, but would not link on PPC.
| 229792 [ryand-ruby@z] ...
+ 229790 [drbrain@se m] Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
+ 229791 [ryand-ruby@z] "NOTE: OSX builds a fat binary, so you need to have the 10.3.9 and

229550 [mattismyname] ...
229566 [m_goldberg@a] DateTime.strptime simply can't handle "1166049481" as an argument. It
229572 [mattismyname] ...

array and hash combine methods
229552 [glen83@gm il] Just thought I'd post a solution I came up with to finding
+ 229590 [o.renaud@la ] There is a Enumerable.combinations method in ruby facets which works like
+ 364001 [jmrepetti@gm] [1,2].combine([3,4]).combine([5,6,7])
  + 364005 [phrogz@ma .c] Juan, it would appear that glen posted this question/tip 3.5 years
  | 364008 [jmrepetti@gm] Sure Gavin, I'm looking for something like that and found this post.
  | 364011 [kamal2222ahm] ...
  + 364017 [shortcutter@] module Enumerable
    364033 [jmrepetti@gm] class Array