Dave Thomas | 1 Jan 01:06 2004

Re: class-name matching problem with rdoc


On Dec 31, 2003, at 16:04, Joel VanderWerf wrote:

>
> After doing 'rdoc --ri' on the FXRuby tree (which mostly went well), I 
> noticed one problem with a pair of nested classes one of whose names 
> is an initial segment of the other. It can be easily reproduced:

Thanks - simple typo/thinko on my part. Fixed in the CVS.

Cheers

Dave

Tim Hunter | 1 Jan 01:06 2004
Picon

Re: Aliasing operators possible?

On Wed, 31 Dec 2003 15:48:42 -0800, GGarramuno wrote:

> SyntaxError: compile error
> (irb):2: syntax error
>    alias :old=~ :=~
>                  ^

"old=~" isn't a legal method name. Try

alias :old_match :=~

GGarramuno | 1 Jan 01:06 2004
Picon

More questions about =~

irb(main):006:1* class String
irb(main):006:1*    alias oldRegex =~
irb(main):006:1*    def =~(o)
irb(main):007:2>     p "string regex"
irb(main):008:2>     oldRegex(o)
irb(main):009:2>    end
irb(main):010:1> end

irb(main):017:0> class Regexp
irb(main):018:1>   alias oldRegex =~
irb(main):019:1*   def =~(o)   
irb(main):020:2>     p "regexp regex"
irb(main):021:2>     oldRegex(o)
irb(main):022:2>   end
irb(main):023:1> end

"abc" =~ /a/
=> 0

Eh?  Where is print statement?
What =~ is being called?

If I do:

irb(main):040:0> "abc".=~ /a/
"string regex"
=> 0

irb(main):041:0> /a/.=~("abc")
"regex regex"
(Continue reading)

Glenn Lewis | 1 Jan 01:47 2004

Embedding Ruby as a plugin (e.g. PhotoShop)

I'm trying to embed Ruby as a plugin to a program called
Animation:Master (http://www.hash.com/).  Everything compiles
and links without errors, and my plugin loads into A:M, and
my file requestor pops up for selecting which script I wish
to run through the Ruby interpreter.

After this, though, I can't seem to get Ruby to run.

If I try this:

   int myargc = 2;
   char* myargv[] = { "ruby", "c:/src/hi.rb", 0 };
   ruby_init();
   ruby_options(myargc, myargv);
   ruby_run();  // - crash

the entire application crashes on the call to ruby_run.
If, however, I try this:

   ruby_init();
   ruby_script("embedded");
   rb_load_file("c:/src/hi.rb");
   ruby_run();  // - hangs

the entire application just hangs... I have to kill it myself.

Just to test out my sanity, I built a separate executable with
the above 2 snipits, and each of them worked fine as a stand-alone
program.

(Continue reading)

David Naseby | 1 Jan 01:51 2004
Picon

Re: amrita parse error

> From: Carl Youngblood [mailto:carl <at> ycs.biz]
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
>
Amrita uses html-parser by default, which I believe doesn't handle
namespaces at all.

The easiest possible workaround is to run with REXML as the parser. Just set
TemplateText#xml => true.

Sample is below:
  require "amrita/template"
  include Amrita

  tmpl_text = <<-END
  <?xml version="1.0"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
      <title>xhtml sample</title>
  </head>
  </html>
     END

  data = {}

  tmpl = TemplateText.new tmpl_text
  tmpl.prettyprint = true
   tmpl.xml = true # use REXML parser
  tmpl.asxml = true
(Continue reading)

Andre Nathan | 1 Jan 02:03 2004
Picon

Re: Denying access to methods on DRb

Austin Ziegler said:
> If you only want methods available locally, then you should probably
> put a proxy class on DRb that exposes everything *but* those methods.

Hi Austin

By 'proxy class' you mean something like this:

class Foobar
  def foo
    puts 'foo'
  end
  def bar
    puts 'bar'
  end
end

class FooProxy # only 'foo' exposed
  def foo
    Foobar.new.foo
  end
end

And then expose FooProxy via DRb?

Excuse my nubyness... :-/

Andre

(Continue reading)

Ian Macdonald | 1 Jan 02:26 2004

Re: rdoc: how to generate rdoc & ri documentation of standard library?

On Thu 01 Jan 2004 at 00:00:48 +0900, Dave Thomas wrote:

> To get something more meaningful, start in the Ruby source tree (not 
> the installed library) and issue the command
> 
>       rdoc --ri *.c lib/*.rb
> 
> That will document (in ri form) the built-in functions and all the 
> direct standard library classes. It'll take a minute or two, but when 
> it's done, you'll be able to say
> 
>    ri  Array
>    ri CGI
>    ri Tempfile::open

If I issue the command line above, I get class entries for Array and
Hash (and probably others) that contain no methods. If I amend the
command line to 'rdoc --ri *.c' (i.e. excluding 'lib/*.rb'), the Array
and Hash entries get populated with their methods.

A bug?

Ian
--

-- 
Ian Macdonald               | Natural laws have no pity. 
System Administrator        | 
ian <at> caliban.org             | 
http://www.caliban.org      | 
                            | 

(Continue reading)

Tim Hunter | 1 Jan 02:41 2004
Picon

[OT] Good article on Open Source, GPL, copyright, etc.

There is periodically some discussion on c.l.r. about Open Source
licensing, the GPL, and copyrights, so I thought some readers would be
interested in reading a good overview of these topics which is now
appearing on the ever-popular Groklaw (www.groklaw.net) blog: "What Is
Open Source Software?," by Mark Webbink, Senior V.P. and General Counsel
of Red Hat, Inc.

We now return you to your normal programming...

Dave Thomas | 1 Jan 02:44 2004

Re: rdoc: how to generate rdoc & ri documentation of standard library?


On Dec 31, 2003, at 19:26, Ian Macdonald wrote:

> If I issue the command line above, I get class entries for Array and
> Hash (and probably others) that contain no methods. If I amend the
> command line to 'rdoc --ri *.c' (i.e. excluding 'lib/*.rb'), the Array
> and Hash entries get populated with their methods.
>
> A bug?

Hmm.. Perhaps, but not in RDoc, exactly... The class TSort extends 
class Array, but flags it :nodoc: so it doesn't get documented 
internally. tsort should probably have used stopdoc instead.

Cheers

Dave

NAKAMURA, Hiroshi | 1 Jan 03:08 2004
Picon

Re: [ANN] ruby 1.8.1

Hi,

> From: "Andreas Schwarz" <usenet <at> andreas-s.net>
> Newsgroups: comp.lang.ruby
> Sent: Wednesday, December 31, 2003 8:41 PM

> But now there's a different failure:
> 
>   1) Failure:
> test_datetime(WSDL::Datetime::TestDatetime) [./wsdl/datetime/test_datetime.rb:63]:
> <2004> expected but was
> <2003>.

It's a stupid bug of the test.  Won't be happened next day.
Please ignore this...

Regards,
// NaHi


Gmane