Commits

Anonymous committed d7723e9

Switched to File-ShareDir.

Comments (0)

Files changed (6)

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

         'Exporter' => 0,
         'Data::Dumper' => 0,
         'Exception::Class' => 0,
+        'File::ShareDir' => 0,
         'Getopt::Long' => 0,
         'HTML::Entities' => 0,
         'List::Util' => 0,

perl/modules/XML-Grammar-Fiction/Changes

 Revision history for XML-Grammar-Fiction.
 
+        - Moved some unused source files to the rejects directory.
+        - Convert to the new XML-Grammar-Fiction-Builder which uses
+        File::ShareDir, which will hopefully resolve testing and installation
+        problems.
+
 0.1.2       Thu Apr 29 22:47:04 IDT 2010
         - In the Build.PL - merged 'test_requires' into 'build_requires'. 
         Turns out that 'test_requires' is a Module::Installism.

perl/modules/XML-Grammar-Fiction/inc/XML/Grammar/Builder.pm

 
 use File::Find;
 
-our $VERSION = '0.0101';
+our $VERSION = '0.0200';
 
 sub new
 {
     my %args = @_;
     my @extradata_files;
     
-    my $module_name = $args{'module_name'};
-    $module_name =~ s{::}{-}g;
-
-    my $filter_files_cb = sub {
-        my $filename = $File::Find::name;
-        if ((-f $filename) &&
-            ($filename =~ /\.(?:mod|xslt|dtd|ent|cat|jpg|rng|xcf\.bz2)$/)
-        )
-        {
-            push @extradata_files, $filename;
-        }
-    };
- 
-    find({ wanted => $filter_files_cb, no_chdir => 1}, "extradata");
-
     my $builder = $package->SUPER::new(
-        extradata_files =>
-        {
-            (map { $_ => $_ } @extradata_files)
-        },
+        share_dir => 'extradata',
+        auto_configure_requires => 1,
         @_
     );
 
-    $builder->add_build_element('extradata');
-
-    $builder->install_path()->{'extradata'} = 
-        File::Spec->catdir(
-                $builder->install_destination("lib"),
-                qw(data modules),
-                $module_name,
-                qw(data)
-        );
-
-    $builder->config_data(
-        'extradata_install_path' =>
-        [$builder->install_path()->{'extradata'}]
-    );
-
     return $builder;
 }
 

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

 
 use XML::LibXSLT;
 
-use XML::Grammar::Fiction::ConfigData;
+use File::ShareDir ':ALL';
 
 use XML::LibXML;
 use XML::LibXSLT;
         return $self->_get_default_data_dir();
     },
 );
+
 has '_rng' =>
 (
     isa => 'XML::LibXML::RelaxNG', 
 {
     my $self = shift;
 
-    return XML::Grammar::Fiction::ConfigData->config('extradata_install_path')->[0];
+    return dist_dir( 'XML-Grammar-Fiction' );
 }
 
 sub _get_rng_schema

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

 
 use XML::LibXSLT;
 
-use XML::Grammar::Fiction::ConfigData;
+use File::ShareDir ':ALL';
 
 use XML::LibXML;
 use XML::LibXSLT;
 {
     my ($self, $args) = @_;
 
-    my $data_dir = $args->{'data_dir'} ||
-        XML::Grammar::Fiction::ConfigData->config('extradata_install_path')->[0];
+    my $data_dir = $args->{'data_dir'} || dist_dir ( 'XML-Grammar-Fiction');
 
     $self->_data_dir($data_dir);
 

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

 
 use XML::LibXSLT;
 
-use XML::Grammar::Fiction::ConfigData;
+use File::ShareDir ':ALL';
 
 use XML::LibXML;
 use XML::LibXSLT;
     my ($self, $args) = @_;
 
     my $data_dir = $args->{'data_dir'} ||
-        XML::Grammar::Fiction::ConfigData->config('extradata_install_path')->[0];
+        dist_dir( 'XML-Grammar-Fiction');
 
     $self->_data_dir($data_dir);