387679-388267 subjects 388109-389597

Re: openssl error - ubuntu (RVM)
387892 [cmirallesp@g] rvm pkg install openssl

calculating days to go using date class-help needed
387899 [joec54@gm il] consider this code stub
+ 387902 [hassan.schro] #today = DateTime.now
+ 387909 [joec54@gm il] that works fine - thanks!

Ruby On-line Courses
387906 [patil.demerj] I'm looking for recommendations for excellent ruby on-line courses or
+ 387911 [spiralofhope] There was some recent conversation about certification, mostly
| 387912 [chris.hulan@] This Ruby Mendicant training looks quite good -
+ 387938 [waynefb@ea t] I don't know anything about this one, but it seems like it covers the =
+ 387945 [treleven.llo] Posted via http://www.ruby-forum.com/.
+ 387959 [josh.cheek@g] sessions worth of video, going from very little assumed knowledge, up to
+ 388131 [patil.demerj] Thanks everyone for some great information.

RVM + 1.9.3pre == broken readline
387914 [code@ap th o] I have not been able to get readline working with the 1.9.3 preview using
+ 387928 [brabuhr@gm i] $ uname -a
| 387951 [code@ap th o] ng
| 387955 [brabuhr@gm i] ing
+ 388162 [rogerpack200] Maybe install pure ruby readline?
  388163 [code@ap th o] Please elaborate.
  388172 [brabuhr@gm i] ...
  388178 [code@ap th o] Thanks.  I had no idea that existed.  "gem install rb-readline" solved

Some newbie questions
387915 [cluny_gissla] I got some newbie questions which I would very much appreciate if
+ 387918 [linuxuser101] The @ means that the variable is an object variable, its scope is
| + 387920 [cluny_gissla] Thanks for answering that question. In Python (the only other language I
| + 387921 [cluny_gissla] So the @-sign in Ruby is like self in Python? Can someone confirm who
|   + 387922 [shortcutter@] Not to the class - to the _instance_!  Or more precisely the name is
|   + 387923 [cwprogram@li] Not so much. Much like Python=2C Ruby classes deal with self as well. Howev=
|   + 387927 [code@ap th o] There have already been some good answers to this, but I'll throw in
+ 387919 [code@ap th o] What exactly do you mean by "the normal way"?
+ 387924 [gwtmp01@ma .] hash1 =3D {}
+ 387926 [rubytalk2dav] Someone beat me to this one, so I'll just preemptively add, @@ means
+ 387931 [g.diemant@gm] Yes. Dir.glob '*' will not return Unix-style hidden files (files that
| 387941 [phrogz@me co] irb(main):001:0> Dir['*']
+ 387943 [cluny_gissla] Thanks for all the helpful answers.
  387949 [matma.rex@gm] Yes.

getting a wider range of google results
387916 [linuxuser101] Lately, I have got some interest in google search & keywords.
387925 [linuxuser101] I think I have nailed it.

How long does it take to complete Ruby
387930 [sasogeek@ya ] I've been learning and practicing ruby for 2 weeks and a half and I'm
+ 387932 [shortcutter@] Well, the answer depends on a lot of factors
+ 387934 [sasogeek@ya ] I meant complete being able to master it. I had given myself a time
| 387937 [shortcutter@] It's always good to have goals - even if one doesn't reach them. :-)
+ 387936 [axyd80@gm il] You can't master anything by reading or learning, only by doing it.
+ 387940 [spiralofhope] 10,000 hours makes for a competent beginner.  =)

defined? var in a var name
387935 [jarodzz@gm i] I'm create a environment.rb in cucumber which stores a lot of env descripts.
387939 [shortcutter@] ts.

wxRuby or Qt4Ruby for learning GUI
387942 [treleven.llo] I've gone past the basics of learning the ruby language and now want to
+ 387944 [serialhex@gm] maintained by a steve kablank (and i probably mis-spelled his last name))
+ 387963 [remosewa@gm ] Shoes is probably the easiest to get started with. I use Wxruby to
+ 387965 [stefano.croc] I don't think there's a *best* library. It depends on your needs and your
+ 387966 [treleven.llo] OK thanks for the advice I'll take a look at these libraries on ruby,  I
+ 387974 [bbxx789_05ss] If you preferred wxPython, then check out wxRuby.  Personally, I prefer
  387976 [steve@st ve ] QT is lgpl licensed nowadays. No biggie.

Joining an array with a table
387947 [istiblasko@g] Hey
+ 387960 [josh.cheek@g] your question probably has more to do with how to use some specific library
+ 387968 [istiblasko@g] Yes, it's Rails!

Redefining Date Constants without warnings.
387953 [schmickcl@gm] I thought this might be helpfull for someone.

array.map! + delete_if possible ?
387957 [k.dorsel@gm ] I have an array of strings that I need to modify. I either need to
+ 387958 [bbxx789_05ss] arr = [1, 2, 3]
+ 387961 [josh.cheek@g] I honestly have no idea what this is supposed to do.
+ 387967 [list.push@gm] Probably :)
+ 387991 [shortcutter@] irb(main):010:0> a = 10.times.to_a
| 387993 [adam@ap es o] => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
| 387999 [shortcutter@] My bad.  I left the conversion out of my example.  With conversion you
+ 388042 [k.dorsel@gm ] Thanks for the answer. Here is the initial array.
  388070 [shortcutter@] I picked the approach to identify fields by their number and create

ruby task monitoring
387962 [remosewa@gm ] I want to use ruby to monitor other programs that are running in
+ 387969 [steve@st ve ] You were fine up until 'on windows.' Most of the ruby stuff I know that does
+ 387970 [cmdjackryan@] PS C:\ > get-process | select-object -Property Id, Name, CPU, Path,
+ 387971 [jon.forums@g] Depending upon your appetite for rolling-your-own, check out using FFI
+ 388028 [shortcutter@] Kind regards

Getting TextMate to list Ruby as a template
387972 [treleven.llo] Can anyone tell me how I can get TextMate to list Ruby as a template via
387973 [matt@ti bi s] Use the Bundle Editor, select something inside the Ruby bundle, and

[ANN] taglib-ruby 0.1.1 (first release!)
387979 [robin@ni or ] I'm happy to announce the first release of taglib-ruby!
387980 [normalperson] Cool, I look forward to Vorbis comment support!
387983 [robin@ni or ] You're welcome, and thanks for your feedback :)

tkroot options
387982 [joec_49@ho m] What are the complete list of tkroot options (title, minsize. resizable
+ 387985 [sophrinix@gm] consider using pry to inspect the methods available on tkroot.
+ 387992 [joec_49@ho m] I know these options....
+ 387994 [joec_49@ho m] Look also at roow.withdraw which is comment out here. there must be
+ 388038 [nagai@ai ky ] See the keys of the result of "Tk.root.current_configinfo".

Strange vector behaviour
387984 [mulvaneyenat] Vector[2,4,6] == Vector[1,2,3]*2
+ 387986 [adam@ap es o] Floating point numbers.
+ 387987 [gwtmp01@ma .] Integer literals have exact representations while floats do not.  =

[ANN] Cameleon 0.1.0 released
387988 [daixque@gm i] Cameleon version 0.1.0 has been released!

[ANN] Ruby-GNOME2 1.0.1
387989 [kou@co mi ng] The Ruby-GNOME2 project released Ruby-GNOME2 1.0.1.
387995 [kou@co mi ng] The Ruby-GNOME2 project released Ruby-GNOME2 1.0.2...

[ANN] test-unit 2.4.0
387990 [kou@co mi ng] gem install test-unit

GoGaRuCo videos
387996 [axyd80@gm il] only available videos I found was these
387997 [ben@bl yt in] Give Confreaks a few days to get the videos posted. They'll be posted

Re: Ruby-GNOME2 1.0.1
387998 [jon.forums@g] Thanks Kou, and the install of the mingw binary gems works fine for me
388021 [kou@co mi ng] Thanks for your report on Windows!

First time Ruby Install
388000 [andy.prondak] Hey, this is my first time ever working with Ruby so this makes me a
388004 [sophrinix@gm] bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

opencv gem on snow leopard failing to bind to all required symbols
388001 [sophrinix@gm] Greetings,
388002 [sophrinix@gm] encv/opencv.bundle
388005 [sophrinix@gm] This fixes this issue. This probably also fixes the issue for those on OSX Lion.

Ruby Speed Question
388003 [oblivious.sa] to examine the speed of binary search on various array sizes in 3
+ 388011 [josh.cheek@g] Java and C# are statically typed and compiled (well... more so than Ruby,
| 388027 [shortcutter@] This is not 100% true.  While they are from a language user's
| 388029 [josh.cheek@g] I've had people say this to me in the past, but I don't understand how this
| 388030 [normalperson] basic types, including simple Fixnum arithmetic (see insns.def).
+ 388012 [cremes.devli] This general question has been answered quite a few times. Some of these links are a little out of date now but the gist is correct. BTW, JRuby is probably the fastest current runtime and the one with the best chances of reaching Java-like performance. Running it with NetBeans isn't slowing you down though you may want to see if you can configure NetBeans to run JRuby with the --server switch (more aggressive JIT'ing by hotspot).
+ 388015 [oblivious.sa] Thanks for your comments, Chuck & Josh!
| + 388016 [jamesthepipe] How are you controlling for startup time?  JRuby's startup has always
| + 388024 [code@ap th o] =20
+ 388079 [joec_49@ho m] I ran a speed test on a simple 'for' loop and found ruby does close to
| 388082 [j.londiche@p] =20
+ 388165 [collegeman09] Hey Kevin what school do you attend?

download rvm and install later?
388006 [bbxx789_05ss] How do you download rvm without installing it?
388008 [sophrinix@gm] curl -s https://rvm.beginrescueend.com/install/rvm
388009 [sophrinix@gm] it should be noted that https://rvm.beginrescueend.com/install/rvm is
388010 [sophrinix@gm] However, for the 'install later part'

388007 [frederick.c.] I'm a Ruby/Rails/Cucumber neophyte.
388026 [justincollin] rvm[1] should help you with the "managing your environments" issue.

Persistent storage in ruby
388013 [treleven.llo] Python has a shelve object for persistent storage what's the equivalent
388014 [tony.arcieri] There's a few built-in options, such as PStore (which is very slow)
388058 [matma.rex@gm] Or maybe you're simply looking for Marshal? It lets you dump almost

FTP ports
388017 [c0dege3k@gm ] I've been writing a super simple terminal FTP client to send text files
+ 388018 [sduncan@we a] Try opening your ftp connection in passive mode;
+ 388019 [cmdjackryan@] Is
+ 388020 [mbostler@gm ] maybe try using the connect method to manually specify the port number
  388022 [c0dege3k@gm ] The connect method suggestion didn't work. And I just noticed another thing-
  + 388023 [sduncan@we a] Sorry, my suggestion may not have been that helpful as, despite the docs
  + 388025 [gwtmp01@ma .] thing-
    388059 [c0dege3k@gm ] Thank you! That worked- and sorry Sam- the link you gave me just showed me
    388060 [sduncan@we a] Hah, no problem. Glad you got there in the end. Evidently you /can/ get

Add a remote location to my gem installation
388031 [tcblues@gm i] I've created a gem file using rake gem, and now I would like to put all

How-to run a 'minitest' test?
388032 [treleven.llo] I am trying run the attached test which I found on the 'minitest'
+ 388033 [justincollin] How does the code in meme_test.rb know about the code in meme.rb?
| 388035 [treleven.llo] Thanks Justin I added the require_relative "meme" as suggested and all
+ 388034 [josh.cheek@g] Honestly, it just depends what you're trying to do. If you just want to run

how to implement method with execution timeout expiration?
388036 [zhoran@in ox] Would you be so kind to advise me Player.get_action() implementation?
+ 388037 [johnjohn.ted] This sounds more like a design issue, if your system blocks while
+ 388072 [shortcutter@] Ruby version 1.9.2

Symbol from variable name
388039 [b1368810@lh ] For example I have a variable jx.
388041 [cwprogram@li] This seems like a bid of an odd use case. Can you give more detailed code t=

388044 [asetpochta@m] How to generate rand (random number) between two numbers?

388045 [cwprogram@li] ot 0) and some number.
388048 [dimeneira@gm] Also you can mod the number by the cardinality of your range and then add
388071 [shortcutter@] 0.13646702557098767
388077 [dimeneira@gm] My bad. I assumed errantly that ruby's rand would default return a rand

How to generate rand (random number) between two numbers?
388046 [asetpochta@m] How to generate rand (random number) between two numbers?
388047 [cremes.devli] irb(main):001:0> def random_number(from, to)
388075 [Rob@Ag le on] irb1.9.2> class Range
388076 [shortcutter@] irb(main):022:0> (0.0..0.1).sample

Overloaded constructor
388049 [ayoya_91@ho ] I want I ask something I am using ruby192 I want to know if it can
+ 388051 [mcpierce@gm ] AFAIK it can't.
+ 388052 [cmdjackryan@] class CRectangle
+ 388053 [ayoya_91@ho ] Thank you very much Phillip:)
  388054 [cmdjackryan@] No problem!
  388061 [jeremy@bo p.] Phillip, your code runs just fine on Ruby 1.8.7 as-is.  Default values

Convert object structure
388055 [tligda@gm il] I'm pretty new to Ruby, so this is probably a pretty simple proposition
+ 388056 [matma.rex@gm] You could just call #flatten on the resulting array.
+ 388057 [tligda@gm il] That works! Thank you very much!

Re: Friend Function
388062 [bbxx789_05ss] No.

Net::Telnet doesnt work but command line telnet does
388063 [timanema@gm ] I am making a simple remote control to vlc and running into troubles on
388064 [ryand-ruby@z] I'm just guessing... but that "Trying ::1" line hints that =
388065 [timanema@gm ] it seems you are right

[ANN] net-http-persistent 2.1 Released
388066 [drbrain@se m] net-http-persistent version 2.1 has been released!

388067 [tragiang_788] EVERBOUQUET/WAYTON

388068 [tragiang_788] GLOBAL CONNECTOR

388069 [tragiang_788] LINEAR ARTWORK

appending \n to each element in an array
388078 [joec_49@ho m] I have an array
+ 388080 [j.londiche@p] =20
| 388085 [shortcutter@] Please do not hijack threads - especially not for commercial activities!
+ 388081 [dsisnero@gm ] ...
| 388086 [shortcutter@] It's not exactly what the OP wanted... :-)  Also, I am suspecting a
+ 388083 [hassan.schro] Yes; see the Ruby doc for Array -- 'map' method
| 388087 [j.londiche@p] =20
| + 388091 [adam@ap es o] David Heinemeier Hansson.
| | 388111 [josh.cheek@g] Considering the use cases for something like this makes it seem decently
| + 388246 [rubytalk2dav] already been going on a completely different topic, appropriate to the
+ 388084 [adam@ap es o] => ["some", "of", "my", "favourite", "words"]
+ 388089 [mayank.kohal] ruby-1.9.2-p290 :001 > ["DOG","CAT","HAT"].map { |element| element + '\n' }
+ 388090 [joec_49@ho m] that worked perfectly (map) - thanks.

StringIO and encodings
388092 [alex@bl ck e] $ ruby -v
+ 388093 [adam@ap es o] Can it not be changed so that it knows the internal encoding, instead? That
| 388094 [alex@bl ck e] I don't know if there's an API for that, but I suspect there isn't.  If
| 388095 [drbrain@se m] instead?
| 388187 [alex@bl ck e] $ ri StringIO
| 388188 [ryand-ruby@z] soooo... instead of fixing it and empowering yourself... you choose... =
| 388189 [alex@bl ck e] rubydoc.info, usually.  Saves fixing it on every single box I ever
| 388191 [josh.cheek@g] +1, ri has worked for me once before, but rarely does, and I don't enjoy the
+ 388292 [b.candler@po] Nothing surprises me any more about encodings in ruby 1.9.

require command
388096 [ayoya_91@ho ] I am using ruby192 and when ever i use "require" to load another saved
+ 388098 [Rob@Ag le on] require "some_file"
+ 388099 [ayoya_91@ho ] Well I tried that it still doesn't work here is the error message it
+ 388100 [cmdjackryan@] Probably because you are trying to require a file in or from within
+ 388101 [ayoya_91@ho ] require_relative "my_file" Works just fine!!

Ruby on a Mac
388097 [pbailey@bn .] I'm new to my Mac. I love it, but, it's definitely different than the
+ 388102 [Carey.Nation] Seems like it can't find curl.  Try putting an explicit path in the backticks.  I tried just `curl` on my leopard box and it worked, though...
| 388120 [pbailey@bn .] I get results from typing "curl" anywhere I am when I'm in terminal.
+ 388106 [ryand-ruby@z] Holy random indenting batman! Could you please normalize your code =
| + 388113 [eule@sp ce c] Here. Can't reproduce your error, Peter. I'd suggest you look at your
| | 388122 [pbailey@bn .] OK. I'll poke around some more. Thanks.
| | 388155 [pbailey@bn .] Wow. I'm sorry. I found my problem. I'm so new to the Mac that I forgot,
| + 388119 [pbailey@bn .] Well, I'm sorry, but, that's how it goes in with a cut & paste from my
+ 388114 [cwprogram@li] I notice you're not really using curl for anything complicated=2C so it see=
+ 388167 [shevegen@li ] I think your code is a problem too. Too many $ where it seems useless.

Reading local variables at_exit
388103 [andreas.lund] I'm writing a slim Ruby Debugger using the set_trace_function.

I am confused with installing a gem
388104 [aef1370@gm i] 'gem install sexp' ) ruby gives me an error but when for second time I
+ 388105 [goforit7arh@] Short version: It installed fine, but one of the dependencies' for the
+ 388107 [ayoya_91@ho ] I am encountering the same problem
+ 388108 [ayoya_91@ho ] This is the error message that appears on the command prompt
| 388110 [ryand-ruby@z] repository
+ 388112 [ayoya_91@ho ] yes its the latest verison i am pretty sure (also my ruby version is
  + 388117 [ryand-ruby@z] In which file? Gems are files that are unpacked into your gem directory. =
  + 388146 [treleven.llo] To find out where gems are installed type gem list -d. This command
    388161 [ayoya_91@ho ] No That is not the problem its command prompt cant find any gems i