[libxml-devel] Libxml directory structure
Aaron Patterson
aaron.patterson at gmail.com
Sun Jul 13 15:39:30 EDT 2008
On Sun, Jul 13, 2008 at 4:00 AM, Trans <transfire at gmail.com> wrote:
>
>
> On Jul 13, 12:36 am, Charlie Savage <c... at savagexi.com> wrote:
>> Moving to new thread...
>>
>> > No not lib/xml/, that's were we had been. we need the code under lib/
>> > libxml/. the xml/ directory is there only for backward compatibility.
>>
>> So is this what you are proposing?
>>
>> lib
>> libxml.rb
>> libxml
>> attributes.rb
>> attr.rb
>> <plus other ruby files>
>>
>> Meaning libxml.rb would look like this:
>>
>> require 'libxml_ruby'
>> require 'libxml/attributes'
>> <etc>
>
> Yep. See...
>
>
> http://groups.google.com/group/libxml-devel/browse_thread/thread/2b87c9656c14eb2c/ae99e0bf4ffa9603?hl=en&lnk=gst&q=libxml+name#ae99e0bf4ffa9603
>
> As Dan said in another thread too, we can set
>
> XML = LibXML
>
> for compatibility.
The top level constant doesn't really matter to me. As long as we do
like you said, and make sure to set the XML constant for
compatibility.
A couple things I would like are: 1) each ruby class in its own file,
and 2) each class under a directory corresponding to its module/class.
For example, the class LibXML::Node::Set would live as
"lib/libxml/node/set.rb". The LibXML::Node class would live as
"lib/libxml/node.rb", and 'require' any classes that are defined in
its namespace.
In my experience, that has made finding classes easy and fairly intuitive.
--
Aaron Patterson
http://tenderlovemaking.com/
More information about the libxml-devel
mailing list