398107-398453 subjects 398504-403783

Re: Digest Articles 398257-398298 (1/1) (ruby-talk ML)
398310 [gregorydavid] help
398414 [elihu5991@gm] What is this?

Binary Heaps in the Context of Prioritization
398316 [lists@ru y- ] What could be improved? What is bad? Was this post somehow interesting

Variable in string in array
398324 [lists@ru y- ] Anybody know how to embed a #{} in a string and then place the string in
+ 398325 [paul.brennan] Simply array =['An #{age} year old...']
| 398326 [matma.rex@gm] Not with single quotes.
+ 398327 [alexg@ru ge ] The code snippet you post is correct, so whatever exception TextMate is
+ 398328 [shortcutter@] If the error originated in that line it can only be caused by invoking
| 398330 [lists@ru y- ] /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:15
| 398336 [shortcutter@] Please trim your quotes.  Thank you!
| 398399 [lists@ru y- ] Is it possible to pass elements in an array (eg 20,50 ) to the function
| 398423 [shortcutter@] Yes, exactly like that.
+ 398335 [lists@ru y- ] Posted by Dave Castellano (dcastellano1) on 2012-08-15 18:07

Eval without eval?
398329 [lists@ru y- ] Can anyone explain how "Proc.new{}" (String) could be converted into
+ 398338 [lists@ru y- ] if str == "Proc.new{}"
| 398339 [theadventmas] It depends on what you need.  Eval is very powerful, but any time you
+ 398340 [ryand-ruby@z] If you have the string, ruby_parser is probably your best bet.=20
  398353 [lists@ru y- ] I found the question to be unclear to the point of senseless.
  398354 [ryand-ruby@z] Then. Don't. Answer.

Print method
398331 [lists@ru y- ] obvious, but I'm too thickheaded to figure it out, so here goes...
+ 398332 [thiagown@gm ] Because print is not a object from the String class. So I'm going to do
| + 398333 [thiagown@gm ] Woops, typo.
| + 398334 [echristopher] No; it's a method from Object (mixed in from Kernel, I believe). It's
|   398337 [lists@ru y- ] The OO conundrum again - function acting on two objects, which object
+ 398356 [hmaddocks@me] I know it's a common example in OOD text books, that an object has a print method (or draw or display), but that design is wrong.
| 398358 [tony.arcieri] Oh has it now?
+ 398401 [lists@ru y- ] Thanks for responding. I'll have to think it over before really grasping
| 398408 [lists@ru y- ] With polymorphism you probably mean that the method acts differently
+ 398402 [lists@ru y- ] So initially I said that Thiago Massa's class String extension worked,
  398407 [sto.mar@we .] Of course, since there is no print method in the Fixnum class.

string processing
398341 [lists@ru y- ] i am trying to automate cacti graph
+ 398342 [eliezer@ng e] a regular expression match of a number can match like that
+ 398343 [lists@ru y- ] I am very new to ruby
| 398348 [eliezer@ng e] this output should be a string and is not enumerable so you can use each
| 398351 [lists@ru y- ] this works perfec
+ 398344 [lists@ru y- ] syntax help would be really appreciate
| 398346 [peterhickman] You need to also make sure that you get the right line, not just pick
| + 398347 [shortcutter@] Alternatively
| + 398349 [lists@ru y- ] but there is a problem , I have modified this as bellow
|   398352 [lists@ru y- ] device_id = nil
+ 398350 [lists@ru y- ] #!/usr/bin/ruby

Senior RoR person required in West Africa
398345 [lists@ru y- ] Mobile Money and financial space is booming in Africa and we are looking

gem install ruby-debug-ide failure
398355 [lists@ru y- ] I'm trying to install the ruby-debug-ide but it is failing.
398357 [hassan.schro] Hmmm.

watir wait.until
398359 [lists@ru y- ] Posted via http://www.ruby-forum.com/.
398360 [ryand-ruby@z] What does `ri Watir::Wait.until` say?
398363 [lists@ru y- ] Great but whats 'ri'?
398364 [ml@co va es ] True. That's why we're here!

Why is assert_match deprecated and not assert_no_match?
398361 [lists@ru y- ] I have found assert_match useful in the past, but have noticed that it
+ 398393 [ryand-ruby@z] what test framework? what version?
| 398404 [lists@ru y- ] Posted via http://www.ruby-forum.com/.
| 398410 [ryand-ruby@z] it
| 398411 [lists@ru y- ] I've just had more of a play. You're right, its not deprecated. It just
| 398440 [ryand-ruby@z] just=20
+ 398396 [sduncan@we a] Can't comment on why it is deprecated, but it seems like you could
  398405 [lists@ru y- ] Yes. I can do assert(pattern =~ text)

case vs if-else
398362 [lists@ru y- ] Which one is faster?
+ 398365 [shortcutter@] Measure it.  There is Benchmark.
| 398375 [lists@ru y- ] means? what measure? and who'll measure?
| 398376 [shortcutter@] You want to know which one is faster so you'll measure it.
+ 398370 [lists@ru y- ] Dude, does it really matter if one variant is some microseconds faster
| + 398371 [elihu5991@gm] What is with Ruby being slow?
| | 398374 [lists@ru y- ] Compared to a native program written in a low level language like C,
| + 398372 [jonanscheffl] Could have been stated a little more politely but he's right. If you find
+ 398378 [lists@ru y- ] It looks like you're made for each other. :-D
| 398380 [shortcutter@] Hey, don't uncover our little secret!  Darn...
+ 398381 [lists@ru y- ] a="x"
  + 398412 [elihu5991@gm] So then what is the point of ruby if it's just for human-readability? Isn't
  | + 398413 [matma.rex@gm] That's precisely the point. Fast to write, easy to read.
  | | + 398421 [sto.mar@we .] and thus also easier to debug.
  | | + 398450 [cmdicely@gm ] And fast-to-write also means that it is quicker to get working code,
  | + 398415 [lists@ru y- ] What? Don't you think that there should be different languages for
  | + 398428 [rubytalk2dav] Ruby does indeed have excellent *functionality*, what with
  + 398464 [charleshixsn] Looks like you've found a "case" where case is better than if.  Not too
    398470 [shortcutter@] +2
    398474 [shortcutter@] The situation is not that bad.  For example, we know that - from a

extending class, namespace question
398366 [lists@ru y- ] class Fixnum
+ 398367 [jgabrielygal] When you say
+ 398368 [lists@ru y- ] A Ruby integer is always an instance of the built-in classes ::Fixnum or
| 398445 [lists@ru y- ] I think that's exactly what the proposed ruby 2.0 "refinements" are
+ 398369 [shortcutter@] Yes.  And with that you have exactly nailed one of the major reasons
+ 398391 [lists@ru y- ] Thanx for your answers!
  398395 [lists@ru y- ] Yes, yes and yes. ;-)
  398417 [lists@ru y- ] These guys could make a living extending built-in classes. :)
  398442 [hmaddocks@me] As with everything in life, it's fine to extend built in classes as long as you're aware of the potential problems.

Manipulating functions-runtime
398373 [lists@ru y- ] suppose
+ 398377 [lists@ru y- ] def hello_world
+ 398379 [shortcutter@] You can do

Methods with same name and parameters in a single class.
398382 [lists@ru y- ] I saw a sample code of Ruby where in a class can have two methods with
+ 398383 [echristopher] Any time a method is defined, it overrides any previous definition of
+ 398384 [lists@ru y- ] So this means there is no versioning but overriding of the previous one.
| 398392 [echristopher] Right.
+ 398461 [josh.cheek@g] Subclass it, then override it. If you want to call the original, invoke

A Ruby class is never closed
398385 [lists@ru y- ] Is it true that a Ruby class definition is never closed? Even after
+ 398386 [lists@ru y- ] That's generally true. You can reopen a class at any time (even the
+ 398387 [lists@ru y- ] How to unfreeze it again?
| 398390 [tony.arcieri] A = A.dup
+ 398388 [lists@ru y- ] This means I can add a method anytime and anywhere in the project? Is
+ 398389 [lists@ru y- ] What you do mean? A sealed class like in C# which doesn't allow
| + 398394 [whitequark@w] For the singleton pattern, there are singleton methods in standard
| + 398462 [josh.cheek@g] I can't think of any reason you would want to do this, but I don't think
+ 398397 [lists@ru y- ] You can do that, but why would you want to?
+ 398576 [lists@ru y- ] I think he basically wants to have a class that can never ever again be
  398602 [shortcutter@] In what ways can you still change a frozen class?
  398603 [ryand-ruby@z] On Aug 27, 2012, at 01:47 , Robert Klemme <shortcutter@googlemail.com> =
  398604 [shortcutter@] The constant reassignment will prompt a warning.
  398617 [ryand-ruby@z] On Aug 27, 2012, at 02:25 , Robert Klemme <shortcutter@googlemail.com> =
  398619 [shortcutter@] Please read again: Marc talked about a class which can never be
  398621 [ryand-ruby@z] gem install change_class
  398624 [josh@jo hr n] class Foo
  398625 [matthew@ke w] Almost.

:symbol vs CONSTANT choice
398398 [charleshixsn] I have a list of about 12 items that I wish to repeatedly store as part
398429 [shortcutter@] There are some approaches to do enums in Ruby out there, e.g.
398463 [charleshixsn] Thanks.  I pulled two versions of enum out of those links, that look

variable from array to function to array
398400 [lists@ru y- ] anyone know if it is possible to pass elements from an array (eg 20,50 )
+ 398403 [jgabrielygal] puts array[0][number_range(array[1], array[2])]
+ 398406 [sto.mar@we .] This will never return max!
  398418 [lists@ru y- ] The bigger picture...  I am saving multiple question templates in a
  + 398424 [sto.mar@we .] Ok... :)
  | 398443 [sto.mar@we .] Here an improved version that allows you to use an arbitrary,
  + 398441 [sean.ohalpin] puts "Hello %{who}" % { :who => "world" }
    398444 [sto.mar@we .] Nice, thanks!

inplace_edit displayed twice
398409 [lists@ru y- ] config.columns[:priority].inplace_edit = true

Main thread blocking spawns
398416 [lists@ru y- ] I came to know about the reason of my program's doing nothing was that

Watir WebDriver-page load complete
398419 [lists@ru y- ] Using Watir WebDriver how to ensure that after clicking a link/button
+ 398946 [lists@ru y- ] You need to look for an element which is only present once the load is
+ 399051 [lists@ru y- ] For most web pages, watir-webdriver's wait is implicit, so it should

Debugging failed Ruby Gem require
398420 [lists@ru y- ] I'm trying to debug why my Ruby installation cannot find gems even
+ 398422 [jam@ja an be] 1. That's a damn old version of rubygems. Try executing gem update to
+ 398465 [charleshixsn] Do you have more than one ruby installation?  I've got three (the system
+ 398525 [lists@ru y- ] thanks for the replies.  Updating the gem version and re-installing has

Connection refused.again
398425 [lists@ru y- ] i have a very stubborn error coming up every time: Connection refused.
398426 [shortcutter@] Unlikely as long as you do not disclose any details about what you are
398430 [lists@ru y- ] I am very sorry, i totally forgot it.
398431 [shortcutter@] Well, if you comment the condition around the raise then of course
398439 [lists@ru y- ] Unfortunately not. If it would work by removing the comments, or by

install redmine on sun sparc solaris 10
398427 [lists@ru y- ] We need to install redmine 2.0.3

Default parameters? + (Noob) Guidance
398432 [lists@ru y- ] 1) working on the RubyMonk.com primer.
+ 398433 [shortcutter@] Welcome to the wonderful world of Ruby!
| 398434 [lists@ru y- ] Thanks so much Robert! Gotcha. The issue I'm confused with is accounting
| 398435 [sto.mar@we .] No, that does not work. Did you try it?
| 398437 [lists@ru y- ] Thanks. Yes, I had tried it. I knew it did not work.
+ 398436 [rubytalk2dav] Perhaps your Google-fu needs some strengthening.  What search string
  398438 [lists@ru y- ] I concur.

[ANN] Rainbows! 4.4.0 - Rack server for the sleepy
398446 [normalperson] Rainbows! is an HTTP server for sleepy Rack applications.  It is based on

accessing protected or private methods from class methods
398447 [lists@ru y- ] There is all kinds of information out there on Ruby method visibility
+ 398448 [lists@ru y- ] What does this have to do with the new method? Your problem is obviously
| 398449 [lists@ru y- ] You are quite right - my initial post was confusing in that regard. The
| 398452 [cmdicely@gm ] In a sense what you are asking for is self-contradictory in Ruby -- a class is
| 398454 [lists@ru y- ] I disagree that this is self-contradictory in Ruby. I understand that
| 398481 [shortcutter@] It (i.e. the class) is external from the perspective of the instance.
+ 398451 [lists@ru y- ] In your case the code from the configure method should be in the

tlv\btree data structure + Berkeley DB.
398455 [eliezer@ng e] I am using blacklist of SquidGuard for content filtering.

Access returned value in a string?
398456 [lists@ru y- ] Can  I access the returned value in a string?
+ 398457 [ssmmcc1@gm i] Why don't you set a variable as
+ 398458 [ssmmcc1@gm i] Additionally you could do something like
| + 398459 [lists@ru y- ] Tried that...
| | + 398460 [wybo@xs al .] u,v,p=nil
| | | 398467 [sto.mar@we .] How would that help???
| | | 398468 [wybo@xs al .] Sorry, I misunderstood the question - your answer was a lot better!
| | + 398466 [sto.mar@we .] They are the values of the last assignment to u and v.
| + 398565 [lists@ru y- ] If you have not been using Ruby for a long time, you should probably
+ 398566 [lists@ru y- ] questions = [

TCPserver how to signal EOT
398469 [lists@ru y- ] figuring out how to break on EOT. I was sending an ASCII control
+ 398477 [shortcutter@] Then it probably blocks.
+ 398478 [lists@ru y- ] information. Here is what I am using right now, it seems to be working
  398480 [shortcutter@] This is a completely different approach: you do not use a termination
  398488 [lists@ru y- ] So that it can be passed to the get_reply method if the client expects a
  398489 [shortcutter@] Aha.  The issue with that is that you can read only with one thread at
  398492 [lists@ru y- ] Please correct me if I am wrong, but shouldn't there be no problem as
  398493 [shortcutter@] Right you are.  But this is a quite inefficient approach IMHO: you

IRB doesn't work in command line
398471 [lists@ru y- ] I've installed Ruby 1.93 in my windows 7 PC using Ruby 1.9.3-p194 one
+ 398472 [lists@ru y- ] Does it work from the Run command?
+ 398473 [ryand-ruby@z] That says pretty much everything you need to know. Your $HOME =

How to get the minitest capture_io method found in my specs?
398475 [lists@ru y- ] require 'minitest/autorun'
398476 [ryand-ruby@z] This isn't necessary. In fact, you only need the autorun and launcher =
398479 [lists@ru y- ] Well, it works when I run the spec via `ruby spec/...`.
398487 [ryand-ruby@z] Fixed and released! Thanks!

RPG online game
398482 [lists@ru y- ] I have a couple of years programming "for fun" and most I know is java,
+ 398485 [lists@ru y- ] Well, I'm not pretty sure but seems that you can't create a "web
| 398486 [echristopher] There's also Chingu, built on top of Gosu.
+ 398494 [lists@ru y- ] thanks a lot for your responses, I will try something with gosu!
+ 398495 [lists@ru y- ] VX Ace has a cooler scripted engine (i mean the default scripts)

[ANN] hoe 3.0.8 Released
398483 [ryand-ruby@z] hoe version 3.0.8 has been released!

[ANN] ruby_parser 3.0.0.a6 Released
398484 [ryand-ruby@z] ruby_parser version 3.0.0.a6 has been released!

How to use openssl with TCPSocket
398490 [lists@ru y- ] irc = TCPSocket.open(@server_name, @port)
398503 [lists@ru y- ] Are you connecting on a different port? Otherwise the server doesn't

Strange line feed behavior with ping command.
398491 [lists@ru y- ] While testing ruby to execute external commands, i'm having a strange
398500 [shortcutter@] This likely has to do with Windows programs using \r\n as line

[ANN] zenweb 3.0.0.b5 Released
398497 [ryand-ruby@z] zenweb version 3.0.0.b5 has been released!

A Ruby Book (free to use)
398498 [lists@ru y- ] Download it from here http://is.gd/r2012
+ 398499 [ml@co va es ] Thanks for the effort and for supplying an entire book for free. Is it possible to have .mobi and/or .epub versions?
+ 398501 [ralf.mueller] Thanks for sharing your work and esp. for the lovely "Math Discovery" at p. 162
| 398502 [shortcutter@] It is well known for a long time that you can prove anything if you
| 398606 [ralf.mueller] Sure, it hasn't. You can proof everything out of something wrong, e.g. my math teacher proofed that he is the
+ 398514 [echristopher] Thanks so much! I haven't had time to look at most of it, but I notice
| + 398515 [ac.ruby59@gm] Thanks for this book !
| + 398607 [lists@ru y- ] To avoid this problem, use this file
+ 398569 [sto.mar@we .] Though appreciating the effort that was put into this,
  398608 [lists@ru y- ] OK, fixed the bug on page 32, but others.... I think that's OK. Thanks,