/[couchdb]/design/design-couch.pl
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 /design/design-couch.pl

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

revision 30 by dpavlin, Sun Apr 26 20:18:17 2009 UTC revision 31 by dpavlin, Sun Apr 26 21:37:40 2009 UTC
# Line 46  sub unroll { Line 46  sub unroll {
46          } elsif ( $ref eq '' ) {          } elsif ( $ref eq '' ) {
47                  $path =~ s{^/+}{};                  $path =~ s{^/+}{};
48    
                 my $ext = '';  
   
49                  if ( $tree =~ m{^\s*function}i ) {                  if ( $tree =~ m{^\s*function}i ) {
50                          $ext = '.js';                          $path .= '.js';
51                  } elsif ( $tree =~ m{<\w+>} ) {                  } elsif ( $tree =~ m{<\w+>} ) {
52                          $ext = '.html';                          $path .= '.html';
53                  }                  }
54    
55                  write_file $path . $ext , $tree;                  write_file $path, $tree;
56                  print "$path ", -s $path, " bytes\n";                  print "$path ", -s $path, " bytes\n";
57          }          }
58    
59  }  }
60    
61  my $json = $response->decoded_content;  my $json = $response->decoded_content;
62  write_file 'design.js', $json;  write_file "../$database-$design.js", $json;
63    
64  unroll( from_json $json, '/' );  unroll( from_json $json, '/' );
65    

Legend:
Removed from v.30  
changed lines
  Added in v.31

  ViewVC Help
Powered by ViewVC 1.1.26