]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiExternal.pm
lei: rename "extinbox" => "external"
[public-inbox.git] / lib / PublicInbox / LeiExternal.pm
similarity index 75%
rename from lib/PublicInbox/LeiExtinbox.pm
rename to lib/PublicInbox/LeiExternal.pm
index c2de773535f2eb2169dfd39db722a9ff0ce5b554..0378551a9d97cc3706df8f9f7dc3fb77e9053ab7 100644 (file)
@@ -1,22 +1,22 @@
 # Copyright (C) 2020 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
-# *-extinbox commands of lei
-package PublicInbox::LeiExtinbox;
+# *-external commands of lei
+package PublicInbox::LeiExternal;
 use strict;
 use v5.10.1;
 use parent qw(Exporter);
-our @EXPORT = qw(lei_ls_extinbox lei_add_extinbox lei_forget_extinbox);
+our @EXPORT = qw(lei_ls_external lei_add_external lei_forget_external);
 
-sub lei_ls_extinbox {
+sub lei_ls_external {
        my ($self, @argv) = @_;
        my $stor = $self->_lei_store(0);
        my $cfg = $self->_lei_cfg(0);
        my $out = $self->{1};
        my ($OFS, $ORS) = $self->{opt}->{z} ? ("\0", "\0\0") : (" ", "\n");
        my (%boost, @loc);
-       for my $sec (grep(/\Aextinbox\./, @{$cfg->{-section_order}})) {
-               my $loc = substr($sec, length('extinbox.'));
+       for my $sec (grep(/\Aexternal\./, @{$cfg->{-section_order}})) {
+               my $loc = substr($sec, length('external.'));
                $boost{$loc} = $cfg->{"$sec.boost"};
                push @loc, $loc;
        }
@@ -28,14 +28,14 @@ sub lei_ls_extinbox {
        }
 }
 
-sub lei_add_extinbox {
+sub lei_add_external {
        my ($self, $url_or_dir) = @_;
        my $cfg = $self->_lei_cfg(1);
        if ($url_or_dir !~ m!\Ahttps?://!) {
                $url_or_dir = File::Spec->canonpath($url_or_dir);
        }
        my $new_boost = $self->{opt}->{boost} // 0;
-       my $key = "extinbox.$url_or_dir.boost";
+       my $key = "external.$url_or_dir.boost";
        my $cur_boost = $cfg->{$key};
        return if defined($cur_boost) && $cur_boost == $new_boost; # idempotent
        $self->lei_config($key, $new_boost);
@@ -44,7 +44,7 @@ sub lei_add_extinbox {
        $stor->done;
 }
 
-sub lei_forget_extinbox {
+sub lei_forget_external {
        # TODO
 }