From 7b703ccffed1faab601b48cf82ff9e22f848be50 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 23 Jul 2021 19:22:25 -0700 Subject: [PATCH] Move Storage and Utils into Core --- lib/PBot/Core.pm | 14 +++++++------- lib/PBot/Core/AntiSpam.pm | 6 +++--- lib/PBot/Core/BanList.pm | 6 +++--- lib/PBot/Core/Capabilities.pm | 2 +- lib/PBot/Core/Channels.pm | 2 +- lib/PBot/Core/Commands.pm | 4 ++-- lib/PBot/Core/Commands/Factoids.pm | 2 +- lib/PBot/Core/EventDispatcher.pm | 4 ++-- lib/PBot/Core/EventQueue.pm | 4 ++-- lib/PBot/Core/Factoids.pm | 6 +++--- lib/PBot/Core/Handlers.pm | 2 +- lib/PBot/Core/IgnoreList.pm | 2 +- lib/PBot/Core/Interpreter.pm | 2 +- lib/PBot/Core/MessageHistory/Storage/SQLite.pm | 8 ++++---- lib/PBot/Core/Registry.pm | 2 +- lib/PBot/{ => Core}/Storage/DualIndexHashObject.pm | 4 ++-- .../{ => Core}/Storage/DualIndexSQLiteObject.pm | 8 ++++---- lib/PBot/{ => Core}/Storage/HashObject.pm | 4 ++-- lib/PBot/Core/Users.pm | 2 +- lib/PBot/{ => Core}/Utils/Indefinite.pm | 2 +- lib/PBot/{ => Core}/Utils/LWPUserAgentCached.pm | 2 +- lib/PBot/{ => Core}/Utils/LoadModules.pm | 2 +- lib/PBot/{ => Core}/Utils/ParseDate.pm | 2 +- lib/PBot/{ => Core}/Utils/PriorityQueue.pm | 2 +- lib/PBot/{ => Core}/Utils/SQLiteLogger.pm | 2 +- lib/PBot/{ => Core}/Utils/SQLiteLoggerLayer.pm | 2 +- lib/PBot/{ => Core}/Utils/SafeFilename.pm | 2 +- lib/PBot/{ => Core}/Utils/ValidateString.pm | 2 +- lib/PBot/Plugin/ParseDate.pm | 2 +- lib/PBot/Plugin/Quotegrabs.pm | 2 +- lib/PBot/Plugin/Weather.pm | 4 ++-- lib/PBot/Plugin/Wttr.pm | 4 ++-- 32 files changed, 57 insertions(+), 57 deletions(-) rename lib/PBot/{ => Core}/Storage/DualIndexHashObject.pm (99%) rename lib/PBot/{ => Core}/Storage/DualIndexSQLiteObject.pm (98%) rename lib/PBot/{ => Core}/Storage/HashObject.pm (98%) rename lib/PBot/{ => Core}/Utils/Indefinite.pm (99%) rename lib/PBot/{ => Core}/Utils/LWPUserAgentCached.pm (97%) rename lib/PBot/{ => Core}/Utils/LoadModules.pm (97%) rename lib/PBot/{ => Core}/Utils/ParseDate.pm (99%) rename lib/PBot/{ => Core}/Utils/PriorityQueue.pm (98%) rename lib/PBot/{ => Core}/Utils/SQLiteLogger.pm (97%) rename lib/PBot/{ => Core}/Utils/SQLiteLoggerLayer.pm (93%) rename lib/PBot/{ => Core}/Utils/SafeFilename.pm (94%) rename lib/PBot/{ => Core}/Utils/ValidateString.pm (98%) diff --git a/lib/PBot/Core.pm b/lib/PBot/Core.pm index 68dadc7f..eb0e0b9b 100644 --- a/lib/PBot/Core.pm +++ b/lib/PBot/Core.pm @@ -50,13 +50,13 @@ use PBot::Core::Registry; use PBot::Core::Refresher; use PBot::Core::SelectHandler; use PBot::Core::StdinReader; +use PBot::Core::Storage::HashObject; +use PBot::Core::Storage::DualIndexHashObject; +use PBot::Core::Storage::DualIndexSQLiteObject; use PBot::Core::Updater; use PBot::Core::Users; +use PBot::Core::Utils::ParseDate; use PBot::Core::WebPaste; -use PBot::Storage::HashObject; -use PBot::Storage::DualIndexHashObject; -use PBot::Storage::DualIndexSQLiteObject; -use PBot::Utils::ParseDate; use Encode; use File::Basename; @@ -195,15 +195,15 @@ sub initialize { $self->{messagehistory} = PBot::Core::MessageHistory->new(pbot => $self, filename => "$conf{data_dir}/message_history.sqlite3", %conf); $self->{modules} = PBot::Core::Modules->new(pbot => $self, %conf); $self->{nicklist} = PBot::Core::NickList->new(pbot => $self, %conf); - $self->{parsedate} = PBot::Utils::ParseDate->new(pbot => $self, %conf); + $self->{parsedate} = PBot::Core::Utils::ParseDate->new(pbot => $self, %conf); $self->{plugins} = PBot::Core::Plugins->new(pbot => $self, %conf); $self->{process_manager} = PBot::Core::ProcessManager->new(pbot => $self, %conf); $self->{select_handler} = PBot::Core::SelectHandler->new(pbot => $self, %conf); $self->{stdin_reader} = PBot::Core::StdinReader->new(pbot => $self, %conf); $self->{webpaste} = PBot::Core::WebPaste->new(pbot => $self, %conf); - # register commands in Commands directory - $self->{commands}->register_commands; + # load commands in Commands directory + $self->{commands}->load_commands; # register command/factoid interpreters $self->{interpreter}->register(sub { $self->{commands}->interpreter(@_) }); diff --git a/lib/PBot/Core/AntiSpam.pm b/lib/PBot/Core/AntiSpam.pm index e6e52ede..dddd460b 100644 --- a/lib/PBot/Core/AntiSpam.pm +++ b/lib/PBot/Core/AntiSpam.pm @@ -15,9 +15,9 @@ sub initialize { my $filename = $self->{pbot}->{registry}->get_value('general', 'data_dir') . '/spam_keywords'; - $self->{keywords} = PBot::Storage::DualIndexHashObject->new( - pbot => $self->{pbot}, - name => 'SpamKeywords', + $self->{keywords} = PBot::Core::Storage::DualIndexHashObject->new( + pbot => $self->{pbot}, + name => 'SpamKeywords', filename => $filename, ); diff --git a/lib/PBot/Core/BanList.pm b/lib/PBot/Core/BanList.pm index f1095a08..b17e3c6e 100644 --- a/lib/PBot/Core/BanList.pm +++ b/lib/PBot/Core/BanList.pm @@ -33,20 +33,20 @@ sub initialize { my $data_dir = $self->{pbot}->{registry}->get_value('general', 'data_dir'); - $self->{'ban-exemptions'} = PBot::Storage::DualIndexHashObject->new( + $self->{'ban-exemptions'} = PBot::Core::Storage::DualIndexHashObject->new( pbot => $self->{pbot}, name => 'Ban exemptions', filename => "$data_dir/ban-exemptions", ); - $self->{banlist} = PBot::Storage::DualIndexHashObject->new( + $self->{banlist} = PBot::Core::Storage::DualIndexHashObject->new( pbot => $self->{pbot}, name => 'Ban List', filename => "$data_dir/banlist", save_queue_timeout => 15, ); - $self->{quietlist} = PBot::Storage::DualIndexHashObject->new( + $self->{quietlist} = PBot::Core::Storage::DualIndexHashObject->new( pbot => $self->{pbot}, name => 'Quiet List', filename => "$data_dir/quietlist", diff --git a/lib/PBot/Core/Capabilities.pm b/lib/PBot/Core/Capabilities.pm index 4386bc92..0f83e4ba 100644 --- a/lib/PBot/Core/Capabilities.pm +++ b/lib/PBot/Core/Capabilities.pm @@ -17,7 +17,7 @@ sub initialize { my $filename = $conf{filename} // $self->{pbot}->{registry}->get_value('general', 'data_dir') . '/capabilities'; # capabilities hash table - $self->{caps} = PBot::Storage::HashObject->new( + $self->{caps} = PBot::Core::Storage::HashObject->new( pbot => $self->{pbot}, name => 'Capabilities', filename => $filename, diff --git a/lib/PBot/Core/Channels.pm b/lib/PBot/Core/Channels.pm index 106d72ce..4b519d14 100644 --- a/lib/PBot/Core/Channels.pm +++ b/lib/PBot/Core/Channels.pm @@ -13,7 +13,7 @@ use PBot::Imports; sub initialize { my ($self, %conf) = @_; - $self->{storage} = PBot::Storage::HashObject->new( + $self->{storage} = PBot::Core::Storage::HashObject->new( pbot => $self->{pbot}, name => 'Channels', filename => $conf{filename} diff --git a/lib/PBot/Core/Commands.pm b/lib/PBot/Core/Commands.pm index a3b206ce..0d08a8e3 100644 --- a/lib/PBot/Core/Commands.pm +++ b/lib/PBot/Core/Commands.pm @@ -11,7 +11,7 @@ use parent 'PBot::Core::Class'; use PBot::Imports; -use PBot::Utils::LoadModules qw/load_modules/; +use PBot::Core::Utils::LoadModules qw/load_modules/; sub initialize { my ($self, %conf) = @_; @@ -20,7 +20,7 @@ sub initialize { $self->{commands} = {}; # command metadata stored as a HashObject - $self->{metadata} = PBot::Storage::HashObject->new( + $self->{metadata} = PBot::Core::Storage::HashObject->new( pbot => $self->{pbot}, name => 'Command metadata', filename => $conf{filename}, diff --git a/lib/PBot/Core/Commands/Factoids.pm b/lib/PBot/Core/Commands/Factoids.pm index fbb7fe60..bbb7ac03 100644 --- a/lib/PBot/Core/Commands/Factoids.pm +++ b/lib/PBot/Core/Commands/Factoids.pm @@ -18,7 +18,7 @@ use Storable; use LWP::UserAgent; use JSON; -use PBot::Utils::SafeFilename; +use PBot::Core::Utils::SafeFilename; our %factoid_metadata_capabilities = ( created_on => 'botowner', diff --git a/lib/PBot/Core/EventDispatcher.pm b/lib/PBot/Core/EventDispatcher.pm index 49cf1de0..35d4fad9 100644 --- a/lib/PBot/Core/EventDispatcher.pm +++ b/lib/PBot/Core/EventDispatcher.pm @@ -12,7 +12,7 @@ use parent 'PBot::Core::Class'; use PBot::Imports; -use PBot::Utils::PriorityQueue; +use PBot::Core::Utils::PriorityQueue; sub initialize { my ($self, %conf) = @_; @@ -47,7 +47,7 @@ sub register_handler { # create new priority-queue for event-name if one doesn't exist if (not exists $self->{handlers}->{$event_name}) { - $self->{handlers}->{$event_name} = PBot::Utils::PriorityQueue->new(pbot => $self->{pbot}); + $self->{handlers}->{$event_name} = PBot::Core::Utils::PriorityQueue->new(pbot => $self->{pbot}); } # add the event handler diff --git a/lib/PBot/Core/EventQueue.pm b/lib/PBot/Core/EventQueue.pm index c0ae785b..e9f2d3f6 100644 --- a/lib/PBot/Core/EventQueue.pm +++ b/lib/PBot/Core/EventQueue.pm @@ -13,13 +13,13 @@ use parent 'PBot::Core::Class'; use PBot::Imports; -use PBot::Utils::PriorityQueue; +use PBot::Core::Utils::PriorityQueue; use Time::HiRes qw/time/; sub initialize { my ($self, %conf) = @_; - $self->{event_queue} = PBot::Utils::PriorityQueue->new(pbot => $self->{pbot}); + $self->{event_queue} = PBot::Core::Utils::PriorityQueue->new(pbot => $self->{pbot}); } # returns seconds until upcoming event. diff --git a/lib/PBot/Core/Factoids.pm b/lib/PBot/Core/Factoids.pm index 88705bd6..3ce5fe59 100644 --- a/lib/PBot/Core/Factoids.pm +++ b/lib/PBot/Core/Factoids.pm @@ -17,8 +17,8 @@ use POSIX qw(strftime); use Text::ParseWords; use JSON; -use PBot::Utils::Indefinite; -use PBot::Utils::ValidateString; +use PBot::Core::Utils::Indefinite; +use PBot::Core::Utils::ValidateString; our %factoid_metadata = ( 'action' => 'TEXT', @@ -65,7 +65,7 @@ sub initialize { $self->{pbot} = $self->{pbot}; - $self->{storage} = PBot::Storage::DualIndexSQLiteObject->new( + $self->{storage} = PBot::Core::Storage::DualIndexSQLiteObject->new( pbot => $self->{pbot}, name => 'Factoids', filename => $filename, diff --git a/lib/PBot/Core/Handlers.pm b/lib/PBot/Core/Handlers.pm index 3a504219..6f009c62 100644 --- a/lib/PBot/Core/Handlers.pm +++ b/lib/PBot/Core/Handlers.pm @@ -10,7 +10,7 @@ use parent 'PBot::Core::Class'; use PBot::Imports; -use PBot::Utils::LoadModules qw/load_modules/; +use PBot::Core::Utils::LoadModules qw/load_modules/; sub initialize { my ($self, %conf) = @_; diff --git a/lib/PBot/Core/IgnoreList.pm b/lib/PBot/Core/IgnoreList.pm index 25e2c18e..e0b129e6 100644 --- a/lib/PBot/Core/IgnoreList.pm +++ b/lib/PBot/Core/IgnoreList.pm @@ -17,7 +17,7 @@ sub initialize { $self->{filename} = $conf{filename}; - $self->{storage} = PBot::Storage::DualIndexHashObject->new( + $self->{storage} = PBot::Core::Storage::DualIndexHashObject->new( pbot => $self->{pbot}, name => 'IgnoreList', filename => $self->{filename} diff --git a/lib/PBot/Core/Interpreter.pm b/lib/PBot/Core/Interpreter.pm index a1ac2e9a..58e6cc51 100644 --- a/lib/PBot/Core/Interpreter.pm +++ b/lib/PBot/Core/Interpreter.pm @@ -22,7 +22,7 @@ use Time::Duration; use Encode; use Unicode::Truncate; -use PBot::Utils::ValidateString; +use PBot::Core::Utils::ValidateString; sub initialize { my ($self, %conf) = @_; diff --git a/lib/PBot/Core/MessageHistory/Storage/SQLite.pm b/lib/PBot/Core/MessageHistory/Storage/SQLite.pm index 90845180..47e81cd3 100644 --- a/lib/PBot/Core/MessageHistory/Storage/SQLite.pm +++ b/lib/PBot/Core/MessageHistory/Storage/SQLite.pm @@ -16,8 +16,8 @@ use PBot::Imports; use PBot::Core::MessageHistory::Constants ':all'; -use PBot::Utils::SQLiteLogger; -use PBot::Utils::SQLiteLoggerLayer; +use PBot::Core::Utils::SQLiteLogger; +use PBot::Core::Utils::SQLiteLoggerLayer; use DBI; use Carp qw/shortmess/; @@ -60,7 +60,7 @@ sub sqlite_debug_trigger { my ($self, $section, $item, $newvalue) = @_; if ($newvalue) { - open $self->{trace_layer}, '>:via(PBot::Utils::SQLiteLoggerLayer)', PBot::Utils::SQLiteLogger->new(pbot => $self->{pbot}); + open $self->{trace_layer}, '>:via(PBot::Core::Utils::SQLiteLoggerLayer)', PBot::Core::Utils::SQLiteLogger->new(pbot => $self->{pbot}); } else { close $self->{trace_layer} if $self->{trace_layer}; delete $self->{trace_layer}; @@ -80,7 +80,7 @@ sub begin { eval { my $sqlite_debug = $self->{pbot}->{registry}->get_value('messagehistory', 'sqlite_debug'); if ($sqlite_debug) { - open $self->{trace_layer}, '>:via(PBot::Utils::SQLiteLoggerLayer)', PBot::Utils::SQLiteLogger->new(pbot => $self->{pbot}); + open $self->{trace_layer}, '>:via(PBot::Core::Utils::SQLiteLoggerLayer)', PBot::Core::Utils::SQLiteLogger->new(pbot => $self->{pbot}); $self->{dbh}->trace($self->{dbh}->parse_trace_flags("SQL|$sqlite_debug"), $self->{trace_layer}); } diff --git a/lib/PBot/Core/Registry.pm b/lib/PBot/Core/Registry.pm index 9aaf9e78..57c46839 100644 --- a/lib/PBot/Core/Registry.pm +++ b/lib/PBot/Core/Registry.pm @@ -18,7 +18,7 @@ sub initialize { my $filename = $conf{filename} // Carp::croak("Missing filename configuration item in " . __FILE__); # registry is stored as a dual-index hash object - $self->{storage} = PBot::Storage::DualIndexHashObject->new( + $self->{storage} = PBot::Core::Storage::DualIndexHashObject->new( pbot => $self->{pbot}, name => 'Registry', filename => $filename, diff --git a/lib/PBot/Storage/DualIndexHashObject.pm b/lib/PBot/Core/Storage/DualIndexHashObject.pm similarity index 99% rename from lib/PBot/Storage/DualIndexHashObject.pm rename to lib/PBot/Core/Storage/DualIndexHashObject.pm index 858558dd..85e7a97b 100644 --- a/lib/PBot/Storage/DualIndexHashObject.pm +++ b/lib/PBot/Core/Storage/DualIndexHashObject.pm @@ -10,12 +10,12 @@ # Data is stored in working memory for lightning fast performance. If you have # a huge amount of data, consider using DualIndexSQLiteObject instead. # -# If a filename is provided, data is written to a file after any modifications. +# If a filename is provided, data is written to the file after any modifications. # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Storage::DualIndexHashObject; +package PBot::Core::Storage::DualIndexHashObject; use PBot::Imports; diff --git a/lib/PBot/Storage/DualIndexSQLiteObject.pm b/lib/PBot/Core/Storage/DualIndexSQLiteObject.pm similarity index 98% rename from lib/PBot/Storage/DualIndexSQLiteObject.pm rename to lib/PBot/Core/Storage/DualIndexSQLiteObject.pm index 909604e9..463aa151 100644 --- a/lib/PBot/Storage/DualIndexSQLiteObject.pm +++ b/lib/PBot/Core/Storage/DualIndexSQLiteObject.pm @@ -11,12 +11,12 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Storage::DualIndexSQLiteObject; +package PBot::Core::Storage::DualIndexSQLiteObject; use PBot::Imports; -use PBot::Utils::SQLiteLogger; -use PBot::Utils::SQLiteLoggerLayer; +use PBot::Core::Utils::SQLiteLogger; +use PBot::Core::Utils::SQLiteLoggerLayer; use DBI; use Text::Levenshtein qw(fastdistance); @@ -63,7 +63,7 @@ sub begin { eval { my $sqlite_debug = $self->{pbot}->{registry}->get_value('dualindexsqliteobject', "debug_$self->{name}"); - open $self->{trace_layer}, '>:via(PBot::Utils::SQLiteLoggerLayer)', PBot::Utils::SQLiteLogger->new(pbot => $self->{pbot}); + open $self->{trace_layer}, '>:via(PBot::Core::Utils::SQLiteLoggerLayer)', PBot::Core::Utils::SQLiteLogger->new(pbot => $self->{pbot}); $self->{dbh}->trace($self->{dbh}->parse_trace_flags("SQL|$sqlite_debug"), $self->{trace_layer}); }; diff --git a/lib/PBot/Storage/HashObject.pm b/lib/PBot/Core/Storage/HashObject.pm similarity index 98% rename from lib/PBot/Storage/HashObject.pm rename to lib/PBot/Core/Storage/HashObject.pm index 31cf6646..7af19166 100644 --- a/lib/PBot/Storage/HashObject.pm +++ b/lib/PBot/Core/Storage/HashObject.pm @@ -6,12 +6,12 @@ # displaying index key. # # Data is stored in working memory for lightning fast performance. If a filename -# is provided, data is written to a file after any modifications. +# is provided, data is written to the file after any modifications. # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Storage::HashObject; +package PBot::Core::Storage::HashObject; use PBot::Imports; diff --git a/lib/PBot/Core/Users.pm b/lib/PBot/Core/Users.pm index d0e6039c..19f84783 100644 --- a/lib/PBot/Core/Users.pm +++ b/lib/PBot/Core/Users.pm @@ -13,7 +13,7 @@ use PBot::Imports; sub initialize { my ($self, %conf) = @_; - $self->{storage} = PBot::Storage::HashObject->new( + $self->{storage} = PBot::Core::Storage::HashObject->new( pbot => $conf{pbot}, name => 'Users', filename => $conf{filename}, diff --git a/lib/PBot/Utils/Indefinite.pm b/lib/PBot/Core/Utils/Indefinite.pm similarity index 99% rename from lib/PBot/Utils/Indefinite.pm rename to lib/PBot/Core/Utils/Indefinite.pm index 84252e12..17aef4fb 100644 --- a/lib/PBot/Utils/Indefinite.pm +++ b/lib/PBot/Core/Utils/Indefinite.pm @@ -2,7 +2,7 @@ # # Purpose: Implements a/an inflexion for nouns. -package PBot::Utils::Indefinite; +package PBot::Core::Utils::Indefinite; use PBot::Imports; diff --git a/lib/PBot/Utils/LWPUserAgentCached.pm b/lib/PBot/Core/Utils/LWPUserAgentCached.pm similarity index 97% rename from lib/PBot/Utils/LWPUserAgentCached.pm rename to lib/PBot/Core/Utils/LWPUserAgentCached.pm index 88facad0..f651506a 100644 --- a/lib/PBot/Utils/LWPUserAgentCached.pm +++ b/lib/PBot/Core/Utils/LWPUserAgentCached.pm @@ -7,7 +7,7 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Utils::LWPUserAgentCached; +package PBot::Core::Utils::LWPUserAgentCached; use PBot::Imports; diff --git a/lib/PBot/Utils/LoadModules.pm b/lib/PBot/Core/Utils/LoadModules.pm similarity index 97% rename from lib/PBot/Utils/LoadModules.pm rename to lib/PBot/Core/Utils/LoadModules.pm index bdf70afc..62684a9b 100644 --- a/lib/PBot/Utils/LoadModules.pm +++ b/lib/PBot/Core/Utils/LoadModules.pm @@ -6,7 +6,7 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Utils::LoadModules; +package PBot::Core::Utils::LoadModules; use PBot::Imports; diff --git a/lib/PBot/Utils/ParseDate.pm b/lib/PBot/Core/Utils/ParseDate.pm similarity index 99% rename from lib/PBot/Utils/ParseDate.pm rename to lib/PBot/Core/Utils/ParseDate.pm index c9fd745e..455b0e6d 100644 --- a/lib/PBot/Utils/ParseDate.pm +++ b/lib/PBot/Core/Utils/ParseDate.pm @@ -6,7 +6,7 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Utils::ParseDate; +package PBot::Core::Utils::ParseDate; use PBot::Imports; diff --git a/lib/PBot/Utils/PriorityQueue.pm b/lib/PBot/Core/Utils/PriorityQueue.pm similarity index 98% rename from lib/PBot/Utils/PriorityQueue.pm rename to lib/PBot/Core/Utils/PriorityQueue.pm index 95c4bf42..e9625ab4 100644 --- a/lib/PBot/Utils/PriorityQueue.pm +++ b/lib/PBot/Core/Utils/PriorityQueue.pm @@ -5,7 +5,7 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Utils::PriorityQueue; +package PBot::Core::Utils::PriorityQueue; use PBot::Imports; diff --git a/lib/PBot/Utils/SQLiteLogger.pm b/lib/PBot/Core/Utils/SQLiteLogger.pm similarity index 97% rename from lib/PBot/Utils/SQLiteLogger.pm rename to lib/PBot/Core/Utils/SQLiteLogger.pm index c6ce9d4a..ff984be1 100644 --- a/lib/PBot/Utils/SQLiteLogger.pm +++ b/lib/PBot/Core/Utils/SQLiteLogger.pm @@ -6,7 +6,7 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Utils::SQLiteLogger; +package PBot::Core::Utils::SQLiteLogger; use PBot::Imports; diff --git a/lib/PBot/Utils/SQLiteLoggerLayer.pm b/lib/PBot/Core/Utils/SQLiteLoggerLayer.pm similarity index 93% rename from lib/PBot/Utils/SQLiteLoggerLayer.pm rename to lib/PBot/Core/Utils/SQLiteLoggerLayer.pm index 289248c9..e47b2987 100644 --- a/lib/PBot/Utils/SQLiteLoggerLayer.pm +++ b/lib/PBot/Core/Utils/SQLiteLoggerLayer.pm @@ -5,7 +5,7 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Utils::SQLiteLoggerLayer; +package PBot::Core::Utils::SQLiteLoggerLayer; use PBot::Imports; diff --git a/lib/PBot/Utils/SafeFilename.pm b/lib/PBot/Core/Utils/SafeFilename.pm similarity index 94% rename from lib/PBot/Utils/SafeFilename.pm rename to lib/PBot/Core/Utils/SafeFilename.pm index 66cac358..7c113446 100644 --- a/lib/PBot/Utils/SafeFilename.pm +++ b/lib/PBot/Core/Utils/SafeFilename.pm @@ -6,7 +6,7 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Utils::SafeFilename; +package PBot::Core::Utils::SafeFilename; use PBot::Imports; diff --git a/lib/PBot/Utils/ValidateString.pm b/lib/PBot/Core/Utils/ValidateString.pm similarity index 98% rename from lib/PBot/Utils/ValidateString.pm rename to lib/PBot/Core/Utils/ValidateString.pm index 8cba76f7..488be16d 100644 --- a/lib/PBot/Utils/ValidateString.pm +++ b/lib/PBot/Core/Utils/ValidateString.pm @@ -7,7 +7,7 @@ # SPDX-FileCopyrightText: 2021 Pragmatic Software # SPDX-License-Identifier: MIT -package PBot::Utils::ValidateString; +package PBot::Core::Utils::ValidateString; use PBot::Imports; diff --git a/lib/PBot/Plugin/ParseDate.pm b/lib/PBot/Plugin/ParseDate.pm index f9eb181e..283f6436 100644 --- a/lib/PBot/Plugin/ParseDate.pm +++ b/lib/PBot/Plugin/ParseDate.pm @@ -1,6 +1,6 @@ # File: ParseDate.pm # -# Purpose: Just a simple interface to test/play with PBot::Utils::ParseDate +# Purpose: Just a simple interface to test/play with PBot::Core::Utils::ParseDate # and make sure it's working properly. # # SPDX-FileCopyrightText: 2021 Pragmatic Software diff --git a/lib/PBot/Plugin/Quotegrabs.pm b/lib/PBot/Plugin/Quotegrabs.pm index dc11e647..78769a2a 100644 --- a/lib/PBot/Plugin/Quotegrabs.pm +++ b/lib/PBot/Plugin/Quotegrabs.pm @@ -20,7 +20,7 @@ use Getopt::Long qw(GetOptionsFromArray); use PBot::Plugin::Quotegrabs::Storage::SQLite; # use SQLite backend for quotegrabs database #use PBot::Plugin::Quotegrabs::Storage::Hashtable; # use Perl hashtable backend for quotegrabs database -use PBot::Utils::ValidateString; +use PBot::Core::Utils::ValidateString; use POSIX qw(strftime); diff --git a/lib/PBot/Plugin/Weather.pm b/lib/PBot/Plugin/Weather.pm index ad6e0a89..59237475 100644 --- a/lib/PBot/Plugin/Weather.pm +++ b/lib/PBot/Plugin/Weather.pm @@ -10,7 +10,7 @@ use parent 'PBot::Plugin::Base'; use PBot::Imports; -use PBot::Utils::LWPUserAgentCached; +use PBot::Core::Utils::LWPUserAgentCached; use XML::LibXML; use Getopt::Long qw(GetOptionsFromArray); @@ -72,7 +72,7 @@ sub get_weather { 'default_expires_in' => 3600 ); - my $ua = PBot::Utils::LWPUserAgentCached->new(\%cache_opt, timeout => 10); + my $ua = PBot::Core::Utils::LWPUserAgentCached->new(\%cache_opt, timeout => 10); my $response = $ua->get("http://rss.accuweather.com/rss/liveweather_rss.asp?metric=0&locCode=$location"); my $xml; diff --git a/lib/PBot/Plugin/Wttr.pm b/lib/PBot/Plugin/Wttr.pm index bbacc20b..f9014c3a 100644 --- a/lib/PBot/Plugin/Wttr.pm +++ b/lib/PBot/Plugin/Wttr.pm @@ -9,7 +9,7 @@ package PBot::Plugin::Wttr; use parent 'PBot::Plugin::Base'; use PBot::Imports; -use PBot::Utils::LWPUserAgentCached; +use PBot::Core::Utils::LWPUserAgentCached; use JSON; use URI::Escape qw/uri_escape_utf8/; @@ -113,7 +113,7 @@ sub get_wttr { my $location_uri = uri_escape_utf8 $location; - my $ua = PBot::Utils::LWPUserAgentCached->new(\%cache_opt, timeout => 30); + my $ua = PBot::Core::Utils::LWPUserAgentCached->new(\%cache_opt, timeout => 30); my $response = $ua->get("http://wttr.in/$location_uri?format=j1&m"); my $json;