Skip to content

Commit 514f077

Browse files
author
Chris White
committed
XML::Axk no longer loads ...App, ...Core
XML::Axk is now a stub that only holds the version and other static information. This way ...App can `use XML::Axk` to get the version number for `axk --version`.
1 parent 1c82dcc commit 514f077

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

lib/XML/Axk.pm

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
#!/usr/bin/env perl
22
# Copyright (c) 2018 cxw42. All rights reserved. Artistic 2.
3-
# XML::Axk: Stub package that loads XML::Axk::Core and XML::Axk::Core.
3+
# XML::Axk: Stub package that just holds the version
44

55
package XML::Axk;
66
use XML::Axk::Base; # uses 5.018, so we can safely use v-strings.
7-
use XML::Axk::Core v0.1.0;
8-
use XML::Axk::App v0.1.0;
9-
use Import::Into;
107

118
use version 0.77; our $VERSION = version->declare("v0.1_2");
129
# underscore before last component => alpha version
1310

14-
sub import {
15-
XML::Axk::Core->import::into(1);
16-
XML::Axk::App->import::into(1);
17-
}
18-
1911
1;
2012
__END__
2113
# === Documentation ===================================================== {{{1
@@ -30,7 +22,8 @@ XML::Axk - ack-like XML processor
3022
3123
=head1 USAGE
3224
33-
use XML::Axk;
25+
use XML::Axk::App; # pick whichever you want,
26+
use XML::Axk::Core; # or both
3427
3528
# Canned interface, as if run from the command line
3629
XML::Axk::App::Main(\@ARGV)

lib/XML/Axk/App.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ sub Main {
136136
parse_command_line(from => $lrArgs, into => \%opts);
137137

138138
if($opts{PRINT_VERSION}) {
139-
say "axk $VERSION";
139+
use XML::Axk;
140+
say "axk $XML::Axk::VERSION";
140141
return 0;
141142
}
142143

lib/XML/Axk/Base.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use Import::Into;
88

99
# Pragmas
1010
use 5.018;
11-
use feature ":5.18";
11+
use feature ":5.18"; # Use expressly so we can re-export it below
1212
use strict;
1313
use warnings;
1414

t/00-load.t

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
use 5.018;
33
use strict;
44
use warnings;
5-
use Test::More tests=>3;
5+
use Test::More tests=>5;
66
use Module::Loaded;
77

88
BEGIN {
9-
use_ok( 'XML::Axk' ) || print "Bail out!\n";
9+
use_ok( 'XML::Axk' ) || print "Could not load main\n";
10+
use_ok( 'XML::Axk::App' ) || print "Could not load App\n";
11+
use_ok( 'XML::Axk::Core' ) || print "Could not load Core\n";
1012
}
1113

1214
diag( "Testing XML::Axk $XML::Axk::VERSION, Perl $], $^X" );

0 commit comments

Comments
 (0)