Skip to content

Commit

Permalink
Switched from Any::Moose to Moo
Browse files Browse the repository at this point in the history
  • Loading branch information
mstratman committed Mar 24, 2016
1 parent a45c069 commit 351993f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name 'HTML-Barcode';
license 'perl';
all_from 'lib/HTML/Barcode.pm';

requires 'Any::Moose' => '0.15';
requires 'Moo';


test_requires 'Test::More';
Expand Down
23 changes: 7 additions & 16 deletions lib/HTML/Barcode.pm
Original file line number Diff line number Diff line change
@@ -1,61 +1,53 @@
package HTML::Barcode;
use Any::Moose;
use Moo;

our $VERSION = '0.12';

has 'text' => (
is => 'rw',
isa => 'Str',
documentation => 'The information to put into the barcode.',
);
has 'foreground_color' => (
is => 'rw',
isa => 'Str',
default => '#000',
documentation => 'A CSS color value for the foreground.',
);
has 'background_color' => (
is => 'rw',
isa => 'Str',
default => '#fff',
documentation => 'A CSS color value for the background.',
);
has 'bar_width' => (
is => 'rw',
isa => 'Str',
default => '2px',
documentation => 'A CSS value for the width of an individual bar.',
);
has 'bar_height' => (
is => 'rw',
isa => 'Str',
default => '100px',
documentation => 'A CSS value for the height of an individual bar.',
);
has show_text => (
is => 'rw',
isa => 'Bool',
default => 1,
documentation => 'Indicates whether or not to render the text below the barcode.',
documentation => 'Boolean. Indicates whether or not to render the text below the barcode.',
);

has 'css_class' => (
is => 'rw',
isa => 'Str',
default => 'hbc',
trigger => \&_css_class_set,
documentation => 'The value for the "class" attribute applied to any container tags.',
);

has 'embed_style' => (
is => 'rw',
isa => 'Bool',
default => 0,
documentation => 'Embed the style information in HTML "style" attributes. This is NOT recommended.',
documentation => 'Boolean. Embed the style information in HTML "style" attributes. This is NOT recommended.',
);

has 'td_on_class' => (is => 'rw', 'isa' => 'Str', lazy => 1, builder => '_build_td_on_class');
has 'td_off_class' => (is => 'rw', 'isa' => 'Str', lazy => 1, builder => '_build_td_off_class');
has 'td_on_class' => (is => 'rw', lazy => 1, builder => '_build_td_on_class');
has 'td_off_class' => (is => 'rw', lazy => 1, builder => '_build_td_off_class');
sub _css_class_set {
my ($self) = @_;
$self->td_on_class($self->_build_td_on_class);
Expand Down Expand Up @@ -234,7 +226,7 @@ Feel free to override any other methods, or use method modifiers
=head2 new (%attributes)
Default constructor provided by L<Moose> or L<Mouse>, which can take values for
Default constructor provided by L<Moo>, which can take values for
any of the L<attributes|/ATTRIBUTES>.
=head2 render
Expand Down Expand Up @@ -297,7 +289,7 @@ C<< <td class="barcode_off"> >>.
=head2 embed_style
Rather than rendering CSS stylesheets, embed the style information
Boolean. Rather than rendering CSS stylesheets, embed the style information
in HTML C<style> attributes. You should not use this option without
good reason, as it greatly increases the size of the generated markup,
and makes it impossible to override with stylesheets.
Expand All @@ -323,5 +315,4 @@ See http://dev.perl.org/licenses/ for more information.
=cut

no Any::Moose;
1; # End of HTML::Barcode
3 changes: 1 addition & 2 deletions lib/HTML/Barcode/1D.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package HTML::Barcode::1D;
use Any::Moose;
use Moo;
extends 'HTML::Barcode';

=head1 NAME
Expand Down Expand Up @@ -64,5 +64,4 @@ See http://dev.perl.org/licenses/ for more information.
=cut

no Any::Moose;
1; # End of HTML::Barcode
3 changes: 1 addition & 2 deletions lib/HTML/Barcode/2D.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package HTML::Barcode::2D;
use Any::Moose;
use Moo;
extends 'HTML::Barcode';

has '+show_text' => (default => 0);
Expand Down Expand Up @@ -92,5 +92,4 @@ See http://dev.perl.org/licenses/ for more information.
=cut

no Any::Moose;
1; # End of HTML::Barcode

0 comments on commit 351993f

Please sign in to comment.