Anonymous avatar Anonymous committed 24980b2

Extract a common base class - XML/Grammar/FictionBase/TagsTree2XML .

Comments (0)

Files changed (4)

perl/modules/XML-Grammar-Fiction/MANIFEST

 lib/XML/Grammar/Fiction/App/ToDocBook.pm
 lib/XML/Grammar/Fiction/App/ToHTML.pm
 lib/XML/Grammar/Fiction/Base.pm
+lib/XML/Grammar/FictionBase/TagsTree2XML.pm
 lib/XML/Grammar/Fiction/Err.pm
 lib/XML/Grammar/Fiction/Event.pm
 lib/XML/Grammar/Fiction/FromProto/Nodes.pm

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto.pm

 use warnings;
 
 use Carp;
-
-use XML::Writer;
 use HTML::Entities ();
 
-use XML::Grammar::Fiction::FromProto::Nodes;
-
 use Moose;
 
+extends("XML::Grammar::FictionBase::TagsTree2XML");
+
 use List::Util (qw(first));
 
-has '_parser_class' =>
-(
-    is => "ro",
-    isa => "Str",
-    init_arg => "parser_class",
-    default => "XML::Grammar::Fiction::FromProto::Parser::QnD",
-);
-
-has "_parser" => (
-    'isa' => "XML::Grammar::Fiction::FromProto::Parser", 
-    'is' => "rw",
-    lazy => 1,
-    default => sub { 
-        my $self = shift; 
-        return $self->_parser_class->new();
-    },
-);
-
-has "_writer" => ('isa' => "XML::Writer", 'is' => "rw");
-
 my $fiction_ns = q{http://web-cpan.berlios.de/modules/XML-Grammar-Fortune/fiction-xml-0.2/};
 my $xml_ns = "http://www.w3.org/XML/1998/namespace";
 

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/TagsTree2XML.pm

+package XML::Grammar::FictionBase::TagsTree2XML;
+
+use Moose;
+
+use XML::Writer;
+use HTML::Entities ();
+
+use XML::Grammar::Fiction::FromProto::Nodes;
+
+
+=head1 NAME
+
+XML::Grammar::FictionBase::TagsTree2XML - base class for the tags-tree
+to XML converters.
+
+=head1 VERSION
+
+Version 0.0.4
+
+=cut
+
+has '_parser_class' =>
+(
+    is => "ro",
+    isa => "Str",
+    init_arg => "parser_class",
+    default => "XML::Grammar::Fiction::FromProto::Parser::QnD",
+);
+
+has "_parser" => (
+    'isa' => "XML::Grammar::Fiction::FromProto::Parser", 
+    'is' => "rw",
+    lazy => 1,
+    default => sub { 
+        my $self = shift; 
+        return $self->_parser_class->new();
+    },
+);
+
+has "_writer" => ('isa' => "XML::Writer", 'is' => "rw");
+
+has '_buffer' => ('isa' => "ScalarRef[Str]", is => "rw");
+
+
+=head2 meta()
+
+Internal - (to settle pod-coverage.).
+
+=head1 AUTHOR
+
+Shlomi Fish, L<http://www.shlomifish.org/>.
+
+=head1 BUGS
+
+Please report any bugs or feature requests to
+C<bug-xml-grammar-fiction at rt.cpan.org>, or through the web interface at
+L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=XML-Grammar-Fiction>.
+I will be notified, and then you'll automatically be notified of progress on
+your bug as I make changes.
+
+
+=head1 ACKNOWLEDGEMENTS
+
+=head1 COPYRIGHT & LICENSE
+
+Copyright 2010, Shlomi Fish.
+
+This program is released under the following license: MIT X11.
+
+=cut
+
+1;
+

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/FromProto.pm

 package XML::Grammar::Screenplay::FromProto;
 
-use strict;
-use warnings;
-
-use Carp;
-
-use base 'XML::Grammar::Screenplay::Base';
-
-use XML::Writer;
-use HTML::Entities ();
-
-use XML::Grammar::Fiction::FromProto::Nodes;
-
 use Moose;
 
-has "_parser" => ('is' => "rw");
-has "_writer" => ('isa' => "XML::Writer", 'is' => "rw");
-
-has '_buffer' => ('isa' => "ScalarRef[Str]", is => "rw");
+extends("XML::Grammar::FictionBase::TagsTree2XML");
 
 my $screenplay_ns = q{http://web-cpan.berlios.de/modules/XML-Grammar-Screenplay/screenplay-xml-0.2/};
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.