[Pyukiwiki-cvs 0012663] CVS update: PyukiWiki-Devel/build

Back to archive index

PyukiWiki CVS Commit pyuki****@lists*****
2012年 7月 31日 (火) 21:49:50 JST


Index: PyukiWiki-Devel/build/compressfile.pl
diff -u PyukiWiki-Devel/build/compressfile.pl:1.443 PyukiWiki-Devel/build/compressfile.pl:1.444
--- PyukiWiki-Devel/build/compressfile.pl:1.443	Tue Jul 31 20:19:09 2012
+++ PyukiWiki-Devel/build/compressfile.pl	Tue Jul 31 21:49:50 2012
@@ -1,6 +1,9 @@
 #!/usr/bin/perl
 # yuicompressor script
-# $Id: compressfile.pl,v 1.443 2012/07/31 11:19:09 papu Exp $
+# $Id: compressfile.pl,v 1.444 2012/07/31 12:49:50 papu Exp $
+
+use JavaScript::Packer;
+use CSS::Packer;
 
 $mode=$ARGV[0];
 $output=$ARGV[1];
@@ -99,12 +102,51 @@
 
 &shell("$convert{utf8} $input.tmp $input.commentcut");
 if($mode eq "js2") {
-	&shell("$compress{js21} $input.tmp21 $input.tmp");
+	my $packer=JavaScript::Packer->init();
+	open(R, "$input.tmp")||die("$input.tmp not found");
+	$scalarref=join('', <R>);
+	close(R);
+	$packer->minify( \$scalarref, { compress=>'best' });
+	open(W, ">$input.tmp2")||die("$input.tmp2 can't write");
+	print W $scalarref;
+ 	close(W);
+
+#	&shell("$compress{js21} $input.tmp21 $input.tmp");
 #	&shell("$compress{js22} $input.tmp21 $input.tmp2");
-	&shell("$compress{js22} -i $input.tmp21 -o $input.tmp2");
+#	&shell("$compress{js22} -i $input.tmp21 -o $input.tmp2");
 
 } else {
-	&shell("$compress{$mode} $input.tmp2 $input.tmp");
+	$scalarref="";
+	if($mode eq "css") {
+		my $packer=CSS::Packer->init();
+		open(R, "$input.tmp")||die("$input.tmp not found");
+		$scalarref=join('', <R>);
+		close(R);
+		$packer->minify( \$scalarref, { compress=>'best' });
+		$packer->minify( \$scalarref, { compress=>'minify' });
+		%tbl=(
+			00=>0,	11=>1,	22=>2,	33=>3,	44=>4,	55=>5,
+			66=>6,	77=>7,	88=>8,	99=>9,
+			AA=>a,	BB=>b,	CC=>c,	DD=>d,	EE=>e,	FF=>f,
+			aa=>a,	bb=>b,	cc=>c,	dd=>d,	ee=>e,	ff=>f,
+		);
+		$scalarref=~s/\#(00|11|22|33|44|55|66|77|88|99|AA|BB|CC|DD|EE|FF|aa|bb|cc|dd|ee|ff)(00|11|22|33|44|55|66|77|88|99|AA|BB|CC|DD|EE|FF|aa|bb|cc|dd|ee|ff)(00|11|22|33|44|55|66|77|88|99|AA|BB|CC|DD|EE|FF|aa|bb|cc|dd|ee|ff)/'#' . $tbl{$1} . $tbl{$2} . $tbl{$3}/ge;
+		$scalarref=~s/ !/!/g;
+		$scalarref=~s/;}/}/g;
+		open(W, ">$input.tmp2")||die("$input.tmp2 can't write");
+		print W $scalarref;
+	 	close(W);
+	} elsif($mode eq "js") {
+		my $packer=JavaScript::Packer->init();
+		open(R, "$input.tmp")||die("$input.tmp not found");
+		$scalarref=join('', <R>);
+		close(R);
+		$packer->minify( \$scalarref, { compress=>'best' });
+		open(W, ">$input.tmp2")||die("$input.tmp2 can't write");
+		print W $scalarref;
+	 	close(W);
+	}
+#	&shell("$compress{$mode} $input.tmp2 $input.tmp");
 }
 &shell("$convert{euc} $input.tmp $input.tmp2");
 
Index: PyukiWiki-Devel/build/installer_sub.sh
diff -u PyukiWiki-Devel/build/installer_sub.sh:1.41 PyukiWiki-Devel/build/installer_sub.sh:1.42
--- PyukiWiki-Devel/build/installer_sub.sh:1.41	Mon Jul 30 20:34:19 2012
+++ PyukiWiki-Devel/build/installer_sub.sh	Tue Jul 31 21:49:50 2012
@@ -10,7 +10,7 @@
 cat <<EOM>headtmp
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <style type="text/css"><!--
-body,td{color:black;background-color:white;margin-left:2%;margin-right:2%;font-size:100%}strong{text-shadow:inherit 0 0 0;font-weight:bold}a:link{color:#215dc6;background-color:inherit;text-decoration:none}a:active{color:#215dc6;background-color:inherit;text-decoration:none}a:visited{color:#a63d21;background-color:inherit;text-decoration:none}a:hover{color:#215dc6;background-color:#cde;text-decoration:underline}h2{font-family:verdana,arial,helvetica,Sans-Serif;color:inherit;background-color:#def;padding:.3em;border:0;margin:0 0 .5em 0}font-weight:bold;background-color:transparent;padding:12px 0 0 0;border:0;margin:12px 0 0 0}h1.error{color:red}*/
+body,td{color:black;background-color:white;margin-left:2%;margin-right:2%;font-size:100%}strong{text-shadow:inherit 0px 0px 0px;font-weight:bold}a:link{color:#215dc6;background-color:inherit;text-decoration:none}a:active{color:#215dc6;background-color:inherit;text-decoration:none}a:visited{color:#a63d21;background-color:inherit;text-decoration:none}a:hover{color:#215dc6;background-color:#cde;text-decoration:underline}h2{font-family:verdana,arial,helvetica,Sans-Serif;color:inherit;background-color:#def;padding:.3em;border:0px;margin:0px 0px .5em 0px}font-weight:bold;background-color:transparent;padding:12px0px0px0px;border:0px;margin:12px0px0px0px}h1.error{color:red}*/
 //--></style>
 </head>
 EOM



Pyukiwiki-cvs メーリングリストの案内
Back to archive index