382664-384680 subjects 383059-383530

Enumerable#find returns an enumerator?
382904 [rogerpack200] I would have expected that
+ 382905 [chris.hulan@] if there were more than 1 occurrence retuning an enumerator makes
+ 382906 [jeremy@bo p.] Basically, you're trying to use the method incorrectly.  I'm not sure if
+ 382910 [l.schirrmeis] The find method on an array takes a block and returns an enumerator if =
| 382921 [shortcutter@] More precisely: the value passed is something which returns the
| 382955 [b.candler@po] I'm pretty sure that calling Enumerable methods without a block only
| 382960 [shortcutter@] Yes, but that was not the point.  I was explicitly talking about the
| 382966 [b.candler@po] You said: "here documentation is clear.  Why do so many people tell
| + 382990 [shortcutter@] Ah, OK *now* you said it.
| + 383003 [bbxx789_05ss] Which makes me wonder why the ri docs are different from the docs you
|   383189 [b.candler@po] The ri docs are different for each version, since they are built from
+ 382911 [bbxx789_05ss] Where in the world did you dream up that?  Enumerable#find() returns the
  382928 [ryand-ruby@z] You're being a jackass. Knock it off.

Generate random string matching specific pattern and length
382913 [darkintent@g] I'm trying to generate a random set of strings to fill a database with that
+ 382915 [adam@ap es o] How's this?
| + 382918 [bbxx789_05ss] Of course with all your misnamed/non-existent variables, that code won't
| | + 382919 [adam@ap es o] Thanks for that. I'd renamed them between checking it in irb and paste.
| | + 382923 [code@ap th o] Whatever happened to "Matz is nice so we are nice"?
| + 382935 [adam@ap es o] a = []
+ 382917 [code@ap th o] at
+ 382948 [shortcutter@] at
+ 382976 [chris.hulan@] at
  383365 [darkintent@g] Thank you everyone.

gsub and multiple-replacement
382916 [greghacke@gm] So I have a file that I am replicating per user.
+ 382920 [bbxx789_05ss] Yes, you do.
+ 382922 [cmdjackryan@] How about using ERB and a template?
+ 382925 [bbxx789_05ss] require 'stringio'
| 382932 [greghacke@gm] OK, I think it would be better to be a bit more specific...
| + 382937 [bbxx789_05ss] Yeah, what is so hard about posting a sample of the original file, as
| + 382953 [jgabrielygal] How big is the file? Is it acceptable to have it all in memory?
+ 382970 [greghacke@gm] <?xml version="1.0" encoding="UTF-8"?>
| 382977 [jgabrielygal] variables =3D {"username" =3D> "Bob", "password" =3D> "pwd"}
+ 383016 [bbxx789_05ss] You can also read the file line by line, and use a hash of replacements
+ 383017 [bbxx789_05ss] require 'rexml/document'

[ANN] faster_require 0.9.2
382931 [rogerpack200] Pleased to announce another update of the faster_require gem, which
+ 382975 [jon.forums@g] Have you had a chance to see how https://gist.github.com/950154
| 383027 [rogerpack200] I haven't tried it, but my guess is that it brings it in parity with
+ 382984 [code@ap th o] What's the license?

How to get index&summary of remote gem library
382934 [jhs408@gm il] Is there a command or a file which can be downloaded which contains a
+ 382946 [dhruva.sagar] Well you can simply do 'gem server'. That will start a server on your local
| 382947 [dhruva.sagar] Sorry that wasn't the correct answer. I replied to the wrong mail.
+ 382951 [ryand-ruby@z] Not strictly true... It's just doing a _lot_.

[ANN] GothamJS: Speak on Broadway!
382939 [gray.herter@] Want to speak about JavaScript on Broadway (yes, that Broadway)? The

how to do task-level parallelism in Windows?
382941 [zdyu2000@gm ] I want to achieve better performance through parallelism. The
382942 [joelvanderwe] Is jruby acceptable? Jruby threads do make use of multiple processors.
382943 [zdyu2000@gm ] I need to use win32ole. I am afraid JRuby cannot do this.
382945 [cmdicely@gm ] There is a jruby-win32ole gem -- I haven't used it, but it sounds like
382950 [zdyu2000@gm ] I just tried it. It seems there are some compatible problems. My code
+ 383020 [viabsb@gm il] Yes, ge ridden of windows.
+ 383263 [headius@he d] Please report this bug at http://bugs.jruby.org. We intend for
  383295 [zdyu2000@gm ] Posted via http://www.ruby-forum.com/.
  383364 [headius@he d] Thank you! Hopefully Tom will be able to look into it some time soon

[ANN] ruby-configurable 1.0.2
382944 [rubyforum@ri] ruby-configurable version 1.0.2 has been released!

How to process div pop up window?
382949 [yuan-li2008@] I open one browser,go to a web. And there is a link in the page, when I

Incorrect paths generated in Windows
382952 [arne.de.herd] I'm currently busy compiling several gems from source on my Windows
+ 382956 [sutniuq@gm .] As far as I can see, these paths are intended to work with the MSYS
+ 382957 [arne.de.herd] Running from the msys shell does work. But right now I'm beeing forced
+ 383012 [luislavena@g] On May 11, 4:56=A0am, Arne De Herdt <arne.de.he...@googlemail.com>

Save value from Core Show Channel
382972 [yasir_hashmi] that give me information abt channel.
382973 [sophrinix@gm] Is this an asterisk question?

How to get the IPs of all the interfaces in my host?
382974 [ibc@al ax ne] network interfaces of my computer in a reliable way.
+ 382979 [ibc@al ax ne] { |x| x[3] }
+ 382996 [normalperson] require 'socket'
  382999 [ibc@al ax ne] Amazing! I knew nothing about it :)

RSpec is doing a Samoa on me
382978 [iainspeed@gm] let(:vtime_start){ Time.now - 10 }
+ 382980 [b.candler@po] I suggest you make a completely standalone rspec test until you find
+ 382983 [developer@wi] Could it be a problem with the logger you're using? Try doing a puts
  382985 [iainspeed@gm] I only started logging it because the test was failing, and the code =
  382986 [chris.hulan@] Could a change in another preceding test be leaking into this one?
  + 382988 [developer@wi] As an aside, TimeCop is a great way to "freeze time" during unit tests that
  + 383094 [iainspeed@gm] It shouldn't (according to my wishes:) have been leaking stuff as each =

UDPSocket does not work with IPv6 ?
382981 [ibc@al ax ne] UDPSocket.open do |s|

RubyInline and Digest::Base error
382982 [mail@ma sh .] irb(main):001:0> require 'inline'

gem list -rd  a  generates an error
382987 [jhs408@gm il] *** REMOTE GEMS ***
383013 [luislavena@g] Please provide the full output of "gem env" plus the same command with
383023 [jhs408@gm il] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
383024 [luislavena@g] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
383067 [jhs408@gm il] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
383156 [luislavena@g] See the rails dependency, the version is not published correctly.

[ANN] Lone Star Ruby Conference V - Call for Speakers
382989 [jimfreeze@gm] Lone Star Ruby Conference V

Scope problem (?) in implementing Design Patterns in Ruby
382991 [RichardDummy] I'm hoping that employing "Design Patterns in Ruby" will lead to less
+ 382993 [developer@wi] I think the second link points to the wrong pastie.
| + 382994 [developer@wi] Expression like I thought it would from the pattern it follows.
| + 382995 [developer@wi] One more suggestion: if you're going to build a hierarchy, might as well
| | 383022 [RichardDummy] ly
| + 383018 [RichardDummy] are
+ 382998 [bbxx789_05ss] prog.rb:4: syntax error, unexpected ':', expecting keyword_then or ','
| 383004 [bbxx789_05ss] class All
| + 383005 [developer@wi] I think the lookup starts at the innermost scope but since All isn't defined
| | 383009 [bbxx789_05ss] 1)
| + 383007 [bbxx789_05ss] Well, that's not true either.  If I define two All classes: one at the
|   383010 [developer@wi] Why not?
|   383091 [RichardDummy] Thanks very much to you both for hanging in there with me.
|   383170 [developer@wi] Happy to help.
|   + 383173 [bbxx789_05ss] Hard to do when you are reading a book on Design Patterns, and you are
|   | 383176 [developer@wi] Hard to do when you are reading a book on Design Patterns, and you are
|   + 383185 [RichardDummy] ch are okay, but often overkill or already built in to Ruby) but also to Ru=
|   | + 383212 [developer@wi] The & has to be adjacent to "all" or "filename" to act as expected. The &
|   | | 383222 [RichardDummy] nto
|   | + 383220 [bbxx789_05ss] Your bible, "The Well-Grounded Rubyist" uses the &:meth_name construct a
|   |   + 383224 [steve@st ve ] This was originally introduced in ActiveSupport, where that was in fact the
|   |   + 383665 [RichardDummy] n-
|   + 383724 [RichardDummy] I just want to let you know your tutelage on this thread has not gone
|     383776 [developer@wi] Glad the advice helped!
|     383918 [RichardDummy] Thanks for your additional improvement. Shrinking 8 lines down to 3
+ 383177 [bbxx789_05ss] Is it a higher order function because it calls a global method?
| 383178 [developer@wi] results = []
+ 383218 [ryand-ruby@z] Design patterns do not lead to less coding errors nor more easily =

Creating and Executing New Threads
383006 [dan.king106@] (1) spawn a new thread
+ 383008 [joelvanderwe] All the threads are running in one process, hence there is only one pid.
+ 383015 [bbxx789_05ss] threads = []
  383019 [cmdicely@gm ] Of course, that paragraph is only correct for MRI 1.8.x and earlier,
  383103 [bbxx789_05ss] Well...since that link explains that ruby threads all run in a single

[ANN] rubygems-update 1.8.2 Released
383021 [drbrain@se m] rubygems-update version 1.8.2 has been released!

how to make eval() faster?
383025 [zdyu2000@gm ] I use eval() to dynamically calculate performance metrics.
+ 383028 [joelvanderwe] Can you eval your formulas into methods, and call the methods on the
| 383030 [zdyu2000@gm ] No. I need flexibility, i.e., allow users to define their own formulas
| + 383031 [mbj@se ni .n] The configuration file can be plain ruby!
| | 383032 [zdyu2000@gm ] Nice catch. Actually I did try to implement it as DSL at the beginning,
| | 383034 [mbj@se ni .n] Too difficult?
| + 383037 [shortcutter@] I believe you did not fully understand what Joel suggested.  You do
+ 383033 [zdyu2000@gm ] I just came up with an idea: I can parse the XML configuration file and
  383035 [stu@ru yp og] I was going to suggest a creating a tmp file with a generator. create
  383036 [fxn@ha hr f.] No need to create a temp file. Unless the resulting code is huge, you can ge=

Re: faster_require 0.9.2
383026 [rogerpack200] any preference? whatever you want it to be... :)
383029 [code@ap th o] Given that Ruby appears to be switching to the BSD License with version
383229 [rogerpack200] Switched it to BSD.
383232 [code@ap th o] Thanks!  Now, if I write an article about it for TechRepublic, I'll know

Where does "define_method" defined?
383039 [brxue.cn@gm ] From Ruby library reference manual, It tells that "define_method" is an
383040 [nobuoka@r- e] Yes, a +define_method+ method is an instance method of the +Module+ class,
383045 [brxue.cn@gm ] Thank you very much for you help.

Learning Ruby advice needed
383041 [passionate_p] While learning a new language, I find it very boring to read again the
+ 383050 [regis.aubare] So try to learn really different language like Prolog, Haskell, Pure,
| 383092 [passionate_p] I don't understand how you all feel so comfortable with "irb". It is
| + 383097 [spoon@ki le ] Yes, store your code in files.  It's The Way (tm).
| + 383099 [code@ap th o] Use interactive_editor With irb For An Inside-Out Ruby IDE
| | 383116 [stu@ru yp og] Glad to see I inspired you. A blog post and everything.  I have hacked
| | 383137 [code@ap th o] I've just been using the heck out of it, for the most part, rather than
| | 383209 [jrmair@gm il] I added an `edit-method` command to pry, which works in principle
| | 383213 [adam@ap es o] Cool!
| + 383105 [bbxx789_05ss] I never use irb or python's irb.  I consider them a complete waste of
|   + 383112 [code@ap th o] Uhh . . . technically, it's not "python's irb".  It's Python's REPL, just
|   + 383114 [cmdjackryan@] Suddenly, enlightenment.
|   + 383124 [spoon@ki le ] I find this sentiment rather amusing!
|     + 383128 [hassan.schro] ? Funny, the irb I'm using does   :-)
|     | + 383130 [stu@ru yp og] It works well with pry as well.
|     | + 383131 [spoon@ki le ] Ah good shout, I'll have to see what's wrong here.  Thanks!
|     + 383138 [code@ap th o] Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]
|       383166 [spoon@ki le ] Thanks!  I'm a bit glaikit sometimes: never thought of making it do
+ 383072 [spoon@ki le ] 1. A tiny text-based game using the socket library (networked hunt the
| 383110 [josh.cheek@g] lol, did you read the "Land of Lisp", too?
| 383127 [spoon@ki le ] No!  It looks fantastic though, cheers for putting me on to it.
+ 383141 [jakekaiden@y] Chris Pine's "Learn To Program" has some neat ideas for practice
  383183 [alexandermcm] ...

hai see me
383042 [mveni.nirmal] veni.497@rediffmail.com

see me
383043 [mveni.nirmal] veni.497@rediffmail.com

383044 [mveni.nirmal] veni.497@rediffmail.com

where does the pure method defined when starting irb
383046 [brxue.cn@gm ] I have some puzzles, when I start irb,
+ 383051 [jakekaiden@y] irb(main):001:0> def hello; end
+ 383077 [cmdicely@gm ] Right, because its not defined as an instance method in the Object
| + 383081 [adgar@ca bo ] I have some puzzles, when I start irb,
| + 383123 [bbxx789_05ss] puts RUBY_VERSION
|   + 383158 [brxue.cn@gm ] Thanks all for your kindly explanation. It really helps.
|   | 383171 [bbxx789_05ss] class Object
|   | 383360 [brxue.cn@gm ] Thank you all.
|   | 383362 [adgar@ca bo ] An instance variable doesn't get created until it is first assigned. So =
|   | 383363 [brxue.cn@gm ] Thank you very much, Michael!
|   + 383161 [bbxx789_05ss] And...
+ 383111 [bbxx789_05ss] puts RUBY_VERSION
+ 383121 [bbxx789_05ss] puts RUBY_VERSION  #=>1.8.6

RubyGems 1.8 treats warnings as errors for C extensions, fails to install RedCloth?
383047 [sutniuq@gm .] ========================================
+ 383052 [now@bi wi se] RedCloth adds -Werror, see
| 383135 [sutniuq@gm .] You're right, that's odd. Then it's a bug in RedCloth, as it's obviously
+ 383147 [ryand-ruby@z] know
  383151 [now@bi wi se] Was this really necessary?  Make the output clearer instead of
  + 383162 [ryand-ruby@z] now
  | 383187 [now@bi wi se] As a project administrator for RubyGems, I believe that you can, see
  + 383207 [luislavena@g] The problem is not RubyGems actually, but that RedCloth turns -Werror
    383210 [now@bi wi se] As I tried to explain to Ryan in a subsequent email, what I meant was
    383215 [luislavena@g] Can you open a feature request for that?

Digest::Base problem
383048 [mail@ma sh .] maasha@mel:~$ irb
+ 383053 [cmdjackryan@] Do you have OpenSSL devel packages installed? Are they found by ./configure=
| 383054 [mail@ma sh .] It doesn't look like configure do anything ssl - should it?
| 383055 [cmdjackryan@] Yes. OpenSSL provides the crypto-backend that Ruby uses.
| 383057 [mail@ma sh .] but still no Digest::Base.
| 383058 [cmdjackryan@] ./configure --help should, well, help.
| 383060 [mail@ma sh .] /usr/lib/libssl.a
| 383064 [cmdjackryan@] with "openssl" (so, adding the path was incorrect information on my
| 383065 [mail@ma sh .] Same with and without a path, and same for --with-ssl.
| 383066 [cmdjackryan@] Phillip Gawlowski
| 383069 [mail@ma sh .] irb(main):001:0> require 'httpclient'
+ 383061 [brabuhr@gm i] Indeed :-)
| 383063 [mail@ma sh .] maasha@maxwell:~/Install/src/ruby-1.9.2-p180$ dpkg -l | grep libssl
| 383070 [brabuhr@gm i] Debian package: apt-get install libopenssl-ruby1.9
| 383073 [brabuhr@gm i] (Though I thought this step was no longer necessary?)
| 383074 [mail@ma sh .] I tested with the precompiled libopenssl-ruby1.9.1 and the precompiled
| + 383076 [cmdjackryan@] It grabs source code for Ruby implementations, and compiles it.
| | 383079 [lmetcalfe@co] I've used this link for installing RVM on Ubuntu, it's very well-written
| | 383082 [mail@ma sh .] I think, that I want to get my ruby working the "old fashioned" way
| + 383090 [brabuhr@gm i] x86_64, all of ruby and ssl and ssl-dev are x86_64?
+ 383188 [b.candler@po] Just one thing to check: you don't happen to have a file called
  383199 [mail@ma sh .] aaaaaaargh!
  383200 [mail@ma sh .] OK, this comes down to my code being badly organized. I will get right