402586-403068

402378-411517 subjects 402820-405470

(none)
402586 [paul.p.carey] ...

automated translation tool - possible or not
402588 [lists@ru y- ] I know I am way in over my head here, but still...
402593 [peterhickman] Well it does depend. Are you looking to take raw text from any source and
402597 [lists@ru y- ] Thank you very much.

How to run a ruby script
402592 [lists@ru y- ] class Dungeonapp
402594 [peterhickman] Well I took you code and pasted it into a file and went
402596 [lists@ru y- ] Thank you for that.
402601 [peterhickman] Well you could just place all the code between
+ 402637 [tamouse.list] As was recommended to me previously, I'd suggest looking at GLI and
| 402639 [lists@ru y- ] Ohk I got it Thank You !
+ 402638 [lists@ru y- ] Thank You I got it!

How to deactivate RubyGems?
402602 [transfire@gm] ...
402605 [flo@an er gr] ruby --disable-gems -S irb
402612 [transfire@gm] ...

DevKit [Was: Ruby-debug and Windows 7]
402604 [jrs.idx@nt w] Thanks for the info.
402970 [rogerdpack2@] failure message?

can't open new ruby program under "new" context menu
402609 [lists@ru y- ] I'm stuck on the new version at trying to do something very simple.
+ 402611 [lists@ru y- ] I do not understand what you are trying to click and create in Windows,
| 402617 [lee_veinot@y] ...
+ 402618 [lists@ru y- ] I just uninstalled what I had and reinstalled using the steps given in
  402645 [lists@ru y- ] I am very familiar with Windows, so I do understand right-clicking the
  402653 [lee_veinot@y] ...
  402655 [lists@ru y- ] ruby 'C:/RubyPrograms/MyFirstProgram/source_code.rb'
  402664 [lee_veinot@y] ...
  402666 [lists@ru y- ] Is not a trouble, see.. most of the programms will run and shut it down by themself, that's why you see a window popping up and closing instantly. If you want to see some prints or any result you have to sleep the programm, from time to time, to see what's happening, like this
  402672 [tamouse.list] I just want to respond to this part.

Map Windows drives with Ruby
402616 [lists@ru y- ] Have ruby scripts running on Windows and I'm having an issue with
402630 [lists@ru y- ] What happens when you double up the backslashes?

"unless" with Regex
402625 [lists@ru y- ] I have a series of folders in a directory that I am trying to read out
+ 402626 [lists@ru y- ] if year =~ /^\d{4}$/
+ 402628 [lists@ru y- ] That worked perfectly thank you....as a follow up, for some reason the
| 402640 [tamouse.list] Wondering if I understand this, wouldn't this give you what you want?
+ 402632 [lists@ru y- ] that "!=" is the wrong method. It's an inequality check (as you
+ 402635 [lists@ru y- ] Dir.foreach yields *one* name at a time to the block, so using a block

require "test/unit"
402642 [lists@ru y- ] When i run my script without require "test/unit" it runs well. But i
+ 402643 [lists@ru y- ] Did you saw the Ruby documentation? either test::unit and minitest are
+ 402667 [lists@ru y- ] Tanks for your reply, i have found below but it do not answer my question or I do not know how to read/use it.. :/
  402747 [lists@ru y- ] I'm kind of new to using test/unit ( and Ruby!  :)  ), but I was getting
  402749 [sto.mar@we .] Defining the class to be tested in the test file does not make
  402750 [lists@ru y- ] You're right, I should not have stated that in that way, but my main
  402755 [tamouse.list] There is a structure for building command-line applications that may
  + 402756 [me@da id wd ] ...
  | + 402757 [tamouse.list] That's davetron1000 :)
  | + 402758 [wbrisett@at ] ...
  + 402759 [lists@ru y- ] Posted by tamouse mailing lists (Guest) on 2013-01-05 03:22
    402771 [tamouse.list] There is much much more to programming that learning a bit of syntax.
    + 402772 [tamouse.list] and/or steering wheel, if you're not doing things with cattle.... :P
    + 402775 [sto.mar@we .] On the other hand, you can also get "lost" in a framework, especially
    | 402778 [lists@ru y- ] You know, for the longest time I keep telling myself I need to create
    + 402777 [lists@ru y- ] Thanks, but this isn't my first time at programming, just Ruby.  So, it
      402787 [tamouse.list] The beauty of free, anonymous advice is that you don't have to listen to it.

[ANN] Tork 19.2.0
402646 [sunaku@gm il] 1. Absorbs test execution overhead into a master process.

Thread.start(variables) do question
402647 [lists@ru y- ] So I have been looking at some code I inherited. I see two examples of
+ 402648 [lists@ru y- ] x = 10
+ 402652 [shortcutter@] See 7stud's examples.  It's not about objects but about scope of variables.
  402654 [matthew@ke w] So does that mean these are functionally identical?
  + 402657 [matthew@ke w] a = 1
  | + 402661 [shortcutter@] This race condition is what my example posted earlier demonstrates.
  | + 402662 [lists@ru y- ] What makes you think that?
  |   402663 [matthew@ke w] Experience in multithreaded environments. Without an explicit mutex or
  + 402658 [matma.rex@gm] There's another thing apart from the race conditions. These are mostly equivalent (except for what you've already said) only if there is no variable called `b` in the outer scope - if there was one, in your second example `b=a` will assign to it and change the value outside the thread. In the first case, the "outer" `b` will simple be inaccessible inside the thread, but its value outside the thread won't be changed.

Create interface to make binary tree program
402649 [lists@ru y- ] i want to make program about balanced binary tree, i want to make like
+ 402650 [alec.taylor6] It's a good idea to create a program like that; however you should
| 402659 [lists@ru y- ] ok i'll try to learn that ruby processing
+ 402651 [shortcutter@] What interface do you actually mean?  Are you talking about classes
| 402660 [lists@ru y- ] i mean Graphical User Interface...
+ 402656 [lists@ru y- ] Can't see the link, is broken..

Failed to allocate memory while I use multi-threads
402665 [lists@ru y- ] Dear all
402669 [shortcutter@] I can make a program crash for memory reasons in far less lines.

ruby make test error
402668 [devguy.ca@gm] After building ruby from source I got the following error with, "make test"
402670 [echristopher] # This test file concludes tests which point out known bugs.
402671 [tamouse.list] Kind of curious why KNOWNBUGS.rb would be included in the standard
402683 [devguy.ca@gm] Eric, thanks for pointing that out, this is something new which i have

Newbie question - gem documentation
402673 [jrs.idx@nt w] I am trying to understand how to find out how to use a gem that I have
+ 402674 [mtczerwinski] Here is a source code https://github.com/kiyoka/fuzzy-string-match and
+ 402675 [tamouse.list] Is the issue that you don't know how to call the methods (which the
  402676 [jrs.idx@nt w] Newbie question - gem documentation
  402677 [tamouse.list] Github is way beyond the scope of a single gem to describe.
  + 402679 [carlos.agari] John,
  + 402680 [jrs.idx@nt w] Newbie question - gem documentation
    402681 [carlos.agari] A "repo" is a repository. It's the place where your project is stored via

GServer in Ruby 2.0.0
402678 [joseph.leo3@] I'm working on updating a gem to be compatible with Ruby 2.0 and am
402744 [sean.ohalpin] I can confirm this is new behaviour in 2.0.0-preview2 - it also
402753 [joseph.leo3@] Wow, this is a really interesting (and effective) solution. Reading the

fuzzy-string-match [was: Newbie question - gem documentation]
402682 [jrs.idx@nt w] ...

Keep temporary files
402684 [lists@ru y- ] In a project I am working on, Tempfile objects are used. Fine, but I
+ 402687 [fluido@fl id] the reson for existence of that class is to make sure the files it
+ 402696 [lists@ru y- ] <a href="http://saadel.com " target="_blank"></a>
+ 402697 [lists@ru y- ] <p><a class="comment-url"
+ 402729 [shortcutter@] You just need to create a class with the same interface as Tempfile
+ 402835 [eule@sp ce c] You can use the extra argument to Tempfile#close to keep tempfiles

Run time error with multiple version of gems installed
402688 [lists@ru y- ] I have installed two versions of rake for different projects.
+ 402693 [matma.rex@gm] I'd have to see some of your code, but you probably have to add `gem 'rake', '0.9.2.2'` before `require 'rake'` somewhere. Otherwise Rubygems will assume you want the newest version available.
| 402694 [me@da id wd ] ...
+ 402695 [rubytalk2dav] Look into rvm or rbenv.  These can be used to manage gemsets so you

temporarily override a methode
402691 [lists@ru y- ] I'd like to do something like this (see below).
+ 402692 [lists@ru y- ] found a way
+ 402717 [lists@ru y- ] However, what you have written doesn't handle your desired case of
+ 402727 [lists@ru y- ] Under OSX my version worked too - but not under windows.
| 402743 [lists@ru y- ] I tried yours under OSX (10.7.5) and it didn't work, and I can't see how
+ 402745 [lists@ru y- ] You are right - I'm working with OSX 10.6.8 and develop my scripts in

Escaping SQL queries.
402698 [ken@jo s. rg] apostrophes, I'm acutely aware of how poorly things can go when SQL
402699 [matma.rex@gm] *The* way would be to use a good ORM so that it does all this for you (I personally recommend Sequel).
402700 [me@da id wd ] ...
402719 [justincollin] Whoa, there. First, `html_safe` does NOT escape anything or change the

[ANN] Rails 3.2.10, 3.1.9, and 3.0.18 have been released!
402701 [tenderlove@r] Rails versions 3.2.10, 3.1.9, and 3.0.18 have been released.  These releases contain an important security fix.  It is recommended that **all users upgrade immediately**.
402702 [tenderlove@r] Thanks for your patience!

How to uninstall particular ruby version
402705 [lists@ru y- ] I am using Ubuntu 11 and i have two versions of ruby 1.8.7 & 1.9.1
+ 402706 [tamouse.list] Are they rvm-managed versions?
| 402711 [lists@ru y- ] no..
| 402712 [matt@te hn r] run "sudo synaptic" and select the packages you want to remove?
| 402714 [tamouse.list] What he said.
+ 402708 [lists@ru y- ] Ubuntu is your prison.
+ 402718 [lists@ru y- ] If it's Ubuntu 11.04 then you are dead in the water anyway. You need

Require a ruby project to automatically include the modules in classes defined in the same .rb file
402707 [lists@ru y- ] I would like to know how I could save one line of code.
+ 402710 [dummey@gm il] Just random theorizing, but couldn't you, in the "required" hook access
+ 402728 [shortcutter@] Is it desirable?  Wouldn't the code be significantly harder to read?
+ 402735 [tamouse.list] Are you telling us that every class you've written writes output? This
+ 402738 [josh.cheek@g] O.o You have 3000 classes? I can't imagine such a project.
  402740 [shortcutter@] That's not overly large for a reasonable sized project I'd say.
  402741 [peterhickman] Seriously?
  402754 [tamouse.list] it begins to smell like Java....
  402763 [shortcutter@] Hehe.  Actually I had Java projects in mind.  I don't really have
  402768 [josh.cheek@g] Hmm, going to the root directory for my current work project, which has had
  402779 [tamouse.list] 10-15 people developing a year and a half, approximately: 1198

[ANN] MountainWest RubyConf 2013 CFP!
402709 [blowmage@gm ] has the reputation (well deserved, IMO) of being the premier ruby hacker's

rexml.elements.each vs 1.9.3 documentation for same
402713 [lists@ru y- ] doc = Document.new '<a><b/><c/><d/>sean<b/><c/><d/></a>'
402715 [kou@co mi ng] Thanks for your report.

Cross-platform gems / conditional loading of gems
402716 [Alex.Allmont] We use ruby as part of our development team tools for Windows and Mac machi=
402731 [transfire@gm] ...
402737 [me@da id wd ] ...

:@fudgeKittens, the use of ':' with '@'
402720 [dummey@gm il] I have run into some code that widely uses symbols with the '@' sign.
402721 [matma.rex@gm] Yes, :@enable creates a symbol for "@enable". This is the same as "@enable".to_sym, valid, and useful if you need to access instance variables of a class using instance_variable_get, as it takes a symbol argument.

Block given to Array::join
402722 [lists@ru y- ] I'm a newby in this Forum and in Ruby, but I want give my contribution.
+ 402723 [lists@ru y- ] x = 10
+ 402726 [shortcutter@] I am thinking that this version is in no way better than using #map
  402746 [lists@ru y- ] Not better. Only simpler...

Suggestions on parsing
402724 [wbrisett@at ] I'm looking for suggestions on how I might parse this data.=20
402725 [matma.rex@gm] For a very simple ugly solution, you could use a regex with lookahead.
402730 [wbrisett@at ] then use someVariable.split(" insFld(foldersTree,")
402733 [tamouse.list] Something like this?
402742 [wbrisett@at ] Thanks tamouse and Matma. In the end I cheated. While certainly not =

respond_to_missing?
402732 [transfire@gm] ...
+ 402734 [lists@ru y- ] "respond_to_missing?" makes "respond_to?" fit for dynamic methods
+ 402761 [sandor.szuec] The answer can be found at [1].
| 402762 [transfire@gm] ...
| 402798 [sandor.szuec] The difference of respond_to? and respond_to_missing? is that you can
+ 402781 [lists@ru y- ] How is that contradictory? Are you sure you got the return values of
  402796 [transfire@gm] ...

Literal notation for Pathnames
402736 [transfire@gm] ...
402739 [phasis@gm il] 2013/1/4 Intransition <transfire@gmail.com>

[ANN] JRuby 1.7.2 Released
402748 [tom.enebo@gm] The JRuby community is pleased to announce the release of JRuby 1.7.2

Ž╠Lithp - a Lisp in 27 lines of Ruby
402752 [lists@ru y- ] Posted via http://www.ruby-forum.com/.
402760 [lists@ru y- ] awesome.

Best practice for &&, ||, and, or
402764 [sto.mar@we .] I really would be interested in your thoughts about this
+ 402773 [calvin.bornh] I want to use a consistent style so I don't have to think about the
+ 402774 [lists@ru y- ] "Use &&/|| for boolean expressions, and/or for control flow. (Rule of
| 402776 [sto.mar@we .] Maybe(?) worth mentioning that the Github Ruby Styleguide, though based
| 402780 [lists@ru y- ] Good point, actually I think I nearly always use && ||. To be fair I
+ 402782 [rubytalk2dav] That's what I do.  You've already been quoted the Ruby Style Guide, so
| 402785 [lists@ru y- ] There's only one time I can think of where I use "or" for the sake of
| 402804 [shortcutter@] There is already too much written about using return values for error
| 402810 [lists@ru y- ] Would you be able to point me in the direction of some of these
| 402836 [shortcutter@] Kind regards
+ 402783 [lists@ru y- ] This can help you: http://rubylearning.com/images/operators.jpg
| 402784 [sto.mar@we .] I do understand their different precedence, that was not the point
+ 402786 [lists@ru y- ] I use and/or for logical expressions and &&/|| for technical stuff like
| + 402788 [rubytalk2dav] No!  No!  1000.times :no!  ;-)
| | 402790 [lists@ru y- ] Why would I expect that? Why would I even *use* assignments in "if"
| | + 402792 [sto.mar@we .] I think Dave was not talking about an assignment in an if statement,
| | + 402793 [davidgamba@g] I totally agree with Jan E.
| | | + 402794 [sto.mar@we .] But note that && has higher precedence than ||.
| | | | 402800 [lists@ru y- ] Exactly.  If && has higher precedence than ||, why "and" does not have
| | | | 402801 [sto.mar@we .] ask Matz :)
| | | + 402803 [rubytalk2dav] Exactly.
| | + 402802 [rubytalk2dav] Sorry, I missed that you were specifically speaking of "if"
| | + 402816 [hmaddocks@me] ...
| |   402830 [matma.rex@gm] You're confusing assigning the result of an if with an assignment within an if. It's the second people are having problems with.
| + 402805 [shortcutter@] Jan, I am not totally sure what you mean by this.  In any case (&& or
+ 402806 [shortcutter@] 3 - for both.  Why should I recommend teaching a practice I don't
| 402807 [sto.mar@we .] Because beginners (in my case high school students with zero programming
| 402808 [lists@ru y- ] Yup.  The way && and || work is like almost all other languages.  But
| 402809 [i_cenov@bo e] ...
+ 402819 [justincollin] I think I'm in the minority here, so I'll give my minority opinion: For
| 402849 [sto.mar@we .] I could not write that line and still sleep at night... :)
+ 403030 [sto.mar@we .] Thanks to all for your interesting input.
  403068 [tamouse.list] This is a *very* good point -- one which I had not considered. Even if

Using and Querying Struct
402765 [wbrisett@at ] I'm trying to use the Stuct class to store some data. In my case, a =
402766 [sto.mar@we .] There is no need to subclass, just use
+ 402767 [sto.mar@we .] If you really need only the first match, you can use #find instead of
+ 402770 [wbrisett@at ] Wow, thanks Marcus!=20

[ANN] flickr_airlift 0.3.2 released
402769 [beholdthepan] - *flickr_uplift *bulk uploads all photos in a given directory. (here's

Open-uri with non-ascii character
402789 [lists@ru y- ] ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin10.8.0]
+ 402791 [fluido@fl id] require 'webrick/httputils'
+ 402795 [lists@ru y- ] Thanks. Now I can open the site.
+ 402797 [tamouse.list] Interestingly enough, if you look at what gets sent through as the

[ANN] ruby-oci8 2.1.4
402799 [kubo@ji ba .] Ruby-oci8 2.1.4 is released. This is the Oracle module using OCI8 API.

any gems to generate words synced with unique IDs
402811 [lists@ru y- ] I'm looking for a neat way to generate humanized names for records
402818 [dave@lo ke s] I would look at the linguistics gem.

newbie question what am I doing wrong?
402812 [lists@ru y- ] puts 'Welcome to McDonald\'s, can I take your order?'
+ 402813 [carlos.agari] When you ask a question and states that your program "won't work", it's not
| 402815 [lists@ru y- ] Thank you!  Yes, that fixed the problem.  In the future I will give more
+ 402814 [hmaddocks@me] What did you expect it to do? How does it not meet your expectations?
+ 402817 [lists@ru y- ] The problem I was having was that after an answer was typed in for the
  + 402823 [davidgamba@g] in `<main>': undefined local variable or method `yes' for
  | 402831 [lists@ru y- ] That's another problem I'm having.  The screen closes before I get a
  + 402826 [tamouse.list] I'm curious -- are you running in windows, and starting the program
    402832 [lists@ru y- ] I'm using Intype to edit my programs, saving them as ruby files, and
    402837 [wbrisett@at ] that
    402838 [fenghe@ns et] My win7 has no DOS, how to run ruby? thanks.
    + 402839 [wbrisett@at ] Sure it does.
    + 402848 [janicetr@fa ] Start menu > Run > Type 'cmd'
threads.html
top