From 2d3debbcf3fa4a4f0705624a897cf43547e5bf32 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 7 Mar 2016 08:10:58 +0000 Subject: 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. --- lib/PublicInbox/Repobrowse.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Repobrowse.pm') diff --git a/lib/PublicInbox/Repobrowse.pm b/lib/PublicInbox/Repobrowse.pm index fe06a5be..0b09800b 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 -- cgit v1.2.3-24-ge0c7