343324-381003 subjects 343771-344270

Reading contents of a file and storing
343566 [idealone5@ho] Guys,
+ 343568 [b.candler@po] However personally I dislike YAML because it's very data-sensitive (note
| 343569 [shortcutter@] You can save one level of indentation by using
+ 343575 [list.push@gm] Another way.
  343593 [vjoel@pa h. ] source.gsub(/^([^=]+)=/) {$1}
  343595 [vjoel@pa h. ] source.gsub(/^([^=]+)=/) {$1 + " "}
  + 344012 [idealone5@ho] Using  source.gsub(/^([^=]+)=/) {$1 + " "} gives me the below shown
  | 344013 [bbxx789_05ss] You would never do that.  You store multiple values in arrays.  For
  | 344014 [bbxx789_05ss] results = ["hello", "hi", "goodbye"]
  | 344019 [idealone5@ho] Let me be more clear over the requirement , my intention to read from
  + 344020 [robert.dober] I was just wondering, should we not refuse to use ^ for the beginning
    + 344044 [vjoel@pa h. ] Didn't the OP want each line converted? It's getting hard to remember...
    | 344072 [robert.dober] Sorry my bad. I did not realize from the snippet that you were doing
    + 344080 [b.candler@po] I didn't follow you, but I've been using \A..\z for years.

Newbie has trouble understanding a Why example
343571 [cjosephson@e] I'm just learning ruby, so I am working my way through 'Why's Poignant
+ 343572 [rick.denatal] on
+ 343574 [robert.dober] on
+ 343576 [zyzygy@te st] Its a little confusing.  In the method definition, sep= and format=
  343589 [robert.dober] on

Load & Execute Code From a Database
343577 [paulf@a2 li ] Sometime ago there was a discussion  about loading & running code held
343622 [karottenreib] I guess you could sandbox it? There are Ruby sandboxes out there...
343627 [b.candler@po] _why's sandbox looks to be pretty good, but it requires you to rebuild
343629 [paulf@a2 li ] My question is a little more basic (and dumb)
343631 [b.candler@po] str = "puts 'ha ha ha'"
343632 [paulf@a2 li ] Thanks, Brian,
343633 [b.candler@po] load("file.rb") is pretty much the same as eval(File.read("file.rb"))
343634 [b.candler@po] ... and incidentally, there are several examples of programs which load
343637 [paulf@a2 li ] Thanks again, Brian,

[ANN] Localmemcache-0.4.2: Improves append performance
343579 [schween@sn f] I have noticed that Localmemcache can become extremely slow when

Linking text with regex
343580 [crazedcougar] This is probably a silly question, but I'm wondering what the best way
343584 [rick.denatal] text.sub!(/#[-'A-Za-z]+/) {|m| link_to(m, tweet.category_name))}
343590 [crazedcougar] aha!  This works great!

Libxml: trying to set encoding for a document
343582 [rozziite@gm ] I have problems with setting encoding for an xml file. I want to produce an
343613 [matt_neuburg] require 'rubygems'
343644 [njus@la sh u] You may also specify indentation and the explicit encoding

Error in Vista
343586 [eric.ramsey@] When creating a ruby script (using Watir) on XP then using
343588 [Carey.Nation] GetProcAddress is a call that dynamically loads a dll and gets you a
343617 [renard@nc rr] rubyscript2exe does not work with ruby-1.8 or later.

ActiveRecord to_json encoding
343591 [calvin98115@] know we can explicitly specify what encoding to use when calling
+ 343600 [b.candler@po] Yes, almost certainly someone does. But you will be more likely to find
| 343603 [calvin98115@] Brian, I really appreciate the quick reply and the insight.  Our team
| 343628 [b.candler@po] The 1.9 language has a lot of backwards-incompatible changes which mean
+ 343614 [james@gr yp ] Rails pretty much assumes UTF-8 data everywhere.  The path of least =20

Destroying related objects doubt ... basic oop question
343592 [sohdubom@ya ] One thing that is confusing me is regarding the lifecycle of the
+ 343621 [karottenreib] So what's your question? You're the city planning departement/programmer. If
+ 343639 [bbxx789_05ss] Really?
| 343645 [mcamou@te no] responsible for managing the Room class and you can't pass in a Room to the
| 343718 [sohdubom@ya ] 1. The rules set for the particular app will say if the relationship is
+ 343726 [rubfor@re it] Yet another reason for steering well clear of object-relational mappers.
  + 343751 [karottenreib] def sarcasm
  | 343774 [rubfor@re it] It was shown (30 years ago) that assembler is noticeably less productive
  | + 343789 [pbooth@no oi] I think the reality is more complex than either of the two positions
  | + 343798 [karottenreib] well, i'm faster making three dumb classes with an orm and calling 3 class
  |   343799 [rubfor@re it] My point was ORMs mean you have to struggle understanding a new
  |   343824 [cmdicely@gm ] No, really, they can't. Whether you use an ORM, or whether you use a
  |   343834 [rubfor@re it] That would mean anyone across the entire corporation is somehow going to
  |   + 343841 [cmdicely@gm ] No, it wouldn't. Whether you use an ORM or not, anything that can
  |   + 343852 [vjoel@pa h. ] I tried eating food without chopsticks once. Much worse that way. Don't
  + 343767 [ilan.berci@g] Actually, it wasn't worked out 30 years ago (I was there).. The OP is

instance_variables vs. local_variables
343596 [rubyforum@sp] Can anyone offer a reasonable explanation for the difference in behavior
343597 [vjoel@pa h. ] That's exactly right, IIRC.
343598 [rubyforum@sp] So the implication here is that there is no way to define a local
+ 343599 [b.candler@po] There's eval with a binding. But the question is, why would you want to
+ 343601 [vjoel@pa h. ] If you are eval-ing code, then you can eval against a binding, and
  + 343608 [rubyforum@sp] This clears up a misperception I had when trying similar examples.  For
  | 343624 [b.candler@po] As far as I understand, it's not exactly a "copy". Rather, each binding
  | 343646 [rubyforum@sp] That makes sense.
  | 343651 [b.candler@po] This may or may not be an intentional change. I googled and couldn't
  + 343609 [jeremy@bi sw] le

[ANN] dnssd 1.1.0 Released
343602 [aaron@te de ] (On behalf of Eric Hodel)

mod_ruby alternative?
343604 [chutsu@gm il] So basically I was wondering what alternative do I have from mod_ruby?
343606 [macarui@gm i] I don't know much about CGI.
343607 [macarui@gm i] You may allso be interested in Sinatra.

Ruby 1.9 evaled from C doesn't load libraries properly
343605 [maccman@gm i] Ok, so I'm using C++ in a project called Titanium and trying to evaluate
+ 343775 [maccman@gm i] I should add that other libraries written in C, like StringIO, work
+ 343776 [drbrain@se m] RubyGems requires thread by itself, why are you doing it?  Why not
  343777 [maccman@gm i] When I require 'rubygems' I get that error - I traced it back to the

Using Ruby on a PC
343610 [sodani@gm il] I haven't used Ruby on a PC in a while and I'm wondering what my
343616 [damnbigman@g] You could install Ruby in Windows, assuming that is what you mean by PC.
343635 [shevegen@li ] Ruby pretty much works everywhere. The underlying OS should be less of

[ANN] tyrantmanager 1.1.0 Released
343618 [jeremy@hi eg] tyrantmanager version 1.1.0 has been released.

rake task writing question
343619 [pauli.price@] that should pass') do |t|

neversaydie version 1.0.0 has been released!
343620 [aaron@te de ] neversaydie version 1.0.0 has been released!

[ANN] loofah 0.2.0 Released
343623 [mike.dalessi] loofah version 0.2.0 has been released!

Use Ruby to create Win executable?
343625 [m.soutopico@] I would like to post a general question about the convenience of using
+ 343626 [m.soutopico@] Sorry, I forgot to say goodbye and to thank you in advance for any
| 343630 [sutniuq@gm .] Ruby itself does not provide a GUI, but there are serveral different GUI
| + 343636 [shevegen@li ] There are plenty of GUI bindings for ruby towards i.e. ruby-gtk, qt,
| | 343648 [sutniuq@gm .] Yes, on Windows you can use features like the MessageBox() function from
| + 343647 [m.soutopico@] I want to focus on this part for now. I've tried to install and run ocra
|   343654 [m.soutopico@] Thanks!
+ 343699 [james.britt@] Use JRuby + Monkeybars for effortless GUI building, then use Rawr to
+ 343755 [richard.conr] Ruby would be more interesting too ... ;-P
  343760 [m.soutopico@] Due to limited time (it had to be done by tomorrow, when I go on
  343816 [rphillips@su] Even if I were in a big hurry, I'd give Titanium a look, too.


Hiding Ruby tasks in Windows display
343640 [pbailey@bn .] I've got a PC acting as a server that only runs Ruby scripts, using the
343641 [robert.dober] I hope memory serves correctly but is there not a rubyw.exe that
343642 [pbailey@bn .] Thanks, Robert. I've found out about rubyw in the pickaxe book and I'll

Object as second parameter to raise
343643 [paul.p.carey] I've just realised that I've been inadvertently passing objects other

Good editor for Windows Ruby
343649 [pbailey@bn .] I've been using ArachnoRuby for years and it's served me well as an
+ 343652 [mo_mail@on h] NetBeans?
| 343655 [pbailey@bn .] Thanks, Mohit. I'll look it up. I think I've heard of it.
| 343657 [pbailey@bn .] Uh, I downloaded and installed NetBeans. Quite painful, actually. I've
| 343660 [mo_mail@on h] In the free world, I believe it is one of the best - on the other hand,
| 343683 [vjoel@pa h. ] Crimson Editor is about the best I've found for windows, too, which
| + 343706 [louposk@gm i] I've tested all IDEs and editors available for Ruby and i recommend
| | + 343707 [harshad.wank] I totally agree. Netbeans is awesome.
| | + 343712 [shortcutter@] I use TextPad for my day to day Ruby scripting.  It has good
| + 343989 [michael.broo] I've tried all the windows editors and IDEs (both ruby oriented and
+ 343729 [pcbala@gm il] I have recently started using Geany [http://geany.org/] and liked it a
| 343731 [rogerdpack@g] I can't suggest a good one, but I can suggest a work in progress :)
+ 343732 [kyleaschmitt] I'd say SCiTE
| + 343733 [pbailey@bn .] Thank you all. I'm going to try your suggestions. I've downloaded and
| + 343735 [gregory.w.ch] So far I have used NetBeans, SciTE, and Notepad++ for writing Ruby on
+ 343754 [richard.conr] Peter,
+ 343770 [phermans@li ] Komodo Edit (free) has very good syntax highlighting and completion for
+ 343995 [jussij@ze se] Zeus - http://www.zeusedit.com/
  344047 [pbailey@bn .] Thank you all very much. I'm playing with Zeus now, and, Komodo. I
  344108 [hramrach@ce ] Of course, you can always run vim on windows. it is one of The Editors
  344177 [nbeyer@gm il] If you're looking for more than just an editor, i'd suggest trying

fail to load the win32-api gem when running OCRA
343650 [m.soutopico@] I'm trying to run ocra but I seem to have a problem with win32-api. I'm
+ 343656 [larschbelunk] OCRA tries to load win32-api using "require 'win32/api'". It looks
+ 343659 [sutniuq@gm .] Does ocra work with Linux or another unix-like environment? I thought,

Readline not working with Ruby
343658 [stewart.math] Hey I compiled ruby with readline support. However when i go to IRB i
+ 343661 [sutniuq@gm .] irb
| 343671 [pjb@in or at] echo $TERM
| + 343673 [robert.dober] I strongly suggest to check if your readline extension really compiled
| | 343678 [stewart.math] /usr/local/src/ruby-1.8.7-p72/ext/readline $ ruby -rreadline -e 'p 42'
| + 343677 [stewart.math] On Aug 11, 5:04=A0pm, p...@informatimago.com (Pascal J. Bourguignon)
+ 343662 [pjb@in or at] Identify  the  terminal (emulator)  that  you  use  and set  the  TERM
| 343664 [stewart.math] On Aug 11, 4:22=A0pm, p...@informatimago.com (Pascal J. Bourguignon)
| 343670 [pjb@in or at] You would use readline only when you're using the program thru a text
+ 343663 [b.candler@po] You need the readline development libraries installed at the time when
| 343666 [stewart.math] Sorry I should have posted more info
| + 343668 [b.candler@po] Did you install readline after compiling it? I imagine that ruby
| | 343675 [stewart.math] There is no mkmf.log file in that directory.  When you say
| + 343672 [james@gr yp ] I'm pretty sure it's not even needed on Mac OS 10.5, as it ships with
| | 343676 [stewart.math] =A0
| | 343681 [james@gr yp ] And do the editing keys now work as expected?
| + 343674 [pjb@in or at] This is not enough information.  What terminal emulator do you use?
+ 343665 [thopre@gm il] 2009/8/11 Stewart <stewart.matheson@gmail.com>
  + 343667 [robert.dober] And I recompiled everything after having installed libreadline5-dev.
  + 343669 [stewart.math] /usr/local/src/ruby-1.8.7-p72/ext/readline $ make
    + 343684 [vjoel@pa h. ] make distclean (should delete the makefile)
    + 343689 [b.candler@po] Hmm, maybe 1.8.7 works differently to 1.8.6 in this regards.
      343717 [stewart.math] line.bundle
      343719 [b.candler@po] C is a tolerant language, from its K&R heritage. Calling a function

Signature XML : library ?
343679 [babiben@ho m] Anyone knows how to use XML signature with ruby ? Are there libraries to

use fortran libraries in Ruby
343680 [jason.lillyw] I noticed from an older post that I might want to try to use

Fwd: Destroying related objects doubt ... basic oop question
343682 [pbooth@no oi] ...

Can URI retrieve the URL of a webpage when its open?
343685 [arti.p.singh] Can I use uri to get the URL Of a web page?
343708 [roddiku@gm i] require 'watir'
343739 [arti.p.singh] This bit won't work since I dont know the URL,its dynamic. I am

multiple projects - Apache
343688 [jj_stuart@ya] I'm trying to configure Apache so I can create multiple rails projects without modifying httpd.conf everytime. Right now, I have one project setup and a apache virtualhost that points to it. Here is how I have it configured.
343722 [jstewart@fu ] AFAIK, that's not possible with passenger. I believe that a new vhost is
343728 [james.herdma] The way I'm doing this is to have a single directory I symlink all of my
+ 343748 [pokui@ps .c ] There's a free preference pane for OS X that's floating around
+ 343753 [jj_stuart@ya] Thanks for the reply. I ended up doing pretty much the same thing. I create the project, link to the public folder and then in an .htaccess file, I add RailsBaseURI /railsProject.

Which initialize method? (or, who is self?)
343690 [rabbitblue@g] hmac = self.new(key)
343693 [shortcutter@] The method invoked is #new and not #initialize!  This means that
343702 [robert.dober] Well analyzed, I did not really get it.
343704 [shortcutter@] Thank you!  It took me some time to see through it, too.
343720 [robert.dober] I was afraid you would say this ;). So I conclude that you indeed see
343750 [shortcutter@] Yes, I think that is an appropriate description.

How to get image extension in Watir?
343691 [roddiku@gm i] the request so that I can parse Content-Type myself? TIA

Dynamically creating a multi dimensional hash
343692 [dsainteclair] I am trying to do something that on the surface seems easy, but in
+ 343694 [shortcutter@] First of all @skuList is not a Hash but an Array.
+ 343695 [vjoel@pa h. ] Looks like an array of hashes. What do you mean by "multidimensional hash"?

Windows ENV object being corrupted
343696 [phermans@li ] I am running in rake ( I have reproduced the problem with a straight
343697 [phermans@li ] This appears to be related to spaces in the value strings.  As a Hack I
343705 [shortcutter@] I cannot either but this is due to the fact that I am missing
343740 [phermans@li ] What I do is write the output from 'set' on windows to a ruby string
343749 [shortcutter@] And what is your aim, i.e. what do you want to achieve?  If you want
+ 343758 [shortcutter@] Pardon, should have been
+ 343769 [phermans@li ] Thanks, Robert.  I can't argue your approach isn't simpler.  In fact, I
  343810 [shortcutter@] I was curious and created the test attached but could not provoke any
  344455 [phermans@li ] I had chance to get and try your routine.  I think the author of this

Subject: [ANN] ri_cal 0.8.0 Released
343700 [rick.denatal] ri_cal version 0.8.0 has been released!

343711 [babiben@ho m] <DA><RE>97975000-5</RE><RS>RUT DE
343716 [b.candler@po] Since you didn't show what you *actually* get from your base64 encoding,
343721 [babiben@ho m] Thanks for your answer. I don't mind "hexdigest".
343734 [babiben@ho m] i have an other question. To find =>miEVzAPgX5mplvvOR8RVSQXXXR0=, i use
343741 [b.candler@po] The error message tells you: follow the link to the XML Canonicalisation

Scrubyt and line breaks
343736 [elchesa@ho m] I'm trying to get a portion of text from a web page using Scrubyt. The

Configuring Textmate for Ruby 1.9.1
343738 [mike.agres@g] I had just installed Ruby 1.9.1 using MacPorts, but TextMate still
343742 [james@gr yp ] I just ran through these steps and everything worked fine for me.
343743 [mike.agres@g] After the error appeared, I had edited the directory location, taking
343744 [james@gr yp ] Can you show me the contents that variable holds now, while it's
343745 [mike.agres@g] Actually, no. I'm at work now (on a PC) and the Mac's at home.
343747 [james@gr yp ] Tonight, or whenever it's convenient, is fine.  :)
343780 [mike.agres@g] /tmp/temp_textmate.dLXXwJ: line 6: : command not found
343782 [james@gr yp ] . in a Unix path means "current directory" and that's not what you
343784 [mike.agres@g] That worked. Thanks James.

ruby class hierarchy
343746 [jason.lillyw] I was going to develop a tree view of ruby class hierarchy using the

343756 [jason.lillyw] Ruby can do Class#ancestors but not Class#descendants.
+ 343757 [vjoel@pa h. ] irb(main):001:0> ObjectSpace.each_object(Class) {|cl| p cl if cl < Numeric}
| + 343761 [jason.lillyw] Thank you. Why does it return 387 after I do this in IRB?
| | 343766 [vjoel@pa h. ] It's the number of instances of Class (since that was the argument). So
| + 343772 [tony@me io .] For what it's worth, here's my implementation, which doesn't use
| | 343773 [vjoel@pa h. ] Not all classes are constants...
| | 343781 [tony@me io .] Oi, good catch.
| | 345641 [duck@an th n] Posted via http://www.ruby-forum.com/.
| | + 345647 [tony@me io .] But this covers even fewer cases than the non-ObjectSpace example I gave
| | | 345650 [duck@an th n] Sorry, my bad. Guess so.
| | + 345648 [rick.denatal] Try that code with p Object.descendants
| + 345578 [headius@he d] This is actually the one each_object case we do support with general
|   345622 [headius@he d] ~/projects/jruby  jruby -rjruby/core_ext -e "p Numeric.subclasses(true)"
|   345627 [tony@me io .] My two cents: I would love to see this as an official addition to Ruby.
+ 343762 [shortcutter@] Let me first state that I believe this is intentional: while sub classes
  + 343764 [jason.lillyw] This is great. Thank you.
  + 343765 [jason.lillyw] irb(main):085:0> ObjectSpace.each_object(Class) do |cl|
    343768 [shortcutter@] Oops, I inserted "superclass" after doing the test.  This is likely the