[Module-build-checkins] Module-Build/lib/Module/Build Authoring.pod,1.3,1.4 Base.pm,1.367,1.368
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <kwi...@us...> - 2005-01-04 05:26:50
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23181/lib/Module/Build Modified Files: Authoring.pod Base.pm Log Message: Add the runtime_params() method Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.367 retrieving revision 1.368 diff -C2 -d -r1.367 -r1.368 *** Base.pm 27 Dec 2004 04:30:01 -0000 1.367 --- Base.pm 4 Jan 2005 05:26:38 -0000 1.368 *************** *** 270,273 **** --- 270,274 ---- sub config_data { shift()->_general_notes('config_data', @_) } sub feature { shift()->_general_notes('features', @_) } + sub runtime_params { shift->_persistent_hash_read('runtime_params', @_ ? shift : ()) } sub add_build_element { *************** *** 833,837 **** close $fh; ! for ('cleanup', 'notes', 'features', 'config_data') { next unless -e $self->config_file($_); $self->_persistent_hash_restore($_); --- 834,838 ---- close $fh; ! for (qw(cleanup notes features config_data runtime_params)) { next unless -e $self->config_file($_); $self->_persistent_hash_restore($_); *************** *** 858,862 **** $self->_write_dumper('build_params', [$self->{args}, $self->{config}, $self->{properties}]); ! $self->_persistent_hash_write($_) foreach qw(notes cleanup features config_data); } --- 859,863 ---- $self->_write_dumper('build_params', [$self->{args}, $self->{config}, $self->{properties}]); ! $self->_persistent_hash_write($_) foreach qw(notes cleanup features config_data runtime_params); } *************** *** 1305,1308 **** --- 1306,1311 ---- # Extract our 'properties' from $cmd_args, the rest are put in 'args'. while (my ($key, $val) = each %args) { + $self->_persistent_hash_write('runtime_params', { $key => $val }) + if $self->valid_property($key); my $add_to = ( $key eq 'config' ? $self->{config} : $additive{$key} ? $self->{properties}{$key} Index: Authoring.pod =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Authoring.pod,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Authoring.pod 18 Dec 2004 20:57:05 -0000 1.3 --- Authoring.pod 4 Jan 2005 05:26:38 -0000 1.4 *************** *** 905,913 **** C<current()> method. ! The C<notes()> method is essentally a glorified hash access. With no ! arguments, C<notes()> returns a reference to the entire hash of notes. ! With one argument, C<notes($key)> returns the value associated with ! the given key. With two arguments, C<notes($key, $value)> sets the ! value associated with the given key to C<$value>. The lifetime of the C<notes> data is for "a build" - that is, the --- 905,913 ---- C<current()> method. ! The C<notes()> method is essentally a glorified hash access. With no ! arguments, C<notes()> returns the entire hash of notes. With one argument, ! C<notes($key)> returns the value associated with the given key. With two ! arguments, C<notes($key, $value)> sets the value associated with the given key ! to C<$value>. The lifetime of the C<notes> data is for "a build" - that is, the *************** *** 917,920 **** --- 917,943 ---- run again or the C<clean> action is run. + =item runtime_params() + + =item runtime_params($key) + + The C<runtime_params()> method stores the values passed on the command-line + for valid properties (that is, any command-line options for which + C<valid_property()> returns a true value). The value on the command-line may + override the default value for a property, as well as any value specified in a + call to C<new()>. This allows you to programmatically tell if C<perl Build.PL> + or any execution of C<./Build> had command-line options specified that + override valid properties. + + The C<runtime_params()> method is essentally a glorified read-only hash. With + no arguments, C<runtime_params()> returns the entire hash of properties + specified on the command-line. With one argument, C<runtime_params($key)> + returns the value associated with the given key. + + The lifetime of the C<runtime_params> data is for "a build" - that is, the + C<runtime_params> hash is created when C<perl Build.PL> is run (or when the + C<new()> method is called, if the Module::Build Perl API is being used instead + of called from a shell), and lasts until C<perl Build.PL> is run again or the + C<clean> action is run. + =item os_type() |