summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bump-version-number.pl25
-rw-r--r--scripts/tag-release.pl16
2 files changed, 18 insertions, 23 deletions
diff --git a/scripts/bump-version-number.pl b/scripts/bump-version-number.pl
index 3884d60..18b13ba 100644
--- a/scripts/bump-version-number.pl
+++ b/scripts/bump-version-number.pl
@@ -3,14 +3,14 @@
use strict;
use warnings;
-use File::Find::Object;
-use IO::All;
+use File::Find::Object ();
+use Path::Tiny qw/ path tempdir tempfile cwd /;
-my $tree = File::Find::Object->new({}, 'lib/');
+my $tree = File::Find::Object->new( {}, 'lib/' );
my $version_n = shift(@ARGV);
-if (!defined($version_n))
+if ( !defined($version_n) )
{
die "Specify version number as an argument! bump-version-number.pl '0.0.1'";
}
@@ -19,27 +19,26 @@ sub process_file
{
# The filename.
my ($r) = @_;
+ my $fh = path($r);
- my @lines = io->file($r)->getlines();
+ my @lines = $fh->lines_utf8;
foreach (@lines)
{
- s#(\$VERSION = "|^Version )\d+\.\d+(?:\.\d+)?("|)#$1 . $version_n . $2#e;
+s#(\$VERSION = "|^Version )\d+\.\d+(?:\.\d+)?("|)#$1 . $version_n . $2#e;
}
- io->file($r)->print(
- @lines
- );
+ $fh->spew_utf8(@lines);
}
process_file('LibXML.pm');
-while (my $r = $tree->next()) {
- if ($r =~ m{/\.(?:svn|hg|git)\z})
+while ( my $r = $tree->next() )
+{
+ if ( $r =~ m{/\.(?:svn|hg|git)\z} )
{
$tree->prune();
}
- elsif ($r =~ m{\.pm\z})
+ elsif ( $r =~ m{\.pm\z} )
{
process_file($r);
}
}
-
diff --git a/scripts/tag-release.pl b/scripts/tag-release.pl
index ca08d00..9c2e6f5 100644
--- a/scripts/tag-release.pl
+++ b/scripts/tag-release.pl
@@ -3,25 +3,21 @@
use strict;
use warnings;
-use IO::All;
+use IO::All qw/ io /;
my ($version) =
- (map { m{\$VERSION *= *"([^"]+)"} ? ($1) : () }
- io->file('LibXML.pm')->getlines()
- )
- ;
+ ( map { m{\$VERSION *= *"([^"]+)"} ? ($1) : () }
+ io->file('LibXML.pm')->getlines() );
-if (!defined ($version))
+if ( !defined($version) )
{
die "Version is undefined!";
}
my @cmd = (
- "git", "tag", "-m",
- "Tagging the XML-LibXML release as $version",
+ "git", "tag", "-m", "Tagging the XML-LibXML release as $version",
"XML-LibXML-$version",
);
-print join(" ", map { /\s/ ? qq{"$_"} : $_ } @cmd), "\n";
+print join( " ", map { /\s/ ? qq{"$_"} : $_ } @cmd ), "\n";
exec(@cmd);
-