390544-391933 subjects 390973-403144

net/sftp hangs
390752 [peymano@gm i] I've got a simple script for enumerating files on an SFTP server and

problem running hpricot
390754 [nilanjanb@li] ....report_activate_error:RubyGem version error: hpricot(0.8.5 not>= 0)
390829 [shevegen@li ] Looks odd. Did you try to run hpricot alone?

Inverse Operation of Module#include
390755 [su.comp.lang] class A
+ 390756 [gilbertly@gm] Maybe you want to undef the method before including a module.
| 390778 [su.comp.lang] I tried that, but that will not remove the mixed-in module from the
+ 390757 [shevegen@li ] I think there unfortunately is not.
+ 390758 [gilbertly@gm] BTW, what do you want to achieve, switch interface at run-time or
| 390779 [su.comp.lang] The latter. In my example code the interface `foo' is not changed but
| 390794 [gilbertly@gm] Then, you probably can consider making different implementations as
+ 390759 [ryand-ruby@z] My "un" gem will do the trick, but there is nothing built in
| + 390764 [isaacbfsande] I would suggest an Adapter pattern use here. IF there is something that has
| | + 390765 [steve@st ve ] Abstract base classes are silly in Ruby; why bother with that
| | | + 390772 [isaacbfsande] The way I have it implemented, but if it were to have a lot of
| | | + 390781 [peter@va de ] Steve,
| | |   + 390782 [luke.gru@gm ] Correct me if I'm wrong, but I think Steve was trying to say that using
| | |   | 390791 [peter@va de ] Aha,  thanks for the detailed reply.
| | |   + 390839 [shortcutter@] => Template method pattern
| | |     390840 [peter@va de ] Thx for that pointer. I am still not clear what Steve exactly meant with
| | |     390844 [shortcutter@] ic
| | + 390784 [su.comp.lang] What if Team inherits from Group, and both FootballTeam and BaseballTeam
| |   390785 [isaacbfsande] If you want to redefine a function, and the adapter pattern does not seem
| + 390780 [su.comp.lang] That's good to know, I will definitely give it a try :)
+ 390813 [sean.ohalpin] [snip code]

docdiff syntax error
390761 [christopheth] ...
390762 [ryand-ruby@z] Linux 5.5

Using OpenSSL for making a network TLS server
390763 [ibc@al ax ne] in C++ using OpenSSL) as noted in
390773 [jdowney@gm i] Ruby's OpenSSL library has an SSLServer class that will do exactly what
390774 [ibc@al ax ne] Really thanks a lot.
390871 [ibc@al ax ne] to do is using OpenSSL on top of a EventMachine TCP connection.
390912 [ibc@al ax ne] Any suggestion about this please? Maybe the only response is that
390947 [b.candler@po] Definitely don't write a TLS implementation yourself.
390952 [ibc@al ax ne] Really interesting, thanks a lot, I will use it.

Native extension: arguments as a hash
390768 [mcpierce@gm ] I'm working on a native extension in C for Ruby 1.8.7. The method I'm
+ 390769 [now@bi wi se] ...
| 390770 [mcpierce@gm ] Thank you! I'm looking it over now. :)
+ 390771 [admin@te so ] I am using 1.9.2, but hopefully it doesn't change much.  To have command

rake --dry-run: how to see what sh commands will be run?
390777 [lw2011@so ic] I am trying to set up some rules to build files with locally installed
+ 390831 [andres.mrad@] well, form what i understand by reading this
+ 390852 [lw2011@so ic] Unfortunately, -v displays shell commands only when I'm not
+ 390883 [andres.mrad@] have you tried invoking it with -T?
+ 390888 [ryand-ruby@z] 'rake
  390892 [ymendel@po o] C projects it is a vastly superior tool. :)
  390908 [lw2011@so ic] That is probably beyond my abilities (or at least beyond my budget of

How to write a sorting program
390788 [sasogeek@ya ] I'm supposed to write my own sorting method for a list of words entered
390789 [cremes.devli] Your teacher is probably a member of this mailing list. Why don't you ask them for some help?
390790 [sasogeek@ya ] I'm reading Chris Pine's book - Learn to program... that's where the
390793 [ryand-ruby@z] Get some scraps of paper, number them, mix them up, and work through it =
390838 [shortcutter@] Samuel, if you need some idea of how sorting algorithms work you'll

Is there a better way to check this array?
390795 [wbrisett@at ] I have an array which contains items that need to be renamed. =
+ 390796 [peter.c.r.la] => true
| 390798 [wbrisett@at ] Thanks. Both of these have given me more food for thought. I knew grep =
| 390799 [ammarabuali@] FYI, you can use variables inside the regular expression.
| 390800 [wbrisett@at ] grep should have worked. The issue Ammar that I see with it though is I =
| 390801 [isaacbfsande] Why u no use hash?
| 390803 [astounding@g] I was wondering the same thing as Isaac.  Your data seems quite well
| 390805 [wbrisett@at ] I think mostly it's due to my inexperience using Ruby (or any other =
+ 390797 [ammarabuali@] grep should do what you want with a regular expression. Here are few

Dynamic instances of a class.
390804 [andres.mrad@] require 'csv'
+ 390806 [lw2011@so ic] I'm not an expert, but your question I can answer. Woohoo!
+ 390807 [lw2011@so ic] Oops, I didn't take into account the format of your data file, in which
| 390817 [andres.mrad@] wow thanks this really is light in the empty void of my ignorance, i'll
+ 390818 [andres.mrad@] For some estrange reason it wont let me edit, but i'll share my results.
+ 390819 [lw2011@so ic] Motorcycle.new( *line.split( ',' )  )
+ 390822 [andres.mrad@] OK, hate to multi-post, but wanted to let you know that i made it, is not really elegant, i wish there was a better way to do it, but at least i (kind of) get a solution for the main problem on this post.
  + 390823 [hassan.schro] Yes, use the CSV library you've required (but never used) to parse
  | 390830 [andres.mrad@] Ok, i really have no experience, and must say that the library was there
  + 390868 [frederick.ch] Be careful here, because you are only referring to your Motorcycle

help with recursive method def'n using eval
390808 [cremes.devli] I would like to solve a problem where a writer of a class can provide an array of fields and those fields are turned into two things.
390809 [cremes.devli] I should have waited a few more minutes. After typing this up, I was hit by inspiration. Here is my solution.
+ 390811 [cremes.devli] And once again I should have waited a few minutes or at least long enough to run my test. Here's a bug fix for the missing "end" to close the method definition (it's the call to #downto).
+ 390821 [transfire@gm] ...
  390837 [cremes.devli] ...
  390860 [pete@pe er i] If it's not important to output the constructed string, you could do it
  390884 [cremes.devli] Pete, thanks for figuring out another approach. I prefer building a string and eval'ing it because it's easier (IMHO) to verify that the generated code is correct by examining the string. Using #define_method works quite well too, but when something is wrong with the method definition it's a bit tougher to track down and fix.
  390885 [pete@pe er i] I respectfully disagree, but you should write your code how you like your

[ANN] sqlite3 1.3.5 - ZOMG Holidays are here Edition Released!
390810 [luislavena@g] sqlite3 version 1.3.5 - has been released!

Re: ANSI v1.4.0 released
390816 [kazu.dev@gm ] Alternatively you can use isna which has simpler approach.
+ 390820 [transfire@gm] ...
| + 390826 [shevegen@li ] To be honest, I think ruby should include an ANSI solution in its
| | 390902 [transfire@gm] ...
| + 391613 [kazu.dev@gm ] I actually went over all of the implementations of ansi before writing
+ 390832 [gsinclair@gm] There's also my "Col" library, created when I wanted efficient control

'open().each' doesn't close file
390833 [viertelvor12] On Ruby 1.9.3 (win7(64))
+ 390834 [m.fellinger@] open will only close if you pass it a block directly.
| 390851 [rubytalk2dav] So just "do end" doesn't count as a block?  Seems (at least to me)
| 390853 [joelvanderwe] In your case, the "do end" block is passed to the #each call, not to the
| 390875 [rubytalk2dav] D'oh!  You're right, sorry, I glossed right over that.  That must be
+ 390854 [luke.gru@gm ] ls -ld /some/dir
  390867 [b.candler@po] The OP was using Windoze.

RedCloth: Adding custom verbatim tag
390835 [sutniuq@gm .] I¡Çm using RedCloth for writing texts, it however doesn¡Çt know anything
390903 [transfire@gm] ...
390905 [sutniuq@gm .] I always thought that was only a bug tracker and general questions

[Ruby C] Using DATA_PTR in multiple methods
390841 [mattbastard@] I'm writing a Ruby extension in C to utilize a library (tsk3, aka. The
+ 390847 [hanmac@gm .d] your alloc method does not create an object, change
| 390859 [sylvester.ke] Is this a C++ extensions? I would be careful mixing new/delete and =
+ 390874 [admin@te so ] This is similar to the issue of pointer and address of pointer.
  390906 [mattbastard@] These were very helpful suggestions.  You're right, the
  390907 [admin@te so ] And don't forget to deallocate the struct myHandle too. :)

array to string conversion
390845 [erj514@gm il] I have an array called l that contains 161 lines of text. I created it
390850 [lw2011@so ic] Your code snippet will fail because it tries to assign global var

390848 [paradisaeida] Firefox sends Capitalized-Hyphenated.
390914 [drbrain@se m] It doesn't matter.  HTTP headers are case-insensitive.
390916 [paradisaeida] Thanks Eric,

Hubeye gem updgrade
390849 [luke.gru@gm ] Hey, I've been working on a project that allows you to track

Sending F3 to telnet
390855 [asanramon@ya] I have been trying to figure out how to send F3 key in net::telnet. I
390891 [echristopher] That would depend on the terminal emulation the other end is

C module calling ruby code cause cfp consistency error
390861 [bukowski.ada] I need some help with joining C code with Ruby.
+ 390870 [kim@bu ge tr] Yes. You cannot call Ruby functions from a thread not created by Ruby. When
+ 390901 [bukowski.ada] Really You explained a lot of things to me. I didn't know basic concepts
+ 414085 [lists@ru y- ] I'm currently developing an ruby extension which confronts me with the

Persistent error: "String can't be coerced into Float"
390869 [windbreiz@gm] I am totally puzzled by this application of the .to_f method. I have

redmine.ruby-lang.org MIA
390872 [keltia@gm il] I have not seen any downtime announce so can anyone fix the redmine
390873 [sophrinix@gm] Are you referring to http://redmine.ruby-lang.org ?

black magical hash element vivification
390876 [code@ap th o] Ruby (1.9.3p0 to be precise, installed with RVM) is not behaving as I
+ 390877 [adam@ap es o] This isn't. Hash.new(Hash.new) != Hash.new { |h, k| h[k] = Hash.new }. The
| + 390878 [adam@ap es o] D'oh! Strike that, it's behaving as expected, it's just hidden beneath an
| | 390889 [code@ap th o] That, for me, is *very* surprising behavior.  I would think that it
| + 390880 [jgabrielygal] Returns a new, empty hash. If this hash is subsequently accessed by a
| | 390882 [adam@ap es o] 2011/12/5 Jess Gabriel y Galn <jgabrielygalan@gmail.com>
| + 390887 [code@ap th o] I figured out that Hash.new(Hash.new) used the same object for all of
+ 390879 [jgabrielygal] Using that Hash constructor, what you pass is the default value for a
  390890 [code@ap th o] I find it rather surprising that assignment does not create something new
  390893 [jgabrielygal] =A0I
  390894 [josh.cheek@g] 2011/12/5 Jes=FAs Gabriel y Gal=E1n <jgabrielygalan@gmail.com>

Re: Using DATA_PTR in multiple methods
390881 [mattbastard@] No.  I'm attempting this in pure C.  The tsk library is written in cpp,

[ANN] Zbatery 4.1.2 - Rack HTTP server without a fork stuck in it
390886 [normalperson] Zbatery is an HTTP server for Rack applications on systems that either

[ANN] clogger 1.1.0 - configurable request logging for Rack
390896 [normalperson] Clogger is Rack middleware for logging HTTP requests.  The log format

Newbie: Understanding Throw/Catch
390899 [ankush_ganat] ...
390900 [josh.cheek@g] You got this out of a book? I'd be hesitant to continue learning from it

Hashes - thanks!
390904 [wbrisett@at ] I wanted to thank everybody for putting me on the right track with the array

Developing Qt4 applications with Ruby 1.9.x
390909 [rcmitchell@g] I am running KDE on 32-bit Linux Mint Debian Edition.  For several years now I
+ 390921 [stefano.croc] qtruby works perfectly for me with ruby 1.9.3, so the answer to your last
+ 390926 [shevegen@li ] I cant help you much myself.
  390934 [rcmitchell@g] It would be a shame, since Ruby and Qt seem made for each other.  If only

Ruby way to define binary
390910 [b1368810@lh ] I have some trouble. How can i define the binary of value in ruby? (I
+ 390911 [wbrisett@at ] Use match
+ 390915 [gilbertly@gm] not sure I understand your question correctly, but Ruby does not offer
+ 390928 [shevegen@li ] I myself patched class String and added a .to_bool method that turns
| 390929 [eule@sp ce c] Why would you ever need to represent a false as the string 'false'?
+ 390931 [ryand-ruby@z] You don't really need to. Everything in ruby has a "truthiness" to it =
+ 390932 [b1368810@lh ] I want to hear this ;) Thanks!

Which pcap (tcpdump) library to use?
390917 [andrewinfose] It seems that the pcap library has not been recently maintained, and so
391287 [code984265@g] I'd go for either two of the pcaprub gems imo.

WEB SURVEY about Ruby Community
390918 [transfire@gm] ...
+ 390919 [normalperson] Yeah, I told him I don't like web browsers, JavaScript or graphics
+ 390927 [shevegen@li ] I did not get anything. But I am using only the Web Interface to the
+ 390935 [josh.cheek@g] I didn't, maybe it's being marked as spam?
| + 390936 [adam@ap es o] I got one, but the email itself says that only a sample of the mailing list
| | 390937 [whitequark@w] misunderstanding. It seems like a terminology clash, i.e. he has
| | 390941 [sutniuq@gm .] I got this mail as well, but didn't had yet time to do any survey. Is
| | 390943 [transfire@gm] ...
| | 390944 [luislavena@g] Most of the english seems results of Google Translate, most likely
| + 390945 [mike@os n. r] I did.
+ 391055 [mg100622@mi ] I'm Masaru Nagai.
+ 391090 [andres.mrad@] wow, thanks god, i was thinking to myself this was some sort of spambot from a shady corporation as the "autor name" is the name of some Japanese actor, so it was confusing, i was going to write back, but now that i found this thread i can be a little bit certain of the authenticity of the e-mail, but i would like to know why use a fakename? or is it some kind of incredible coincidence (or do you happen to be a Japanese actor? O: ).
  391091 [mg100622@mi ] Masaru Nagai is my real name.
  391141 [andres.mrad@] That solves the mystery :), thanks for your reply, hope your thesis get the highest grade.

[ANN] md2man 1.0.1 (was redcarpet-manpage)
390922 [sunaku@gm il] md2man - write UNIX man pages in Markdown

[ANN] binman 2.0.0
390923 [sunaku@gm il] binman - UNIX man pages for Ruby bin/ scripts

Rake question
390924 [mphoeppner@g] Say I have a list of files (based on file extension), that all need to
+ 390933 [eldestdamphy] Actually what I would do in your position would be to create rules
+ 390962 [g.diemant@gm] Put the transform task definition in front of your each loop.

Re: binman 2.0.0
390925 [shevegen@li ] That screenshot looks GREAT.
+ 390938 [code@ap th o] I do use manpages -- a *lot* -- and I think this is an excellent library.
| 390953 [sunaku@gm il] Glad to hear that.  Please enjoy! :)
+ 390954 [sunaku@gm il] binman load YOUR_BIN_SCRIPT | markdown > YOUR_WWW_PAGE.html

[Job] PHP+Ruby Web Developer London
390939 [job@we at co] We are looking for a talented web developer to work full time in our

Truncation using Pixels
390942 [thanuja_16@y] Is there any method available to truncate string based on Pixels in
390946 [jeremy@bo p.] I'm not aware of any built-in method to do this, and I suspect it will
390992 [thanuja_16@y] Thanks Jeremy for the reply.
+ 390994 [astounding@g] If you're rendering in a web browser, unless you're using some sort of
+ 390998 [hassan.schro] That's what CSS is for. Set a width on the containing element and use
+ 391173 [timr@pr bo c] This is simply impossible to do on the server side, in part because you

Viewing a script source loaded into the interpreter
390948 [promos@bu ch] I've read about the SCRIPT_LINES__ hash being able hold the contents of
+ 390949 [hanmac@gm .d] i thought you joked because i test it...
+ 390950 [promos@bu ch] I believe it also does not work for ruby scripts loaded via the

[ANN] terrible_timeout 0.1.0 - an alternative to timeout
390951 [normalperson] This module still sucks, don't use it without knowing its caveats.  Read
+ 390957 [ryand-ruby@z] Read
+ 391007 [rubytalk2dav] Side effects may include dry mouth, DRY code, a tingling sense of

[ANN] minitest 2.9.0 Released
390956 [ryand-ruby@z] minitest version 2.9.0 has been released!

[ANN] terrible_timeout 0.2.0 - an alternative to timeout
390958 [normalperson] Heh, I reread my own code before using it, too.

[ANN] TestR 14.1.1
390959 [sunaku@gm il] TestR - Continuous testing tool for Ruby

remove newline characters in d anchors
390960 [pillay.mithu] i am working on this code where i need to list the files in a dir and
+ 390964 [shortcutter@] I think you want
+ 390967 [pillay.mithu] i just made the first 2 edits which u suggested and it worked  :)

Using any trick to omit () in constant lookup?
390961 [shevegen@li ] I once had the idea of an abstracted UI language.
+ 390963 [g.diemant@gm] Make a simple button wrapper class and put the logic from your Button
+ 390965 [b.candler@po] What you are asking for is possible, simply by overriding the new
+ 390966 [hanmac@gm .d] or an idea, forgot your Button class, and override const_missing
| 390969 [shortcutter@] There is a much simpler solution
+ 390968 [ryand-ruby@z] Don't convert the button instance. Change the class.
  390970 [shortcutter@] Road to perdition.

Removing a multiple array layer
390971 [stkfdt@gm il] I'm trying to remove a array layer implied by multiple Array#product
+ 390979 [g.diemant@gm] Try prod =3D prod.product(ranges) without loop.
| 390988 [stkfdt@gm il] Tryed but does not the opposite expected output
| 390990 [wishdev@gm i] Are you claiming your input arrays are as follows?
| 391121 [stkfdt@gm il] Sorry
+ 391122 [stkfdt@gm il] ok resolved it

Which is the best online document conversion site?
390972 [mariamoore95] Can anyone tell me that which is the best online document conversion
+ 390999 [rakeshgopalm] If you contact production@jvinfosol.com - they have been putting xml
| 391001 [peterhickman] You will probably get a better response if you told us what sort of
+ 391150 [janifersmith] Here is it  just click on onlinedocumentconversion.com and convert your