Skip to content

Commit

Permalink
rewrite module infomation
Browse files Browse the repository at this point in the history
  • Loading branch information
shelling committed Apr 9, 2009
1 parent 957cb3b commit 9d23548
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 99 deletions.
11 changes: 11 additions & 0 deletions .gitignore
@@ -0,0 +1,11 @@
*~
*.swp
META.yml
Makefile
Makefile.PL
Makefile.old
inc/
blib/
.build
CPAN-MirrorStatus-*/
CPAN-MirrorStatus-*.tar.gz
24 changes: 18 additions & 6 deletions MANIFEST.SKIP
@@ -1,6 +1,18 @@
Changes
Makefile.PL
MANIFEST
README
t/CPAN-MirrorStatus.t
lib/CPAN/MirrorStatus.pm
README.markdown
^dist.ini$
^\.gitignore$
\.cvsignore
\.svn/
\.git/
\bRCS\b
\bCVS\b
%MANIFEST\.
^Makefile$
~$
^#
\.old$
^blib/
^pm_to_blib
^MakeMaker-\d
\.gz$
^tools/
40 changes: 13 additions & 27 deletions README.markdown
@@ -1,40 +1,26 @@
CPAN-MirrorStatus version 0.01
==============================
# CPAN-MirrorStatus

The README is used to introduce the module and provide instructions on
how to install the module, any machine dependencies it may have (for
example C compilers and installed libraries) and any other information
that should be provided before the module is installed.
query mirror sites status from mirrors.cpan.org

A README file is required for CPAN modules since CPAN extracts the
README file from a module distribution so that people browsing the
archive can use it get an idea of the modules uses. It is usually a
good idea to provide version information here so that people can
decide whether fixes for the module are worth downloading.

INSTALLATION
### INSTALLATION

To install this module type the following:

perl Makefile.PL
make
make test
make install

DEPENDENCIES
perl Makefile.PL
make
make test
make install

This module requires these other modules and libraries:
### DEPENDENCIES

blah blah blah
Rubyish::Attribute
self

COPYRIGHT AND LICENCE
### COPYRIGHT AND LICENCE

Put the correct copyright and licence information here.
Copyright (C) 2008 by shelling

Copyright (C) 2008 by 許 家瑋
MIT(X11) Lincence

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.


67 changes: 15 additions & 52 deletions lib/CPAN/MirrorStatus.pm
@@ -1,14 +1,13 @@
package CPAN::MirrorStatus;
# ABSTRACT: query mirrors status from mirrors.cpan.org

use 5.008008;
use 5.010;
use strict;
use warnings;

our $VERSION = '0.01';

use LWP::Simple;
use Rubyish::Attribute;
use selfvars;
use self;

# configurable attributions
# each attribution would be setted in constructor
Expand All @@ -32,74 +31,38 @@ sub new {
}

sub query {
my () = @args;


}

sub render {
my ($format) = @args;
give ($format) {
when ($format eq "widget") { }
when ($format eq "json") { }
default { }
given ($format) {
when ("widget") { render_widget() }
when ("json") { render_json() }
}
}

sub render_json {

1;
__END__
# Below is stub documentation for your module. You'd better edit it!
}

sub render_widget

=head1 NAME

CPAN::MirrorStatus - querying mirrors status from mirrors.cpan.org
1;

=head1 SYNOPSIS
use CPAN::MirrorStatus;
$q = CPAN::MirrorStatus->new;
$q->target("cpan.nctu.edu.tw"); #=> set query target as cpan.nctu.edu.tw
$q->st_of("cpan.nctu.edu.tw"); #=> which mirror status do you want to know
$q->query;
$q->render("json"); #=> output json
$q->render("widget"); #=> output javascript
$q->render("widget"); #=> output javascript widget
=head1 DESCRIPTION
Stub documentation for CPAN::MirrorStatus, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.
Blah blah blah.
=head2 EXPORT
None by default.
=head1 SEE ALSO
Mention other useful documentation such as the documentation of
related modules or operating system documentation (such as man pages
in UNIX), or any relevant external documentation such as RFCs or
standards.
If you have a mailing list set up for your module, mention it here.
If you have a web site set up for your module, mention it here.
=head1 AUTHOR
許 家瑋, E<lt>shelling@apple.comE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2008 by 許 家瑋
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.8 or,
at your option, any later version of Perl 5 you may have available.
=cut

17 changes: 3 additions & 14 deletions t/00-load.t
@@ -1,15 +1,4 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl CPAN-MirrorStatus.t'

#########################

# change 'tests => 1' to 'tests => last_test_to_print';

use Test::More tests => 1;
use lib qw(lib t/lib);
use Test::More tests => 2;
BEGIN { use_ok('CPAN::MirrorStatus') };

#########################

# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.

require_ok("CPAN::MirrorStatus");

0 comments on commit 9d23548

Please sign in to comment.