[Bps-public-commit] RT-Authen-PAUSE branch, master, updated. 3e8b38102283a58c27b4e37e38533dde53efc708
Thomas Sibley
trs at bestpractical.com
Fri Feb 22 20:37:24 EST 2013
The branch, master has been updated
via 3e8b38102283a58c27b4e37e38533dde53efc708 (commit)
from 719dd8128c8ca7db65909ef9d7a38357b7991a1f (commit)
Summary of changes:
META.yml | 6 +-
Makefile.PL | 3 +-
README | 19 +++++
inc/Module/Install/ReadmeFromPod.pm | 138 ++++++++++++++++++++++++++++++++++++
lib/RT/Authen/PAUSE.pm | 21 +++---
5 files changed, 170 insertions(+), 17 deletions(-)
create mode 100644 README
create mode 100644 inc/Module/Install/ReadmeFromPod.pm
- Log -----------------------------------------------------------------
commit 3e8b38102283a58c27b4e37e38533dde53efc708
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Feb 22 17:37:14 2013 -0800
Update documentation
diff --git a/META.yml b/META.yml
index 4f0d272..a3fba3f 100644
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
---
abstract: 'Allows RT to do authentication via PAUSE (pause.perl.org)'
author:
- - 'Best Practical Solutions, LLC.'
+ - '-2013 Best Practical Solutions, LLC.'
- 'Thomas Sibley <trs at bestpractical.com>'
build_requires:
ExtUtils::MakeMaker: 6.36
@@ -10,7 +10,7 @@ configure_requires:
distribution_type: module
dynamic_config: 1
generated_by: 'Module::Install version 1.06'
-license: gpl
+license: gplv2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
@@ -23,4 +23,4 @@ requires:
LWP::UserAgent: 0
resources:
license: http://opensource.org/licenses/gpl-license.php
-version: 0.03
+version: 0.10
diff --git a/Makefile.PL b/Makefile.PL
index fd68d0f..7234de0 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,7 +6,8 @@ name ('RT-Authen-PAUSE');
abstract ('Allows RT to do authentication via PAUSE (pause.perl.org)');
author ('Thomas Sibley <trs at bestpractical.com>');
version_from ('lib/RT/Authen/PAUSE.pm');
-license ('GPL version 2');
+license ('GPLv2');
+readme_from ('lib/RT/Authen/PAUSE.pm');
requires ('LWP::UserAgent');
diff --git a/README b/README
new file mode 100644
index 0000000..fa4baf7
--- /dev/null
+++ b/README
@@ -0,0 +1,19 @@
+NAME
+ RT::Authen::PAUSE - authenticate RT users against PAUSE
+
+DESCRIPTION
+ This RT extension allows people to login into RT using their CPAN ID and
+ passwords by proxing requests to PAUSE. This extension doesn't import
+ user entries from CPAN or other Perl related sources, so you have to do
+ it yourself.
+
+ People still can change their passwords in RT, if they have the
+ ModifySelf right. They will be able to use the new password in RT,
+ however we don't push changes back to PAUSE.
+
+COPYRIGHT
+ This extension is Copyright (C) 2005-2013 Best Practical Solutions, LLC.
+
+ It is freely redistributable under the terms of version 2 of the GNU
+ GPL.
+
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
new file mode 100644
index 0000000..6a80818
--- /dev/null
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -0,0 +1,138 @@
+#line 1
+package Module::Install::ReadmeFromPod;
+
+use 5.006;
+use strict;
+use warnings;
+use base qw(Module::Install::Base);
+use vars qw($VERSION);
+
+$VERSION = '0.20';
+
+sub readme_from {
+ my $self = shift;
+ return unless $self->is_admin;
+
+ # Input file
+ my $in_file = shift || $self->_all_from
+ or die "Can't determine file to make readme_from";
+
+ # Get optional arguments
+ my ($clean, $format, $out_file, $options);
+ my $args = shift;
+ if ( ref $args ) {
+ # Arguments are in a hashref
+ if ( ref($args) ne 'HASH' ) {
+ die "Expected a hashref but got a ".ref($args)."\n";
+ } else {
+ $clean = $args->{'clean'};
+ $format = $args->{'format'};
+ $out_file = $args->{'output_file'};
+ $options = $args->{'options'};
+ }
+ } else {
+ # Arguments are in a list
+ $clean = $args;
+ $format = shift;
+ $out_file = shift;
+ $options = \@_;
+ }
+
+ # Default values;
+ $clean ||= 0;
+ $format ||= 'txt';
+
+ # Generate README
+ print "readme_from $in_file to $format\n";
+ if ($format =~ m/te?xt/) {
+ $out_file = $self->_readme_txt($in_file, $out_file, $options);
+ } elsif ($format =~ m/html?/) {
+ $out_file = $self->_readme_htm($in_file, $out_file, $options);
+ } elsif ($format eq 'man') {
+ $out_file = $self->_readme_man($in_file, $out_file, $options);
+ } elsif ($format eq 'pdf') {
+ $out_file = $self->_readme_pdf($in_file, $out_file, $options);
+ }
+
+ if ($clean) {
+ $self->clean_files($out_file);
+ }
+
+ return 1;
+}
+
+
+sub _readme_txt {
+ my ($self, $in_file, $out_file, $options) = @_;
+ $out_file ||= 'README';
+ require Pod::Text;
+ my $parser = Pod::Text->new( @$options );
+ open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
+ $parser->output_fh( *$out_fh );
+ $parser->parse_file( $in_file );
+ close $out_fh;
+ return $out_file;
+}
+
+
+sub _readme_htm {
+ my ($self, $in_file, $out_file, $options) = @_;
+ $out_file ||= 'README.htm';
+ require Pod::Html;
+ Pod::Html::pod2html(
+ "--infile=$in_file",
+ "--outfile=$out_file",
+ @$options,
+ );
+ # Remove temporary files if needed
+ for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') {
+ if (-e $file) {
+ unlink $file or warn "Warning: Could not remove file '$file'.\n$!\n";
+ }
+ }
+ return $out_file;
+}
+
+
+sub _readme_man {
+ my ($self, $in_file, $out_file, $options) = @_;
+ $out_file ||= 'README.1';
+ require Pod::Man;
+ my $parser = Pod::Man->new( @$options );
+ $parser->parse_from_file($in_file, $out_file);
+ return $out_file;
+}
+
+
+sub _readme_pdf {
+ my ($self, $in_file, $out_file, $options) = @_;
+ $out_file ||= 'README.pdf';
+ eval { require App::pod2pdf; }
+ or die "Could not generate $out_file because pod2pdf could not be found\n";
+ my $parser = App::pod2pdf->new( @$options );
+ $parser->parse_from_file($in_file);
+ open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
+ select $out_fh;
+ $parser->output;
+ select STDOUT;
+ close $out_fh;
+ return $out_file;
+}
+
+
+sub _all_from {
+ my $self = shift;
+ return unless $self->admin->{extensions};
+ my ($metadata) = grep {
+ ref($_) eq 'Module::Install::Metadata';
+ } @{$self->admin->{extensions}};
+ return unless $metadata;
+ return $metadata->{values}{all_from} || '';
+}
+
+'Readme!';
+
+__END__
+
+#line 254
+
diff --git a/lib/RT/Authen/PAUSE.pm b/lib/RT/Authen/PAUSE.pm
index 643eddd..d6f5d10 100644
--- a/lib/RT/Authen/PAUSE.pm
+++ b/lib/RT/Authen/PAUSE.pm
@@ -4,30 +4,25 @@ RT::Authen::PAUSE - authenticate RT users against PAUSE
=head1 DESCRIPTION
-RT's extension that allows people to login into RT using their
-CPANID and passwords. This extension doesn't import user entries
-from CPAN or other perl related sources, so you have to do it
-yourself.
+This RT extension allows people to login into RT using their CPAN ID and
+passwords by proxing requests to PAUSE. This extension doesn't import user
+entries from CPAN or other Perl related sources, so you have to do it yourself.
-To avoid constant requests to the PAUSE service we update user's
-password in RT's DB on successful login, so next time we can avoid
-this step.
-
-People still can change thier passwords in RT, only if they have enough
-rights to do that. That will work and they will be able to use new
-passwords in RT, however we don't push changes back to PAUSE.
+People still can change their passwords in RT, if they have the ModifySelf
+right. They will be able to use the new password in RT, however we don't push
+changes back to PAUSE.
=cut
package RT::Authen::PAUSE;
-our $VERSION = '0.03';
+our $VERSION = '0.10';
1;
=head1 COPYRIGHT
-This extension is Copyright (C) 2005 Best Practical Solutions, LLC.
+This extension is Copyright (C) 2005-2013 Best Practical Solutions, LLC.
It is freely redistributable under the terms of version 2 of the GNU GPL.
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list