Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #455 from tudorconstantin/generate_valid_README_md

Generate valid README.md
  • Loading branch information...
commit 80f1fac4eff8c59a2b3605813a33a6d22aa18637 2 parents d6942d7 + 535fc6d
@gugod authored
View
2  Makefile.PL
@@ -12,8 +12,10 @@ requires
'Devel::PatchPerl' => '1.28',
'Pod::Parser' => '1.62',
'Pod::Usage' => '1.64',
+ 'Pod::Markdown' => '2.002';
'local::lib' => '2.000014';
+
test_requires
'ExtUtils::MakeMaker' => '6.86',
'File::Temp' => '0.2304',
View
16 README
@@ -11,16 +11,17 @@ Description:
You then can benefit from not having to run 'sudo' commands to install
cpan modules because those are installed inside your HOME too.
- For the documentation of perlbrew usage see perlbrew command on CPAN, or
- by running "perlbrew help". The following documentation features the API
- of "App::perlbrew" module, and may not be remotely close to what your
- want to read.
+ For the documentation of perlbrew usage see perlbrew command on MetaCPAN
+ <https://metacpan.org/>, or by running "perlbrew help", or by visiting
+ perlbrew's official website <http://perlbrew.pl/>. The following
+ documentation features the API of "App::perlbrew" module, and may not be
+ remotely close to what your want to read.
Installation:
It is the simplest to use the perlbrew installer, just paste this
statement to your terminal:
- curl -kL http://install.perlbrew.pl | bash
+ curl -L http://install.perlbrew.pl | bash
Or this one, if you have "fetch" (default on FreeBSD):
@@ -45,7 +46,7 @@ Installation:
before running the installer:
export PERLBREW_ROOT=/opt/perl5
- curl -kL http://install.perlbrew.pl | bash
+ curl -L http://install.perlbrew.pl | bash
As a result, different users on the same machine can all share the same
perlbrew root directory (although only original user that made the
@@ -159,7 +160,8 @@ Author:
Kang-min Liu "<gugod@gugod.org>"
Copyright:
- Copyright (c) 2010,2011,2012,2013,2014 Kang-min Liu "<gugod@gugod.org>".
+ Copyright (c) 2010,2011,2012,2013,2014,2015 Kang-min Liu
+ "<gugod@gugod.org>".
Disclaimer of Warranty:
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
View
174 README.md
@@ -0,0 +1,174 @@
+# NAME
+
+[App::perlbrew](https://metacpan.org/pod/App::perlbrew) - Manage perl installations in your `$HOME`
+
+# SYNOPSIS
+
+ # Installation
+ curl -L http://install.perlbrew.pl | bash
+
+ # Initialize
+ perlbrew init
+
+ # Pick a preferred CPAN mirror
+ perlbrew mirror
+
+ # See what is available
+ perlbrew available
+
+ # Install some Perls
+ perlbrew install 5.18.2
+ perlbrew install perl-5.8.1
+ perlbrew install perl-5.19.9
+
+ # See what were installed
+ perlbrew list
+
+ # Swith to an installation and set it as default
+ perlbrew switch perl-5.18.2
+
+ # Temporarily use another version only in current shell.
+ perlbrew use perl-5.8.1
+ perl -v
+
+ # Or turn it off completely. Useful when you messed up too deep.
+ # Or want to go back to the system Perl.
+ perlbrew off
+
+ # Use 'switch' command to turn it back on.
+ perlbrew switch perl-5.12.2
+
+ # Exec something with all perlbrew-ed perls
+ perlbrew exec -- perl -E 'say $]'
+
+# DESCRIPTION
+
+[perlbrew](https://metacpan.org/pod/perlbrew) is a program to automate the building and installation of perl in an
+easy way. It provides multiple isolated perl environments, and a mechanism
+for you to switch between them.
+
+Everything are installed unter `~/perl5/perlbrew`. You then need to include a
+bashrc/cshrc provided by perlbrew to tweak the PATH for you. You then can
+benefit from not having to run 'sudo' commands to install
+cpan modules because those are installed inside your HOME too.
+
+For the documentation of perlbrew usage see [perlbrew](https://metacpan.org/pod/perlbrew) command
+on [MetaCPAN](https://metacpan.org/), or by running `perlbrew help`,
+or by visiting [perlbrew's official website](http://perlbrew.pl/). The following documentation
+features the API of `App::perlbrew` module, and may not be remotely
+close to what your want to read.
+
+# INSTALLATION
+
+It is the simplest to use the perlbrew installer, just paste this statement to
+your terminal:
+
+ curl -L http://install.perlbrew.pl | bash
+
+Or this one, if you have `fetch` (default on FreeBSD):
+
+ fetch -o- http://install.perlbrew.pl | sh
+
+After that, `perlbrew` installs itself to `~/perl5/perlbrew/bin`, and you
+should follow the instruction on screen to modify your shell rc file to put it
+in your PATH.
+
+The installed perlbrew command is a standalone executable that can be run with
+system perl. The minimum system perl version requirement is 5.8.0, which should
+be good enough for most of the OSes these days.
+
+A fat-packed version of `patchperl` is also installed to
+`~/perl5/perlbrew/bin`, which is required to build old perls.
+
+The directory `~/perl5/perlbrew` will contain all install perl executables,
+libraries, documentations, lib, site\_libs. In the documentation, that directory
+is referred as "perlbrew root". If you need to set it to somewhere else because,
+say, your HOME has limited quota, you can do that by setting `PERLBREW_ROOT`
+environment variable before running the installer:
+
+ export PERLBREW_ROOT=/opt/perl5
+ curl -L http://install.perlbrew.pl | bash
+
+As a result, different users on the same machine can all share the same perlbrew
+root directory (although only original user that made the installation would
+have the permission to perform perl installations.)
+
+You may also install perlbrew from CPAN:
+
+ cpan App::perlbrew
+
+In this case, the perlbrew command is installed as `/usr/bin/perlbrew` or
+`/usr/local/bin/perlbrew` or others, depending on the location of your system
+perl installation.
+
+Please make sure not to run this with one of the perls brewed with
+perlbrew. It's the best to turn perlbrew off before you run that, if you're
+upgrading.
+
+ perlbrew off
+ cpan App::perlbrew
+
+You should always use system cpan (like /usr/bin/cpan) to install
+`App::perlbrew` because it will be installed under a system PATH like
+`/usr/bin`, which is not affected by perlbrew `switch` or `use` command.
+
+The `self-upgrade` command will not upgrade the perlbrew installed by cpan
+command, but it is also easy to upgrade perlbrew by running \`cpan App::perlbrew\`
+again.
+
+# METHODS
+
+- (Str) current\_perl
+
+ Return the "current perl" object attribute string, or, if absent, the value of
+ PERLBREW\_PERL environment variable.
+
+- (Str) current\_perl (Str)
+
+ Set the "current\_perl" object attribute to the given value.
+
+# PROJECT DEVELOPMENT
+
+perlbrew project uses github
+[http://github.com/gugod/App-perlbrew/issues](http://github.com/gugod/App-perlbrew/issues) and RT
+<https://rt.cpan.org/Dist/Display.html?Queue=App-perlbrew> for issue
+tracking. Issues sent to these two systems will eventually be reviewed
+and handled.
+
+See [https://github.com/gugod/App-perlbrew/contributors](https://github.com/gugod/App-perlbrew/contributors) for a list
+of project contributors.
+
+# AUTHOR
+
+Kang-min Liu `<gugod@gugod.org>`
+
+# COPYRIGHT
+
+Copyright (c) 2010,2011,2012,2013,2014,2015 Kang-min Liu `<gugod@gugod.org>`.
+
+# LICENCE
+
+The MIT License
+
+# DISCLAIMER OF WARRANTY
+
+BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
+YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR, OR CORRECTION.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
+LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
View
23 dev-bin/generate-readme.pl
@@ -5,10 +5,12 @@
use Cwd qw(realpath);
use File::Spec::Functions;
use Pod::Usage;
+use Pod::Markdown;
my $perlbrew_pm = realpath catfile($FindBin::Bin, "..", "lib", "App", "perlbrew.pm");
my $perlbrew_pl = realpath catfile($FindBin::Bin, "..", "bin", "perlbrew");
my $readme = realpath catfile($FindBin::Bin, "..", "README");
+my $readme_md = realpath catfile($FindBin::Bin, "..", "README.md");
my $out = "";
open my $fh, ">", \$out;
@@ -40,8 +42,25 @@
-noperldoc => 1
);
+close $fh;
+
open(my $readme_fh, ">", $readme) or die "Failed to open $readme";
-print $readme_fh $out;
+ print $readme_fh $out;
+
+close $readme_fh;
+
+print "Generated README.\n";
+
+my $parser = Pod::Markdown->new( perldoc_url_prefix => 'metacpan' );
+
+open my $in_file, "<", $perlbrew_pm or die "Failed to open '$perlbrew_pm': $!\n";
+open my $out_file, ">", $readme_md or die "Failed to open '$perlbrew_pm': $!\n";
+
+$parser->output_fh($out_file);
+$parser->parse_file($in_file);
+
+close $out_file;
+close $in_file;
-print "Done.\n";
+print "Generated README.md.\n";
View
41 lib/App/perlbrew.pm
@@ -2015,7 +2015,7 @@ sub run_command_exec {
if ($opts{with}) {
my %installed = map { $_->{name} => $_ } map { ($_, @{$_->{libs}}) } $self->installed_perls;
- my $d = ($opts{with} =~ / /) ? qr( +) : qr(,+);
+ my $d = ($opts{with} =~ m/ /) ? qr( +) : qr(,+);
my @with = grep { $_ } map {
my ($p,$l) = $self->resolve_installation_name($_);
$p .= "\@$l" if $l;
@@ -2903,9 +2903,9 @@ __END__
=head1 NAME
-App::perlbrew - Manage perl installations in your $HOME
+L<App::perlbrew> - Manage perl installations in your C<$HOME>
-=head1 SYNOPSIS
+=head2 SYNOPSIS
# Installation
curl -L http://install.perlbrew.pl | bash
@@ -2944,23 +2944,24 @@ App::perlbrew - Manage perl installations in your $HOME
# Exec something with all perlbrew-ed perls
perlbrew exec -- perl -E 'say $]'
-=head1 DESCRIPTION
+=head2 DESCRIPTION
-perlbrew is a program to automate the building and installation of perl in an
+L<perlbrew> is a program to automate the building and installation of perl in an
easy way. It provides multiple isolated perl environments, and a mechanism
for you to switch between them.
Everything are installed unter C<~/perl5/perlbrew>. You then need to include a
bashrc/cshrc provided by perlbrew to tweak the PATH for you. You then can
-benefit from not having to run 'sudo' commands to install
-cpan modules because those are installed inside your HOME too.
+benefit from not having to run C<sudo> commands to install
+cpan modules because those are installed inside your C<HOME> too.
For the documentation of perlbrew usage see L<perlbrew> command
-on CPAN, or by running C<perlbrew help>. The following documentation
+on L<MetaCPAN|https://metacpan.org/>, or by running C<perlbrew help>,
+or by visiting L<perlbrew's official website|http://perlbrew.pl/>. The following documentation
features the API of C<App::perlbrew> module, and may not be remotely
close to what your want to read.
-=head1 INSTALLATION
+=head2 INSTALLATION
It is the simplest to use the perlbrew installer, just paste this statement to
your terminal:
@@ -2979,13 +2980,13 @@ The installed perlbrew command is a standalone executable that can be run with
system perl. The minimum system perl version requirement is 5.8.0, which should
be good enough for most of the OSes these days.
-A fat-packed version of C<patchperl> is also installed to
+A fat-packed version of L<patchperl> is also installed to
C<~/perl5/perlbrew/bin>, which is required to build old perls.
The directory C<~/perl5/perlbrew> will contain all install perl executables,
libraries, documentations, lib, site_libs. In the documentation, that directory
-is referred as "perlbrew root". If you need to set it to somewhere else because,
-say, your HOME has limited quota, you can do that by setting C<PERLBREW_ROOT>
+is referred as C<perlbrew root>. If you need to set it to somewhere else because,
+say, your C<HOME> has limited quota, you can do that by setting C<PERLBREW_ROOT>
environment variable before running the installer:
export PERLBREW_ROOT=/opt/perl5
@@ -3015,27 +3016,27 @@ C<App::perlbrew> because it will be installed under a system PATH like
C</usr/bin>, which is not affected by perlbrew C<switch> or C<use> command.
The C<self-upgrade> command will not upgrade the perlbrew installed by cpan
-command, but it is also easy to upgrade perlbrew by running `cpan App::perlbrew`
+command, but it is also easy to upgrade perlbrew by running C<cpan App::perlbrew>
again.
-=head1 METHODS
+=head2 METHODS
=over 4
=item (Str) current_perl
Return the "current perl" object attribute string, or, if absent, the value of
-PERLBREW_PERL environment variable.
+C<PERLBREW_PERL> environment variable.
=item (Str) current_perl (Str)
-Set the "current_perl" object attribute to the given value.
+Set the C<current_perl> object attribute to the given value.
=back
-=head1 PROJECT DEVELOPMENT
+=head2 PROJECT DEVELOPMENT
-perlbrew project uses github
+L<perlbrew project|http://perlbrew.pl/> uses github
L<http://github.com/gugod/App-perlbrew/issues> and RT
<https://rt.cpan.org/Dist/Display.html?Queue=App-perlbrew> for issue
tracking. Issues sent to these two systems will eventually be reviewed
@@ -3052,11 +3053,11 @@ Kang-min Liu C<< <gugod@gugod.org> >>
Copyright (c) 2010,2011,2012,2013,2014,2015 Kang-min Liu C<< <gugod@gugod.org> >>.
-=head1 LICENCE
+=head3 LICENCE
The MIT License
-=head1 DISCLAIMER OF WARRANTY
+=head2 DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
Please sign in to comment.
Something went wrong with that request. Please try again.