/[Frey]/trunk/lib/Frey/Class/Create.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/Create.pm

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

trunk/lib/Frey/ClassCreator.pm revision 682 by dpavlin, Tue Dec 2 17:36:51 2008 UTC trunk/lib/Frey/Class/Create.pm revision 1089 by dpavlin, Sun Jun 28 15:42:05 2009 UTC
# Line 1  Line 1 
1  package Frey::ClassCreator;  package Frey::Class::Create;
2  use Moose;  use Moose;
3    
4  extends 'Frey';  extends 'Frey';
# Line 13  has class => ( Line 13  has class => (
13          is => 'rw',          is => 'rw',
14          isa => 'Str',          isa => 'Str',
15          required => 1,          required => 1,
16          default => 'Frey::Skeleton',          default => 'App::Skeleton',
17  );  );
18    
19  has svk_add => (  has svk_add => (
# Line 21  has svk_add => ( Line 21  has svk_add => (
21          is => 'rw',          is => 'rw',
22          isa => 'Bool',          isa => 'Bool',
23          required => 1,          required => 1,
24          default => 0,          default => 1,
25  );  );
26    
27  sub create_class_source_as_markup {  sub create_class_source_as_markup {
# Line 31  sub create_class_source_as_markup { Line 31  sub create_class_source_as_markup {
31    
32          my $class_path  = $class;          my $class_path  = $class;
33          $class_path =~ s{::}{/}g;          $class_path =~ s{::}{/}g;
34          $class_path = "lib/$class.pm";          $class_path = "lib/$class_path.pm";
35    
36          my $test_path = $class;          my $test_path;
37          $test_path =~ s{::}{-};  
38          $test_path = "t/30-$test_path.t";          my @c = split(m{::}, $class);
39            foreach ( -1 .. $#c ) {
40                    my $to = $#c - $_;
41                    my $path = 't/' . join('/', @c[ 0 .. $to ] );
42                    if ( -e $path ) {
43                            my $file = join('-', @c[ $to + 1 .. $#c ] );
44                            $test_path = $path . '/' . $file . '.t';
45                            last;
46                    }
47            }
48    
49            die "no test_path from $class" unless $test_path;
50    
51          die qq|class "$class" exists as |, $self->path_size($class_path) if -e $class_path;          die qq|class "$class" exists as |, $self->path_size($class_path) if -e $class_path;
52          die qq|class "$class" test exists as |, $self->path_size($test_path) if -e $test_path;          die qq|class "$class" test exists as |, $self->path_size($test_path) if -e $test_path;
# Line 65  sub create_class_source_as_markup { Line 76  sub create_class_source_as_markup {
76                  . $self->path_size($test_path)                  . $self->path_size($test_path)
77                  ;                  ;
78    
79          $html = $self->editor_links( $html );          $html = $self->html_links( $html );
80    
81          return $html;          return $html;
82  }  }

Legend:
Removed from v.682  
changed lines
  Added in v.1089

  ViewVC Help
Powered by ViewVC 1.1.26