@@ -1,10 +1,5 @@
.cvsignore
Changes
-ex/tables/Base.pm
-ex/tables/README.txt
-ex/tables/table_example.html
-ex/tables/table_example.pl
-ex/tables/table_example.pm
lib/HTML/Element/Replacer.pm
lib/HTML/Element/Replacer.pod
Makefile.PL
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: HTML-Element-Replacer
-version: 0.06
+version: 0.01
abstract: ~
author:
- Terrence Brannon <tbone@cpan.org>
@@ -11,15 +11,13 @@ configure_requires:
build_requires:
ExtUtils::MakeMaker: 0
requires:
- HTML::Element::Library: 4.2
- HTML::Tree: 3.23
- Moose: 0.72
- Test::More: 0
+ Moose: 0.72
+ Test::More: 0
no_index:
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.54
+generated_by: ExtUtils::MakeMaker version 6.50
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
@@ -13,8 +13,6 @@ WriteMakefile(
PL_FILES => {},
PREREQ_PM => {
'Test::More' => 0,
- 'HTML::Tree' => 3.23,
- 'HTML::Element::Library' => 4.2,
'Moose' => 0.72,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
@@ -1,10 +0,0 @@
-package Base;
-
-use base qw(HTML::Seamstress) ;
-
-sub comp_root { '/home/tbrannon/prg/html-element-replacer/HTML-Element-Replacer/ex/tables' }
-
-
-
-
-1;
@@ -1,6 +0,0 @@
-
-
-usage:
-
-1 - edit Base.pm so that comp_root points to the same directory this README is in.
-2 - type spkg.pl --base_pkg=Base table_example.html
\ No newline at end of file
@@ -1,26 +0,0 @@
-<html>
-<head>
-</head>
-
-<body>
-
-<table>
-
- <tr seam_class="beer_row">
- <td kmap="brand"> blah </td>
- <td kmap="age"> blah </td>
- </tr>
-
- </table>
-
-<table>
-
- <tr seam_class="fruit_row">
- <td kmap="fruit"> blah </td>
- <td kmap="color"> blah </td>
- </tr>
-
- </table>
-
-</body>
-</html>
\ No newline at end of file
@@ -1,52 +0,0 @@
-
-use HTML::Element::Replacer;
-
-my @beer =
- (
- { brand => 'miller', age => 12 },
- { brand => 'coors' , age => 15 },
- { brand => 'coke' , age => 22 }
- );
-
-my @fruit =
- (
- { fruit => 'apple' , color => 'red' },
- { fruit => 'orange' , color => 'orange' },
- { fruit => 'banana' , color => 'yellow' }
- );
-
-
-
-use table_example;
-my $tree = table_example->new;
-
-
- {
- my $replacer = HTML::Element::Replacer->new(tree => $tree, look_down => [ seam_class => 'beer_row' ]);
-
- for my $data (@beer) {
- # defmap is documented here
- # http://search.cpan.org/~tbone/HTML-Element-Library-3.53/lib/HTML/Element/Library.pm#$elem-%3Edefmap($attr_name,_\%hashref,_$debug)
- $replacer->push_clone->defmap(kmap => $data); # clone and push onto @temp_list
- }
-
- }
-
- {
- use List::Cycle;
- my $row_style = List::Cycle->new( { values => [ qw/main alt/ ] } ) ;
-
- my $replacer = HTML::Element::Replacer->new(tree => $tree, look_down => [ seam_class => 'fruit_row' ]);
-
-
- for my $data (@fruit) {
- # defmap is documented here
- # http://search.cpan.org/~tbone/HTML-Element-Library-3.53/lib/HTML/Element/Library.pm#$elem-%3Edefmap($attr_name,_\%hashref,_$debug)
- my $elem = $replacer->push_clone;
- $elem->defmap(kmap => $data); # clone and push onto @temp_list
- $elem->attr(row_style => $row_style->next);
- }
-
- }
-
-warn $tree->as_HTML(undef, ' ');
@@ -1,59 +0,0 @@
-package table_example;
-
-# cmdline: /usr/bin/spkg.pl --base_pkg=Base table_example.html
-
-use strict;
-use warnings;
-
-use base qw(Class::Prototyped HTML::Seamstress);
-
-
-;
-use base qw(Base);
-use vars qw($html);
-
-our $tree;
-
-#warn Base->comp_root();
-#Base
-
-
-#$html = __PACKAGE__->html(__FILE__ => 'html') ;
-$html = __FILE__;
-
-sub new {
-# my $file = __PACKAGE__->comp_root() . 'table_example.html' ;
- my $file = __PACKAGE__->html($html => 'html');
-
- -e $file or die "$file does not exist. Therefore cannot load";
-
- $tree =HTML::TreeBuilder->new;
- $tree->store_declarations;
- $tree->parse_file($file);
- $tree->eof;
-
- bless $tree, __PACKAGE__;
-}
-
-sub process {
- my ($tree, $c, $stash) = @_;
-
- use Data::Dumper;
- warn "PROCESS_TREE: ", $tree->as_HTML;
-
- # $tree->look_down(id => $_)->replace_content($stash->{$_})
- # for qw(name date);
-
- $tree;
-}
-
-sub fixup {
- my ($tree, $c, $stash) = @_;
-
- $tree;
-}
-
-
-
-
-1;
@@ -12,7 +12,7 @@ has 'look_down' => ( is => 'rw', required => 1 ) ;
has 'replacements' => ( is => 'rw', isa => 'ArrayRef') ;
-our $VERSION = '0.06';
+our $VERSION = '0.01';
sub BUILD {
my($self)=@_;
@@ -7,7 +7,7 @@
use HTML::Element::Replacer;
{
- my $replacer = HTML::Element::Replacer->new(tree => $tree, look_down => [ scla => 'mid' ]);
+ my $replacer = HTML::Element::Replacer->new(look_down => [ scla => 'mid' ]);
for my $data (@data) {
$replacer->push_clone->defmap(attr_name => $data); # clone and push onto @temp_list
@@ -80,7 +80,7 @@ Many thanks to Dave Rolsky in #moose on irc.perl.org
=head1 SOURCE
-L<http://github.com/metaperl/html-element-replacer>
+L<http://code.google.com/p/html-element-replacer/>
=head1 BUGS