88150-88771

87907-88715 subjects 88299-88934

^ UnboundMethods Useless?
88150 [transami run] Urrrr.....
+ 88153 [jgb3 email.b] I believe the idea is something like this: you have a class A and an
+ 88193 [pbrannan atd] It's not useless; I found at least one use for it in [ruby-talk:29122].
| 88194 [decoux moulo] Try this
| 88202 [pbrannan atd] By this I'm guessing you mean that I don't have to explictly make foo
| 88205 [decoux moulo] Yes, the default scope at top level is private : `class A; end' was just
+ 88239 [djd15 po.cwr] class Object
  88309 [transami run] Ah ha! I see, by putting the method in Object you get a sort-of universal
  88322 [chad chadfow] # Ah ha! I see, by putting the method in Object you get a sort-of universal
  88323 [decoux moulo] He is trying to take a method from a class and define this method in the
  88327 [transami run] Expectations' are precisely the point. The difference is all about the *order*
  88328 [decoux moulo] If you expect something else than a coredump, then probably there is
  88332 [transami run] Why Guy? In lisp you can move functions around til the cows come home. I'm
  88333 [dblack wobbl] I don't know what you mean by (ir)reversible, but the point is that
  + 88334 [dblack wobbl] Whoops, dropped off the cliff there, but let's just say it's for
  + 88336 [Peter.Vanbro] By the same reasoning, Ruby is suggesting that any module makes sense in
  | + 88337 [decoux moulo] a module is not a class
  | | + 88343 [Peter.Vanbro] I never said that. The analogy was including a mixin (seen as a collection
  | | | 88344 [decoux moulo] No, I'm saying that only method in *some* class can work in another class.
  | | | 88348 [Peter.Vanbro] Then maybe the test is too strict.
  | | | 88349 [decoux moulo] before trying to change ruby, try first to understand it.
  | | | 88352 [Peter.Vanbro] Before we start calling each other names, I need a clarification. I can do
  | | | + 88353 [decoux moulo] try first to resolve this
  | | | | 88354 [transami run] First of all what represents a core function? Every method that I know of can
  | | | + 88358 [transami run] "Ruby somehow internally fixes method m for use in B such that it is no longer
  | | | + 88362 [matz ruby-la] Moving code is dangerous sometimes at C level.  And I didn't think it
  | | |   88368 [Peter.Vanbro] Thanks Matz, that explains it.
  | | + 88347 [transami run] He's talking about the methods in the module that you include in the class.
  | + 88340 [dblack wobbl] There's a difference between freedom and a free-for-all or chaos.  In
  |   88346 [Peter.Vanbro] Yes, agreed. But we want to implement a higher level language mechanism,
  + 88341 [transami run] It is not meaningless. It is not arbitrary. Programmer's do not just blow
    88345 [chad chadfow] # > I don't know what you mean by (ir)reversible, but the point is that

^ Ruby-Gtk and accessor methods
88152 [surrender_it] I was playing a little with ruby-Gtk2 , and I have to admit that this
88187 [mutoh highwa] In Ruby-GNOME2, it's normal.

^ Extracting multiple lines from a file
88156 [rcoutts envi] This should be an easy question for Ruby-heads but I can't seem to
88159 [djberge qwes] See the second argument to IO#readlines.  Or, you can set $/ manually -
88161 [rcoutts envi] Thanks for the quick reply Dan, but I may not have been clear as to what
+ 88162 [rodrigo.berm] stuff=%r|^BEGIN_FOO$(.+)^END_FOO$|m
| 88163 [michael_s_ca] lines
| 88165 [markjreed ma] What version of Ruby are you running?  I'm seeing the same behavior
+ 88164 [dave pragpro] Yeah - Ruby 1.8 changed this. You could try
| 88167 [rcoutts envi] Thanks Dave and Rodrigo for your regex solutions.  The file is small
+ 88166 [markjreed ma] That's one of the things that changed between Ruby 1.6 (which is what's
  88199 [lewisd f00f.] Who maintains that list?  It would appear that the behavior of all the
  + 88201 [matz ruby-la] By you-know-who that is incredibly stupid and so easy to forget
  + 88206 [dave pragpro] Do you have the latest 'ri' (from sf/net/projects/rdoc). It's got the
    88367 [lewisd f00f.] Unless I've done something wrong, it looks like Proc.arity still has the

^ [ANN] rubric news aggregator 0.2.1
88171 [ jupp gmx.de] Present version of RSS aggregator 'rubric' is 0.2.1

^ Copying methods from one class to another
88172 [transami run] Is there any way to copy a method from one class to another?
88174 [jgb3 email.b] I'd like to know the answer to this one, too, though I suspect there
88183 [transami run] At first it seemed like it would be easy, since Ruby is so dynamic --if I add
88189 [dblack wobbl] redef.rb:7: warning: already initialized constant C
88191 [transami run] Thanks David, I forgot the most important part! Here, this one makes it even
+ 88195 [hacksaw hack] class C < C;
| + 88196 [decoux moulo] He try to bypass the method binding : but ruby has seen this, and fatally
| + 88200 [transami run] class C
|   88267 [hacksaw hack] No. Why would B and C be equal? B is a subclass of C. Specifically, methods
|   88282 [transami run] That's okay, I had the same difficulties understanding this at firs too. Let
|   + 88294 [hacksaw hack] Well, okay, you can do this. It strikes me that this is the equivalent of asking for a new ferrari, and then replacing it's insides with another new ferrari.
|   | 88317 [Peter.Vanbro] Actually that's what we'd like it to do, but it doesn't. All existing
|   | 88350 [hacksaw hack] Okay, I'm trying to figure this out, so let me reveal my ignorance, and see if
|   | 88360 [transami run] Hacksaw, I have fowarded your inquery to suby-muse. I am interested in
|   + 88706 [NewGroups nt] <transami@runbox.com> writes
|     + 88719 [jgb3 email.b] Well, I'm not really the right one to answer this, but I'll try.  My
|     + 88735 [transami run] James' answer is correct. We have been discussing Aspect Oriented Programming
+ 88215 [dblack wobbl] redef.rb:5: warning: already initialized constant C
  88223 [transami run] Agghhh...I sware I ran it before I posted it, hmm.... oh, duh! I added the
  + 88242 [michael_s_ca] Out of curiosity, why do you need/want this functionality?
  | + 88249 [hal9000 hype] I've wanted to do this once or twice. I forget the circumstances. But
  | + 88260 [transami run] Trying to see just how far we can push current Ruby into doing method wrapping
  |   88262 [michael_s_ca] it?
  + 88315 [decoux moulo] Sincerely, what do you expect which such a program ?
    88329 [transami run] Essentially, combining two classes to behave as a single unit. The inner layer
    88331 [decoux moulo] I've given the example
    88342 [michael_s_ca] inner layer

^ trying to override != or create a unary negation method
88173 [sera fhwang.] I'm trying to add Criteria-style query inference to Lafcadio, which so
88175 [chad chadfow] # So I figure, fine, I can make my query condition objects flip

^ Secure Ruby
88176 [dragoncity i] I have developed a technique for executing Ruby programs in a secure manner,
88180 [cjh_nospam m] Attached source code.
88186 [flori ping.d] Even using a full path to ruby isn't a fix, because it's easy to

^ redirect stdout for Kernel.system()?
88179 [nspring cs.w] $stdout=File.open("foo.out", "w")
+ 88184 [bob.news gmx] robert
+ 88217 [nobu.nokada ] $stdout.reopen("foo.out")
| 88518 [nspring cs.w] thanks! that was exactly what I needed.
+ 88771 [ajohnson cpa] oldout = $stdout.dup

^ ruby-gtk2 extension
88181 [walker letha] I'm writing a script based off a ruby-gtk2 extension, and I'd like to know if there exists a standard (or ruby-gtk2 built in) method of exiting the program only after the last window closes. There isn't one main window that controls the rest, but several windows open in parallel.
88192 [mutoh highwa] Hmm, I think your solution is not so bad.

^ rescue block doesn't get run
88188 [hacksaw hack] This code snippet processes the options correctly, but if I leave off a
+ 88198 [matz ruby-la] Perhaps you forgot to call GetoptLong#get or #each.
| 88264 [hacksaw hack] Ahh, so you do late execution? I didn't notice that it was complaining about
+ 88209 [ahoward ngdc] /tmp > cat foo.rb
+ 88218 [nobu.nokada ] Don't you re-raise the exception?

^ Article on SWIG & Ruby in January 2004 Issue of CUJ
88190 [lyle knology] All,

^ Open Source Convention 2004 - Call for Papers
88197 [djberge qwes] All,
88448 [jbritt ruby-] Where is the conference held?  I couldn't find that info on that page.
88452 [lyle knology] Lyle
88512 [ptkwt aracne] Yup, right here in Stumptown ;-)  (great for those of us who live here,

^ Newbie questions
88211 [jfrapper lyc] I was wondering what the equivalent tools were to perldoc(ri is not)
+ 88212 [dcarrera mat] I haven't found any (and I've been around Ruby for over a year).  I think
| 88213 [jgb3 email.b] Any volunteers? ;)
| 88216 [hal9000 hype] OK, I've heard this discussed before, but as I'm not a Perler, I don't
| + 88219 [dcarrera mat] Using perldoc feels much the same as using man.  In fact, you can use
| | 88220 [djberge qwes] perldoc is closer to a database than a simple api help system.  It
| | + 88221 [dcarrera mat] Cool!
| | | + 88222 [rodrigo.berm] I would say Perl Documentation rocks.
| | | | 88225 [dcarrera mat] Good documentation is part of what makes a language great.  Not just the
| | | | 88433 [jfrapper lyc] I couldn't agree more.
| | | | + 88437 [RandyS ThePi] I don't know. Those seem like good reasons to switch. Look at it as an
| | | | | 88457 [jfrapper lyc] Hey Randy,
| | | | + 88440 [djd15 po.cwr] The way multiple constructors should probably be done in Ruby is similar
| | | | + 88465 [austin halos] YAGNI. There is no method overloading at all in Ruby at this point --
| | | |   88467 [dave pragpro] You might want to scan
| | | |   88525 [austin halos] This is *precisely* what I was talking about. I just did something
| | | + 88226 [hal9000 hype] It's permissible to speak kindly of one's parents... ;)
| | + 88224 [hal9000 hype] Thanks, Daniel B and Daniel C.
| |   + 88227 [thomas_adam1] You can't, it is already taken.
| |   | 88228 [hal9000 hype] Oops. How about "rperson"?  ;)
| |   | + 88229 [djberge qwes] Is "rubydoc" taken?
| |   | | + 88230 [carter danas] Absolutely!  I'm currently very fluent with Perl and I'm struggling
| |   | | | 88251 [dave pragpro] charset=US-ASCII;
| |   | | | 88258 [rasputnik he] Thats awesome, the one thing I missed from perl was the way
| |   | | | 88263 [dave pragpro] It's in the ruby CVS tree: if you install Ruby, you now get RDoc and
| |   | | + 88232 [hal9000 hype] Sounds a little too derivative of Perl to me. (Yes, I know much of
| |   | + 88233 [dcarrera mat] Now, why do we have to pick a creative name?  Why don't we pick a boring
| |   |   + 88237 [hal9000 hype] I care much less about the name than the software functionality and
| |   |   | + 88240 [dcarrera mat] I hear you.  Names with dashes are the worst ("apt-get").  My fingers
| |   |   | | + 88246 [hal9000 hype] I think I might sort of like that, except that
| |   |   | | | 88250 [dcarrera mat] I didn't know that 'rdoc' was already the name of a program.  I tested
| |   |   | | | 88268 [gsinclair so] RDoc is part of the standard distro now (after 1.8.0, in time for
| |   |   | | + 88285 [dblack wobbl] /usr/local/bin/rdoc
| |   |   | + 88450 [jbritt ruby-] On the ruby-doc list, while discussing a possiboe extension of ri, we
| |   |   |   88453 [gsinclair so] But RubyForge has no such appetite for short names, so it's known as
| |   |   + 88252 [austin halos] GIMP isn't "uninformative." It's the GNU Image Manipulation Program.
| |   |     88253 [dcarrera mat] It's unly informative if you already know that.  Like GNU or PINE.
| |   |     88254 [dcarrera mat] - unly
| |   |     88371 [ jupp gmx.de] only + ugly -> unly
| |   + 88231 [dcarrera mat] rman sounds good.
| |   + 88288 [rodrigo.berm] I would pay $25 for a printed version of any ruby related stuff.
| |   + 88449 [jbritt ruby-] Then please consider (if you haven't already) joining the ruby-doc
| + 88241 [luke madstop] We've discussed a parallel to perldoc, but what about CPAN?  I know that
|   + 88248 [hal9000 hype] The nascent RubyGems project is a big step toward dealing with this
|   + 88265 [luke madstop] There was a bug in the version of CPAN shipped with 5.6.0, I believe,
+ 88259 [chad chadfow] # I was wondering what the equivalent tools were to perldoc(ri is not)
  + 88266 [gsinclair so] Furthermore, RDoc is the perldoc semi-equivalent, and the new
  | + 88269 [luke madstop] This is definitely good to hear.  I've seen mentions of most of it, but
  | + 88270 [dcarrera mat] Perldoc IS viewable via command-line.  How else would you use it?
  |   + 88271 [luke madstop] Shouldn't it just use the PAGER or READER environment variable?  I don't
  |   | + 88272 [dcarrera mat] I didn't know about those variables.  How do they work?
  |   | | 88280 [luke madstop] They're just the standard variables to set to change your pager.  The man
  |   | | + 88283 [dcarrera mat] I didn't know you could change that.  That's awesome!
  |   | | + 88302 [dave pragpro] So says the man who hasn't looked at the perldoc source... ;)
  |   | | | + 88303 [James.Weiric] [... Chad mentions RubyGems ...]
  |   | | | | + 88305 [RandyS ThePi] The current spec is at <http://module-build.sourceforge.net/META-spec.html>
  |   | | | | + 88409 [RandyS ThePi] I've looked briefly at RubyGem (and Rake). Looks great. I didn't find
  |   | | | |   88410 [chad chadfow] # >
  |   | | | |   88413 [RandyS ThePi] I was referring to distributions. Both of the perl build tools MakeMaker
  |   | | | |   88416 [chad chadfow] # >
  |   | | | + 88338 [luke madstop] Hey now, I think I included an "on Unix" disclaimer somewhere, although it
  |   | | + 88370 [lewisd f00f.] Just a note about PAGER.  Some systems (both my Debian installs, for
  |   | |   + 88372 [thomas_adam1] update-alternatives --config pager
  |   | |   | 88374 [lewisd f00f.] Yeah, I just wanted to make sure whoever implements this pager
  |   | |   + 88373 [jgb3 email.b] MANPAGER
  |   | |     88375 [lewisd f00f.] Interesting.  So there's apparantly no consistant way of finding a pager
  |   | |     88378 [thomas_adam1] It would be easy to do...
  |   | + 88274 [djberge qwes] See ruby-ldap on the RAA.  Dunno about ssl support.
  |   |   88281 [luke madstop] Yeah, I'm using it (and getting segfaults :), but it has to be compiled
  |   + 88273 [hal9000 hype] I think he meant this benefit was added to rdoc.
  |   | + 88276 [dcarrera mat] Well... I'm thinking of man pages here.  A typical man page is a lot
  |   | | 88278 [thomas_adam1] man <some_page> | col -b | less
  |   | | 88284 [dcarrera mat] Yes, exactly.  That's what I was saying.  You can already do
  |   | | 88287 [gfb tonesoft] That's exactly what "man" is doing here -- sending its output to
  |   | + 88301 [dave pragpro] Your wish... I've added it here, so it'll be in the next commit.
  |   + 88277 [chad chadfow] # >
  + 88300 [RandyS ThePi] Will this include a builder like perl's MakeMaker[1] or its successor

^ substituting apostrphe's
88234 [lists debona] I have a bit of a problem, I can't seem to substitute an apostrphe
+ 88235 [dcarrera mat] Backspace the apostrophe.
+ 88243 [Peter.Vanbro] irb(main):003:0> a = "a"
| 88244 [Peter.Vanbro] Did it again... The last line gives "bcbc" as result.
| + 88245 [James.Weiric] I had a wanted to replace a single apostrophe with an backslash+apostrophe.
| | 88247 [michael_s_ca] backslash+apostrophe.
| + 88275 [mike ratdog.] What do you want it to do?
+ 88255 [austin halos] puts a.gsub(/'/) { "\\'" }
  88256 [James.Weiric] Hmmm ... I count three backslashes instead of four.  I get the same result
  88261 [michael_s_ca] result

^ resolv.rb question
88236 [daniel night] I'm writing a script where it would be really good to be able to give
88306 [daniel night] #!/usr/bin/env ruby

^ Re: Secure Ruby ?
88286 [dragoncity i] Thanks Clifford,
88297 [cjh_nospam m] Even Java with its bytecodes isn't immune to reverse engineering,

^ Very odd IO problem
88289 [coish hfx.ea] I have a very strange problem.  I'm hoping someone can help me with
+ 88290 [chad chadfow] #
| 88291 [coish hfx.ea] Sorry, I should have mentioned that. :)
+ 88292 [matz ruby-la] Hmm, it seems working pretty as I expect.  What's your problem?
| 88293 [matz ruby-la] Oops, I was looking at the second part.  You were talking about getwd.
| 88295 [coish hfx.ea] Thanks for the reply!  I was hoping that it wasn't a VMS only problem.
| 88298 [cjh_nospam m] Directories on VMS are quite odd to those from a MSDOS or Unix world.
| 88335 [BCoish Dymax] Thanks for the response!  For the most part ruby handles VMS paths
| 88364 [matz ruby-la] How does the following work?
| 88369 [BCoish Dymax] I tried the above example, but it has a syntax error, 3 ".
| 88376 [matz ruby-la] Oops, sorry.
| 88384 [BCoish Dymax] No problem.  I tried what you asked and here is the
| 88388 [matz ruby-la] Thank you.  Do me one more favor.
| 88391 [BCoish Dymax] s = open("|ruby [bh.scripts]cwd.rb").read
+ 88296 [nobu.nokada ] At first, this script works correctly?  Which do you have the
  88321 [coish hfx.ea] Thanks for the response!  I applied the specified patch to util.c
  88324 [nobu.nokada ] I know the previous patch wouldn't fix the odd behavior, since
  88339 [BCoish Dymax] I tried using File.read and it worked successfully.
threads.html
top