187167-256613

186972-188450 subjects 187400-251594

Examine Folder Contents?
187167 [forum@jo h. ] I'd like Ruby to open a folder, search it for files and then store all
+ 187168 [benjohn@fy h] You'll want the class Dir, and the class method glob.
| 187208 [forum@jo h. ] Thank you so far. I'm using this in Ruby on Rails and tried the
| + 187209 [forum@jo h. ] cannot convert String into Integer
| + 187218 [steve@wa ts ] @images = Dir.glob('/images/content/parties/photo_galleries/1/
| + 187393 [baumanj@gm i] This is operating on the actual filesystem, so you have to use real
|   187670 [forum@jo h. ] Thank you all, guys!
|   + 187671 [ara.t.howard] list_of_paths.map!{|path| File.expand_path path}
|   + 187672 [forum@jo h. ] Oh, and how do I cut the RAILS_ROOT away again? So I can use the paths
|     187682 [chris.hulan@] You might want to look at Pathname
+ 187271 [nospam@se th] <% bilder = Dir["*.jpeg"] %>

Ruby way to sum digits
187170 [mlunzena@un ] To sum the digits of an Integer I have got
187183 [james@gr yp ] => nil
187283 [logancapaldo] num_s =  num.to_s
187294 [dave@bu t. d] require 'enumerator'
187455 [mlunzena@un ] Thanks a lot! I will try one of your solutions.
187471 [baumanj@gm i] Just one more way, since I haven't seen a solution that takes advantage

Ixnay on the Amphibious Programming
187174 [transfire@gm] I have finally come to the conclusion that the non-localality of
+ 187245 [rhkramer@gm ] RDoc to even completely do so.
| 187249 [logancapaldo] ...
| 187269 [transfire@gm] That's right.
+ 187251 [robert.dober] ...
  187260 [robert.dober] ...

Eval needs explicit self for accessor methods?
187191 [dario_insane] i encountered a strange problem with eval. please see the following
187192 [transfire@gm] It really has nothing to do with eval, your just setting a local
+ 187196 [dario_insane] Of course! Thank you! Sorry for the dumb question. Makes perfect sense
+ 187241 [noone@no he ] Since you bring this up, there are a few more cases where implicit locals
  + 187243 [gwtmp01@ma .] The 'x' in each of those blocks references the local variable 'x'
  | + 187250 [logancapaldo] ...
  | + 187268 [noone@no he ] Changing the hiding characteristics of formal arguments sounds like a good
  + 187386 [pit@ca it in] x = nil

Regexp madness
187193 [damphyr@fr e] OK you Regexp gurus out there (has anyone noticed the relative size of
+ 187213 [chris.alfeld] I just answered this is the other regexp thread.  If you put a ?you're regexp becomes non-greedy
| 187236 [damphyr@fr e] Yeap, it had to be something like this. Nice, thanks. Now I know.
+ 187224 [james@gr yp ] I see you already got an answer to the other question, I will tackle

Ruby Goes to the Sun
187194 [james_b@ne r] I've not seen this translated anyplace, but the Japanese Ruby site has
+ 187198 [diegoguidi@g] Today it's the joke day... nice ... :)
| 187200 [runner@be ke] That's just not funny.
+ 187201 [pjpizza@rs e] Did you catch the linked article about YARV?  Koichi-San explains how relieved
+ 187203 [dharple@ge e] No 6 in that name?
+ 187206 [jared-NO-SPA] Excellent! I can't wait for Enterprise Ruby Beans!
| 187257 [dave@bu t. d] No, they will have to find a new name, we already have an ERB, eRuby!
| 187276 [robert.dober] ...
+ 187238 [davidw@de as] I heard that that Hanson guy was putting the band back together for the
+ 187277 [david@va ln ] Pffft, -waaay- too obvious. I prefer April's Fools jokes that are completely
  187305 [james_b@ne r] You forgot the link.
  187387 [david@va ln ] Hmm, didn't get that one with the original mail...
  187390 [robert.dober] ...

Compile requirements of Ruby and Extensions
187199 [usenet-42006] is there anywhere a list what libs ruby and a extension needs to be
+ 187217 [steve@wa ts ] ...
+ 187319 [interfecus@g] Ruby seems to have very few dependencies. On my ruby 1.8.4 / linux
  187355 [usenet-42006] But that is not the end. Tk needs libtk,libtcl...

[Facets] Add a Module#attr_validator method
187202 [daniel.schie] I couldn't find a Facets mailing list, and I know the developers use
187205 [daniel.schie] Note that this of course only works when you actually *use* the setter

Regular Expression matching biggest possible
187204 [petermichaux] I would like to remove comments from a JavaScript file with a Ruby
+ 187211 [chris.alfeld] You can make a regexp non greedy with a ?, that is
| 187226 [petermichaux] Thanks Chris,
+ 187237 [damphyr@fr e] Wow, I only had to wait 20 minutes before posting (or you could have

Now what
187210 [junk@da de e] I've gotten through the Programming Ruby book and I have good idea of
+ 187214 [anne@wj .h r] etc
+ 187219 [steve@wa ts ] ...
| 187221 [jeppe88@gm i] ...
+ 187225 [huw@DE TH SB] Funnily enough, we are looking for ideas for good, short Ruby projects for
+ 187366 [abbatangelo@] Actually you're probably more than ready to test out Rails. Check out

Wee or..
187212 [lebowski_@in] I want develop web applications using my or shared class.
+ 187223 [james_b@ne r] You can find docs and help for Nitro at
| 187234 [lebowski_@in] I had see http://nitrohq.com but I had hope in a more complete and
+ 187433 [interfecus@g] Rails can be 'unpacked' into the vendor directory, allowing it to be

Dynamic code generation
187228 [thiago.arrai] I have been trying to do some simple dynamic code generation in Ruby.
+ 187265 [logancapaldo] This seems to be a solution looking for a problem
| 187339 [thiago.arrai] I need a method to identify the child classes, something like
| 187417 [logancapaldo] % cat identifiers.rb
| 187509 [thiago.arrai] This is what it seemed at first to me too. But I would like the
| + 187520 [mtrier@gm il] Take with a grain of salt, because I don't really understand this
| | 187522 [thiago.arrai] No, you are calling the class level method of the _class_ variable.
| | 187527 [mtrier@gm il] Got it.  I misunderstood what you were trying to achieve.
| + 187532 [logancapaldo] ...
|   187535 [thiago.arrai] Yup. I think I am going with this one.
+ 187278 [interfecus@g] Firstly you confuse things too much by using the same name as an
  187338 [thiago.arrai] I thought too, code just seems too cluttered. The effect I was trying

[ANN] blog.rb 1.0
187229 [ilmari.heikk] ...

%w{tomato cheese ham pineapple}.join(', ', ' and ')
187230 [benjohn@fy h] => 'tomato, cheese, ham and pineapple'
+ 187231 [james@gr yp ] => ["tomato", "cheese", "ham", "pineapple"]
| 187297 [benjohn@fy h] ! :) Thanks!
| 187315 [logancapaldo] class Array
+ 187252 [cameron.mcbr] %w{tomato cheese ham pineapple}.join(', ').sub(/, (\S+)$/,' and \1')
| + 187275 [mike@st k. a] The Oxford comma is useful and acceptable.  If there is any ambiguity
| + 187300 [benjohn@fy h] ...
|   187306 [benjohn@fy h] Is there somewhere for suggestion new features? I'm sure I remember
|   187309 [dblack@wo bl] Once you've really determined that you can make a case for it, you can
|   187347 [benjohn@fy h] Thank you, I'll do that. I was wracking my brains trying to remember
|   187408 [cardologist@] class Array
|   187476 [briankbuckle] ...
+ 187296 [david@va ln ] A little late, but in spirit of when the thread started: I'd get the pizza
| 187303 [benjohn@fy h] Good timing - I'm munchy.
+ 187304 [transfire@gm] That's an interesting idea. Perhaps an options hash though in case

list.rhtml
187239 [chriswillis1] I have designed a messageboard and i have gone into lis.rhtml to make
187242 [james_b@ne r] You'll need to provide more detail.
187259 [chriswillis1] Please could you e-mail me and i will send you the files.
187432 [interfecus@g] 1. You've got the wrong list. There's a specific Ruby on Rails list.
187440 [mguterl@gm i] ...
187443 [james_b@ne r] It's a Rails app.  I was E-mailed offlist.

list.rhtml
187240 [chriswillis1] I have designed a messageboard and i have gone into list.rhtml to make

Re: Add a Module#attr_validator method
187246 [transfire@gm] Thanks Daniel, I'll give this some consideration.
+ 187256 [ara.t.howard] fyi.
+ 187376 [daniel.schie] Thanks for considering my idea. Personally, I like to think of a

[ANN] FasterCSV 0.2.0 -- The user requests release!
187254 [james@gr yp ] FasterCSV 0.2.0 Released
187384 [schoenm@ea t] Awesome, thank you!

Regexp grouping question
187262 [petermichaux] I'm trying to remove unecessary white space around equals signs and
+ 187264 [chris.alfeld] compressed = "foo = bar; red  = herring;"
| 187267 [petermichaux] Thank you!
| 187273 [logancapaldo] If you want to use $1, $2, $3, etc. with gsub, you can use the block
+ 256613 [drubdrub@ya ] This thread has been *very helpful*.  Thank you!

Typed Parameters
187263 [robert.dober] ...
+ 187279 [halostatue@g] This might happen, but it's unlikely to work the way you havesuggested. I personally hope it doesn't happen, as it will makeRuby a little less "smart."
| + 187298 [transfire@gm] <blockquote>
| | + 187308 [dblack@wo bl] foofunc(object_that_responds_to_foofunc, etc.)
| | | 187320 [transfire@gm] But the class of that object dictates the functionality of that
| | | 187364 [dblack@wo bl] method.  That can vary from one instance to another, even within a
| | | 187402 [transfire@gm] [David]
| | | 187407 [billk@ct .c ] I don't see why you would need to bear the burden of worrying
| | | 187411 [transfire@gm] class Watchamacallit
| | | 187414 [ara.t.howard] not to mention that rdoc can then generate a doc block for 'what foo does with
| | | + 187418 [vjoel@pa h. ] If foo is implemented in duck type style, should it even say what it
| | | + 187424 [surrender_it] and that you can actually extend the interface, either in a subclass or
| | + 187312 [surrender_it] <noise type="useless">
| | + 187313 [nugend@gm il] Well, I think you should allowed to put a selective effect on the
| |   + 187314 [nugend@gm il] Actually... now that I'm looking about it, that's kinda dumb, we might
| |   | + 187316 [nugend@gm il] def foo(arg1, arg2)
| |   | + 187322 [transfire@gm] No, it's not so dumb actually. A system like the one you propose could
| |   |   187327 [nugend@gm il] Hrm... I see, however, effective multi-dispatch would still be
| |   |   187362 [surrender_it] care to elaborate?
| |   |   187365 [dblack@wo bl] Well, *something* is making Ruby pleasant, so the absence of this
| |   + 187345 [robert.dober] ...
| |     187371 [halostatue@g] In Ruby, at least, inheritance is not a guarantee of a contract (even onobjects derived from core classes). It's far better to think in terms ofwhat an object must *do* in your method, rather than to try to considerwhat they *are* in your method. An example might help.
| |     + 187372 [robert.dober] ...
| |     | 187378 [halostatue@g] By and large, I don't modify core classes except with modules, and inlibraries that I have released I try to make those modificationsseparately loadable.
| |     + 187373 [gwtmp01@ma .] If I remember correctly from _Object Oriented Software Engineering_,
| |       187374 [robert.dober] ...
| |       187379 [gwtmp01@ma .] I don't follow.  Wouldn't each method call involve executing the pre-
| |       187382 [robert.dober] ...
| |       187389 [gwtmp01@ma .] Just to clarify.  I think there is great value in programming-by-
| |       + 187391 [surrender_it] ...
| |       + 187392 [robert.dober] ...
| |         187398 [gwtmp01@ma .] Well no, but I think the back and forth on this topic is
| + 187344 [robert.dober] ...
+ 187419 [john.carter@] Howabout what I do..

Newbie! Programming Calculations
187280 [yascene@gm i] Im new to programming, im learning ruby.
+ 187285 [jeppe88@gm i] ...
+ 187289 [collinsj@se ] Just like in math, the parentheses indicate what happens first. The
| 187292 [yascene@gm i] Cool thank you for the explanations guys :)
| 187307 [collinsj@se ] There is a thing (which other posts here mention) called operator
+ 187291 [cyclists@nc ] When you have an expression that uses more than one arithmetic operator,
+ 187302 [yascene@gm i] how many hours are in a year? = puts (7* (60*24))  *52
  + 187324 [jeppe88@gm i] ...
  + 187328 [non@no e. om] seconds --> minutes --> hours --> days --> weeks --> years

converting numbers via bit dropping
187282 [lists@ka am ] I'm trying to figure out how to convert a number by dropping bits
187287 [clr9.10.rand] This should be 284, right?
187290 [lists@ka am ] Yep, my bad.

MONTHNAMES
187288 [lester@ix ne] I'm getting 3 unprintable characters after April when use
187359 [one.three@gm] Maybe you have corrupted Ruby installation or just corrupted date.rb file.
187422 [lester@ix ne] Thanks, Martins... that's an interesting thing. I think something got

[ANN] lazyscript 0.2.0
187299 [listen@ma cr] Benny is happy to announce the release of lazyscript.rb  0.2.0

[serial ports ]    looking for help
187317 [gsc@om ga og] I just switched to Ruby and I am finding my way through it.
187350 [rubyprogramm] I don't know anything about this.

Help Ruby Emacs on Ubuntu
187323 [pcslen@co ca] I know I am trying to tackle to many thing at once but it just the way
+ 187342 [roys@mi ds r] and
| 187399 [pcslen@co ca] Thanks
+ 187369 [zarahneander] Open a terminal and type 'sudo apt-get install ruby-elisp'

gems in userdir - Could not find RubyGem ...
187326 [usenet-42006] I am new to ruby and gem and I have installed a few gems (rails and
187356 [usenet-42006] $ irb
187358 [jim@we ri hh] Perhaps rake is also installed as a non-gem?
187363 [usenet-42006] Thank you Jim.
187403 [jim@we ri hh] It would certainly be more consistent for RubyGems to always use .gemrc.

rand
187329 [jeff_thorne@] ...
+ 187331 [phurley@gm i] ri rand
+ 187332 [dharple@ge e] ...
+ 187334 [cyclists@nc ] $ ri rand

[ANN] Lirpa 1.0
187335 [transfire@gm] Introducing Lirpa 1.0!

Does Ruby simplify our tasks and lives?
187343 [simplicityfi] Does Ruby simplify our lives by providing more elegant methods to
187396 [james@gr yp ] Don't all programming languages?  :)
187582 [simplicityfi] I'm not entirely sure that all programming languages are elegant;
187586 [botp@de mo t] #I suppose anyone can make something complex or messy, no
187706 [simplicityfi] I'm not sure people purposely aim for complexity, it is something that

Re: Lirpa 1.0
187346 [w_a_x_man@ya] => "April 1"

Keyboard access
187348 [rubyprogramm] How can I gain access to the keyboard so that I can feed output from
+ 187349 [rubyprogramm] I am using Windows2000.
| 187394 [james_b@ne r] Go grab AutoItX, and script it from Ruby.
| 187461 [rubyprogramm] That was exactly what I was looking for.
+ 187388 [david@va ln ] Is it a console or window application?
  187460 [rubyprogramm] I neglected to say that it is a windows application.

Gathering ngrams with the highest probability
187351 [minkoo.seo@g] I'm writing some scientific applications with Ruby, and found a
+ 187352 [robert.feldt] ngrams.inject({}) do |highest, ngram|
+ 187353 [sylvain.joye] ngrams.inject({}) do |table, ngram|

odd number list for hash error and command line parsers in general
187367 [toktay@gm il] ...
187368 [decoux@mo lo] In your eval you have

ruby to send email attachments
187377 [rtilley@vt e] I searched the news group and found a script that sends email with
+ 187439 [phasis68@ho ] insert this line
+ 187497 [aglarond@gm ] You might want to check out SimpleMail

I can't get hash list params working
187383 [work@as le m] I must be doing something stoopid here.  Can anyone explain why I get
187385 [dblack@wo bl] You can only use the "magic" hash argument if it's the last thing in
threads.html
top