Made JSAN support optional
Sebastian Riedel [Mon, 31 Oct 2005 00:27:50 +0000 (00:27 +0000)]
Build.PL
lib/Catalyst/Helper.pm

index 1ac3dc7..992fba1 100644 (file)
--- a/Build.PL
+++ b/Build.PL
@@ -16,7 +16,6 @@ my $build = Module::Build->new(
         'HTTP::Headers'                     => 1.59,
         'HTTP::Request'                     => 0,
         'HTTP::Response'                    => 0,
-        'JSAN'                              => 0,
         'LWP::UserAgent'                    => 0,
         'MIME::Types'                       => 0,
         'Module::Pluggable::Fast'           => 0.16,
@@ -30,7 +29,7 @@ my $build = Module::Build->new(
         'Tree::Simple::Visitor::FindByPath' => 0,
         'URI'                               => 1.35,
     },
-    recommends         => { 'Catalyst::Engine::Apache' => 0, },
+    recommends         => { 'Catalyst::Engine::Apache' => 0, JSAN => 0 },
     create_makefile_pl => 'passthrough',
     create_readme      => 1,
     script_files       => [ glob('script/*') ],
index ab6b11f..59b8321 100644 (file)
@@ -708,7 +708,8 @@ my $home = Catalyst::Utils::home('[% name %]');
 $ENV{JSAN_PREFIX} ||= File::Spec->catdir( $home, 'root', 'static', 'js' );
 
 # JSAN shell
-require JSAN;
+eval 'require JSAN';
+die "Please install JSAN\n" if $@;
 JSAN->control;
 
 1;
@@ -736,7 +737,7 @@ Install JavaScript libraries from the JSAN shell.
 
 =head1 SEE ALSO
 
-http://openjsan.org
+L<JSAN>, L<http://openjsan.org>
 
 =head1 AUTHOR