@@ -101,7 +101,7 @@ sub view : Private {
101
101
102
102
$c -> res-> last_modified( $out -> {date } );
103
103
104
- $self -> groom_contributors( $c , $out );
104
+ my $contribs = $self -> groom_contributors( $c , $out );
105
105
106
106
$c -> stash( $c -> model(' API::Favorite' )-> find_plussers($distribution ) );
107
107
@@ -123,6 +123,8 @@ sub view : Private {
123
123
examples => \@examples ,
124
124
files => \@view_files ,
125
125
126
+ contributors => $contribs ,
127
+
126
128
# TODO: Put this in a more general place.
127
129
# Maybe make a hash for feature flags?
128
130
(
@@ -135,35 +137,4 @@ sub view : Private {
135
137
);
136
138
}
137
139
138
- # massage the x_contributors field into what we want
139
- sub groom_contributors {
140
- my ( $self , $c , $out ) = @_ ;
141
-
142
- return unless $out -> {metadata }{x_contributors };
143
-
144
- # just in case a lonely contributor makes it as a scalar
145
- $out -> {metadata }{x_contributors } = [ $out -> {metadata }{x_contributors } ]
146
- unless ref $out -> {metadata }{x_contributors };
147
-
148
- my @contributors = map {
149
- s / <(.*)>// ;
150
- { name => $_ , email => $1 }
151
- } @{ $out -> {metadata }{x_contributors } };
152
-
153
- $out -> {metadata }{x_contributors } = \@contributors ;
154
-
155
- for my $contributor ( @{ $out -> {metadata }{x_contributors } } ) {
156
-
157
- # heuristic to autofill pause accounts
158
- $contributor -> {pauseid } = uc $1
159
- if !$contributor -> {pauseid }
160
- and $contributor -> {email } =~ / ^(.*)\@ cpan.org/ ;
161
-
162
- next unless $contributor -> {pauseid };
163
-
164
- $contributor -> {url } = $c -> uri_for_action( ' /author/index' ,
165
- [ $contributor -> {pauseid } ] );
166
- }
167
- }
168
-
169
140
1;
0 commit comments