[Bps-public-commit] rt-extension-rest2 branch, dev, created. c9a53e942ff3641b6b6127a25e55e283bf4d177a

Wallace Reis wreis at bestpractical.com
Fri Jan 16 12:32:49 EST 2015


The branch, dev has been created
        at  c9a53e942ff3641b6b6127a25e55e283bf4d177a (commit)

- Log -----------------------------------------------------------------
commit 5a80160e4b2e3b8f1833dd8ca1296b7d484bc9b2
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Wed Jan 14 19:51:49 2015 -0200

    Add charset info to main doc page

diff --git a/lib/RT/Extension/REST2/Dispatcher.pm b/lib/RT/Extension/REST2/Dispatcher.pm
index 309ad07..d64908f 100644
--- a/lib/RT/Extension/REST2/Dispatcher.pm
+++ b/lib/RT/Extension/REST2/Dispatcher.pm
@@ -11,7 +11,7 @@ sub dispatch_request {
     sub (/) {
         return [
             200,
-            ['Content-Type' => 'text/html'],
+            ['Content-Type' => 'text/html; charset=utf-8'],
             [ podview_as_html('RT::Extension::REST2') ]
         ];
     },

commit 1dfe47a1b3319f1233d0b4604894d69080ae1d0c
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Wed Jan 14 19:51:51 2015 -0200

    Custom Pod View and stylesheet

diff --git a/lib/RT/Extension/REST2/PodViewer.pm b/lib/RT/Extension/REST2/PodViewer.pm
index ab0dcb2..3d96a6f 100644
--- a/lib/RT/Extension/REST2/PodViewer.pm
+++ b/lib/RT/Extension/REST2/PodViewer.pm
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use Module::Path 'module_path';
 use Pod::POM;
-use Pod::POM::View::HTML;
+use RT::Extension::REST2::PodViewer::HTMLView;
 
 use Sub::Exporter -setup => {
     exports => [qw(podview_as_html)]
@@ -13,7 +13,7 @@ use Sub::Exporter -setup => {
 sub podview_as_html {
     my ($module_name) = @_;
     my $pom = Pod::POM->new->parse( module_path($module_name) );
-    return $pom->present('Pod::POM::View::HTML');
+    return $pom->present('RT::Extension::REST2::PodViewer::HTMLView');
 }
 
 1;
diff --git a/lib/RT/Extension/REST2/PodViewer/HTMLView.pm b/lib/RT/Extension/REST2/PodViewer/HTMLView.pm
new file mode 100644
index 0000000..a6fabeb
--- /dev/null
+++ b/lib/RT/Extension/REST2/PodViewer/HTMLView.pm
@@ -0,0 +1,42 @@
+package RT::Extension::REST2::PodViewer::HTMLView;
+
+use strict;
+use warnings;
+use base 'Pod::POM::View::HTML';
+
+sub view_pod {
+    my ($self, $pod) = @_;
+    my $title = q{<title>RT::Extension::REST2</title>};
+    my $style = <<'END_STYLE';
+<style type="text/css">
+body {
+    bgcolor: #ffffff;
+    margin: 0;
+    border: 0 solid #000;
+    padding: 0;
+    padding-top: 0.1px
+}
+h1, h2, h3, h4, h5, h6, p {
+    margin: 15px 10px;
+}
+h1 { font-size: 1.5em }
+h2 { font-size:1.3em }
+h3 { font-size:1.1em }
+h4 { font-size:1.0em }
+h1, h2, h3 { font-weight: bold }
+pre {
+    color: #333333;
+    background-color: #f5f5f5;
+    border: 1px solid #cccccc;
+    padding: 8.5px;
+    margin: 0 0 9px;
+}
+ul { list-style-type: none }
+</style>
+END_STYLE
+    return qq{<html><head>${title}${style}</head><body>\n}
+        . $pod->content->present($self)
+        . "</body></html>\n";
+}
+
+1;

commit c9a53e942ff3641b6b6127a25e55e283bf4d177a
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Thu Jan 15 12:09:02 2015 -0200

    Doc updates

diff --git a/lib/RT/Extension/REST2.pm b/lib/RT/Extension/REST2.pm
index a26e260..3ad1817 100644
--- a/lib/RT/Extension/REST2.pm
+++ b/lib/RT/Extension/REST2.pm
@@ -15,7 +15,7 @@ use RT::Extension::REST2::Dispatcher;
 
 =head1 NAME
 
-RT-Extension-REST2 - Adds a modern REST API to RT under /REST/2.0/
+RT::Extension::REST2 - Adds a modern REST API to RT under /REST/2.0/
 
 =head1 INSTALLATION
 
@@ -43,22 +43,6 @@ Add this line:
 
 =back
 
-=head1 CONFIGURATION
-
-=over
-
-=item C<$RESTPath>
-
-The relative path from C<$WebPath> where you want to have the REST API being
-served.
-
-C<$RESTPath> requires a leading / but no trailing /, or it can be blank.
-
-Defaults to C</REST/2.0>. Thus, if you have C<$WebPath> set to C</rt> then the
-base REST API URI will be like C<https://example.com/rt/REST/2.0>.
-
-=back
-
 =head1 USAGE
 
 =head2 Summary
@@ -256,7 +240,7 @@ This software is Copyright (c) 2015 by Best Practical Solutions, LLC.
 
 This is free software, licensed under:
 
-  The GNU General Public License, Version 2, June 1991
+The GNU General Public License, Version 2, June 1991
 
 =cut
 

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list