399263-400301

399027-411244 subjects 399454-410909

[ANN] RubyFrontier 1.1 Released
399263 [matt@ti bi s] RubyFrontier 1.1 puts its foot into strange waters by attempting to be

inject is pathetic?
399265 [rubytalk2dav] What do you mean by that?
399275 [matt@ti bi s] He probably just doesn't grasp how fundamental it is. After all, no one
+ 399276 [zhiqiang.lei] Agree. #inject is essential for Array.
+ 399288 [josh.cheek@g] I disagree. Nearly everything you want to use inject for, each_with_object
  + 399289 [botpena@gm i] but josh, isn't that because of String#+  ?
  | 399291 [josh.cheek@g] Yes
  + 399315 [lists@ru y- ] Correct, in ruby, because ruby isn't optimised for funtional use.
    399359 [zhiqiang.lei] ...
    399362 [matthew@ke w] I strongly doubt it, there's too much OO in the core for the language
    399371 [tony.arcieri] FP and OO are not orthogonal. Perhaps the word you were looking for was

\b not working?
399269 [lists@ru y- ] j=0
+ 399270 [matthew@ke w] In short: it depends where you're printing it.
| 399271 [lists@ru y- ] Thanks for your reply!
| 399272 [matthew@ke w] I'm afraid it doesn't help me, since I'm not a Mac user.  From what I
| 399273 [lists@ru y- ] Eek - thanks so much for your time, Matthew - appreciate it!
| 399274 [hassan.schro] No idea what Aptana has to do with it but it works fine in a Mac (10.7.4)
+ 399292 [lists@ru y- ] Have you tried looking into these differences?
+ 399314 [lists@ru y- ] $ ruby -e 'puts "X\bY"'
  399645 [lists@ru y- ] Any others that can help with this? I'm running RubyMine on Mac and
  399679 [echristopher] All I know is that the terminal emulators built into editors and IDEs

[ANN] simple_gui_creator 0.2.0 released
399280 [lists@ru y- ] simple_gui_creator is a tool designed to make integrating a GUI front

want to get string between specialchars at endof the string
399283 [lists@ru y- ] I have string like
+ 399284 [lists@ru y- ] "tes<tr>ubyrails  <test@gmail.com>".split(" <").each do |el| puts
| 399286 [shortcutter@] Like
| 399287 [shortcutter@] irb(main):005:0> if %r{\A(.*?)\s+<(.*?)>\z} =~ s then front=$1;
+ 399310 [lists@ru y- ] str = "tes<tr>ubyrails  <test@gmail.com>"

Problem with RDoc cross-compiling for SH4
399290 [lists@ru y- ] I'm trying to cross-compile last Ruby stable version (1.9.3-p194) for a
399308 [ryand-ruby@z] You're raising in operating_system.rb, which is normally empty and used by O=

Ruby on Ubuntu 12.04 LST
399293 [lists@ru y- ] I just finished with tutorials from TheNewBoston so I have some
+ 399294 [kisharvind@g] Bojan,
| 399295 [krishna@ar d] Try Sublime Text 2: http://www.sublimetext.com/2
| + 399296 [richard.conr] As the Ruby IDEs go, IntelliJ comes out pretty good (Redmine?) among people
| | 399297 [ivan.bisevac] I tried RubyMine and it's great but it's not free (there is 30 days trail).
| + 399333 [ml@co va es ] ...
|   399335 [krishna@ar d] No. TextMate doesn't build on Linux, though this *may* change eventually
+ 399300 [lists@ru y- ] I have problem when I try install SublimeText 2.0.1
| + 399302 [krishna@ar d] Regards,
| + 399303 [sto.mar@we .] According to the error message, the `mv' command does not find
| + 399309 [ryand-ruby@z] Spaces vs underscores
+ 399342 [lists@ru y- ] Hei.
+ 399419 [lists@ru y- ] I use NetBeans 7.1 with rails plugin at home (Ubuntu 10.04) and at work

wow, YAML / Psych in 1.9.3 is *slow*!
399298 [matt@ti bi s] I just started trying Ruby 1.9.3, coming from Ruby 1.8.7, and was
+ 399305 [ryand-ruby@z] File. A. Bug.
| 399317 [matt@ti bi s] With? Whom?
| + 399320 [jam@ja an be] The psych devs.
| | 399339 [matt@ti bi s] I think the question is a reasonable one. Who is to "blame" in a case
| | 399341 [jam@ja an be] Where is the performance problem? File the issue there.
| | 399357 [matt@ti bi s] In the end I filed in two places: Psych on github, and Ruby itself.
| | 399510 [tony.arcieri] You do realize Syck is completely broken and unmaintained, right?
| + 399321 [ryand-ruby@z] Given that you've now blogged about psych and cited its source... I'm =
+ 399508 [lists@ru y- ] Wow indeed! With a test app with some of my data (having to load 820
  399530 [whitequark@w] Yes; namely, not being compatible with YAML specification.
  399531 [lists@ru y- ] So then what can be done to improve the speed of the 'correct' YAML library?  The difference is to put it mildly, significant.  :(

Rspec for thor script
399301 [lists@ru y- ] How should we write rspecs for thor tasks.

Ruby 1.9.3 and OS X Mountain Lion
399304 [sto.mar@we .] I am using Ruby in an introductory computer science class in Highschool.
+ 399306 [ryand-ruby@z] Don't bother uninstalling. It'll just come back in updates.mapple leaves /us=
| 399311 [sto.mar@we .] Thanks Ryan and Wayne.
| 399312 [ryand-ruby@z] gems work without additional adjustments?
| 399313 [jos@ca no k.] Jos
+ 399307 [wbrisett@at ] As a Mac OS X user, and fairly novice Ruby scripter, I would recommend leaving
+ 399318 [matt@ti bi s] It happens that I just did this (install 1.9.3 on Snow Leopard and
| 399323 [ryand-ruby@z] I disagree with this route. As you can see, homebrew makes things =
| + 399338 [hutch-lists@] more complex as well as error prone?
| | 399364 [lists@ru y- ] Homebrew installs stuff under /usr/local/Cellar/<pkg>/<version>/ and
| + 399340 [matt@ti bi s] I see no error prone-ness. I've now done this on four different Mac OS X
|   399356 [matt@ti bi s] Actually the rbenv way is even more boom-done. Once he's done the
+ 399373 [sto.mar@we .] Are all the various options free (as in "free beer")?
| 399384 [ryand-ruby@z] yes, xcode is free. everything mentioned (iirc) is free.
+ 400300 [sto.mar@we .] I did not recommend it but the student absolutely wanted to try RVM.
  400301 [alec.taylor6] Using OSX Mountain Lion, used brew install to get latest ruby, the

using erb to generate a file
399324 [devguy.ca@gm] Hey guys I am generating a file using erb and an input template file.
399325 [devguy.ca@gm] OK I tried the following in IRB and I get the same type of error?
399326 [devguy.ca@gm] OK it seems, for things to work I need to pass in 'binding' and make
399366 [lists@ru y- ] That's correct. Without a Binding object the result() method cannot

how to write a array into a string
399327 [lists@ru y- ] I have a array, this is a information queue,I want to send it as the
+ 399328 [lists@ru y- ] arr = ['a', 'b', 'c']
| 399330 [lists@ru y- ] Posted via http://www.ruby-forum.com/.
+ 399329 [lists@ru y- ] arr = ['a', 'b', 'c']
+ 399331 [lists@ru y- ] cool, it works, thanks for your help!

Nokogiri problem
399332 [lists@ru y- ] I am using Nokogiri to validate a large XML file (more than 300,000
+ 399336 [krishna@ar d] Apparently, it is a problem with libxml, not nokogiri. There is an
+ 399337 [lists@ru y- ] Thanks a lot!

Class variables or Class singleton variables?
399343 [lists@ru y- ] Guys, how are you?
399358 [josh.cheek@g] The instance variable solution is better, I advocate never using class
399361 [lists@ru y- ] Agree with you as with Jan.
399363 [josh.cheek@g] No, I'm saying don't do this. You can count dog legs since that's a single
399370 [lists@ru y- ] Well but I don't see another way of keep track of the objects which
+ 399374 [hmaddocks@me] On 17/09/2012, at 3:41 AM, "Dami=E1n M. Gonz=E1lez" =
+ 399375 [josh.cheek@g] Yeah, I would not do this. If you want to keep track of them, then
  399378 [lists@ru y- ] Woah, I had never thought this way...

Re: Class variables or class singleton variables?
399344 [lists@ru y- ] You should definitely use class instance variables. The only situation
399345 [lists@ru y- ] Are we aren't talking about the same thing?
399346 [lists@ru y- ] irb(main):022:0> class << Foo
+ 399347 [lists@ru y- ] I don't get what you mean. The singleton class of a class is obviously
| 399349 [lists@ru y- ] Yes. What I did was stupid, but I realized late to edit it.
| 399350 [lists@ru y- ] Exactly. And the singleton class can also have its own methods and constants. In fact, the only relation to the original class is that the instance methods of the singleton class are the singleton methods of the original class (and vice versa). Apart from that it's a completely separate class.
| 399351 [lists@ru y- ] Well this is amazing, I've tried to understand what you say, you mean
| 399352 [lists@ru y- ] class Foo
| 399353 [lists@ru y- ] Yes, those code snippets all do the same (the second one requires the class to already exist, however).
+ 399348 [lists@ru y- ] @some_var = 10

"Anonymous classes or modules", what are? (Marshaling)
399354 [lists@ru y- ] I'm trying to find out if is possible to serialize a class object, with
399355 [whitequark@w] Ruby does not support serializing code. At all. If you serialize
399368 [lists@ru y- ] Is not code what I'm trying to serialize just the state of a class, of

[ANN] kramdown 0.14.0
399360 [t_leitner@gm] ## About kramdown

Re: "Anonymous classes or modules", what they are? (Marshaling)
399365 [lists@ru y- ] Here are examples of each of these in turn, presented as a member of a vanilla Hash object. They all fail.
399367 [lists@ru y- ] Can you give me a short example?
399415 [lists@ru y- ] class Factory
399428 [lists@ru y- ] Correct me if I'm wrong: the only way that I see to save the state of a

Ruby, AI, Chatbots, Semantic Avatars and memory (persistence?)
399369 [phil@pr co .] People,
399372 [peterhickman] There are a number of chatbots in Ruby out there but after I looked at
399376 [phil@pr co .] Peter,
399385 [peterhickman] I have considered persistence but have been sidetracked with getting

send batch files to FTP server, got Permission denied error message
399382 [lists@ru y- ] Dear all,
399426 [lists@ru y- ] ftp.puttextfile(local_file, remotefile = File.basename(f))

Ruby - is it worth the effort?
399386 [neomex@on t.] I've been browsing web few last days, researching ruby vs. stuff, but I
+ 399388 [lists@ru y- ] imo you could do everything possible in python in ruby too
| 399389 [elihu5991@gm] It's all good and well that it can, yet about its effective and efficiency?
+ 399390 [marco-oweber] Search existing games - have a look at what languages they are using.
+ 399391 [lists@ru y- ] I find very fun making games with gosu-ruby. It's a framework to build
+ 399406 [lists@ru y- ] Unfortunately with Ruby for me it's typically "fun and fast development"
| + 399409 [whitequark@w] I want to note that there isn't a general measure for slowness. Is it
| | 399491 [shortcutter@] Right.  Unfortunately too often these types of requirements are
| | 399492 [peterhickman] Being a Ruby shop we try to use Ruby everywhere but when it does come
| | + 399494 [elihu5991@gm] That's what it comes down to ... right tool for right job.
| | + 399495 [shortcutter@] Was that 1.8.* or did you try that with 1.9.* MRI?  What kind of
| | | 399496 [carlos.agari] I'd like to know, too. I stumbled upon a similar problem, but it was long
| | | 399497 [peterhickman] Ok here is a quick test that I hacked up. The data is a 2,659,800 line
| | | 399498 [shortcutter@] Let's see: that are 252 chars per line on average.
| | | 399499 [shortcutter@] $ cat ruby-8.rb
| | + 399500 [lists@ru y- ] might be useful, if it ends up being regex's that are the slowdown :)
| |   399501 [shortcutter@] Interesting.  Thank you for the pointer!  Too bad it does not support
| + 399410 [matma.rex@gm] That's got little to do with Ruby and a lot with the bloated, overkill
+ 399411 [lists@ru y- ] "Some people prefer python more, but it kinda comes down to personal

yard-rubicle 0.1.1 released (related by Rubicle, the unofficial Ruby mascot)?=
399387 [info@ru ic e] We have released yard-rubicle gem as a part of support activity for Rubicle,

Finalizer in the GC
399392 [lists@ru y- ] Why does GC uses finalizer in the sweep phase? Also what is the
+ 399401 [whitequark@w] Judging from my telepathic abilities, you are talking about
+ 399408 [lists@ru y- ] I think historically it allowed to run finalizers "later" i.e. "after GC

Inline Assembly / Inline C
399396 [neomex@on t.] Is it possible to use inline C or Assembly in Ruby?
399397 [whitequark@w] Using inline assembly on platforms where Ruby runs doesn't
399399 [neomex@on t.] Wouldn't it improve performance in tasks such as image editions, where
+ 399403 [whitequark@w] Basically there are two kinds of operations which require stepping
+ 399404 [matma.rex@gm] Not really. Compilers are smarter than us these days; they can
  399422 [lists@ru y- ] void add_numbers(int* a, int* b, int* results, unsigned count) {

Dir.mktmpdir doesn't remove it at exit?
399398 [lists@ru y- ] I would have expected that creating a "temporary dir" would be deleted
+ 399402 [matma.rex@gm] "If a block is given, it is yielded with the path of the directory.
+ 399405 [lists@ru y- ] so in your opinion *should* it remove the "temp dir" at exit, or not?
| 399407 [tony.arcieri] You need both options. The block form gives you automatic cleanup (as the
+ 399412 [lists@ru y- ] Hmmm. IMO, the behaviour should be consistent, and not depend on whether
  399417 [tony.arcieri] Many methods in Ruby which deal with external resources
  399420 [lists@ru y- ] It also closes file descriptors "at_exit" for you, which is what I
  399424 [whitequark@w] Unixen don't allow removal of non-empty directories as well.

Job - Red 5 Studios (ex WoW Developers) Ruby Developer
399416 [lists@ru y- ] Description

Encoding question
399421 [lists@ru y- ] I am new to ruby and play around with it a little bit at the moment. I
+ 399423 [nbeyer@gm il] In the code example you used, there's no external encoding being
| 399541 [lists@ru y- ] That is correct.
| + 399542 [lists@ru y- ] I meant to say ISO-8859-1 not UTF-8 there.
| + 399571 [nbeyer@gm il] Indeed ...
|   399589 [lists@ru y- ] The letter "c" has not been transcoded. It happens to be the same in
|   + 399590 [lists@ru y- ] I meant the letter "h" and the byte 0x68. Too tired.
|   + 399615 [nbeyer@gm il] I'm aware of the implementation details of Ruby 1.9's String. What
|     399619 [lists@ru y- ] Ah, well that's an open-ended question. Ruby's standard library is very large, and none of the encoding-related behaviour is documented. But File.open / getc are pretty fundamental to encoding behaviour.
|     399622 [nbeyer@gm il] I think we're talking about different things now. What I was testing
|     399632 [lists@ru y- ] That's correct. Sorry my brain has not been working 100% for my
+ 399437 [lists@ru y- ] Thanks for your help. It is a bit a try and error thing! This worked for
| + 399483 [nbeyer@gm il] If it's an upload via HTTP, you might get lucky and get a 'charset' in
| + 399568 [fxn@ha hr f.] I don't know yet, how to determine the encoding of those uploaded
+ 399440 [lists@ru y- ] File.foreach("somefile.txt",mode: "r:iso-8859-1:utf-8") do
+ 399470 [lists@ru y- ] Well, imagine you are interviewing for a job as a translator.  The
+ 399489 [lists@ru y- ] Thank you all for your helpful hints and comments!

LoadLibrary & GetProcAddress Problem
399427 [lists@ru y- ] I'm new to Ruby and i have been trying to get this piece of code to call
+ 399474 [lists@ru y- ] Why you don't directly define MessageBox usign Win32API instead of using
+ 399487 [lists@ru y- ] Thank you so much for the help Mr. Lavena. You are right, I should've

Teaching a Class on Ruby
399436 [keystonelemu] Hey guys, I'm new to the list. I'm a Student Rubyist/Unix Hacker out of
+ 399453 [elihu5991@gm] This sounds very good. Do pursue to the end!
+ 399473 [ryand-ruby@z] On Sep 17, 2012, at 23:41 , Brandon Weaver <keystonelemur@gmail.com> =
| 399480 [carlos.agari] Brandon, nice job. I'm trying to teach Ruby to a friend of mine and would
| 399481 [keystonelemu] - On Tue, Sep 18, 2012 at 5:55 PM, Carlos Agarie <carlos.agarie@gmail.co=
+ 399482 [josh.cheek@g] I taught some friends Ruby. All the material is open source

Ruby Postgres driver (pg) and case sensitivity
399438 [lists@ru y- ] I am playing around with ruby and postgres. Postgresql is usually cAsE
+ 399442 [shortcutter@] It is common with SQL databases that table names given are case insensitive.
+ 399457 [lists@ru y- ] Well the postgres server is not the problem, I use pgAdmin with its ISQL
  399461 [shortcutter@] I know.  I used psql to illustrate the point about case handling

Bug or feature
399441 [lists@ru y- ] There has probably been some discussion about this problem so sorry if I
+ 399443 [shortcutter@] Yes. #clone is just shallow copy.
| 399471 [lists@ru y- ] Why is real cloning not implemented in ruby, since this fake cloning can
| 399475 [shortcutter@] What do you mean - "real cloning"?  Shallow copy is as real as deep
| 399486 [lists@ru y- ] So there is a good reason not to implement object duplication (deep
| 399488 [shortcutter@] As I said elsewhere: I prefer custom logic tailored to the use case
| 399514 [lists@ru y- ] Your statement that Java does the same kind of cloning.
| 399537 [shortcutter@] Ah, OK.  Although I rather meant that the example of Java demonstrates
+ 399446 [lists@ru y- ] a.clone duplicate the object 'a' , but each elements of the array are
+ 399452 [lists@ru y- ] b = a.map(&:clone)
| 399463 [shortcutter@] Well, you can do
+ 399469 [lists@ru y- ] a = ['0']
+ 399555 [lists@ru y- ] dclone()

Class variables
399451 [neomex@on t.] Is it obligatory to use instance variables in classes? Can't we just
+ 399455 [jgabrielygal] This doesn't work. The keyword def starts a new scope, so the "var"
+ 399456 [lists@ru y- ] I think the main problem here is that you somehow try to apply the
| 399502 [lists@ru y- ] This is exactly the question that I also wanted to ask, being new to
| 399503 [ruby-talk@la] class Test
+ 399493 [shortcutter@] You can do that.  But it probably does not lead to the result you are
+ 399504 [lists@ru y- ] Thanks for the answer.
| 399509 [rob@ag le on] def suit
+ 399522 [lists@ru y- ] Meaby it is good for you to know that also exist: attr_reader and
+ 399525 [lists@ru y- ] class Dog
+ 399529 [lists@ru y- ] class Card
| 399552 [lists@ru y- ] I use them all the time !
+ 399553 [lists@ru y- ] Test is a standard Ruby Library module, and test() is an important
+ 399581 [lists@ru y- ] Thank you very much for all your replies.
  399587 [calvin.bornh] The @@ makes the variable a static-like variable as you know it from
  399591 [ruby-talk@la] class Foo
  399594 [calvin.bornh] Works too. If you just wanted to read the variable or perform actions
threads.html
top