Here's #4.
--cut---
require 'rexml/document'
XML = <<-EOF
<?xml version="1.0"?>
<foo>
</foo>
EOF
doc = REXML::Document.new(XML)
REXML::XPath.match(doc, "/foo//@uri").first.to_s
--end--
On Monday 06 March 2006 12:46 pm, Charles O Nutter wrote:
> Fixity fixed! When I modified the includeModule code to recursively
> include other modules (allowing modules to be searched in correct
> order), there was one other change I should have made. When including
> before, it iteratively included all parents. In addition to screwing
> up the order, this allowed it to check each incoming module against
> already-included modules to avoid an overlap.
>
> The code that prevented double-included remained after the recursive
> version, even though it was now inappropriate to check all of a
> module's includes for overlap. As a result, when class FooTest tried
> to include BarMod, BarMod's includes were searched for overlaps.
> Finding Assertions in BarMod and knowing that FooTest had already
> included Assertions, the include was canceled, and BarMod was not
> included into FooTest.
>
> The fix was to only check the immediate module for overlap, and not
> all its includes (since they would be checked during the recursion).
> Easy!
>
> This obviously could break a number of things, since anywhere a module
> was included from multiple places it would cause some of those places
> to be busticated.
>
> Give this a try and let us know. It's in HEAD now.
>
> On 3/5/06, David Corbin <[EMAIL PROTECTED]> wrote:
> > Here's another one that's similar to the last one. Note, the include
> > "Test::Unit::Assertions" is key to creating the problem. The net-effect
> > of this is that the Assertions have been included twice, since they're
> > already in TestCase.
> >
> > I'm not able to access CVS, so this is not quite a test against HEAD.
> >
> > David
> > ---cut---
> > require 'test/unit'
> >
> > module BarMessage
> > class Message
> > def initialize key
> > end
> > end
> > end
> > module BarMod
> > include BarMessage
> > include Test::Unit::Assertions
> > end
> >
> > class FooTest < Test::Unit::TestCase
> >
> > include BarMod
> >
> > def testFoo
> > Message.new('foo')
> > end
> >
> > end
> > ---end---
> >
> > Not sure what's going on, by emails from my office seem to be "really
> > slow" to get to their list.
> >
> > On Tuesday 28 February 2006 02:50 am, David Corbin wrote:
> > > Well, things are better, but still not right. I've getting numerous
> > > different failures now. I'll have to spend some time paring it down to
> > > a reasonable example of the different failures...
> > >
> > > David
> > >
> > > On Monday 27 February 2006 06:45 pm, David Corbin wrote:
> > > > I'll give our "stuff" another go tomorrow...
> > > >
> > > > On Monday 27 February 2006 01:23 pm, Charles O Nutter wrote:
> > > > > Fixed! The wrapper for includes, IncludedModuleWrapper, was never
> > > > > updated when I fixed the module include ordering, so it was still
> > > > > expecting superclasses to be included below it rather than above
> > > > > it. I updated it to do things the correct way and it works right
> > > > > now. I also added a test case based on yours below.
> > > > >
> > > > > On 2/26/06, David Corbin <[EMAIL PROTECTED]> wrote:
> > > > > > Here's another one. This one *looks* like you can simplify it
> > > > > > further, but I haven't been able to.
> > > > > >
> > > > > > --begin--
> > > > > > require 'test/unit'
> > > > > >
> > > > > > module ModA
> > > > > > def methodA
> > > > > > $stderr.puts "It Works!"
> > > > > > end
> > > > > > end
> > > > > >
> > > > > > module ModB
> > > > > > include ModA
> > > > > >
> > > > > > def methodB
> > > > > > methodA
> > > > > > end
> > > > > > end
> > > > > >
> > > > > > module ModC
> > > > > > include ModB
> > > > > >
> > > > > > def methodC
> > > > > > methodB
> > > > > > end
> > > > > > end
> > > > > >
> > > > > > class DTest < Test::Unit::TestCase
> > > > > >
> > > > > > include ModC
> > > > > >
> > > > > > def testD
> > > > > > methodC
> > > > > > end
> > > > > >
> > > > > > end
> > > > > >
> > > > > >
> > > > > > --end--
> > > > > >
> > > > > >
> > > > > > -------------------------------------------------------
> > > > > > This SF.Net email is sponsored by xPML, a groundbreaking
> > > > > > scripting language that extends applications into web and mobile
> > > > > > media. Attend the live webcast and join the prime developer group
> > > > > > breaking into this new coding territory!
> > > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat
> > > > > >=121 64 2 _______________________________________________
> > > > > > Jruby-devel mailing list
> > > > > > [email protected]
> > > > > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > > > >
> > > > > --
> > > > > Charles Oliver Nutter @ headius.blogspot.com
> > > > > JRuby Developer @ jruby.sourceforge.net
> > > > > Application Architect @ www.ventera.com
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > > > > language that extends applications into web and mobile media.
> > > > > Attend the live webcast and join the prime developer group breaking
> > > > > into this new coding territory!
> > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
> > > > > _______________________________________________
> > > > > Jruby-devel mailing list
> > > > > [email protected]
> > > > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > > >
> > > > -------------------------------------------------------
> > > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > > > language that extends applications into web and mobile media. Attend
> > > > the live webcast and join the prime developer group breaking into
> > > > this new coding territory!
> > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121
> > > >642 _______________________________________________
> > > > Jruby-devel mailing list
> > > > [email protected]
> > > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > > language that extends applications into web and mobile media. Attend
> > > the live webcast and join the prime developer group breaking into this
> > > new coding territory!
> > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=12164
> > >2 _______________________________________________
> > > Jruby-devel mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/jruby-devel
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > language that extends applications into web and mobile media. Attend the
> > live webcast and join the prime developer group breaking into this new
> > coding territory!
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> > _______________________________________________
> > Jruby-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jruby-devel
>
> --
> Charles Oliver Nutter @ headius.blogspot.com
> JRuby Developer @ jruby.sourceforge.net
> Application Architect @ www.ventera.com
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live
> webcast and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
> _______________________________________________
> Jruby-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jruby-devel
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel