diff options
author | David Phillips <david@sighup.nz> | 2018-09-16 23:42:35 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-09-17 00:01:48 +1200 |
commit | 5331e8ef6cdb9163e3ec6ee85491b7b286f4cbdc (patch) | |
tree | 034e3ffcd6f0f450ba2d6ee51ba54ac3feced716 /Plugin/Jinx.pm | |
parent | 0352e7d89441abc913d69ce6cff551872edc1fe9 (diff) | |
download | idalius-5331e8ef6cdb9163e3ec6ee85491b7b286f4cbdc.tar.xz |
Overhaul config parsing
* makes plugin config more private:
The config file now uses sections denoted with [Plugin::Foo] where plugin-
private config can be stored. Plugins are now passed the usual, as well
as a hashref for their own config section. They are also passed the config
section of the core, i.e. those config options not appearing in an explicit
section. Generally, these are used for bot-global options, so should be
accessible to all plugins, but plugin-specific config shall be hidden
* tries to improve parsing of hash-like strings and arrays
The previous mechanism of using regex to pull out possible tokens was only
ever meant to be temporary, and caused problems with escaping or
encapsulation inside strings. I have made steps on hash parsing to allow
tokens inside strings. Both array and hash parsing still to provide an
escape character to escape the item separator (,)
Diffstat (limited to 'Plugin/Jinx.pm')
-rw-r--r-- | Plugin/Jinx.pm | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/Plugin/Jinx.pm b/Plugin/Jinx.pm index a514bb8..f1e712b 100644 --- a/Plugin/Jinx.pm +++ b/Plugin/Jinx.pm @@ -11,13 +11,10 @@ my %last_response; # Last message said on the channel my %last; -my %config; sub configure { my $self = $_[0]; my $cmdref = $_[1]; - my $cref = $_[2]; - %config = %$cref; return $self; } |