411589-413140 subjects 412029-412545

Passing code blocks to methods and debugging
411829 [gvimrc@gm il] def sub1(x)
+ 411830 [lists@ru y- ] Ruby will trace the source of exceptions back to either the block of the
+ 411845 [shortcutter@] But that is true for _any_ method.  Blocks are just anonymous

[ANN] ZenTest 4.9.5 Released
411833 [ryand-ruby@z] ZenTest version 4.9.5 has been released!

Not being able to understand ruby code
411836 [lists@ru y- ] Can anyone explain the below code?
+ 411837 [lists@ru y- ] The last line is equivalent to
| 411839 [lists@ru y- ] This is interesting... I am trying to understand.. How should I catch
| 411840 [lists@ru y- ] got it from
| 411842 [lists@ru y- ] My reply was a bit too late. ;)
+ 411841 [lists@ru y- ] The second example is correct as well, as it is equivalent to

Building Ruby without the Standard Library
411838 [lists@ru y- ] I have been writing an application (game library) which embeds Ruby into

Data from Fixtures
411850 [lists@ru y- ] I'm using Cucumber+Watir for a POC. I want to use testdata from
411855 [tamouse.list] This actually turns out to be more complicated than you might imagine. I =

[ANN] Alf 0.15.0 is out. Relational algebra at your fingertips -- www.try-alf.org
411851 [blambeau@gm ] Alf 0.15.0, Relational Algebra at your Fingertips, has just been released
411856 [tamouse.list] released to rubygems.org. Alf provides a rich set of features for =

[ANN] unicorn 4.7.0 - Rack HTTP server for fast clients and Unix
411852 [normalperson] Unicorn is an HTTP server for Rack applications designed to only serve

Generating an XML file
411853 [lists@ru y- ] I am reading an excel file and then generating a XML file. I am using
+ 411854 [peterhickman] If you are building an XML file why are you then converting it to YAML? Why
+ 411857 [tamouse.list] (NoMethodError)
  411874 [lists@ru y- ] Thanks Tamouse. Dont know why that didnt trigger to me before. Able to

Calling functions
411858 [lists@ru y- ] Hey guys, totally new to Ruby so bear with me please.
+ 411859 [Carey.Nation] You only call the output function at the bottom of your script.  It does what it does and then you exit.  If you want the other stuff to happen, you have to call it too.
+ 411860 [lists@ru y- ] Don't know how I missed that, I have ageChecker in the version I'm using
| + 411861 [jgabrielygal] Yes, variables are local to their scope. In your case, age is local to
| + 411862 [fluido@fl id] Sorry for the delay!
+ 411863 [lists@ru y- ] Ok, thanks. But when I then move on to nameChecker from ageChecker, the
| 411864 [jgabrielygal] I think it's cleaner that each method does only one thing, and have
+ 411865 [lists@ru y- ] Ok, I'll try that out, thanks for the help!

411866 [fighter.lyt@] ...
411867 [ginesgb@gm i] unsubscibe

411868 [fighter.lyt@] ...

Error installing visualruby MacOS X.9 ('Mavericks')
411869 [lists@ru y- ] This appears to have come up off and on in this forum, but the responses
+ 411870 [tamouse.list] On Nov 4, 2013, at 4:35 PM, Warren Adams-Ockrassa <lists@ruby-forum.com> =
+ 411872 [lists@ru y- ] Yes, yes, and yes.

Watir not finding element
411871 [lists@ru y- ] Basically no matter what I do the webdriver refuses to click a
+ 411873 [lists@ru y- ] What's the page HTML?
+ 411881 [lists@ru y- ] I cannot find the id "double_your_btc_link2" anywhere on the site you
+ 411885 [lists@ru y- ] Oops, sorry guys.

I Love Ruby update
411875 [lists@ru y- ] Have added Blocks & Functions section to my free ruby programming book I
+ 411882 [lists@ru y- ] I skimmed through it. Plenty of clearly written examples and good
+ 411883 [lists@ru y- ] that math thing is a prank :)
+ 411895 [lists@ru y- ] is.gd URL shortener has banned I Love Ruby. Don't know why exactly. One

How to add a licence section to source files - Part 1
411876 [lists@ru y- ] A couple of years ago I was working on an Android anti-virus scanning
411878 [shortcutter@] Barry, wouldn't this be better hosted as a blog? You typically have

how to avoid global variable ?
411877 [lists@ru y- ] Every tutorial I read says global variables are bad, but I'm struggling
+ 411879 [xeno.campano] You want to make variables as local as possible.  Then, you want to make
+ 411880 [stefano.croc] You can replace the global variable $nums with a local variable in Menu
  411886 [lists@ru y- ] yes, this is great, it didn't occur to me that you can pass instance
  411887 [shortcutter@] I'd have a slightly different organization of the code. For example, a

Volatile variables in loops?
411888 [mail@ss le s] irb(main):009:0* 5.times{|i; j| if i == 0 then j = 1 end; print i, j,
411889 [justincollin] This is a block, just like any other block. The code is explicitly
411890 [mail@ss le s] Yes indeed -- in Ruby each loop is in first order a block, that is what
411893 [shortcutter@] Not each loop but #each loop. :-)
411906 [mail@ss le s] Thanks for that important hint.
411908 [shortcutter@] Probably because there are no "do/end" keywords.
411919 [sur.max@gm i] @Stefan
+ 411928 [justincollin] This is not accurate.
+ 411931 [mail@ss le s] $ ruby -v

[ANN] yahns 0.0.2 - sleepy application server for Ruby
411891 [normalperson] A Free Software, multi-threaded, non-blocking network application server

How to resolve mixed character Encodings in ruby?
411892 [mydting@gm i] I'm learning ruby and try to get the filename from a ftp server. The string

WATIR question.
411896 [lists@ru y- ] I used the function "$browser.close_others", but it throws the below
+ 411899 [lists@ru y- ] It looks like a bug. You should be able to get around it by updating
+ 411901 [lists@ru y- ] Ok thank you.

watir question regarding to Browser.
411897 [lists@ru y- ] I want to gain the control of last opened browser.How would I do that?
+ 411898 [lists@ru y- ] Try b = browser.windows.last.browser
+ 411902 [lists@ru y- ] It's working perfect, thank you.
+ 411920 [lists@ru y- ] I was using WATIR::IE.attach(:index,1) to attach the browser. Now I am
+ 411921 [lists@ru y- ] Wait for the page to load before line 1
+ 411922 [lists@ru y- ] yes that's what I am putting sleep statement in between, but are you
+ 411923 [lists@ru y- ] $browser.link(:id,'something').when_present.click
+ 411929 [lists@ru y- ] when_present is working here, But I wrongly typed the code, Actually it
+ 411930 [lists@ru y- ] parseHTML($browser1.table(:class,'something').when_present.html)
+ 411944 [lists@ru y- ] I use your code but still it's not reading. It's ok, I swifted to attach

x ? a, b = b, a : a, b = a + 1, b + 1
411903 [mail@ss le s] irb(main):002:0> a = 1; b = 2; x = true # Ruby 1.9.3
411905 [andrea@an re] x ? (a,b = b,a) : (a,b = a+1, b+1)

Re: x a, b = b, a : a, b = a + 1, b + 1
411904 [lists@ru y- ] You just need to avoid ambiguous code layout. Don't let Ruby's sweet

Ruby Developers 50K
411907 [lists@ru y- ] New to this.
411966 [keystonelemu] Fair warning, 50k might be enough to attract a Junior straight out of
+ 411967 [shortcutter@] Whatever currency and location that is...
+ 411974 [atma@co va e] ...

Is there any way to get this result?
411909 [lists@ru y- ] I did a test in a job interview and one of the questions was something
+ 411911 [shortcutter@] I think the code is OK - except your looping condition. It does not
| + 411912 [dummey@gm il] I don't have a working copy of ruby on me, but I feel like a more Rubyish
| | 411913 [dummey@gm il] Oh bah, I did it for every other value of the fib sequence instead of the
| | 411927 [adam.shelly@] (2..n).step(3) should get you all the even fib values.
| + 411914 [lists@ru y- ] Yes I expressed myself bad
+ 411925 [mike@st k. a] I would prefer to use

How do the Japanese( or any other non-English) use Ruby language?
411910 [gdprasad@gm ] Can somebody explain how the Japanese use Ruby language?
411915 [echristopher] Prasad,

a, b, c, d = [a, b, c, d].map{|x| x + o}
411916 [mail@ss le s] I am doing some calculations, which often includes adding some offset to
411918 [abinoam@gm i] Considering the slower approachs they could lead you to a code like this ...
411926 [shortcutter@] I agree to the approach to create a specific class for coordinates.
411932 [abinoam@gm i] +1 to Robert Klemme (and to the blog post)

Re: a, b, c, d = .map{|x| x + o}
411917 [lists@ru y- ] I think there's nothing wrong with writing

[ANN] minitest-focus 1.1.0 Released
411924 [ryand-ruby@z] minitest-focus version 1.1.0 has been released!

Case loop / Program quits
411933 [lists@ru y- ] I'm trying to make a little grocery list to practice. My intention is to
411934 [shortcutter@] You need a loop starting here and ...
411937 [ryand-ruby@z] when "yes", "y"

Mechanize ResponseCodeError
411935 [lists@ru y- ] I'm having trouble handling the ResponseCodeError in Mechanize.
+ 411936 [chris.hulan@] drop the .initialize() would be my first guess
+ 411938 [lists@ru y- ] I dropped it. Got the same error.

[ANN] LevelDB for Ruby
411939 [joelvanderwe] * single process, no client-server
411940 [wahidaafza@g] Please inscribe me from this email-list.
411941 [ryand-ruby@z] That might hurt. A lot.
411942 [tamouse.list] Images of Dolores Umbridge correcting Harry=92s behaviour spring to =

[ANN] diff-lcs 1.2.5 Released
411943 [austin@ru yf] diff-lcs version 1.2.5 has been released!

regular expression,
411945 [lists@ru y- ] a='hi how are you_I am fine"
+ 411946 [lists@ru y- ] a[/(.*)_/, 1]
+ 411947 [lists@ru y- ] oh I have made a small mistake, I have tried like a[/(.*)_/, \1]. Thank
| 411948 [shortcutter@] irb(main):001:0> 'hi how are you_I am fine'.sub! /_.*/, ''
+ 411949 [lists@ru y- ] Another clever way, thank you.

Some Sample Code (Watir / Mechanize / GTK)
411950 [lists@ru y- ] I've uploaded some of my Ruby Toolkit to Github for redundant storage
411951 [lists@ru y- ] Thank you for sharing this!

Browsing a queue and also finding the queue depth with RubyWMQ
411952 [ruby.student] Team,
411956 [wahidaafza@g] unsubscribe me please ...

read file in parallel
411953 [lists@ru y- ] I have a file contain a lot of string.
+ 411959 [shortcutter@] What do you mean by "slice" here?  What do you need to do to those lines?
+ 411988 [garthy_lmklt] You can definitely use Ruby to parallelise tasks. Just yesterday I

New Array Methods idea
411957 [keystonelemu] So granted I've ventured over to Lisp land a bit, but these ideas still
+ 411958 [justincollin] Yes, please. I use `array[1..-1]` all the time and it feels cumbersome.
| 411963 [lists@ru y- ] Why not
| + 411965 [keystonelemu] It doesn't fit the feel of Ruby, and isn't nearly as expressive or succinct
| | 411968 [botpena@gm i] ruby is not lisp.
| | 411969 [keystonelemu] "Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit that.
| | 411977 [tamouse.list] On Nov 9, 2013, at 11:26 AM, Brandon Weaver <keystonelemur@gmail.com> =
| | 411978 [keystonelemu] Someone already did, and I did actually go straight to that list. The
| | 411979 [tamouse.list] On Nov 9, 2013, at 5:50 PM, Brandon Weaver <keystonelemur@gmail.com> =
| + 412006 [groups@in ox] a = [1,2,3,4,5]
+ 412004 [lists@ru y- ] I use Arrays with "headers" quite a lot, so I think this is an excellent
+ 412014 [lists@ru y- ] Someone already did, and I did actually go directly to that record. The

FileUtlis class options
411960 [lists@ru y- ] I am confused with the actual use cases of the options
411976 [tamouse.list] method-c-mv

Ruby will be die :(
411961 [hack3rcon@ya] ...
+ 411962 [hassan.schro] The wheel turns -- everything dies eventually.
| 411964 [ruby.student] LOL
| 411970 [chrisw_88@ho] ...
| 411971 [keystonelemu] RPG, COBOL. That is all.
+ 411972 [matt@te hn r] I expect it will, but I don't know when.  After Fortran and COBOL are
+ 411980 [tamouse.list] Node.js and angular but how ruby can challenge them?
| 411986 [tamouse.list] No. You completely misconstrued my point.
| 411993 [tamouse.list] I did.
+ 411982 [tony.arcieri] Node.js results in unmaintainable code written by hand in continuation
+ 411984 [lists@ru y- ] Ruby is a general program,so it can do a lot of things not just in web
| + 411987 [saji@u- iz .] Felix,
| | 411990 [carlos.agari] I worked in humanities (musicology) at a Swiss university (I=92m now
| | + 411994 [lists@ru y- ] I had tried to install nmatrix few month ago. I am a Archlinux user and
| | | 411996 [carlos.agari] Yeah, there were some problems with NMatrix installation due to these
| | + 411997 [joelvanderwe] Good to see someone's keeping up the sciruby flame.
| + 412115 [stu@ru yp og] @felix
|   + 412116 [hassan.schro] ?! "web developers" and "implement in the JVM" would seem to be
|   + 412123 [lists@ru y- ] What do you mean here?
+ 412218 [lists@ru y- ] Ive just released MDArray 0.5.5.  It has similar features as NumPy and NArray, but for JRuby.  Might interest people on this thread.
+ 412226 [lists@ru y- ] "the web developers get bored and start playing with shiny new toys we

payment gateway for tech support
411973 [lists@ru y- ] We provide Payment Gateway for Tech Support process all around the globe

Kind of Array "product" question
411975 [mail@ss le s] irb(main):053:0* a = ['a', 'b', 'c']
411981 [tamouse.list] a.product([b]).map(&:flatten)

What's New in Ruby? New List (Wiki Page on GitHub) for Finding Ruby News Sites
411983 [gerald.bauer] For the upcoming Vienna.rb talk on the new Planet Ruby site [1][2]

[ANN] yahns 0.0.3 - sleepy application server for Ruby
411985 [normalperson] A Free Software, multi-threaded, non-blocking network application server

AW: Ruby will be die :(
411989 [max.haas@un ] Felix,
411991 [max.haas@un ] AW: Ruby will be die :(
412049 [lists@ru y- ] I totally agree.

Is there an easier way to parse into tokens a string?
411992 [ruby.student] When running the piece of code below, I expect and get the following line
411995 [jgabrielygal] 2.0.0-p195 :003 > s = "AMQ8409: Display Queue details.\n   QUEUE(TEMP)
411998 [Reid.Thompso] irb(main):015:0> s = "AMQ8409: Display Queue details.\n   QUEUE(TEMP)         TYPE(QLOCAL)\n   CURDEPTH(6)"

string#encode with fallback not working
411999 [lists@ru y- ] I am trying to replace '?' with 'e',but no luck

RVM 2.0 - Fundraise - 2 days left
412000 [abinoam@gm i] [I'm not affiliated to RVM in any way. I'm just a happy user]

[ANN] proxyconf 0.1.0 Released
412001 [daixque@gm i] proxyconf 0.1.0 has been releasesd.

What's does this double @ sign syntax mean after __END__
412002 [aleiphoenix@] I'm wondering what does double @ sign after __END__ syntax meaning like in
412003 [atma@co va e] ...
412005 [fxn@ha hr f.] Sinatra does a little bit of magic there.

Help with Nokogiri
412007 [lists@ru y- ] (In french)
+ 412008 [tamouse.list] What code have you got so far, and how is it not working?
+ 412009 [lists@ru y- ] frdoc = Nokogiri::XML( open("http://www.dicocitations.com/xml-rss2.php")
| 412015 [Reid.Thompso] frcits.each do |ea|
+ 412028 [lists@ru y- ] OK thanks, I'll try it this evening

Help planning out a GPA program.
412010 [lists@ru y- ] Any advice as to how I should format a GPA program I am making. You have
+ 412018 [tamouse.list] have
+ 412172 [lists@ru y- ] Yeah - Max, we need more details in order to help you.  What are you

uninitialized constant Gem::Package
412011 [lists@ru y- ] I just updated my system with gem update --system and now I am having

json variable passing
412012 [lists@ru y- ] i have been using PHP for some time now to take a big complicated data
+ 412019 [tamouse.list] ?>');
+ 412020 [lists@ru y- ] tamouse - thank you very much for taking the time to answer my question.
| 412026 [tamouse.list] question.=20
+ 412076 [lists@ru y- ] tamouse - once again, thank you for your time and your patience with
  412091 [tamouse.list] like=20

[ANN] RbNaCl 2.0.0: a modern cryptography library for Ruby
412013 [bascule@gm i] RbNaCl is a Ruby FFI binding to the Networking and Cryptography Library by

[ANN] Simplecheck 1.0
412017 [farrel.lifso] Simplecheck is a lightweight property checking API for Ruby designed to

Passing script input as method args always global?
412021 [gvimrc@gm il] print 'Enter data: ';
+ 412022 [normalperson] doit(in.dup)
| 412023 [gvimrc@gm il] I seem to have misunderstood something. Changing 'data' within the
| + 412024 [groups@in ox] So it seems args are passed by value after all ..... unless I'm mistaken
| | 412032 [gvimrc@gm il] var = 2
| | + 412033 [fluido@fl id] The line
| | | 412040 [gvimrc@gm il] So a parameter is passed by reference but as soon as you modify it
| | | + 412042 [fluido@fl id] It is not always true that the object is cloned. It depends on the
| | | | 412044 [gvimrc@gm il] I don't see the connection with my simple function example. You have
| | | | 412046 [fluido@fl id] No! :v, v and @v are THREE DIFFERENT THINGS altogether.
| | | | 412048 [gvimrc@gm il] I know they're different. It's just that my example was simplified to
| | | + 412043 [fxn@ha hr f.] So a parameter is passed by reference but as soon as you modify it you've
| | |   + 412047 [gvimrc@gm il] Which is what I would expect, but why does x retain its original value
| | |   | + 412051 [fxn@ha hr f.] That example illustrates what you could do if you **had** pass by reference
| | |   | + 412052 [fluido@fl id] you receive an object, but you return another one. The fact that it is
| | |   + 412088 [groups@in ox] Thanks for spelling this out. I'd gotten pass-by-reference and
| | + 412034 [s.manolloff@] I think you are passing a _copy_ of the reference to the object. This is why
| |   412035 [fxn@ha hr f.] Ruby passes arguments *by value*. You can modify a mutable object via its
| |   412038 [gvimrc@gm il] Thank you! That's the only explanation that makes sense so far but
| + 412025 [lists@ru y- ] No, you were right to start with, ruby passes by reference.  However,
+ 412027 [tamouse.list] 'data' is always accessing and changing the file-global variable 'in'. =
+ 412039 [fxn@ha hr f.] Perl only has pass by reference (the elements of @_ are aliases of the ones
+ 412045 [amichai@te m] ...
+ 412050 [lists@ru y- ] No, not at all.
  412053 [gvimrc@gm il] I'm beginning to see Ruby's "everything is an object" as a serious
  + 412055 [lists@ru y- ] x = x.+(1);
  | 412057 [gvimrc@gm il] Ruby's beauty is looking increasingly skin-deep to me as I learn more.
  | 412060 [fluido@fl id] What is happening is that you resist change. What you lose seems to
  | 412063 [gvimrc@gm il] I understand where you're coming from but for me arithmetic operators
  | 412066 [fluido@fl id] I am not sure you know where I come from ;-)
  + 412056 [fxn@ha hr f.] I'm beginning to see Ruby's "everything is an object" as a serious barrier
  | 412059 [gvimrc@gm il] x =2
  | 412062 [fxn@ha hr f.] ... will mutate x but I now understand, from what others have explained,
  | 412064 [gvimrc@gm il] PHP, I believe, adopted pass-by-reference a few major version back.
  | 412065 [fxn@ha hr f.] When we talk about "pass by reference", "reference" means a reference to
  + 412058 [fluido@fl id] barriers to comprehension are made to be overcome. A haiku may be this
    412061 [gvimrc@gm il] I'm sure there are many more contortions like this that Ruby facilitates
    412067 [lists@ru y- ] Well, Perl does the same unless explicitly told.
    + 412068 [gvimrc@gm il] The difference is that Perl explicitly shifts the parameter into a new
    | 412084 [lists@ru y- ] This conversation has gone on quite a bit.  It started out like "I don't
    + 412069 [gvimrc@gm il] x = 2
    | 412071 [fxn@ha hr f.] Perl retains the passed reference unless modified. Not so in Ruby where y
    + 412070 [fxn@ha hr f.] When the method or constructor is invoked (15.12),
      412094 [lists@ru y- ] Whoops, I got that mixed up then, sorry. The effect is that of a