[Bps-public-commit] HTML-RewriteAttributes branch, master, updated. 64f48c53ba56c3de533178b5e173a3a4b5b58ae0

Thomas Sibley trs at bestpractical.com
Mon Oct 22 18:14:43 EDT 2012


The branch, master has been updated
       via  64f48c53ba56c3de533178b5e173a3a4b5b58ae0 (commit)
       via  99806a9170546ff779e6aeda044d02532b0940a7 (commit)
       via  2a329f6c107a502dfcf321f359a75fc387a15964 (commit)
      from  c4f5549f896792074393ed7b84cfd00a98f8aca7 (commit)

Summary of changes:
 .gitignore                    |  1 +
 Changes                       |  4 +++
 MANIFEST.SKIP                 | 66 +++++++++++++++++++++++++++++++++++++
 Makefile.PL                   |  2 ++
 README                        | 76 +++++++++++++++++++++++++++++++++++++++++++
 lib/HTML/RewriteAttributes.pm |  2 +-
 6 files changed, 150 insertions(+), 1 deletion(-)
 create mode 100644 MANIFEST.SKIP
 create mode 100644 README

- Log -----------------------------------------------------------------
commit 2a329f6c107a502dfcf321f359a75fc387a15964
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Oct 22 14:57:28 2012 -0700

    Sign dists and generate a README from the POD

diff --git a/Makefile.PL b/Makefile.PL
index 2025f90..81cea7d 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,11 +3,13 @@ use inc::Module::Install;
 # Define metadata
 name            'HTML-RewriteAttributes';
 all_from        'lib/HTML/RewriteAttributes.pm';
+readme_from     'lib/HTML/RewriteAttributes.pm';
 
 requires 'HTML::Parser';
 requires 'HTML::Entities';
 requires 'HTML::Tagset';
 requires 'URI';
 
+sign;
 WriteAll;
 
diff --git a/README b/README
new file mode 100644
index 0000000..48b9052
--- /dev/null
+++ b/README
@@ -0,0 +1,76 @@
+NAME
+    HTML::RewriteAttributes - concise attribute rewriting
+
+SYNOPSIS
+        $html = HTML::RewriteAttributes->rewrite($html, sub {
+            my ($tag, $attr, $value) = @_;
+
+            # delete any attribute that mentions..
+            return if $value =~ /COBOL/i;
+
+            $value =~ s/\brocks\b/rules/g;
+            return $value;
+        });
+
+
+        # writing some HTML email I see..
+        $html = HTML::RewriteAttributes::Resources->rewrite($html, sub {
+            my $uri = shift;
+            my $content = render_template($uri);
+            my $cid = generate_cid_from($content);
+            $mime->attach($cid => content);
+            return "cid:$cid";
+        });
+
+
+        # up for some HTML::ResolveLink?
+        $html = HTML::RewriteAttributes::Links->rewrite($html, "http://search.cpan.org");
+
+        # or perhaps HTML::LinkExtor?
+        HTML::RewriteAttributes::Links->rewrite($html, sub {
+            my ($tag, $attr, $value) = @_;
+            push @links, $value;
+            $value;
+        });
+
+DESCRIPTION
+    "HTML::RewriteAttributes" is designed for simple yet powerful HTML
+    attribute rewriting.
+
+    You simply specify a callback to run for each attribute and we do the
+    rest for you.
+
+    This module is designed to be subclassable to make handling special
+    cases eaiser. See the source for methods you can override.
+
+METHODS
+  "new"
+    You don't need to call "new" explicitly - it's done in "rewrite". It
+    takes no arguments.
+
+  "rewrite" HTML, callback -> HTML
+    This is the main interface of the module. You pass in some HTML and a
+    callback, the callback is invoked potentially many times, and you get
+    back some similar HTML.
+
+    The callback receives as arguments the tag name, the attribute name, and
+    the attribute value (though subclasses may override this --
+    HTML::RewriteAttributes::Resources does). Return "undef" to remove the
+    attribute, or any other value to set the value of the attribute.
+
+SEE ALSO
+    HTML::Parser, HTML::ResolveLink, Email::MIME::CreateHTML,
+    HTML::LinkExtor
+
+THANKS
+    Some code was inspired by, and tests borrowed from, Miyagawa's
+    HTML::ResolveLink.
+
+AUTHOR
+    Shawn M Moore, "<sartak at bestpractical.com>"
+
+LICENSE
+    Copyright 2008-2010 Best Practical Solutions, LLC.
+    HTML::RewriteAttributes is distributed under the same terms as Perl
+    itself.
+

commit 99806a9170546ff779e6aeda044d02532b0940a7
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Oct 22 15:05:37 2012 -0700

    Add a MANIFEST.SKIP

diff --git a/.gitignore b/.gitignore
index fa7c8d8..08226ac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ MANIFEST
 MANIFEST.bak
 SIGNATURE
 cover_db/
+*.bak
diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
new file mode 100644
index 0000000..2518b3f
--- /dev/null
+++ b/MANIFEST.SKIP
@@ -0,0 +1,66 @@
+
+#!start included /opt/perlbrew/perls/perl-5.14.1/lib/5.14.1/ExtUtils/MANIFEST.SKIP
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+\bSCCS\b
+,v$
+\B\.svn\b
+\B\.git\b
+\B\.gitignore\b
+\b_darcs\b
+\B\.cvsignore$
+
+# Avoid VMS specific MakeMaker generated files
+\bDescrip.MMS$
+\bDESCRIP.MMS$
+\bdescrip.mms$
+
+# Avoid Makemaker generated and utility files.
+\bMANIFEST\.bak
+\bMakefile$
+\bblib/
+\bMakeMaker-\d
+\bpm_to_blib\.ts$
+\bpm_to_blib$
+\bblibdirs\.ts$         # 6.18 through 6.25 generated this
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build/
+\bBuild.bat$
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
+
+# Avoid temp and backup files.
+~$
+\.old$
+\#$
+\b\.#
+\.bak$
+\.tmp$
+\.#
+\.rej$
+
+# Avoid OS-specific files/dirs
+# Mac OSX metadata
+\B\.DS_Store
+# Mac OSX SMB mount metadata files
+\B\._
+
+# Avoid Devel::Cover and Devel::CoverX::Covered files.
+\bcover_db\b
+\bcovered\b
+
+# Avoid MYMETA files
+^MYMETA\.
+#!end included /opt/perlbrew/perls/perl-5.14.1/lib/5.14.1/ExtUtils/MANIFEST.SKIP
+
+
+# Dist droppings
+^MYMETA\.
+\.tar\.gz$
+
+# ctags files
+^\.tags

commit 64f48c53ba56c3de533178b5e173a3a4b5b58ae0
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Oct 22 14:57:48 2012 -0700

    Bump version to 0.05

diff --git a/Changes b/Changes
index 6906335..4d7f935 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 Revision history for HTML-RewriteAttributes
 
+0.05    Mon Oct 22 2012
+        Resources: Preserve the media attribute when inlining CSS
+        Resources: Avoid uninitialized warnings by checking the attributes we expect
+
 0.04    Thu Nov 18 2010
         Resources: Ignore @import statements that appear in comments
 
diff --git a/lib/HTML/RewriteAttributes.pm b/lib/HTML/RewriteAttributes.pm
index 8d947cf..8d4957c 100644
--- a/lib/HTML/RewriteAttributes.pm
+++ b/lib/HTML/RewriteAttributes.pm
@@ -6,7 +6,7 @@ use base 'HTML::Parser';
 use Carp 'croak';
 use HTML::Entities 'encode_entities';
 
-our $VERSION = '0.04';
+our $VERSION = '0.05';
 
 sub new {
     my $class = shift;

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list