From: Eric Wong Date: Mon, 7 Mar 2016 08:10:58 +0000 (+0000) Subject: repobrowse: improve API consistency, harder X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d3debbcf3fa4a4f0705624a897cf43547e5bf32;p=thirdparty%2Fpublic-inbox.git repobrowse: improve API consistency, harder This allows RepobrowseConfig objects to passed directly to Repobrowse initialization, similar to the way the normal Config can be passed to WWW at initialization. --- diff --git a/lib/PublicInbox/Repobrowse.pm b/lib/PublicInbox/Repobrowse.pm index fe06a5bef..0b09800bc 100644 --- a/lib/PublicInbox/Repobrowse.pm +++ b/lib/PublicInbox/Repobrowse.pm @@ -29,8 +29,9 @@ my %VCS = (git => 'Git'); my %LOADED; sub new { - my ($class, $file) = @_; - bless { rconfig => PublicInbox::RepobrowseConfig->new($file) }, $class; + my ($class, $rconfig) = @_; + $rconfig ||= PublicInbox::RepobrowseConfig->new; + bless { rconfig => $rconfig }, $class; } # simple response for errors