Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest BWIPP #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ AUTHORS - Authors of and contributors to Alien-BWIPP

=item Jozef Kutej C<< <[email protected]> >>

=item Matthew Newton C<< <[email protected]> >>

=back
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

Changes - Revision history for Alien-BWIPP

=head2 0.007 2014-07-03

upgrade to barcode writer version 2014-06-30-1

=head2 0.006 2010-07-01

=over
Expand Down
22 changes: 11 additions & 11 deletions README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=encoding UTF-8

Alien-BWIPP version 0.006 is Copyright © 2010, Lars Dɪᴇᴄᴋᴏᴡ
Alien-BWIPP version 0.007 is Copyright © 2010, Lars Dɪᴇᴄᴋᴏᴡ

=head1 NAME

Expand All @@ -11,17 +11,17 @@ README - basic information for users prior to downloading

=head2 system-wide installation

perl Makefile.PL
make
make test
sudo make install
perl Build.PL
./Build
./Build test
sudo ./Build install

=head2 installation in a private directory

perl Makefile.PL INSTALL_BASE=~/modules_prefix
make
make test
make install
perl Build.PL --install_base ~/modules_prefix
./Build
./Build test
./Build install

Do not forget to add F<$HOME/modules_prefix/lib/perl5> to your C<@INC>, see
L<perlfaq8/"How do I add a directory to my include path (@INC) at runtime?">.
Expand All @@ -48,9 +48,9 @@ L<Moose>, L<MooseX::ClassAttribute>, L<Exception::Class>, L<File::ShareDir>

=head2 F<barcode.ps>

Barcode Writer in Pure PostScript - Version 2010-06-20
Barcode Writer in Pure PostScript - Version 2014-06-30-1

Copyright © 2004-2010 Terry Burton C<< <[email protected]> >>
Copyright © 2004-2014 Terry Burton C<< <[email protected]> >>

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
Expand Down
33 changes: 15 additions & 18 deletions lib/Alien/BWIPP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use Moose qw(has);
use MooseX::ClassAttribute qw(class_has);
use Storable qw(dclone);

our $VERSION = '0.006';
our $VERSION = '0.007';

has 'barcode_source_handle' => (
is => 'rw',
Expand Down Expand Up @@ -43,10 +43,7 @@ sub _build__chunks {
$block_name = 'LICENCE';
continue;
}
when (/\A% --BEGIN PREAMBLE--/) {
$block_name = 'PREAMBLE';
}
when (/\A %[ ]--BEGIN[ ](?<type>(?:RENDER|ENCOD)ER)[ ](?<name>\w+)--/msx) {
when (/\A %[ ]--BEGIN[ ](?<type>(?:RENDERER|ENCODER|RESOURCE))[ ](?<name>\w+)--/msx) {
$block_type = $LAST_PAREN_MATCH{type} if $LAST_PAREN_MATCH{type};
$block_name = $LAST_PAREN_MATCH{name} if $LAST_PAREN_MATCH{name};
}
Expand All @@ -56,7 +53,7 @@ sub _build__chunks {
(?:--)? \n \z/msx
) {
unless ($LAST_PAREN_MATCH{feature_name} ~~ [qw(BEGIN END)]) {
$chunks{ENCODER}{$block_name}{$LAST_PAREN_MATCH{feature_name}}
$chunks{$block_type}{$block_name}{$LAST_PAREN_MATCH{feature_name}}
= $LAST_PAREN_MATCH{feature_value};
}
}
Expand All @@ -79,15 +76,15 @@ sub create_classes {
my @meta_classes;
my %chunks = %{$self->_chunks};
for my $encoder (@{$self->_encoders}) {
my $prepended = $chunks{HEADER}{LICENCE}{post_script_source_code}
. $chunks{HEADER}{PREAMBLE}{post_script_source_code};
for my $renderer (split q{ }, $chunks{ENCODER}{$encoder}{RNDR}) {
$prepended .= $chunks{RENDERER}{$renderer}{post_script_source_code};
}
my $prepended = $chunks{HEADER}{LICENCE}{post_script_source_code};
for my $dependency_type (qw(REQUIRES SUGGESTS)) {
if (exists $chunks{ENCODER}{$encoder}{$dependency_type}) {
for my $dependency (split q{ }, $chunks{ENCODER}{$encoder}{$dependency_type}) {
$prepended .= $chunks{ENCODER}{$dependency}{post_script_source_code};
for my $resource_type (qw(RENDERER ENCODER RESOURCE)) {
if (exists $chunks{$resource_type}{$dependency}{post_script_source_code}) {
$prepended .= $chunks{$resource_type}{$dependency}{post_script_source_code};
}
}
}
}
}
Expand Down Expand Up @@ -127,8 +124,8 @@ Alien::BWIPP - Barcode Writer in Pure PostScript

=head1 VERSION

This document describes C<Alien::BWIPP> version C<0.006>. It is based on
I<Barcode Writer in Pure PostScript> version C<2010-06-20>.
This document describes C<Alien::BWIPP> version C<0.007>. It is based on
I<Barcode Writer in Pure PostScript> version C<2014-06-30-1>.


=head1 SYNOPSIS
Expand Down Expand Up @@ -265,9 +262,9 @@ See file F<AUTHORS>.

=head2 F<barcode.ps>

Barcode Writer in Pure PostScript - Version 2010-06-20
Barcode Writer in Pure PostScript - Version 2014-06-30-1

Copyright © 2004-2010 Terry Burton C<< <[email protected]> >>
Copyright © 2004-2014 Terry Burton C<< <[email protected]> >>

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
Expand Down Expand Up @@ -303,5 +300,5 @@ Distributable under the same licence.

=head1 SEE ALSO

homepage L<http://www.terryburton.co.uk/barcodewriter/>,
manual L<http://groups.google.com/group/postscriptbarcode/web>
homepage L<http://bwipp.terryburton.co.uk/>,
manual L<https://github.com/bwipp/postscriptbarcode/wiki>
Binary file modified share/barcode.ps
Binary file not shown.
7 changes: 5 additions & 2 deletions t/10-generated-class.t
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!perl -T
use strict;
use warnings FATAL => 'all';
use Test::More tests => 5;
use Test::More tests => 6;

use Alien::BWIPP;
my $instance = Alien::BWIPP::qrcode->new;
can_ok($instance, qw(DESC EXAM EXOP RNDR));
is($instance->DESC, 'QR Code');
is($instance->EXAM, 'http://www.terryburton.co.uk/barcodewriter/');
is($instance->EXAM, 'http://bwipp.terryburton.co.uk');
is($instance->EXOP, 'eclevel=M');
is($instance->RNDR, 'renmatrix');
ok((scalar grep /^%%BeginResource/, split /\n/,$instance->post_script_source_code) ==
(1 + scalar split / +/, $instance->REQUIRES));