Author: jkeenan Date: Sun Jan 4 16:07:29 2009 New Revision: 34947 Modified: trunk/lib/Parrot/Configure/Data.pm trunk/t/configure/004-configure.t trunk/t/postconfigure/02-data_slurp.t trunk/t/postconfigure/06-data_slurp_temp.t trunk/tools/dev/reconfigure.pl
Log: Change names of two Parrot::Configure::Data methods to reduce the number of subroutines named '*slurp*'. Cf.: https://trac.parrot.org/parrot/ticket/117. Modified: trunk/lib/Parrot/Configure/Data.pm ============================================================================== --- trunk/lib/Parrot/Configure/Data.pm (original) +++ trunk/lib/Parrot/Configure/Data.pm Sun Jan 4 16:07:29 2009 @@ -236,7 +236,7 @@ return keys %{ $self->{c} }; } -=item * C<slurp()> +=item * C<get_PConfig()> =over 4 @@ -256,7 +256,7 @@ =cut -sub slurp { +sub get_PConfig { my $self = shift; my $res = eval <<EVAL_CONFIG; no strict; @@ -270,7 +270,7 @@ $self->{c} = $res; } -=item * C<slurp_temp()> +=item * C<get_PConfig_Temp()> =over 4 @@ -292,7 +292,7 @@ =cut -sub slurp_temp { +sub get_PConfig_Temp { my $self = shift; my $res = eval <<EVAL_CONFIG_TEMP; no strict; Modified: trunk/t/configure/004-configure.t ============================================================================== --- trunk/t/configure/004-configure.t (original) +++ trunk/t/configure/004-configure.t Sun Jan 4 16:07:29 2009 @@ -77,17 +77,17 @@ SKIP: { my $reason = <<REASON; If you have already completed configuration, -you can call Parrot::Configure::Data::slurp(). +you can call Parrot::Configure::Data::get_PConfig(). But here you are testing for that method's failure. REASON skip $reason, 1 if defined $res; - eval { $conf->data()->slurp(); }; + eval { $conf->data()->get_PConfig(); }; like( $@, qr/You cannot use --step until you have completed the full configure process/, -"Got expected error message for --step option and slurp() without prior configuration" +"Got expected error message for --step option and get_PConfig() without prior configuration" ); } @@ -95,17 +95,17 @@ SKIP: { my $reason = <<REASON; If you have already completed configuration, -you can call Parrot::Configure::Data::slurp_temp(). +you can call Parrot::Configure::Data::get_PConfig_Temp(). But here you are testing for that method's failure. REASON skip $reason, 1 if defined $res; - eval { $conf->data()->slurp_temp(); }; + eval { $conf->data()->get_PConfig_Temp(); }; like( $@, qr/You cannot use --step until you have completed the full configure process/, -"Got expected error message for --step option and slurp_temp() without prior configuration" +"Got expected error message for --step option and get_PConfig_Temp() without prior configuration" ); } Modified: trunk/t/postconfigure/02-data_slurp.t ============================================================================== --- trunk/t/postconfigure/02-data_slurp.t (original) +++ trunk/t/postconfigure/02-data_slurp.t Sun Jan 4 16:07:29 2009 @@ -1,7 +1,7 @@ #! perl # Copyright (C) 2007, The Perl Foundation. # $Id$ -# 02-data_slurp.t +# 02-data_get_PConfig.t use strict; use warnings; @@ -81,15 +81,15 @@ SKIP: { my $reason = <<REASON; If you have already completed configuration, -you can call Parrot::Configure::Data::slurp(). +you can call Parrot::Configure::Data::get_PConfig(). You appear not to have completed configuration; hence, two tests are skipped. REASON skip $reason, 2 unless defined $res; - eval { $conf->data()->slurp(); }; - ok( ( defined $@ ) && ( !$@ ), "Parrot::Configure::slurp() succeeded" ); + eval { $conf->data()->get_PConfig(); }; + ok( ( defined $@ ) && ( !$@ ), "Parrot::Configure::get_PConfig() succeeded" ); my $rv; my $stdout; capture ( sub {$rv = $conf->run_single_step( $args->{step})}, \$stdout ); @@ -102,11 +102,11 @@ =head1 NAME -02-data_slurp.t - test Parrot::Configure::Data::slurp() once configuration has been completed +02-data_get_PConfig.t - test Parrot::Configure::Data::get_PConfig() once configuration has been completed =head1 SYNOPSIS - % prove t/postconfigure/02-data_slurp.t + % prove t/postconfigure/02-data_get_PConfig.t =head1 DESCRIPTION @@ -117,7 +117,7 @@ when your Parrot filesystem is in a "pre-F<make>, post-F<Configure.pl>" state. The tests in this file mimic the functionality of F<tools/dev/reconfigure.pl> -and test C<Parrot::Configure::Data::slurp()>. What is 'slurped' here is an +and test C<Parrot::Configure::Data::get_PConfig()>. What is 'slurped' here is an already created C<%Parrot::Config::PConfig>. =head1 AUTHOR Modified: trunk/t/postconfigure/06-data_slurp_temp.t ============================================================================== --- trunk/t/postconfigure/06-data_slurp_temp.t (original) +++ trunk/t/postconfigure/06-data_slurp_temp.t Sun Jan 4 16:07:29 2009 @@ -1,7 +1,7 @@ #! perl # Copyright (C) 2007, The Perl Foundation. # $Id$ -# 06-data_slurp_temp.t +# 06-data_get_PConfig_Temp.t use strict; use warnings; @@ -83,18 +83,18 @@ SKIP: { my $reason = <<REASON; If you have already completed configuration, -you can call Parrot::Configure::Data::slurp(). +you can call Parrot::Configure::Data::get_PConfig(). You appear not to have completed configuration; hence, three tests are skipped. REASON skip $reason, 3 unless defined $res; - eval { $conf->data()->slurp(); }; - ok( ( defined $@ ) && ( !$@ ), "Parrot::Configure::slurp() succeeded" ); + eval { $conf->data()->get_PConfig(); }; + ok( ( defined $@ ) && ( !$@ ), "Parrot::Configure::get_PConfig() succeeded" ); - eval { $conf->data()->slurp_temp(); }; - ok( ( defined $@ ) && ( !$@ ), "Parrot::Configure::slurp_temp() succeeded" ); + eval { $conf->data()->get_PConfig_Temp(); }; + ok( ( defined $@ ) && ( !$@ ), "Parrot::Configure::get_PConfig_Temp() succeeded" ); my $rv; my $stdout; capture ( sub {$rv = $conf->run_single_step( $args->{step}) }, \$stdout); @@ -107,11 +107,11 @@ =head1 NAME -06-data_slurp_temp.t - test Parrot::Configure::Data::slurp() once configuration has been completed +06-data_get_PConfig_Temp.t - test Parrot::Configure::Data::get_PConfig_Temp() once configuration has been completed =head1 SYNOPSIS - % prove t/postconfigure/06-data_slurp_temp.t + % prove t/postconfigure/06-data_get_PConfig_Temp.t =head1 DESCRIPTION @@ -122,8 +122,8 @@ when your Parrot filesystem is in a "pre-F<make>, post-F<Configure.pl>" state. The tests in this file mimic the functionality of F<tools/dev/reconfigure.pl> -and test C<Parrot::Configure::Data::slurp()>. What is 'slurped' here is an -already created C<%Parrot::Config::PConfig>. +and test C<Parrot::Configure::Data::get_PConfig()>. What is 'slurped' here is +an already created C<%Parrot::Config::PConfig>. =head1 AUTHOR Modified: trunk/tools/dev/reconfigure.pl ============================================================================== --- trunk/tools/dev/reconfigure.pl (original) +++ trunk/tools/dev/reconfigure.pl Sun Jan 4 16:07:29 2009 @@ -24,15 +24,15 @@ $conf->add_step( $args->{step} ); $conf->options->set( %{$args} ); -# The result of slurp() is that the parameters in %Parrot::Config::PConfig +# The result of get_PConfig() is that the parameters in %Parrot::Config::PConfig # are assigned to the {c} attribute in $conf. -$conf->data()->slurp(); +$conf->data()->get_PConfig(); -# The result of slurp_temp() is that the parameters in +# The result of get_PConfig_Temp() is that the parameters in # %Parrot::Config::PConfig_Temp # are assigned to the {c}{$_} attribute in $conf. if ( $args->{step} =~ /gen::makefiles/ ) { - $conf->data()->slurp_temp(); + $conf->data()->get_PConfig_Temp(); } $conf->run_single_step( $args->{step} ); print "\n";