From: Brian Cassidy Date: Fri, 25 Aug 2006 02:26:18 +0000 (+0000) Subject: removing old dir X-Git-Tag: v0.13^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-ConfigLoader.git;a=commitdiff_plain;h=555e496292fae96181048866e7489e5a9e21510f removing old dir --- diff --git a/lib/Catalyst/Plugin/ConfigLoader/General.pm b/lib/Catalyst/Plugin/ConfigLoader/General.pm deleted file mode 100644 index f6e8d16..0000000 --- a/lib/Catalyst/Plugin/ConfigLoader/General.pm +++ /dev/null @@ -1,80 +0,0 @@ -package Catalyst::Plugin::ConfigLoader::General; - -use strict; -use warnings; - -=head1 NAME - -Catalyst::Plugin::ConfigLoader::General - Load Config::General files - -=head1 DESCRIPTION - -Loads Config::General files. Example: - - name = TestApp - - foo bar - - - qux xyzzy - - -=head1 METHODS - -=head2 extensions( ) - -return an array of valid extensions (C, C). - -=cut - -sub extensions { - return qw( cnf conf ); -} - -=head2 load( $file ) - -Attempts to load C<$file> via Config::General. - -=cut - -sub load { - my $class = shift; - my $file = shift; - - require Config::General; - my $configfile = Config::General->new( $file ); - my $config = { $configfile->getall }; - - return $config; -} - -=head1 AUTHOR - -=over 4 - -=item * Brian Cassidy Ebricas@cpan.orgE - -=back - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006 by Brian Cassidy - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=head1 SEE ALSO - -=over 4 - -=item * L - -=item * L - -=item * L - -=back - -=cut - -1; \ No newline at end of file diff --git a/lib/Catalyst/Plugin/ConfigLoader/INI.pm b/lib/Catalyst/Plugin/ConfigLoader/INI.pm deleted file mode 100644 index 9c24cab..0000000 --- a/lib/Catalyst/Plugin/ConfigLoader/INI.pm +++ /dev/null @@ -1,82 +0,0 @@ -package Catalyst::Plugin::ConfigLoader::INI; - -use strict; -use warnings; - -=head1 NAME - -Catalyst::Plugin::ConfigLoader::INI - Load INI config files - -=head1 DESCRIPTION - -Loads INI files. Example: - - name=TestApp - - [Controller::Foo] - foo=bar - - [Model::Baz] - qux=xyzzy - -=head1 METHODS - -=head2 extensions( ) - -return an array of valid extensions (C). - -=cut - -sub extensions { - return qw( ini ); -} - -=head2 load( $file ) - -Attempts to load C<$file> as an INI file. - -=cut - -sub load { - my $class = shift; - my $file = shift; - - require Config::Tiny; - my $config = Config::Tiny->read( $file ); - my $main = delete $config->{ _ }; - - $config->{ $_ } = $main->{ $_ } for keys %$main; - - return $config; -} - -=head1 AUTHOR - -=over 4 - -=item * Brian Cassidy Ebricas@cpan.orgE - -=back - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006 by Brian Cassidy - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=head1 SEE ALSO - -=over 4 - -=item * L - -=item * L - -=item * L - -=back - -=cut - -1; \ No newline at end of file diff --git a/lib/Catalyst/Plugin/ConfigLoader/JSON.pm b/lib/Catalyst/Plugin/ConfigLoader/JSON.pm deleted file mode 100644 index 1c100ce..0000000 --- a/lib/Catalyst/Plugin/ConfigLoader/JSON.pm +++ /dev/null @@ -1,92 +0,0 @@ -package Catalyst::Plugin::ConfigLoader::JSON; - -use strict; -use warnings; - -=head1 NAME - -Catalyst::Plugin::ConfigLoader::JSON - Load JSON config files - -=head1 DESCRIPTION - -Loads JSON files. Example: - - { - "name": "TestApp", - "Controller::Foo": { - "foo": "bar" - }, - "Model::Baz": { - "qux": "xyzzy" - } - } - -=head1 METHODS - -=head2 extensions( ) - -return an array of valid extensions (C, C). - -=cut - -sub extensions { - return qw( json jsn ); -} - -=head2 load( $file ) - -Attempts to load C<$file> as a JSON file. - -=cut - -sub load { - my $class = shift; - my $file = shift; - - open( my $fh, $file ) or die $!; - my $content = do { local $/; <$fh> }; - close $fh; - - eval { require JSON::Syck; }; - if( $@ ) { - require JSON; - JSON->import; - return jsonToObj( $content ); - } - else { - return JSON::Syck::Load( $content ); - } -} - -=head1 AUTHOR - -=over 4 - -=item * Brian Cassidy Ebricas@cpan.orgE - -=back - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006 by Brian Cassidy - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=head1 SEE ALSO - -=over 4 - -=item * L - -=item * L - -=item * L - -=item * L - -=back - -=cut - -1; \ No newline at end of file diff --git a/lib/Catalyst/Plugin/ConfigLoader/Perl.pm b/lib/Catalyst/Plugin/ConfigLoader/Perl.pm deleted file mode 100644 index e94edba..0000000 --- a/lib/Catalyst/Plugin/ConfigLoader/Perl.pm +++ /dev/null @@ -1,76 +0,0 @@ -package Catalyst::Plugin::ConfigLoader::Perl; - -use strict; -use warnings; - -=head1 NAME - -Catalyst::Plugin::ConfigLoader::Perl - Load Perl config files - -=head1 DESCRIPTION - -Loads Perl files. Example: - - { - name => 'TestApp', - 'Controller::Foo' => { - foo => 'bar' - }, - 'Model::Baz' => { - qux => 'xyzzy' - } - } - -=head1 METHODS - -=head2 extensions( ) - -return an array of valid extensions (C, C). - -=cut - -sub extensions { - return qw( pl perl ); -} - -=head2 load( $file ) - -Attempts to load C<$file> as a Perl file. - -=cut - -sub load { - my $class = shift; - my $file = shift; - - return eval { require $file }; -} - -=head1 AUTHOR - -=over 4 - -=item * Brian Cassidy Ebricas@cpan.orgE - -=back - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006 by Brian Cassidy - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=head1 SEE ALSO - -=over 4 - -=item * L - -=item * L - -=back - -=cut - -1; \ No newline at end of file diff --git a/lib/Catalyst/Plugin/ConfigLoader/XML.pm b/lib/Catalyst/Plugin/ConfigLoader/XML.pm deleted file mode 100644 index f44346c..0000000 --- a/lib/Catalyst/Plugin/ConfigLoader/XML.pm +++ /dev/null @@ -1,82 +0,0 @@ -package Catalyst::Plugin::ConfigLoader::XML; - -use strict; -use warnings; - -=head1 NAME - -Catalyst::Plugin::ConfigLoader::XML - Load XML config files - -=head1 DESCRIPTION - -Loads XML files. Example: - - - TestApp - - bar - - - xyzzy - - - -=head1 METHODS - -=head2 extensions( ) - -return an array of valid extensions (C). - -=cut - -sub extensions { - return qw( xml ); -} - -=head2 load( $file ) - -Attempts to load C<$file> as an XML file. - -=cut - -sub load { - my $class = shift; - my $file = shift; - - require XML::Simple; - XML::Simple->import; - my $config = XMLin( $file, ForceArray => [ qw( component model view controller ) ] ); - - return $config; -} - -=head1 AUTHOR - -=over 4 - -=item * Brian Cassidy Ebricas@cpan.orgE - -=back - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006 by Brian Cassidy - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=head1 SEE ALSO - -=over 4 - -=item * L - -=item * L - -=item * L - -=back - -=cut - -1; \ No newline at end of file diff --git a/lib/Catalyst/Plugin/ConfigLoader/YAML.pm b/lib/Catalyst/Plugin/ConfigLoader/YAML.pm deleted file mode 100644 index f1e6a86..0000000 --- a/lib/Catalyst/Plugin/ConfigLoader/YAML.pm +++ /dev/null @@ -1,88 +0,0 @@ -package Catalyst::Plugin::ConfigLoader::YAML; - -use strict; -use warnings; - -=head1 NAME - -Catalyst::Plugin::ConfigLoader::YAML - Load YAML config files - -=head1 DESCRIPTION - -Loads YAML files. Example: - - --- - name: TestApp - Controller::Foo: - foo: bar - Model::Baz: - qux: xyzzy - - -=head1 METHODS - -=head2 extensions( ) - -return an array of valid extensions (C, C). - -=cut - -sub extensions { - return qw( yml yaml ); -} - -=head2 load( $file ) - -Attempts to load C<$file> as a YAML file. - -=cut - -sub load { - my $class = shift; - my $file = shift; - - eval { require YAML::Syck; }; - if( $@ ) { - require YAML; - return YAML::LoadFile( $file ); - } - else { - open( my $fh, $file ) or die $!; - my $content = do { local $/; <$fh> }; - close $fh; - return YAML::Syck::Load( $content ); - } -} - -=head1 AUTHOR - -=over 4 - -=item * Brian Cassidy Ebricas@cpan.orgE - -=back - -=head1 COPYRIGHT AND LICENSE - -Copyright 2006 by Brian Cassidy - -This library is free software; you can redistribute it and/or modify -it under the same terms as Perl itself. - -=head1 SEE ALSO - -=over 4 - -=item * L - -=item * L - -=item * L - -=item * L - -=back - -=cut - -1; \ No newline at end of file