[Bps-public-commit] rt-extension-localdateheader branch, master, updated. b5be0b970696a60fefd4de15a3ee516101f221bd

Kevin Falcone falcone at bestpractical.com
Mon Jan 6 18:22:07 EST 2014


The branch, master has been updated
       via  b5be0b970696a60fefd4de15a3ee516101f221bd (commit)
       via  1513aa92aa5f04d97e546bb7de488f328d76e261 (commit)
       via  6077ff501546aa9ddf3846c027a6c0f6c4f3d35d (commit)
       via  5b530e54280c5a3f240f1f7abf16bef10590bcdb (commit)
       via  f5679b4adb25c264ba51255eb0c8d08300f63e2c (commit)
      from  adaa082e86383e1d4c34c92af4cede44bc657a82 (commit)

Summary of changes:
 Changes                                            |  7 ++++
 MANIFEST                                           |  3 ++
 META.yml                                           |  3 +-
 README                                             | 18 +++++++-
 .../Elements/ShowMessageHeaders/BeforeLocalization |  1 +
 inc/Module/Install/RTx.pm                          | 48 ++++++++--------------
 inc/Module/Install/ReadmeFromPod.pm                |  2 +-
 lib/RT/Extension/LocalDateHeader.pm                | 22 ++++++++--
 xt/99changes.t                                     |  4 ++
 9 files changed, 71 insertions(+), 37 deletions(-)
 create mode 100644 Changes
 create mode 100644 html/Callbacks/LocalDateHeader/Elements/ShowMessageHeaders/BeforeLocalization
 create mode 100644 xt/99changes.t

- Log -----------------------------------------------------------------
commit f5679b4adb25c264ba51255eb0c8d08300f63e2c
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Jan 6 16:22:50 2014 -0500

    4.2 compatibility (we moved ShowMessageHeaders)

diff --git a/MANIFEST b/MANIFEST
index 1b4c6da..0eb546c 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,5 @@
 etc/callback_before_localization.diff
+html/Callbacks/LocalDateHeader/Elements/ShowMessageHeaders/BeforeLocalization
 html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
 inc/Module/Install.pm
 inc/Module/Install/Base.pm
diff --git a/html/Callbacks/LocalDateHeader/Elements/ShowMessageHeaders/BeforeLocalization b/html/Callbacks/LocalDateHeader/Elements/ShowMessageHeaders/BeforeLocalization
new file mode 100644
index 0000000..02b10a4
--- /dev/null
+++ b/html/Callbacks/LocalDateHeader/Elements/ShowMessageHeaders/BeforeLocalization
@@ -0,0 +1 @@
+<& /Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization,     %ARGS &>

commit 5b530e54280c5a3f240f1f7abf16bef10590bcdb
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Jan 6 16:25:14 2014 -0500

    Upgrade Module::Install::RTx and ReadmeFromPod

diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 73b9cda..ac04c79 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,13 +8,13 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.29';
+our $VERSION = '0.32';
 
 use FindBin;
 use File::Glob     ();
 use File::Basename ();
 
-my @DIRS = qw(etc lib html bin sbin po var);
+my @DIRS = qw(etc lib html static bin sbin po var);
 my @INDEX_DIRS = qw(lib bin sbin);
 
 sub RTx {
@@ -62,10 +62,11 @@ sub RTx {
     unshift @INC, "$RT::LocalPath/lib" if $RT::LocalPath;
     unshift @INC, $lib_path;
 
-    $RT::LocalVarPath  ||= $RT::VarPath;
-    $RT::LocalPoPath   ||= $RT::LocalLexiconPath;
-    $RT::LocalHtmlPath ||= $RT::MasonComponentRoot;
-    $RT::LocalLibPath  ||= "$RT::LocalPath/lib";
+    $RT::LocalVarPath    ||= $RT::VarPath;
+    $RT::LocalPoPath     ||= $RT::LocalLexiconPath;
+    $RT::LocalHtmlPath   ||= $RT::MasonComponentRoot;
+    $RT::LocalStaticPath ||= $RT::StaticPath;
+    $RT::LocalLibPath    ||= "$RT::LocalPath/lib";
 
     my $with_subdirs = $ENV{WITH_SUBDIRS};
     @ARGV = grep { /WITH_SUBDIRS=(.*)/ ? ( ( $with_subdirs = $1 ), 0 ) : 1 }
@@ -129,23 +130,13 @@ install ::
 
     my %has_etc;
     if ( File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*") ) {
-
-        # got schema, load factory module
         $has_etc{schema}++;
-        $self->load('RTxFactory');
-        $self->postamble(<< ".");
-factory ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
-
-dropdb ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
-
-.
     }
     if ( File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*") ) {
         $has_etc{acl}++;
     }
     if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
+    if ( -d 'etc/upgrade/' )    { $has_etc{upgrade}++; }
 
     $self->postamble("$postamble\n");
     unless ( $subdirs{'lib'} ) {
@@ -164,28 +155,25 @@ dropdb ::
         print "For first-time installation, type 'make initdb'.\n";
         my $initdb = '';
         $initdb .= <<"." if $has_etc{schema};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema \$(NAME) \$(VERSION)))"
 .
         $initdb .= <<"." if $has_etc{acl};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl \$(NAME) \$(VERSION)))"
 .
         $initdb .= <<"." if $has_etc{initialdata};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert \$(NAME) \$(VERSION)))"
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");
+        if ($has_etc{upgrade}) {
+            print "To upgrade from a previous version of this extension, use 'make upgrade-database'\n";
+            my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
+            $self->postamble("upgrade-database ::\n$upgradedb\n");
+            $self->postamble("upgradedb ::\n$upgradedb\n");
+        }
     }
 }
 
-sub RTxInit {
-    unshift @INC, substr( delete( $INC{'RT.pm'} ), 0, -5 ) if $INC{'RT.pm'};
-    require RT;
-    RT::LoadConfig();
-    RT::ConnectToDatabase();
-
-    die "Cannot load RT" unless $RT::Handle and $RT::DatabaseType;
-}
-
 # stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
 { my %word = (
     a     => -4,
@@ -228,4 +216,4 @@ sub requires_rt {
 
 __END__
 
-#line 348
+#line 336
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index fb7075f..b5e03c3 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,7 +7,7 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.18';
+$VERSION = '0.22';
 
 sub readme_from {
   my $self = shift;

commit 6077ff501546aa9ddf3846c027a6c0f6c4f3d35d
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Jan 6 18:06:15 2014 -0500

    Update documentation for 4.2 Plugin and with a better Description

diff --git a/README b/README
index 55eb3fa..410d810 100644
--- a/README
+++ b/README
@@ -2,6 +2,16 @@ NAME
     RT-Extension-LocalDateHeader - Display local date for attachment Date
     header
 
+DESCRIPTION
+    The Date: header included in emails received by RT will often be in the
+    sender's timezone (or possibly force to UTC by the remove mail server).
+    This extension will rewrite the Date: header to the user's timezone
+    while also displaying the original Date: next to it.
+
+VERSION
+    Compatible with RT 4.0 and 4.2. Versions earlier than 4.0.8 will need to
+    patch as instructed below. Untested on 3.8.
+
 INSTALLATION
     perl Makefile.PL
     make
@@ -9,7 +19,11 @@ INSTALLATION
         May need root permissions
 
     Edit your /opt/rt4/etc/RT_SiteConfig.pm
-        Add this line:
+        If you are using RT 4.2 or later, add this line:
+
+            Plugin('RT::Extension::LocalDateHeader');
+
+        For earlier releases of RT 4, add this line:
 
             Set(@Plugins, qw(RT::Extension::LocalDateHeader));
 
@@ -30,7 +44,7 @@ AUTHOR
     sunnavy <sunnavy at bestpractical.com>
 
 LICENSE AND COPYRIGHT
-    Copyright 2012 Best Practical Solutions, LLC.
+    Copyright 2012-2014 Best Practical Solutions, LLC.
 
     This is free software, licensed under:
 
diff --git a/lib/RT/Extension/LocalDateHeader.pm b/lib/RT/Extension/LocalDateHeader.pm
index 27fc26e..c0143b0 100644
--- a/lib/RT/Extension/LocalDateHeader.pm
+++ b/lib/RT/Extension/LocalDateHeader.pm
@@ -8,6 +8,18 @@ our $VERSION = '0.01';
 
 RT-Extension-LocalDateHeader - Display local date for attachment Date header
 
+=head1 DESCRIPTION
+
+The Date: header included in emails received by RT will often be in the
+sender's timezone (or possibly force to UTC by the remove mail server).
+This extension will rewrite the Date: header to the user's timezone
+while also displaying the original Date: next to it.
+
+=head1 VERSION
+
+Compatible with RT 4.0 and 4.2.  Versions earlier than 4.0.8 will need to
+patch as instructed below.  Untested on 3.8.
+
 =head1 INSTALLATION 
 
 =over
@@ -22,7 +34,11 @@ May need root permissions
 
 =item Edit your /opt/rt4/etc/RT_SiteConfig.pm
 
-Add this line:
+If you are using RT 4.2 or later, add this line:
+
+    Plugin('RT::Extension::LocalDateHeader');
+
+For earlier releases of RT 4, add this line:
 
     Set(@Plugins, qw(RT::Extension::LocalDateHeader));
 
@@ -48,7 +64,7 @@ sunnavy <sunnavy at bestpractical.com>
 
 =head1 LICENSE AND COPYRIGHT
 
-Copyright 2012 Best Practical Solutions, LLC.
+Copyright 2012-2014 Best Practical Solutions, LLC.
 
 This is free software, licensed under:
 

commit 1513aa92aa5f04d97e546bb7de488f328d76e261
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Jan 6 18:06:56 2014 -0500

    Add a Changes file
    
    Test to make sure we keep it up to date

diff --git a/Changes b/Changes
new file mode 100644
index 0000000..9dad9ce
--- /dev/null
+++ b/Changes
@@ -0,0 +1,7 @@
+Revision history for RT-Extension-LocalDateHeader
+
+0.02 2014-01-06
+ - Compatibility with 4.2 
+
+0.01 Not Released
+ - Initial version
diff --git a/MANIFEST b/MANIFEST
index 0eb546c..2b32ac5 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,3 +1,4 @@
+Changes
 etc/callback_before_localization.diff
 html/Callbacks/LocalDateHeader/Elements/ShowMessageHeaders/BeforeLocalization
 html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
@@ -16,3 +17,4 @@ Makefile.PL
 MANIFEST			This list of files
 META.yml
 README
+xt/99changes.t
diff --git a/META.yml b/META.yml
index 4bfc807..1a49d63 100644
--- a/META.yml
+++ b/META.yml
@@ -19,6 +19,7 @@ no_index:
     - etc
     - html
     - inc
+    - xt
 resources:
   license: http://opensource.org/licenses/gpl-license.php
 version: 0.01
diff --git a/xt/99changes.t b/xt/99changes.t
new file mode 100644
index 0000000..a9831b3
--- /dev/null
+++ b/xt/99changes.t
@@ -0,0 +1,4 @@
+use Test::More;
+eval 'use Test::CPAN::Changes';
+plan skip_all => 'Test::CPAN::Changes required for this test' if $@;
+changes_ok();

commit b5be0b970696a60fefd4de15a3ee516101f221bd
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Jan 6 18:12:27 2014 -0500

    Bump version

diff --git a/META.yml b/META.yml
index 1a49d63..8ea611e 100644
--- a/META.yml
+++ b/META.yml
@@ -22,4 +22,4 @@ no_index:
     - xt
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: 0.01
+version: 0.02
diff --git a/lib/RT/Extension/LocalDateHeader.pm b/lib/RT/Extension/LocalDateHeader.pm
index c0143b0..4482b76 100644
--- a/lib/RT/Extension/LocalDateHeader.pm
+++ b/lib/RT/Extension/LocalDateHeader.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 package RT::Extension::LocalDateHeader;
 
-our $VERSION = '0.01';
+our $VERSION = '0.02';
 
 =head1 NAME
 

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



More information about the Bps-public-commit mailing list