Skip to content

Commit

Permalink
Add a $VERSION string to each module file
Browse files Browse the repository at this point in the history
  • Loading branch information
run4flat committed Aug 26, 2014
1 parent 2f35542 commit ba4481c
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/PDL/Graphics/Prima.pm
Expand Up @@ -4,7 +4,7 @@ use warnings;
############################################################################
package PDL::Graphics::Prima;
############################################################################
our $VERSION = 0.14;
our $VERSION = 0.14; # do not delete these spaces

# Add automatic support for PDL terminal interactivity
use PDL::Graphics::Prima::ReadLine;
Expand Down
2 changes: 2 additions & 0 deletions lib/PDL/Graphics/Prima/Axis.pm
Expand Up @@ -7,6 +7,8 @@ use PDL::Graphics::Prima::Limits;
# Here's a package to handle the axes for me:
package PDL::Graphics::Prima::Axis;

our $VERSION = 0.14; # update with update-version.pl

use PDL::Graphics::Prima::Limits;
use PDL::Graphics::Prima::Scaling;
use Carp;
Expand Down
2 changes: 2 additions & 0 deletions lib/PDL/Graphics/Prima/DataSet.pm
Expand Up @@ -82,6 +82,8 @@ package PDL::Graphics::Prima::DataSet;
use Carp;
use Scalar::Util;

our $VERSION = 0.14; # update with update-version.pl

=item widget
The widget associated with the dataset.
Expand Down
4 changes: 4 additions & 0 deletions lib/PDL/Graphics/Prima/Limits.pm
@@ -1,6 +1,10 @@
use strict;
use warnings;

package PDL::Graphics::Prima::Limits;

our $VERSION = 0.14; # update with update-version.pl

# Defines the lm (limits) package in a way that CPAN won't index it
package
lm;
Expand Down
2 changes: 2 additions & 0 deletions lib/PDL/Graphics/Prima/Palette.pm
Expand Up @@ -74,6 +74,8 @@ All Palette classes know how to make new copies of themselves... ?
package PDL::Graphics::Prima::Palette;
use Carp;

our $VERSION = 0.14; # update with update-version.pl

=head2 new
Accepts key/value pairs. The only required key is the C<apply> key, which
Expand Down
2 changes: 2 additions & 0 deletions lib/PDL/Graphics/Prima/PlotType.pm
Expand Up @@ -2283,6 +2283,8 @@ sub draw {

package PDL::Graphics::Prima::PlotType;

our $VERSION = 0.14; # update with update-version.pl

use Carp 'croak';

=back
Expand Down
2 changes: 2 additions & 0 deletions lib/PDL/Graphics/Prima/ReadLine.pm
Expand Up @@ -3,6 +3,8 @@ use strict;
use warnings;
use Carp;

our $VERSION = 0.14; # update with update-version.pl

my $is_setup = 0;

sub is_happy_with {
Expand Down
4 changes: 4 additions & 0 deletions lib/PDL/Graphics/Prima/Scaling.pm
@@ -1,6 +1,10 @@
use strict;
use warnings;

package PDL::Graphics::Prima::Scaling;

our $VERSION = 0.14; # update with update-version.pl

package
sc;
use constant Linear => 'PDL::Graphics::Prima::Scaling::Linear';
Expand Down
2 changes: 2 additions & 0 deletions lib/PDL/Graphics/Prima/Simple.pm
Expand Up @@ -3,6 +3,8 @@ use strict;
use warnings;
use Carp 'croak';

our $VERSION = 0.14; # update with update-version.pl

use PDL::Graphics::Prima;

=head1 NAME
Expand Down
27 changes: 27 additions & 0 deletions update-versions.pl
@@ -0,0 +1,27 @@
use strict;
use warnings;

# Propogates the version string in lib/PDL/Graphics/Prima.pm to the version
# strings in the other modules.

open my $in_fh, '<', 'lib/PDL/Graphics/Prima.pm';
# Find the version string
while(<$in_fh>) {
last if /^our \$VERSION = (\d\.\d\d.{4})/;
}
my $version = $1;
close $in_fh;

# OK, now run through all the module files
for my $module_filename (glob 'lib/PDL/Graphics/Prima/*.pm') {
next if $module_filename =~ /Internals/;
print "Updating $module_filename\n";
open my $out_fh, '+<', $module_filename;
while (my $line = <$out_fh>) {
if ($line =~ /\$VERSION = /) {
print $out_fh "our \$VERSION = $1\n";
last;
}
}
close $out_fh;
}

0 comments on commit ba4481c

Please sign in to comment.