Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mattn/76100 to your computer and use it in GitHub Desktop.

Select an option

Save mattn/76100 to your computer and use it in GitHub Desktop.
From a77b5f904f84785c158d8e38729a6d74dd87dc7f Mon Sep 17 00:00:00 2001
From: mattn <[email protected]>
Date: Mon, 9 Mar 2009 13:08:33 +0900
Subject: [PATCH] use Config::IniFiles instead of Config::INI::Simple
---
lib/Plagger/Plugin/Subscription/PlanetINI.pm | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/Plagger/Plugin/Subscription/PlanetINI.pm b/lib/Plagger/Plugin/Subscription/PlanetINI.pm
index 263a0d5..8ed036a 100644
--- a/lib/Plagger/Plugin/Subscription/PlanetINI.pm
+++ b/lib/Plagger/Plugin/Subscription/PlanetINI.pm
@@ -2,7 +2,7 @@ package Plagger::Plugin::Subscription::PlanetINI;
use strict;
use base qw( Plagger::Plugin );
-use Config::INI::Simple;
+use Config::IniFiles;
use Plagger::Util;
use URI;
@@ -18,15 +18,14 @@ sub register {
sub load {
my($self, $context) = @_;
- my $config = Config::INI::Simple->new;
- $config->read($self->conf->{path});
+ my $config = Config::IniFiles->new( -file => $self->conf->{path} );
- for my $url (keys %$config) {
+ for my $url ($config->Sections) {
next if $url !~ m!https?://!;
my $feed = Plagger::Feed->new;
$feed->url($url);
- $feed->title($config->{$url}->{name});
+ $feed->title($config->val($url, 'name'));
$context->subscription->add($feed);
}
--
1.5.5.1015.g9d258
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment