Shlomi Fish avatar Shlomi Fish committed f136e54

Convert from Mouse to Moo / MooX::late.

Comments (0)

Files changed (21)

perl/modules/XML-Grammar-Fiction/Build.PL

         'HTML::Entities' => 0,
         'List::MoreUtils' => 0,
         'List::Util' => 0,
-        'Mouse' => 0,
-        'Mouse::Meta::Attribute::Custom::Trait::Array' => 0,
+        'Moo' => 0,
+        'MooX' => 0,
+        'MooX::late' => 0,
         'Parse::RecDescent' => 0,
         'strict' => 0,
         'warnings' => 0,

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

 use HTML::Entities ();
 use XML::Writer;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::FictionBase::TagsTree2XML");
 

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

 
 package XML::Grammar::Fiction::FromProto::Node;
 
-use Mouse;
+use MooX 'late';
 
 sub _short_isa
 {
 
 package XML::Grammar::Fiction::FromProto::Node::WithContent;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node");
 
 
 package XML::Grammar::Fiction::FromProto::Node::Element;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node::WithContent");
 
 
 package XML::Grammar::Fiction::FromProto::Node::List;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node");
 
 
 package XML::Grammar::Fiction::FromProto::Node::Text;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node::WithContent");
 
 
 package XML::Grammar::Fiction::FromProto::Node::Saying;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node::Text");
 
 
 package XML::Grammar::Fiction::FromProto::Node::Description;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node::Text");
 
 package XML::Grammar::Fiction::FromProto::Node::Paragraph;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node::Element");
 
 package XML::Grammar::Fiction::FromProto::Node::InnerDesc;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node::Element");
 
 
 package XML::Grammar::Fiction::FromProto::Node::Comment;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::FromProto::Node");
 

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

 use strict;
 use warnings;
 
-use Mouse;
+use MooX 'late';
 
 =head1 NAME
 

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

 use strict;
 use warnings;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::FictionBase::FromProto::Parser::XmlIterator");
 

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

 
 =cut
 
-use Mouse;
+use MooX 'late';
 
 extends ("XML::Grammar::FictionBase::XSLT::Converter");
 
 has '+rng_schema_basename' => (default => "fiction-xml.rng");
 
+=head1 METHODS
+
+=head2 rng_schema_basename()
+
+Inherited - (to settle pod-coverage).
+
 =head1 AUTHOR
 
 Shlomi Fish, L<http://www.shlomifish.org/>.

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/Struct/Tag.pm

 use strict;
 use warnings;
 
-use Mouse;
+use MooX 'late';
 
 use List::MoreUtils;
 
 
 package XML::Grammar::Fiction::Struct::Tag::Para;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::Fiction::Struct::Tag");
 

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

 
 use Carp;
 
-use Mouse;
+use MooX 'late';
 
 extends ("XML::Grammar::Fiction::RNG_Renderer");
 
 
 our $VERSION = '0.9.3';
 
+=head1 METHODS
+
 =head2 new()
 
 Accepts no arguments so far. May take some time as the grammar is compiled
 
 Internal - (to settle pod-coverage.).
 
+=head2 xslt_transform_basename()
+
+Inherited - (to settle pod-coverage).
+
 =cut
 
 

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

 
 use Carp;
 
-use Mouse;
+use MooX 'late';
 
 extends( 'XML::Grammar::Fiction::RNG_Renderer' );
 
 
 our $VERSION = '0.9.3';
 
+=head1 METHODS
+
+=head2 xslt_transform_basename()
+
+Inherited - (to settle pod-coverage).
+
 =head2 new()
 
 Accepts no arguments so far. May take some time as the grammar is compiled

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

 
 =cut
 
-use Mouse;
+use MooX 'late';
 
 use XML::Grammar::Fiction::FromProto::Nodes;
 
 
 1;
 
+=head1 SLOTS
+
+=head2 $event->elem()
+
+The DOM (Document Object Model) element that the event refers to. See
+L<XML::Grammar::Fiction::FromProto::Node> .
+
+=head2 $event->tag_elem()
+
+Extra tag_elem.
+
+=head2 $event->type()
+
+A string specifying the type.
+
+=head2 tag
+
+An optional string (or undef) with the tag name.
+
+=head1 METHODS
+
 =head2 $event->is_tag_of_name($name)
 
 Determines if the $event is a tag and of name $name.

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/FromProto/Parser/LineIterator.pm

 use strict;
 use warnings;
 
-use Mouse;
+use MooX 'late';
 
 use XML::Grammar::Fiction::Err;
 

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/FromProto/Parser/XmlIterator.pm

 use strict;
 use warnings;
 
-use Mouse;
+use Carp ();
+
+use MooX 'late';
 
 use XML::Grammar::Fiction::Err;
 use XML::Grammar::Fiction::Struct::Tag;
     isa => "ArrayRef",
     is => "rw",
     default => sub { [] },
+);
+
+=begin Removed
+    # Not supported by Moo / MooX yet.
+
     traits => ['Array'],
     handles =>
     {
         '_pop_tag' => 'pop',
         '_get_tag' => 'get',
     },
-);
+
+=end Removed
+
+=cut
+sub _get_tag
+{
+    my ($self, $idx) = @_;
+
+    return $self->_tags_stack->[$idx];
+}
+
+sub _tag_stack_is_empty
+{
+    my $self = shift;
+
+    return (! @{$self->_tags_stack});
+}
+
+sub _grep_tags_stack
+{
+    my $self = shift;
+    my $cb = shift;
+
+    return grep { $cb->($_) } @{$self->_tags_stack};
+}
+
+sub _push_tag
+{
+    my $self = shift;
+
+    push( @{$self->_tags_stack}, @_);
+
+    return;
+}
+
+sub _pop_tag
+{
+    my $self = shift;
+
+    return pop(@{$self->_tags_stack});
+}
 
 has "_events_queue" =>
 (
     # isa => "ArrayRef",
     is => "rw",
     default => sub { []; },
+);
+
+=begin Removed
+    # Not supported by Moo / MooX yet.
+
     traits => ['Array'],
     handles =>
     {
         _no_events => 'is_empty',
         _clear_events => 'clear',
     },
-);
+
+=end Removed
+
+=cut
+
+sub _clear_events
+{
+    my $self = shift;
+
+    $self->_events_queue([]);
+
+    return;
+}
+
+sub _no_events
+{
+    my $self = shift;
+
+    return (! @{$self->_events_queue});
+}
+
+sub _enqueue_event
+{
+    my $self = shift;
+    my $event = shift;
+
+    if (@_) {
+        Carp::confess("More than one argument.");
+    }
+
+    push( @{$self->_events_queue}, $event);
+
+    return;
+}
+
+sub _extract_event
+{
+    my $self = shift;
+
+    return shift(@{$self->_events_queue});
+}
 
 has '_ret_tag' =>
 (

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

 package XML::Grammar::FictionBase::TagsTree2XML;
 
-use Mouse;
+use MooX 'late';
 
 use XML::Writer;
 use HTML::Entities ();

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/XSLT/Converter.pm

 use XML::LibXML;
 use XML::LibXSLT;
 
-use Mouse;
+use MooX 'late';
 
 has '_data_dir' => (isa => 'Str', is => 'rw');
 has '_data_dir_from_input' => (isa => 'Str', is => 'rw', init_arg => 'data_dir',);
 
 our $VERSION = '0.9.3';
 
+=head1 METHODS
+
 =head2 new()
 
 Accepts no arguments so far. May take some time as the grammar is compiled
 
 Internal - (to settle pod-coverage.).
 
+=head2 rng_schema_basename()
+
+Inherited - (to settle pod-coverage.).
+
+=head2 xslt_transform_basename()
+
+Inherited - (to settle pod-coverage.).
+
 =cut
 
 sub BUILD

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

 
 use XML::Writer;
 
-use Mouse;
+use MooX 'late';
 
 extends("XML::Grammar::FictionBase::TagsTree2XML");
 

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

 use strict;
 use warnings;
 
-use Mouse;
+use MooX 'late';
 
 1;
 

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

 use strict;
 use warnings;
 
-use Mouse;
+use MooX 'late';
 
 extends( 'XML::Grammar::FictionBase::FromProto::Parser::XmlIterator' );
 
 
 =head2 $self->meta()
 
+Leftover from Moo.
+
+=head2 $self->next_line_ref
+
 Leftover from Mouse.
 
 =head1 AUTHOR

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

 package XML::Grammar::Screenplay::ToDocBook;
 
-use Mouse;
+use MooX 'late';
 
 extends('XML::Grammar::Screenplay::XSLT::Base');
 
 XML::Grammar::Screenplay::ToDocBook - module that converts the Screenplay
 XML to DocBook.
 
+=head1 METHODS
+
+=head2 xslt_transform_basename()
+
+Inherited - (to settle pod-coverage).
+
 =head1 VERSION
 
 Version 0.9.3

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

 package XML::Grammar::Screenplay::ToHTML;
 
-use Mouse;
+use MooX 'late';
 
 extends('XML::Grammar::Screenplay::XSLT::Base');
 
 
 our $VERSION = '0.9.3';
 
+=head1 METHODS
+
+=head2 xslt_transform_basename()
+
+Inherited - (to settle pod-coverage).
+
 =head2 new()
 
 Accepts no arguments so far. May take some time as the grammar is compiled

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

 use strict;
 use warnings;
 
-use Mouse;
+use MooX 'late';
 
 extends('XML::Grammar::Screenplay::XSLT::Base');
 
 
 =head2 meta()
 
-Internal - (to settle pod-coverage.).
+Internal - (to settle pod-coverage).
+
+=head2 xslt_transform_basename()
+
+Inherited - (to settle pod-coverage).
 
 =head2 $converter->translate_to_tei({source => {file => $filename}, output => "string" })
 

perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/XSLT/Base.pm

 package XML::Grammar::Screenplay::XSLT::Base;
 
-use Mouse;
+use MooX 'late';
 
 extends('XML::Grammar::FictionBase::XSLT::Converter');
 
 
 Version 0.9.3
 
+=head1 METHODS
+
+=head2 rng_schema_basename()
+
+Inherited - (to settle pod-coverage).
+
 =head1 AUTHOR
 
 Shlomi Fish, L<http://www.shlomifish.org/>.
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.