343771-344270 subjects 344181-405603

Can't execute shell commands in CGI
343986 [psixxx@bk ru] It is necessary to execute linux command in CGI(apache)
+ 343987 [psixxx@bk ru] def cmd(com)
+ 343992 [bbxx789_05ss] 1) There aren't any code tags here.  You can just post your code and the
| 344051 [psixxx@bk ru] The path log.log can be correct since ">" creates a file if it does not
| 344063 [lists@be tr ] Redirect $stderrr, too. Direct it into /tmp to avoid access rights
+ 344082 [b.candler@po] system("pwd >/tmp/log.log")
  344149 [psixxx@bk ru] thank all, and thank you, Brian Candler. /tmp/log.log has pwd

Parsing JavaScript to prevent maliciousness?
343991 [mongoosehq@g] I'm working on a site that is implementing similar functionality to _A
343993 [xenogenesis@] On Aug 15, 9:35=A0pm, Mongoose Sir mongoose <mongoos...@gmail.com>
343994 [aaron@te de ] Both support AST manipulation as well as turning the AST back in to
343998 [karottenreib] Yep, sounds quite dangerous to me as well...
344000 [mongoosehq@g] @pharrington - thanks for the pointer on Hpricot/Nokogirl.  I'm familiar
+ 344003 [tony@me io .] For what it's worth we're using Johnson for something similar, the intent
+ 344017 [karottenreib] But if you let them manipulate the dom, how are you going to prevent script

[ANN] unicorn 0.90.0
344004 [normalperson] Unicorn is a Rack HTTP server for Unix, fast clients and nothing else

while !file.eof?
344005 [derekbellner] How can I use a while loop in such as way where I want to process the
+ 344007 [botpena@gm i] on your case, you do not need the EOF sig. Pls read on ruby's
| 344018 [shortcutter@] You're not closing the file handle properly. :-)
| + 344035 [derekbellner] OK thx guys!
| | + 344048 [shortcutter@] The difference is just precedence.  But actually both are bad idioms as
| | + 344060 [8si.greg@gm ] Ah. "do ... end" vs. "{ ... }". Yes, that was a bit confusing at
| + 344062 [botpena@gm i] i was leaning on the op's example... :)  For the record, when it comes
|   344074 [shortcutter@] Probably yes.  But: it will certainly be later than necessary (when a
+ 344008 [james@gr yp ] each() is already doing that in the code you showed, so the easiest
+ 344040 [kyleaschmitt] It's not always appropriate, but File.read() is pretty slick too...

How can I extract variables from a ruby snippet
344006 [laran@la an ] <request>
344085 [b.candler@po] You can't tell that - lots of objects implement an 'each' iterator, and
344105 [shortcutter@] I toyed around a bit - this solution is by far not perfect!

start_with?  Does someone need a grammar lesson?
344009 [bbxx789_05ss] String#start_with?-------------------------------
+ 344010 [pbooth@no oi] ...
+ 344016 [bbxx789_05ss] Hmm...I guess start_with?'s  name is consistent with the naming
| 344022 [rick.denatal] Yep,  I too found it a bit jarring when I first started using Ruby,
| 344029 [robert.dober] I bet you prefer that I call you "vieux ami" instead of "ami vieux" though!
| 344058 [rick.denatal] h!
| 344066 [robert.dober] Now I am confused. But no, they do not need to stand after nouns,
+ 344027 [rogerdpack@g] I'd be quite happy if someone came up with a gem that aliased
+ 344052 [dominikho@gm] mystring.start_with? (or include? or respond_to? and so on) are best
| + 344054 [vjoel@pa h. ] Or
| + 344161 [caduceass@gm] Nah, it's a common artifact of moving east asian grammar to western.
|   344171 [caduceass@gm] I didn't give an example.  My bad...
|   344334 [dominikho@gm] I honestly rather like to explain this "artifact" by the fact what it
|   345534 [caduceass@gm] You might be right.  But in any case, I'm guessing at least 40% of
+ 344130 [nilesh.tr@gm] Hey str, do you start_with "hello" ?

SOAP, WSDL and LiveDepartureBoards
344015 [peter.hicks@] All,

[ANN] Don't forget: deadline is Aug. 21 for RubyConf proposals!
344021 [dblack@ru yp] Please remember that the deadline for RubyConf talk proposals is

free proxy site
344024 [enggroups8@g] free proxy site

Compiling Ruby for T5220 UltraSparc's
344033 [christopher.] I have to compile Ruby as a Operations requirement on a T5220
344041 [rogerdpack@g] If you have a copy around, you can find out "a lot about it" via

Git Subprojects and Rubyforge
344034 [transfire@gm] I was thinking about the issue of Rubyforge only supporting a single
344039 [vjoel@pa h. ] Scary...

task/work queue
344036 [g@gu pa .c .] I have created essentially a webapp using sinatra/webrick which allows a
344046 [msassak@gm i] anything that fits your requirements exactly, but you could definitely find

CSV import to hash to compare with database
344037 [john.mcleod@] Is it practical to import data from a csv file, via FasteCSV to a
+ 344038 [james@gr yp ] I don't see why it wouldn't be.  FasterCSV::Row has a to_hash()
| 344043 [john.mcleod@] Mr. Gray,
| 344056 [james@gr yp ] You can stick with James.  I'm not that old yet.  ;)
| 344095 [john.mcleod@] James,
| 344101 [shortcutter@] John,
| 344104 [john.mcleod@] Robert,
| 344107 [shortcutter@] It may not be a viable solution in your case but it could be
| 344111 [john.mcleod@] Robert,
| 344197 [shortcutter@] 'm
+ 346570 [yonision@gm ] If you wish to avoid programming and would consider a third party

[ANN] Net::SSH 2.0.13 Released
344042 [delano@so ut] client

[ANN] release: a "which" command written in ruby--very useful for  windows users at least
344045 [rogerdpack@g] Announcing the release of "ruby which"[1]
344049 [drbrain@se m] $ gem which fileutils
344114 [rogerdpack@g] Nice.  I've noted the usefulness of "gem which" in the README file now.

Logging into cisco intrusion prevention system
344050 [ruby.haxor@g] Is there any gem module which can be used to login to the cisco
344083 [b.candler@po] but with a simpler API the same as Net::Telnet (so you can write code
344140 [ruby.haxor@g] Thanks a lot Brian, i'l give it a try and see how it works :-)

Named Matrix like ArrayFields
344053 [dan@ep rk ab] I'm looking for a named matrix that acts like arrayfields so you can
344214 [list.push@gm] Maybe take a look at Struct.

ANN: ThirdBase 1.2.0
344055 [code@je em e] ThirdBase is a replacement for Ruby's standard Date/DateTime
344057 [rogerdpack@g] How does it compare to http://tomayko.com/src/date-performance/
344059 [code@je em e] I haven't used Date::Performance, but from reading that page,
344090 [rick.denatal] Both Date::Performance and ThirdBase seem to focus on the performance
344102 [code@je em e] ThirdBase doesn't just focus on parsing speed.  It also tries to be fast

conditional logic in HAML
344061 [gnoll110@ya ] ERB
344068 [andrew@an re] -if ENV["RACK_ENV"] =3D=3D "production"

External Model Definition Using ActiveRecord
344064 [elizabeth.bu] I've been Googling this topic, and I haven't found the answer.
+ 344081 [b.candler@po] require 'rubygems'
| 344129 [elizabeth.bu] Thank you!  I come from Perl, so I kept thinking use lib.  I can
| 344139 [b.candler@po] No, you would have to do it yourself, e.g.
+ 344187 [boesemar@gm ] I did that by writing a small script that simply copies all models from

ruby-net-ldap search result pagination
344067 [maxima.parag] I'm new to ldap and I need to paginate the search result that it will
344122 [dsisnero@gm ] I think ruby-net-ldap automatically already uses the paged search control
344873 [maxima.parag] Thank you for your reply.

copying values from a different file into variables
344073 [idealone5@ho] I would like to copy specific lines(contents) from file1 into file2.
344206 [pokui@ps .c ] You'd generally get more help if you try to do some of the work and

unit testing generated content
344075 [sylvain.viar] I'm writing unit test.
+ 344079 [b.candler@po] You can match a single regexp across a multi-line string; using /m
+ 344084 [bbxx789_05ss] def test_it(str)
  344106 [sylvain.viar] Hey cool seems great.

how to Get the list of MenuBars in excel using ruby
344076 [vamsikrishna] i'm trying to get the list of menubars in the excel using ruby
344096 [david.mullet] The MenuBars collection is not intended for use through the API.
344195 [vamsikrishna] Thank you David, its working.

[ANN] ruby_parser 2.0.4 Released
344077 [ryand-ruby@z] ruby_parser version 2.0.4 has been released!

Including a module in an included module.
344078 [prince.nez@g] module M1; end
+ 344086 [bbxx789_05ss] The results seem to speak for themselves: include only unwraps the
| 344087 [bbxx789_05ss] Nope.  That rule doesn't work with example 1.  It appears one level of
+ 344089 [shortcutter@] Inclusion apparently works by extracting the ancestors of a module at

fromdos dos2unix in ruby
344088 [ciapecki@gm ] fromdos dos_file.txt unix_file.txt
344091 [ciapecki@gm ] just to add, I need to do that conversion under windows.
344093 [dominikho@gm] Well, you would read from the input file, replace the dos/windows line
344103 [ciapecki@gm ] I tried with following dos2unix.rb script
344109 [shortcutter@] You are not closing the File object properly so your output might
+ 344110 [ciapecki@gm ] can you let me know how to close it properly?
+ 344113 [Rob@Ag le on] You open the file with the default mode of 'r' here so the File class
  + 344120 [ciapecki@gm ] into =A0
  + 344126 [robert.dober] o buffer
    344131 [fxn@ha hr f.] Just for the record... in Ruby "\n" == 10.chr in all platforms. I find
    344144 [robert.dober] eperator
    344145 [shortcutter@] I would let Ruby do the line detection to avoid the issue Robert pointed
    344148 [fxn@ha hr f.] Hey but this is dos2unix :-).
    + 344157 [robert.dober] Yup, I thought my code solved the issue, tell Ruby that a line ends
    | 344159 [fxn@ha hr f.] The idea is good, but this topic is brittle (though easy when you get
    | 344198 [robert.dober] But I did open it in binary mode, did I not?
    + 344196 [shortcutter@] Ooops, make that then
      344200 [fxn@ha hr f.] Oh you are right. I thought chomp chomped the input record separator,

[ANN] Refactoring in Ruby rough cut
344092 [kevin@ru he ] I thought some of you might be interested in this...

[ANN] ri_cal 0.8.1 Released
344100 [rick.denatal] ri_cal version 0.8.1 has been released!

gem installation oddity
344112 [rps@sa as co] I have been totally puzzled by what I think is a misconfiguration of my
+ 344116 [rogerdpack@g] Might be a bug.  http://github.com/Pistos/ruby-which/tree/master might
+ 344136 [drbrain@se m] Is there even a wxruby in the gem?
  344138 [rps@sa as co] I don't think I exactly followed this. But in the meanwhile I think I
  344141 [drbrain@se m] Designate /opt/local/ruby as your primary ruby by setting your PATH,
  344143 [rps@sa as co] $ echo $PATH

One-click Windows installer for Ruby 1.9.
344115 [pbailey@bn .] Does anyone know when they're be a one-click installer for Ruby 1.9? I
344119 [rogerdpack@g] Check out http://rubyinstaller.org/
344217 [pbailey@bn .] I tried this Ruby, and, I have to say, it leaves something to be
344232 [luislavena@g] no
+ 344234 [masonkelsey@] "* Adding Ruby to the PATH requires administrative privileges. The
| 344237 [luislavena@g] e two
+ 344241 [pbailey@bn .] I am a full administrator.
  344247 [lyle@ly ej h] I think that what Luis was trying to say is that Ruby 1.9 is not

rake and cucumber fails with ruby-1.9.1-p243 and polyglot 0.2.7
344117 [orengolan@gm] rake and cucumber fails with  ruby-1.9.1-p243 and polyglot 0.2.7.
344121 [orengolan@gm] I guess it was fixed in 0.2.8 -

[ANN] Initial release of the desc_method gem--a "run time RI for  methods"
344118 [rogerdpack@g] I am pleased to announce the release of desc_method.
344123 [karottenreib] hm, is that just me, or why am i getting this strange error?
344127 [rogerdpack@g] Yes I get that too, for some reason.  Very weird.

[ADV/REMINDER] Ruby language training in September w/ Black & Kastner!
344124 [dblack@ru yp] Don't forget that Ruby Power and Light has some Ruby training coming

exercise in DRY
344125 [crazedcougar] I have some simple code for a thumbs up/thumbs down functionality.
+ 344128 [karottenreib] class Tweet
| 344132 [crazedcougar] This look pretty good!  I have to set up a bunch of migrations before I
| 344134 [karottenreib] 2009/8/18 Peter Ehrlich <crazedcougar@gmail.com>
| 344135 [crazedcougar] Alright awesome, thanks for the help!  (And yes I suppose I should throw
+ 344191 [eule@sp ce c] How about: (assumes rails and haml)
  344192 [karottenreib] that's not quite correct
  + 344228 [crazedcougar] Alright, thanks to both of you, its working beautifully (and I've
  | 344275 [crazedcougar] (no haml just because I'm too busy learning rails and ruby already :-)
  | 344280 [josh.cheek@g] If you have that many <% ... %> all in a row, and are placing that much
  | 344367 [crazedcougar] Thanks for the advise, its very much appreciated.  I think I did just
  + 344389 [eule@sp ce c] Yeah, it should have been.. but if you look at the original, only
    344527 [karottenreib] just wanted to make sure the end result works ;-) I know how many futile

Q re nokogiri - searching Google  and counting web pages with specific text
344133 [phil@pr co .] People,
344137 [drbrain@se m] Why don't you use the google search API?
344142 [phil@pr co .] Eric,
+ 344152 [jstewart@fu ] The google search API does not use SOAP anymore, that's been
+ 344153 [drbrain@se m] Looks like the SOAP API isn't being maintained anymore, use the modern

show a listing of methods unique to class
344146 [jason.lillyw] Often I find myself in IRB wanting to see a list of methods available to
344147 [jason.lillyw] irb(main):073:0> (1.public_methods - Object.public_methods).sort
+ 344150 [vjoel@pa h. ] irb(main):002:0> Integer.instance_methods.size
+ 344151 [dblack@ru yp] Integer.instance_methods(false)
  344154 [jason.lillyw] Thanks folks. This is very helpful.

Inconsistent Modal Dialog Error on IE7 and IE8
344155 [arti.p.singh] has anyone seen this error before?

[ANN] MagickWand for Ruby 0.2.0
344156 [TimHunter@nc] I've just uploaded the second beta release of MagickWand for Ruby, my

Re: Initial release of the desc_method gem--a "run time RI for  methods"
344158 [luislavena@g] On Aug 18, 1:20=A0pm, Fabian Streitel <karottenre...@googlemail.com>

when run from cron, regex NEVER match, always give nil
344160 [jdinkel@gm i] I'm using ruby 1.8.6 on RHEL 5.3. I also had this problem with ruby
+ 344162 [TimHunter@nc] It's cron. Or rather, it's not cron, or Ruby, but something about the
| 344253 [xeno.campano] It probably has something to do with the cron not using Bash as the default
+ 344273 [8si.greg@gm ] Like Tim said, it's probably something in the environment. Besides
  344279 [jdinkel@gm i] sorry for the silence, I've been swamped today (consultants are here
  + 344281 [ray.baxter@g] How exactly do you know that your regular expression doesn't match?
  + 344283 [ryand-ruby@z] I can almost guarantee it has nothing to do with cron itself.

Problem with Net::SFTP
344163 [robin@ro in ] I apologize if this is not the right place to post a message about a gem
344168 [robin@ro in ] I did not mean to post this multiple times - I thought I was seeing a

Problem with Net::SFTP
344164 [robin@ro in ] I apologize if this is not the right place to post a message about a gem
344173 [robin@ro in ] I did not mean to post this multiple times - I thought I was seeing a

Problem with Net::SFTP
344165 [robin@ro in ] I apologize if this is not the right place to post a message about a gem
344172 [robin@ro in ] I did not mean to post this multiple times - I thought I was seeing a

Problem with Net::SFTP
344166 [robin@ro in ] I apologize if this is not the right place to post a message about a gem
344170 [robin@ro in ] I did not mean to post this multiple times - I thought I was seeing a

Problem with Net::SFTP
344167 [robin@ro in ] I apologize if this is not the right place to post a message about a gem
344169 [robin@ro in ] I did not mean to post this multiple times - I thought I was seeing a

if defined on var
344175 [derekbellner] db =
+ 344176 [sepp2k@go gl] true and defined are two very different things. Take this snippet as an
| 344276 [derekbellner] Hey Seb,
| 344277 [bg-rubytalk@] The variable "table_exists" is not nil and not false.  It is probably
| 344278 [derekbellner] Amen Ben!  I understand completely. Thank you!
+ 344178 [lists@be tr ] irb(main):001:0> x = nil
  344194 [b.candler@po] Only if you "require 'yaml'"

[ANN] vlad 2.0.0 Released
344179 [ryand-ruby@z] vlad version 2.0.0 has been released!

344180 [transfire@gm] Messing with optional argument check for the umpteenth time, eg.
+ 344208 [rogerdpack@g] Maybe morph this to
| 344226 [transfire@gm] Either way is fine. The defined method interface doesn't matter.
| 344243 [matt@ha ps a] ...
| 344262 [matt@ha ps a] def has_arguments?(&b)
| 344265 [vjoel@pa h. ] Using #local_variables won't work for this, will it?
| 344266 [matt@ha ps a] Good point....  I didn't think of that case -- can you suggest a solution?
+ 344216 [rick.denatal] I've never felt the need for this.
| 344225 [transfire@gm] Right, it precisely the times when nil is a valid value that it is a
| 344230 [drbrain@se m] class X
+ 344264 [cmshea@gm il] def meth(a=3D(no_argument=3D'default'))
| 344268 [headius@he d] Yeah, my version avoids the falsy issue...but yours is shorter.
+ 344267 [headius@he d] def meth(a=(defaults=true;Exception))
+ 344309 [b.candler@po] But it doesn't solve the general case of
+ 344322 [shortcutter@] My 0.02 EUR: if your method's behavior changes depending on argument
  344324 [b.candler@po] def foo(a = nil)
  + 344326 [rick.denatal] I didn't take Robert as meaning that the above is silly.
  | 344332 [b.candler@po] # prog1.rb
  | 344338 [shyouhei@ru ] In this case method m is explicitly called with argument x, so showing ni=
  + 344327 [shortcutter@] Can you explain what the differences are?
    + 344328 [shortcutter@] Argh!  Now I see what you mean.  If you use nil as universal "absence"
    | 344336 [b.candler@po] I've certainly used it. Using the *args pattern only works if the
    + 344333 [b.candler@po] What I mean is, when you have an argument with a default value, you may