Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Complete work on http://trac.parrot.org/parrot/ticket/532. Change

Parrot::Headerizer::Object back to simply Parrot::Headerizer.
  • Loading branch information...
commit f123b3079b08e50f1581dcdbb52ee2ae75685ac1 1 parent a3882f5
@jkeenan jkeenan authored
View
2  MANIFEST
@@ -1034,7 +1034,7 @@ lib/Parrot/Harness/DefaultTests.pm [devel]lib
lib/Parrot/Harness/Options.pm [devel]lib
lib/Parrot/Harness/Smoke.pm [devel]lib
lib/Parrot/Headerizer/Functions.pm [devel]lib
-lib/Parrot/Headerizer/Object.pm [devel]lib
+lib/Parrot/Headerizer.pm [devel]lib
lib/Parrot/IO/Directory.pm [devel]lib
lib/Parrot/IO/File.pm [devel]lib
lib/Parrot/IO/Path.pm [devel]lib
View
18 lib/Parrot/Headerizer/Object.pm → lib/Parrot/Headerizer.pm
@@ -1,17 +1,17 @@
# Copyright (C) 2004-2010, Parrot Foundation.
# $Id$
-package Parrot::Headerizer::Object;
+package Parrot::Headerizer;
=head1 NAME
-Parrot::Headerizer::Object - Parrot header generation functionality
+Parrot::Headerizer - Parrot header generation functionality
=head1 SYNOPSIS
- use Parrot::Headerizer::Object;
+ use Parrot::Headerizer;
- $headerizer = Parrot::Headerizer::Object->new( {
+ $headerizer = Parrot::Headerizer->new( {
macro_match => $macro_match, # optional
} );
@@ -25,7 +25,7 @@ Parrot::Headerizer::Object - Parrot header generation functionality
=head1 DESCRIPTION
-C<Parrot::Headerizer::Object> knows how to extract all kinds of information out
+C<Parrot::Headerizer> knows how to extract all kinds of information out
of C-language files. Its methods are used in F<tools/dev/headerizer.pl> and
F<t/codingstd/c_function_docs.t>.
@@ -67,11 +67,11 @@ valid C<PARROT_XXX> macros.
=item * Arguments
- $headerizer = Parrot::Headerizer::Object->new();
+ $headerizer = Parrot::Headerizer->new();
No mandatory arguments, but one special use-case takes a hash reference.
- $headerizer = Parrot::Headerizer::Object->new( {
+ $headerizer = Parrot::Headerizer->new( {
macro_match => $macro_match, # optional
} );
@@ -81,7 +81,7 @@ used.
=item * Return Value
-Parrot::Headerizer::Object object.
+Parrot::Headerizer object.
=back
@@ -90,7 +90,7 @@ Parrot::Headerizer::Object object.
sub new {
my ($class, $args) = @_;
if (defined $args) {
- die "Argument to Parrot::Headerizer::Object must be hashref"
+ die "Argument to Parrot::Headerizer must be hashref"
unless reftype($args) eq 'HASH';
}
else {
View
4 t/codingstd/c_function_docs.t
@@ -8,7 +8,7 @@ use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Config qw(%PConfig);
use Parrot::Distribution;
-use Parrot::Headerizer::Object;
+use Parrot::Headerizer;
=head1 NAME
@@ -30,7 +30,7 @@ declared.
=cut
my $DIST = Parrot::Distribution->new;
-my $headerizer = Parrot::Headerizer::Object->new;
+my $headerizer = Parrot::Headerizer->new;
# can not handle .ops or .pmc files yet
my @files = grep {/\.(c|h)$/ } @ARGV ? @ARGV :
View
4 t/codingstd/pmc_docs.t
@@ -8,7 +8,7 @@ use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Config qw(%PConfig);
use Parrot::Distribution;
-use Parrot::Headerizer::Object;
+use Parrot::Headerizer;
=head1 NAME
@@ -30,7 +30,7 @@ declared.
=cut
my $DIST = Parrot::Distribution->new;
-my $headerizer = Parrot::Headerizer::Object->new;
+my $headerizer = Parrot::Headerizer->new;
my @files = @ARGV ? @ARGV :
map {s/^$PConfig{build_dir}\///; $_}
View
56 t/tools/dev/headerizer/02_methods.t
@@ -14,20 +14,20 @@ use File::Temp qw( tempdir );
use Test::More qw(no_plan); # tests => 46;
use lib qw( lib );
use Parrot::Headerizer::Functions qw( read_file );
-use Parrot::Headerizer::Object;
+use Parrot::Headerizer;
use IO::CaptureOutput qw| capture |;
my $cwd = cwd();
my $self;
-eval { $self = Parrot::Headerizer::Object->new([]); };
-like($@, qr/Argument to Parrot::Headerizer::Object must be hashref/,
+eval { $self = Parrot::Headerizer->new([]); };
+like($@, qr/Argument to Parrot::Headerizer must be hashref/,
"Got expected error message for bad argument to constructor" );
-$self = Parrot::Headerizer::Object->new({ macro_match => 1});
-isa_ok( $self, 'Parrot::Headerizer::Object' );
+$self = Parrot::Headerizer->new({ macro_match => 1});
+isa_ok( $self, 'Parrot::Headerizer' );
-$self = Parrot::Headerizer::Object->new();
-isa_ok( $self, 'Parrot::Headerizer::Object' );
+$self = Parrot::Headerizer->new();
+isa_ok( $self, 'Parrot::Headerizer' );
ok( $self->valid_macro( 'PARROT_EXPORT' ),
"valid_macro() confirmed validity of macro" );
ok(! $self->valid_macro( 'PARROT_FOOBAR' ),
@@ -145,8 +145,8 @@ $self->squawk($file, $func, $error[1]);
mkpath( $srcopsdir, 0, 0777 );
my $srcopso = File::Spec->catfile( $srcopsdir, 'ops.o' );
touchfile($srcopso);
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srcopso);
ok( ! keys %{$self->{sourcefiles}},
"Skipped file in src/ops/ -> no sourcefiles" );
@@ -169,8 +169,8 @@ $self->squawk($file, $func, $error[1]);
touchfile($srco);
my $srcs = File::Spec->catfile( $srcdir, 'other.s' );
touchfile($srcs);
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srco);
ok( ! keys %{$self->{sourcefiles}},
"Skipped file in src/ -> no sourcefiles" );
@@ -189,8 +189,8 @@ $self->squawk($file, $func, $error[1]);
my $srco = setup_src_list_test($cwd, $tdir);
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srco);
ok( keys %{$self->{sourcefiles}},
"sourcefiles" );
@@ -221,10 +221,10 @@ $self->squawk($file, $func, $error[1]);
my $srco = setup_src_list_test($cwd, $tdir);
my $macro = 'PARROT_CAN_RETURN_NULL';
- $self = Parrot::Headerizer::Object->new( {
+ $self = Parrot::Headerizer->new( {
macro_match => $macro,
} );
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srco);
ok( keys %{$self->{sourcefiles}},
"sourcefiles" );
@@ -270,8 +270,8 @@ $self->squawk($file, $func, $error[1]);
copy "$cwd/t/tools/dev/headerizer/testlib/${stub}_pmc.in" => $srcc
or croak "Unable to copy";
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srco);
ok( ! keys %{$self->{sourcefiles}},
"no sourcefiles" );
@@ -308,8 +308,8 @@ $self->squawk($file, $func, $error[1]);
copy "$cwd/t/tools/dev/headerizer/testlib/${stub}_pmc.in" => $srcc
or croak "Unable to copy";
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srco);
ok( ! keys %{$self->{sourcefiles}},
"no sourcefiles" );
@@ -342,8 +342,8 @@ $self->squawk($file, $func, $error[1]);
my $srco = setup_src_list_test($cwd, $tdir);
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srco);
ok( keys %{$self->{sourcefiles}},
"sourcefiles" );
@@ -383,8 +383,8 @@ $self->squawk($file, $func, $error[1]);
my $srco = setup_src_list_test($cwd, $tdir);
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srco);
ok( keys %{$self->{sourcefiles}},
"sourcefiles" );
@@ -418,8 +418,8 @@ $self->squawk($file, $func, $error[1]);
my $srco = setup_src_list_test($cwd, $tdir);
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
$self->get_sources($srco);
ok( keys %{$self->{sourcefiles}},
"sourcefiles" );
@@ -513,8 +513,8 @@ $self->squawk($file, $func, $error[1]);
my $srco = setup_src_list_test($cwd, $tdir);
- $self = Parrot::Headerizer::Object->new();
- isa_ok( $self, 'Parrot::Headerizer::Object' );
+ $self = Parrot::Headerizer->new();
+ isa_ok( $self, 'Parrot::Headerizer' );
my ($return_type, %macros, $name, $file);
@@ -717,7 +717,7 @@ sub setup_src_list_test {
=head1 NAME
-02_methods.t - Test functions in Parrot::Headerizer::Object.
+02_methods.t - Test functions in Parrot::Headerizer.
=head1 SYNOPSIS
View
6 tools/dev/headerizer.pl
@@ -6,7 +6,7 @@
use Getopt::Long;
use lib qw( lib );
-use Parrot::Headerizer::Object;
+use Parrot::Headerizer;
use Parrot::Headerizer::Functions qw(
process_argv
);
@@ -80,7 +80,7 @@ =head1 COMMAND-LINE OPTIONS
) or exit(1);
my @ofiles = process_argv(@ARGV);
-my $headerizer = Parrot::Headerizer::Object->new( {
+my $headerizer = Parrot::Headerizer->new( {
macro_match => $macro_match,
} );
@@ -94,7 +94,7 @@ =head1 AUTHOR
The original headerizer program was created by Andy Lester in May 2006, with
assistance from Jerry Gay and others. In the last half of 2010, Most of the
-code was refactored into F<lib/Parrot/Headerizer/Object.pm> and
+code was refactored into F<lib/Parrot/Headerizer.pm> and
F<lib/Parrot/Headerizer/Functions.pm> by James E Keenan.
=cut
Please sign in to comment.
Something went wrong with that request. Please try again.