Skip to content

Commit ecab3ca

Browse files
author
Pete Evstratov
committed
Fixed missing build prereqs
1 parent 60f5a16 commit ecab3ca

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

Changes

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
Revision history for Perl extension JavaScript::Minifier.
22

3-
1.09 2013-01-22
3+
1.10 2014-01-22
4+
- Added missing test prereqs
5+
- Fixed up wrong year in the latest versions in the change log
6+
7+
1.09 2014-01-22
48
- Made some changes to dzil plugins and added git repos for this module
59

6-
1.08 2013-01-19
10+
1.08 2014-01-19
711
- Fixed RT#76800 (preserve "\n" at the end of file)
812

9-
1.07 2013-01-19
13+
1.07 2014-01-19
1014
- Fixed license issue (RT#92298)
1115
- Converted to Dist::Zilla for packaging
1216

dist.ini

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ name = JavaScript-Minifier
22
author = Zoffix Znet <cpan@zoffix.com>
33
license = Perl_5
44
copyright_holder = Peter Michaux <petermichaux@gmail.com>
5-
5+
66
[@Basic]
7-
7+
88
[Prereqs]
99
Exporter = 5.64_03
1010

11+
[Prereqs / TestRequires]
12+
Test::More = 0.88
13+
1114
[Git::NextVersion]
1215
first_version = 1.09
13-
version_regexp = ^(.+)$
16+
version_regexp = ^(.+)$
1417

1518
[MetaResources]
1619
repository.type = git

lib/JavaScript/Minifier.pm

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require Exporter;
77
our @ISA = qw(Exporter);
88
our @EXPORT = qw(minify);
99

10-
our $VERSION = '1.09';
10+
our $VERSION = '1.10';
1111

1212
#return true if the character is allowed in identifier.
1313
sub isAlphanum {
@@ -43,7 +43,7 @@ sub isPostfix {
4343

4444
sub _get {
4545
my $s = shift;
46-
46+
4747
if ($s->{inputType} eq 'file') {
4848
my $char = getc($s->{input});
4949
$s->{last_read_char} = $char
@@ -89,7 +89,7 @@ sub _put {
8989
sub action1 {
9090
my $s = shift;
9191
if (!isWhitespace($s->{a})) {
92-
$s->{lastnws} = $s->{a};
92+
$s->{lastnws} = $s->{a};
9393
}
9494
$s->{last} = $s->{a};
9595
action2($s);
@@ -136,8 +136,8 @@ sub putLiteral {
136136
action1($s);
137137
do {
138138
while (defined($s->{a}) && $s->{a} eq '\\') { # escape character only escapes only the next one character
139-
action1($s);
140-
action1($s);
139+
action1($s);
140+
action1($s);
141141
}
142142
action1($s);
143143
} until ($s->{last} eq $delimiter || !defined($s->{a}));
@@ -232,11 +232,11 @@ sub minify {
232232
my $ccFlag; # marks if a comment is an Internet Explorer conditional comment and should be printed to output
233233

234234
while (defined($s->{a})) { # on this line $s->{a} should always be a non-whitespace character or undef (i.e. end of file)
235-
235+
236236
if (isWhitespace($s->{a})) { # check that this program is running correctly
237237
die 'minifier bug: minify while loop starting with whitespace, stopped';
238238
}
239-
239+
240240
# Each branch handles trailing whitespace and ensures $s->{a} is on non-whitespace or undef when branch finishes
241241
if ($s->{a} eq '/') { # a division, comment, or regexp literal
242242
if (defined($s->{b}) && $s->{b} eq '/') { # slash-slash comment
@@ -253,7 +253,7 @@ sub minify {
253253
preserveEndspace($s);
254254
}
255255
else {
256-
skipWhitespace($s);
256+
skipWhitespace($s);
257257
}
258258
}
259259
}
@@ -273,7 +273,7 @@ sub minify {
273273
action3($s); # the *
274274
$s->{a} = ' '; # the /
275275
collapseWhitespace($s);
276-
if (defined($s->{last}) && defined($s->{b}) &&
276+
if (defined($s->{last}) && defined($s->{b}) &&
277277
((isAlphanum($s->{last}) && (isAlphanum($s->{b})||$s->{b} eq '.')) ||
278278
($s->{last} eq '+' && $s->{b} eq '+') || ($s->{last} eq '-' && $s->{b} eq '-'))) { # for a situation like 5-/**/-2 or a/**/a
279279
# When entering this block $s->{a} is whitespace.
@@ -341,15 +341,15 @@ sub minify {
341341
skipWhitespace($s);
342342
}
343343
}
344-
344+
345345
if ( $s->{last_read_char} =~ /\n/ ) {
346346
_put($s, "\n");
347347
}
348-
348+
349349
if (!defined($s->{outfile})) {
350350
return $s->{output};
351351
}
352-
352+
353353
} # minify()
354354

355355
1;
@@ -375,7 +375,7 @@ To minify a JavaScript file and have the output written directly to another file
375375
To minify a JavaScript string literal. Note that by omitting the outfile parameter a the minified code is returned as a string.
376376
377377
my minifiedJavaScript = minify(input => 'var x = 2;');
378-
378+
379379
To include a copyright comment at the top of the minified code.
380380
381381
minify(input => 'var x = 2;', copyright => 'BSD License');

0 commit comments

Comments
 (0)