Commits

Shlomi Fish committed fd00311

Add a script to bump the version number.

Comments (0)

Files changed (8)

XML-GrammarBase/Changes

 Revision history for XML-GrammarBase
 
-         Add t/01libxml-basic.t for diag()s for libxml2 and XML::LibXML
+         * Add t/01libxml-basic.t for diag()s for libxml2 and XML::LibXML
          (so we'll know which versions of them are failing).
+         * Add scripts/bump-version-number.pl .
 
 0.1.1    Thu  3 Jan 13:39:42 IST 2013
          Add keywords and resources to the META.yml / META.json.

XML-GrammarBase/MANIFEST

 lib/XML/GrammarBase/Role/RelaxNG.pm
 lib/XML/GrammarBase/Role/XSLT.pm
 lib/XML/GrammarBase/Role/XSLT/Global.pm
+scripts/bump-version-number.pl
 t/00-load.t
 t/01libxml-basic.t
 t/data/fiction-xml-invalid-test.xml

XML-GrammarBase/lib/XML/GrammarBase.pm

 
 =head1 VERSION
 
-Version 0.1.1
+Version 0.1.2
 
 =cut
 
-our $VERSION = '0.1.1';
+our $VERSION = '0.1.2';
 
 
 =head1 SYNOPSIS

XML-GrammarBase/lib/XML/GrammarBase/Role/DataDir.pm

 
 =head1 VERSION
 
-Version 0.1.1
+Version 0.1.2
 
 =cut
 
 
 use File::ShareDir qw(dist_dir);
 
-our $VERSION = '0.1.1';
+our $VERSION = '0.1.2';
 
 has 'module_base' => (isa => 'Str', is => 'rw');
 has 'data_dir' => (isa => 'Str', is => 'rw',

XML-GrammarBase/lib/XML/GrammarBase/Role/RelaxNG.pm

 
 =head1 VERSION
 
-Version 0.1.1
+Version 0.1.2
 
 =cut
 
 
 with ('XML::GrammarBase::Role::DataDir');
 
-our $VERSION = '0.1.1';
+our $VERSION = '0.1.2';
 
 has 'rng_schema_basename' => (isa => 'Str', is => 'rw');
 has '_rng' =>

XML-GrammarBase/lib/XML/GrammarBase/Role/XSLT.pm

 
 =head1 VERSION
 
-Version 0.1.1
+Version 0.1.2
 
 =cut
 
 
 use autodie;
 
-our $VERSION = '0.1.1';
+our $VERSION = '0.1.2';
 
 
 sub make_variant

XML-GrammarBase/lib/XML/GrammarBase/Role/XSLT/Global.pm

 
 =head1 VERSION
 
-Version 0.1.1
+Version 0.1.2
 
 =cut
 
 
 use autodie;
 
-our $VERSION = '0.1.1';
+our $VERSION = '0.1.2';
 
 with ('XML::GrammarBase::Role::RelaxNG');
 

XML-GrammarBase/scripts/bump-version-number.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use File::Find::Object;
+use IO::All;
+
+my $tree = File::Find::Object->new({}, 'lib/');
+
+my $version_n = shift(@ARGV);
+
+if (!defined($version_n))
+{
+    die "Specify version number as an argument! bump-version-number.pl '0.0.1'";
+}
+
+while (my $r = $tree->next()) {
+    if ($r =~ m{/\.svn\z})
+    {
+        $tree->prune();
+    }
+    elsif ($r =~ m{\.pm\z})
+    {
+        my @lines = io->file($r)->getlines();
+        foreach (@lines)
+        {
+            s#(\$VERSION = '|^Version )\d+\.\d+(?:\.\d+)?('|)#$1 . $version_n . $2#e;
+        }
+        io->file($r)->print(
+            @lines
+        );
+    }
+}
+