366840-368527 subjects 367285-372975

^ Inject problem
367058 [amiref ymail] In inject method , everytime that inject called what is returned ? for
367061 [brabuhr gmai] irb(main):001:0> array =3D [*1..10]

^ Remove the error
367059 [amiref ymail] Why these codes result error ?
+ 367063 [brabuhr gmai] irb(main):001:0> array = [*1..10]
+ 367094 [b.candler po] sum = array.inject(0) { |memo,item| item != 3 ? memo+item : memo }
+ 367105 [gf.bozzetti ] Avoid expressions returning  tre/false as if or nil as puts.

^ documenting string
367064 [ciur.eugen g] #!/usr/bin/ruby
367066 [rws1111 gmai] I believe Ruby treats this as a double quoted string. The following
367068 [ciur.eugen g] Oh, indeed "instance variable"!!
367096 [b.candler po] And incidentally, you can change the semantics of heredocs to those of
367099 [eugen prime-] Thank you Brian, that is really what I was looking for !

^ YARD documentation for splat (lists) as parameters
367069 [jtprince gma] [I am using YARD to document my code.  I'm new to YARD, but I've read

^ undefined method `debug' for nil:NilClass(NoMethodError
367080 [kadishmal gm] I created very simple AR code to add new record to MySQL table. But I
367092 [b.candler po] I think you need to show the full backtrace. This will show not only

^ Re: ENV" is nil when the code is run with "sudo"
367083 [kadishmal gm] I have to find the location where the CUBRID Database Server (or any

^ Get rid of extra, blank lines via html parsing?
367084 [wrinkliez gm] So I am trying to get some information from a snippet of html
+ 367090 [jgabrielygal] do
+ 367098 [gf.bozzetti ] Use the String methods: s. strip!, s.gsub! and s.squeeze as in
  367116 [wrinkliez gm] Hey guys, thanks for the responses.  Jesus, the gsubs don't do anything
  367126 [jgabrielygal] Can you show your code?

^ Monkey Patching, passing in extra data, FXRuby bug
367089 [ralphs dos32] Because of an apparent bug in FXRuby/Fox/Something that causes a segmentation fault ...

^ Method with array PROBLEM
367095 [calabazag ho] not able to combine the two things.
+ 367097 [jgabrielygal] Take a look at the File#read and File#readline methods, and to
+ 367101 [josh.cheek g] StringScanner (in the stdlib) is intended for tasks like this. They show an
  367102 [jgabrielygal] Thanks ! I had forgotten about StringScanner :-)

^ Regarding win 32 screenshot
367100 [mails4vardha] Me using the latest version of gem win32screen shot..
367119 [rogerpack200] You need to pass it a block, like the readme examples do.
367279 [jarmo.p gmai] Maybe using yield might be better indeed, like Roger recommended some
367283 [rogerpack200] Yeah the only way I know of to force their use it so either use yield
367352 [jarmo.p gmai] Released version 0.0.6 where i'm using yield instead of block.call.

367104 [jeffrey.bons] Is there a simpler code to set the Headers and Footers on all N pages in

^ jmx4r metaprogramming
367106 [aidy.lewis g] I am attempting to use the jmx4r library to set an MBean attribute.
367118 [jmesnil gmai] This error is strange, there should not be a white space between
367123 [aidy.lewis g] jmx4r is a pretty useful library.

^ net/smtp
367107 [dglnz2 gmail] Okay I am officially stumped!!!
367110 [b.candler po] It's because of the double newlines: you are adding \n as well as having
367111 [b.candler po] irb(main):001:0> require 'time'
367154 [dglnz2 gmail] many thanks for you're assistance Brian,
367157 [b.candler po] You must not put spaces before the Subject: header. Align your text with
367164 [dglnz2 gmail] You are a brilliant!!!!!
367170 [b.candler po] Not really - probably worth looking at gems like mail or tmail.

^ Rails3 Engines (mountable apps)
367108 [hj.blok gmai] I've a question about Rails 3 Engines. I'm looking everywhere for good
+ 367109 [hj.blok gmai] sorry wrong forum....
+ 367112 [luislavena g] It creates an engine template for rails 3, generate one and take a
| + 367113 [hj.blok gmai] Thanks, I'll try generating a Engine using enginex and compare it with
| | 367115 [hj.blok gmai] Do you know how to use enginex? I've tried, but there is no
| | 367117 [luislavena g] That's all, next you need to inspect the output of NAME
| + 367121 [eregontp gma] I wish I saw that earlier.
|   367122 [hj.blok gmai] Yeah this one works. Enginex probably also works, but I simply don't
+ 367125 [ryand-ruby z] please send such queries in the future to the rails mailing list/forum.
  367150 [hj.blok gmai] I will, but I already mentioned I posted it here accidentally...

^ can't inline calendar  for some reason
367120 [grikdog pobo] Can anyone tell a newbie why this doesn't produce output in an Apache

^ [ANN] Call for Participation for 2010 Workshop on Scheme and  Functional Programming
367124 [feeley iro.u] Here is the final program for the 2010 Workshop on Scheme and

^ A little problem
367127 [amiref ymail] What is difference between these 2 codes ?
+ 367128 [astahl hi5.c] In the first function, you're performing interpolation on the variable;
+ 367130 [marvin.guelk] welcome1(3)
+ 367132 [joelvanderwe] The first calls #to_s and the second calls #to_str. The #to_str method

^ Default arguments problem
367129 [amiref ymail] How can I have a method with 3 arguments so that only second argument is
+ 367133 [  jbw jbw.cc] Does the default arg have to be the second one? If not just move it to
+ 367134 [joelvanderwe] $ irb19

^ ruby watir on Win2008R2
367131 [debuke gmail] is this possible?  i'm running in to LoadErrors and i've done all of
367138 [luislavena g] Please post the exact error you're getting, with backtraces and
367194 [debuke gmail] we are running our scripts fine on windows server 2003 (standard) and
367200 [luislavena g] setting to RUBYOPT=3Drubygems ?
367203 [debuke gmail] well... to answer my own question... YES: ruby with watir is possible

^ Return value problem
367136 [amiref ymail] What is happen for return value in these 2 codes ?
+ 367137 [astahl hi5.c] If you don't explicitly return anything, ruby returns the value of the
| 367139 [oscartheduck] ...
+ 367140 [brabuhr gmai] $ cat i.rb

^ Send Text w/ Ruby
367142 [bbaarrnneess] I'm curious if it is possible to send text to a window or web
+ 367147 [echristopher] <http://raa.ruby-lang.org/project/win32-guitest/>.
| 367148 [james.britt ] AutoItX is also very handy for scripting Windows apps and the Win32 API.
| 367155 [sutniuq gmx.] If I'm allowed to promote myself...
| + 367190 [thenaztyboys] ou
| + 367195 [bbaarrnneess] ou
+ 367185 [rogerpack200] watir itself can populate fields, can it not?
  + 367191 [thenaztyboys] Yes it can, but the fields in are encrypted in the html source, so it
  + 367196 [bbaarrnneess] It can, but the tags for these fields are encrypted, so every time the
    367197 [wishdev gmai] Have you looked at the page with Firebug/Firefinder to see if any pattern
    367201 [bbaarrnneess] me

^ warning: method redefined; discarding old <=>
367143 [ralphs dos32] I have monkey patched the spaceship operator in an FXRuby Class.
367161 [b.candler po] begin

^ Ruby exception overhead
367144 [duke.halak g] I've been seeing various bits and pieces mentioning the overhead Ruby's
367160 [b.candler po] That's the wrong approach to improving performance. Measure first, then

^ Ruby scrips getting executed in a loop.
367151 [parulg covel] While calling multiple ruby scripts into a single file, my scripts are
367152 [jgabrielygal] What do you mean by "called out"? Can you show the code?
367156 [parulg covel] Following is the piece of code in Run.rb . All the three files are
367162 [jgabrielygal] he

^ Unknown character print on irb or command prompt
367153 [shahpriyank0] I read html file using nokogiri. and its work fine.
367159 [b.candler po] Try using
367163 [shahpriyank0] Thanks for reply,
367174 [b.candler po] That is useful.

^ Data::Dumper Request
367158 [brentgclarkl] I know we can use JSON, YAML, Marshal etc for representation of the data.
+ 367184 [rogerpack200] you can try
+ 367219 [vikkous gmai] spelling, you'll get something else) which serializes ruby data
+ 367326 [ninja slapha] How so?

^ Output and return value
367165 [amiref ymail] What is difference between "output" and "return value"? for example when
367166 [jgabrielygal] a = method_call(parameters)

^ Project name ownership and conflict
367167 [emmanuel.gom] I recently had a discussion with a fellow Ruby developer that revealed a
+ 367168 [peterhickman] What was the name of your gem? Would googling for it have returned
| 367209 [emmanuel.gom] My project is called Clockwork. http://github.com/emmanuel/clockwork
| 367215 [transfire gm] Oh, yes. I had a premonition about this today. Rename the project
| 367217 [emmanuel.gom] I think I'll do just that. Although 'orange' may be too general, I think
| 367245 [rick.denatal] or Droog!
+ 367183 [rogerpack200] Yeah typically all we check if "can I push this gem?" before grabbing
  + 367187 [richard.conr] Is this issue growing in significance? I have heard of cases of gemname
  | 367211 [emmanuel.gom] I can't speak to this as a trend at all.
  + 367210 [emmanuel.gom] Based on responses received so far, this seems to be the prevailing
    367212 [james.britt ] I suggest you call your gem something like improved-clockwork or
    + 367214 [transfire gm] It a wider issue than we might realize too. Today I was looking for a
    + 367222 [martindemell] clockwork2 should solve the issue neatly, though it leads to the

^ Abstracting exception handling
367169 [mail maasha.] I am interested in abstracting exception handling so it can be included
367173 [b.candler po] Nope. The exception is raised, nothing catches it, *then* your END block
367176 [mail maasha.] include "my_class"
367177 [wagner.andre] What kind of stuff are you doing in my_script.rb? Defining a class? A
367179 [mail maasha.] <do_stuff> would be something simple like parsing a tabular file and
367192 [wagner.andre] def do_something
367202 [mail maasha.] Sorry, I have no idea how to do that - it sounds terribly complicated.
367206 [wagner.andre] Ok, so here's something fairly simple to try. There are better ways to do
367207 [wagner.andre] For a somewhat more robust ErrorHandling module, which requires 1.9, try the
367232 [mail maasha.] I have been looking at your suggestions and done a few tests. However, I
367233 [b.candler po] What do you want the exception handler to do? Will the program still
367238 [mail maasha.] I want to write the exception type to a log file and terminate the
367242 [b.candler po] It does for me.
367243 [b.candler po] Actually, the sample output I showed was without the 'exit!'
367244 [mail maasha.] This works great! I was sure I had tested this, but I had screwed up the

^ Used Car Sri Lanka
367171 [m.10ahesh gm] Used Car Sri Lanka

367172 [dmgreta hotm] Salve! Qualcuno di voi ne sa qualcosa di allineamento ottimo locale tra

^ String concatenation in ruby
367175 [prachi.tripa] This seems to be a basic question but i would like to know why.
+ 367180 [justincollin] As you mention, using + will create strings which then need to be
+ 367181 [colinb2r goo] You can experiment using benchmark (see below) or hitimes (which I haven't

^ Converting a website to ruby
367178 [trevor nugen] I'm pretty new to ruby, and I've been grasping everything that I've read
+ 367182 [rogerpack200] Maybe use ruby CGI?
+ 367189 [hassan.schro] CGI? Archaic and pointless, IMO -- if not Rails, there are other light
  367198 [trevor nugen] Your post was a little unclear. Are you trying to suggest I should use
  367199 [hassan.schro] IMO = "In My Opinion"
  367220 [trevor nugen] Well What exactly would you suggest then.
  367221 [hassan.schro] See previous "light weight framework" comment.
  367246 [trevor nugen] Ok thank you.

^ Luhn
367188 [usmanhhussai] Has anyone used the Luhn Algorithm before?
367193 [hassan.schro] "There's A Gem For That"(tm)  :-)

^ Audio Files length
367204 [e.j.jurman g] I'm modifying a Radio Automation program that I built with tkSnack for
367227 [jazzezravi g] To get the frame length of the MP3 file  Please use the below ruby gem

^ expecr error help!
367205 [derekbellner] Any ideas? Output and error is below at __OUT__
367230 [b.candler po] What platform are you on - operating system type and version, ruby type
367260 [derekbellner] # ruby -v
+ 367262 [derekbellner] I even tried the passwd command code copied from this site in someone
+ 367267 [b.candler po] Then it looks like the PTY library doesn't work properly under HP-UX. If


This is pretty interesting...

367216 [pavsuri gmai] ...

^ [ANN]  August Phoenix Ruby User Group Meeting
367218 [james.britt ] August Phoenix Ruby User Group Meeting

^ Where to host the Ruby Project Source Code
367223 [kadishmal gm] I have created the Ruby Driver for CUBRID Database System. Currently
+ 367224 [kadishmal gm] By the way, the proposal came from twitter user. The conversation can be
+ 367226 [richard.conr] Well if you look at all of the Ruby extensions that are popular and in
+ 367229 [b.candler po] rubyforge.org is the granddaddy, and does now support git I believe, but
| 367231 [kadishmal gm] Sounds like more and more Rubyists prefer Github. At least there is
+ 367253 [canglan gmai] As I suggested in the tweet, I am pro-Github.
+ 367296 [josh.cheek g] I tend to be skeptical of code not hosted on github, I associate it with
  367357 [kadishmal gm] So, you say you vote for Github, right?
  367426 [kadishmal gm] The final decision has been made and the CUBRID Database Connector for

^ Connecting to SQL Server 2005
367228 [parulg covel] I need to connect to SQL server 2005 using Ruby. I went through some
+ 367247 [d_rems yahoo] ODBC is the way.
+ 367249 [javaalley gm] if your are working with rails you can try

^ lt operator on class object, checking a class' superclasses
367234 [tomekwr gmai] Do you know a good way to check whether a class is a subclass of a
+ 367236 [jgabrielygal] Klass.ancestors.include?(Ancestor)
+ 367237 [sutniuq gmx.] It is documented, although it may be a bit hard to find, since the
  + 367240 [tomekwr gmai] I see. I got deceived by the fact that the method actually seems to be
  + 367241 [michal lomni] What's more '<' operator itself is defined in Object class not in
    367248 [calamitates ] Module.instance_methods - Object.instance_methods
    367250 [michal lomni] Of course. Shame on me.

^ Re: regular expression negate a word (not character)
367235 [ryan.holmes ] I know this is an old post, but was trying to do something similar and

^ Parse a Date From a String
367251 [arti.p.singh] Help!! I get a float when I  try to parse a date from a string.
+ 367252 [aurelien.ami] or
+ 367266 [s.korteling ] The "%I" in your code should be a "%H" (24 hour clock)
  367298 [gf.bozzetti ] p(obj) displays obj using its inspect method.

^ comparing two arrays, too slow
367254 [rubytalk che] I don't have access to the database, but everyday I get a csv dump of all
+ 367256 [matt harpsta] terminated_ids.each do |row|
+ 367259 [wyhaines gma] The answer to, "it's too slow", is often, "don't do that, then."
+ 367261 [vikkous gmai] Here's an idea... although, Matthew's suggestion is really the better
  367268 [b.candler po] Another option: sort them by id, then walk through them together. If the
  367368 [rubytalk che] Guys!  Thanks for the great responses, and clever perspectives on this

^ Problem with return value
367257 [amiref ymail] def test_method(name)
+ 367258 [matthew byte] Because in Ruby, the last statement executed in a block is the block's
| 367263 [Rob AgileCon] Actually, 3+5 is the last statement in your test_method.  Are you
+ 367265 [brabuhr gmai] irb(main):001:0> def test_method(name)

^ Adding sugar to Ruby
367264 [prog janleli] gem called zucker.
+ 367270 [rogerpack200] I like the regex one.
+ 367272 [yermej gmail] I was going to give it a try, but when I installed it (sudo gem
+ 367282 [eregontp gma] [3,4,5].zip([1,2]).each { |e,f| puts "#{f},#{e}" }
| 367307 [prog janleli] Thank you all for your feedback :)
| 367318 [yermej gmail] Yeah, looks like something is wrong with my machine. I've used gems in
+ 367303 [mike mike-no] I like the way you think :)  These feel like a natural progression, although I

^ Failed to install 'rubynode' gem after Snow Leopard upgrade
367271 [uvwqijguiith] I've just upgraded to Mac OS X 10.6, and was following the instructions
+ 367273 [ryand zenspi] No, you'll likely never need it for rails development. AFAIK, it isn't =
+ 367274 [sora134 gmai] i think ruby's source isn't included in osx.

^ class definition outside module
367275 [raj_plays ya] I have 2 classes, Parser and Util in parser.rb and util.rb respectively.
+ 367276 [stefano.croc] classes, Parser and Util in parser.rb and util.rb respectively.
+ 367277 [b.candler po] module Mod

^ A problem with "puts"
367278 [amiref ymail] Considering that , "puts" always return "nil" why in below code the
+ 367280 [dblack rubyp] I don't think I understand your question. Can you show the output you
+ 367281 [brabuhr gmai] What output do you expect to see?