RDF-NS

 view release on metacpan or  search on metacpan

update.pl  view on Meta::CPAN

    print "Usage: $0 http://prefix.cc/popular/all.file.txt  # from url\n";
    print "Usage: $0 all.txt                                #  from file\n";
    exit;
};

# make sure, git repository is clean
my $dirty = `git status --porcelain`;
die "git repository is dirty\n" if $dirty;

# get current version distribution
my $dist        = do { local ( @ARGV, $/ ) = 'lib/RDF/NS.pm'; <> };
my $cur_version = $1 if $dist =~ /^our \$VERSION\s*=\s*'([^']+)'/m;
$cur_version or die 'current version not found in lib/RDF/NS.pm';

# get current prefixes
my $cur = RDF::NS->LOAD( "share/prefix.cc", warn => 1 );
die "share/prefix.cc is empty" unless %$cur;

# get new current datestamp
my @t           = gmtime;
my $new_version = sprintf '%4d%02d%02d',    $t[5] + 1900, $t[4] + 1, $t[3];

update.pl  view on Meta::CPAN

  lib/App/rdfns.pm
  lib/RDF/NS.pm
  lib/RDF/NS/Trine.pm
  lib/RDF/NS/URIS.pm
  lib/RDF/SN.pm
  README.md
);

foreach my $file (@files) {
    print "$cur_version => $new_version in $file\n";
    local ( $^I, @ARGV ) = ( '.bak', $file );
    while (<>) {
        s/$cur_version/$new_version/ig;
        print;
    }
}

my $msg = `git log --pretty=format:" - %s" $cur_version..`;

do {
    print "prepend modifications to Changes\n";
    local ( $^I, @ARGV ) = ( '.bak', 'Changes' );
    my $line = 0;
    while (<>) {
        if ( !$line++ ) {    # prepend
            print join '', map { "$_\n" } @log;
            print "\n$msg" if $msg;
            print "\n\n";
        }
        print;
    }
};



( run in 0.516 second using v1.01-cache-2.11-cpan-49f99fa48dc )