[BACK]Return to rt_invoices.pl CVS log [TXT][DIR] Up to [local] / RT / Invoicing

Diff for /RT/Invoicing/rt_invoices.pl between version 1.4 and 1.5

version 1.4, 2011/03/21 05:01:33 version 1.5, 2011/03/21 18:36:59
Line 383 
Line 383 
   
 use 5.010;  use 5.010;
   
 use YAML::Any qw/ LoadFile /;  use YAML::Any qw/ LoadFile Dump Load /;
   
 sub new {  sub new {
     my ( $class, $args ) = @_;      my ( $class, $args ) = @_;
   
     my $self = { file => '', };      my $self = { file => '', };
     bless $self, $class;      bless $self, $class;
   
     my $file = $args->{file} || $self->_find_config;      my $file = $args->{file} || $self->_find_config;
     $self->read_config($file);      $self->read_config($file);
   
Line 421 
Line 422 
     if ( $c->{default} ) {      if ( $c->{default} ) {
         foreach my $cust ( @{ $c->{customers} } ) {          foreach my $cust ( @{ $c->{customers} } ) {
             foreach my $k ( keys %{ $c->{default} } ) {              foreach my $k ( keys %{ $c->{default} } ) {
                 $cust->{$k} //= $c->{default}->{$k};                  $cust->{$k} //= Load( Dump( $c->{default}->{$k} ) );
             }              }
         }          }
     }      }
Line 432 
Line 433 
   
 sub get {  sub get {
     my ( $self, $key ) = @_;      my ( $self, $key ) = @_;
       return Load( Dump( $self->{_config}->{$key} ) );
     # XXX This should deep copy? not a reference would be good  
     return $self->{_config}->{$key};  
 }  }
   
 package RTI::State;  package RTI::State;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>