/[Frey]/trunk/lib/Frey/Class/Refactor/Modify.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Class/Refactor/Modify.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 773 by dpavlin, Tue Dec 9 20:31:33 2008 UTC revision 774 by dpavlin, Tue Dec 9 20:31:35 2008 UTC
# Line 47  sub as_markup { Line 47  sub as_markup {
47    
48          $html .= qq|<ul>|;          $html .= qq|<ul>|;
49    
50            my $rename;
51            my $from_path = $self->from;
52            $from_path =~ s{::}{/}g;
53    
54          foreach my $selected ( @{ $self->selected } ) {          foreach my $selected ( @{ $self->selected } ) {
55                  warn "# selected ", $self->dump( $selected );                  warn "# selected ", $self->dump( $selected );
56                  my $path = $self->path->[$selected] || die "no $selected path in ", $self->dump( $self->path );                  my $path = $self->path->[$selected] || die "no $selected path in ", $self->dump( $self->path );
# Line 59  sub as_markup { Line 63  sub as_markup {
63                  my $from = $self->from;                  my $from = $self->from;
64                  my $to = $self->modification->[$selected];                  my $to = $self->modification->[$selected];
65    
66                    $rename->{ $content_path } = $to if $content_path =~ m{$from_path};
67    
68                  $content[ $line ] =~ s{\Q$from\E}{$to}s;                  $content[ $line ] =~ s{\Q$from\E}{$to}s;
69                  $self->write_file( $content_path, @content );                  $self->write_file( $content_path, @content );
70                    
# Line 67  sub as_markup { Line 73  sub as_markup {
73    
74          $html .= qq|</ul>|;          $html .= qq|</ul>|;
75    
76            $html .= qq|
77                    <div class="frey-notice">
78                    <a target="Frey::SVK" href="/Frey::SVK/as_markup">Verify and commit changes</a>
79                    and execute following commands to rename classes in file system:
80                    </div>
81            |;
82    
83            foreach my $old ( keys %$rename ) {
84                    my $to = $rename->{$old};
85                    $to =~ s{::}{/}g;
86                    my $new = $old;
87                    $new =~ s{$from_path}{$to};
88                    $html .= qq|<pre>svk mv $old $new\n</pre>|;
89            }
90    
91          $html;          $html;
92  }  }
93    

Legend:
Removed from v.773  
changed lines
  Added in v.774

  ViewVC Help
Powered by ViewVC 1.1.26