[Bps-public-commit] rt-extension-localdateheader branch, master, updated. 0.02-5-ga1bfca7
Kevin Falcone
falcone at bestpractical.com
Thu Mar 13 20:11:43 EDT 2014
The branch, master has been updated
via a1bfca7b9473b84ca0d4cd6a39787cfca33c495c (commit)
via d376fe030b9b87dc803ce0e11087fc4a7721f7fa (commit)
via 35d9c151a673ce693be12dbcf84c78151da5d0f6 (commit)
via 85bbbbe5da78a37315b9c9074bf682a349dc5067 (commit)
via a3230d72f62d0c30096bb9821049048a0116302d (commit)
from b5be0b970696a60fefd4de15a3ee516101f221bd (commit)
Summary of changes:
Changes | 3 ++
MANIFEST | 2 ++
META.yml | 2 +-
README | 8 +++--
doc/images/extension.png | Bin 0 -> 57554 bytes
doc/images/noextension.png | Bin 0 -> 50469 bytes
inc/Module/Install/RTx.pm | 64 ++++++++++++++++++++----------------
lib/RT/Extension/LocalDateHeader.pm | 12 +++++--
xt/99changes.t | 5 ++-
9 files changed, 60 insertions(+), 36 deletions(-)
create mode 100644 doc/images/extension.png
create mode 100644 doc/images/noextension.png
- Log -----------------------------------------------------------------
commit a3230d72f62d0c30096bb9821049048a0116302d
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Mar 13 11:46:39 2014 -0400
Failing test if VERSION bumps but not Changes
This does require you to run make test before shipping (make upload does
this, but it all depends on your release methodology).
It'll also complain if you screw up the syntax of Changes.
Not convinced that this is the true way forward, but it's worth testing.
diff --git a/xt/99changes.t b/xt/99changes.t
index a9831b3..ae12213 100644
--- a/xt/99changes.t
+++ b/xt/99changes.t
@@ -1,4 +1,7 @@
use Test::More;
eval 'use Test::CPAN::Changes';
plan skip_all => 'Test::CPAN::Changes required for this test' if $@;
-changes_ok();
+plan undef;
+use_ok('RT::Extension::LocalDateHeader');
+changes_file_ok('Changes',{version => $RT::Extension::LocalDateHeader::VERSION});
+done_testing;
commit 85bbbbe5da78a37315b9c9074bf682a349dc5067
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Mar 13 12:00:05 2014 -0400
Fix some typos, explain intent better
diff --git a/README b/README
index 410d810..79852a8 100644
--- a/README
+++ b/README
@@ -4,9 +4,13 @@ NAME
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).
+ sender's timezone (or possibly forced to UTC by the remote mail server).
This extension will rewrite the Date: header to the user's timezone
- while also displaying the original Date: next to it.
+ while also displaying the original Date: next to it. This reduces
+ confusion when RT lists "Correspondence added" in the user's timezone
+ but the Date header looks totally different. Most non- technical users
+ don't know how to interpret the -0000 or -0400 syntax of mail Date:
+ headers.
VERSION
Compatible with RT 4.0 and 4.2. Versions earlier than 4.0.8 will need to
diff --git a/lib/RT/Extension/LocalDateHeader.pm b/lib/RT/Extension/LocalDateHeader.pm
index 4482b76..d504828 100644
--- a/lib/RT/Extension/LocalDateHeader.pm
+++ b/lib/RT/Extension/LocalDateHeader.pm
@@ -11,9 +11,13 @@ 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).
+sender's timezone (or possibly forced to UTC by the remote mail server).
This extension will rewrite the Date: header to the user's timezone
-while also displaying the original Date: next to it.
+while also displaying the original Date: next to it. This reduces
+confusion when RT lists "Correspondence added" in the user's
+timezone but the Date header looks totally different. Most non-
+technical users don't know how to interpret the -0000 or -0400
+syntax of mail Date: headers.
=head1 VERSION
commit 35d9c151a673ce693be12dbcf84c78151da5d0f6
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Mar 13 19:42:51 2014 -0400
Include a screenshot
diff --git a/MANIFEST b/MANIFEST
index 2b32ac5..4a5b6a1 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,4 +1,6 @@
Changes
+doc/images/extension.png
+doc/images/noextension.png
etc/callback_before_localization.diff
html/Callbacks/LocalDateHeader/Elements/ShowMessageHeaders/BeforeLocalization
html/Callbacks/LocalDateHeader/Ticket/Elements/ShowMessageHeaders/BeforeLocalization
diff --git a/doc/images/extension.png b/doc/images/extension.png
new file mode 100644
index 0000000..9699298
Binary files /dev/null and b/doc/images/extension.png differ
diff --git a/doc/images/noextension.png b/doc/images/noextension.png
new file mode 100644
index 0000000..94ee4d0
Binary files /dev/null and b/doc/images/noextension.png differ
diff --git a/lib/RT/Extension/LocalDateHeader.pm b/lib/RT/Extension/LocalDateHeader.pm
index d504828..acd6812 100644
--- a/lib/RT/Extension/LocalDateHeader.pm
+++ b/lib/RT/Extension/LocalDateHeader.pm
@@ -19,6 +19,8 @@ timezone but the Date header looks totally different. Most non-
technical users don't know how to interpret the -0000 or -0400
syntax of mail Date: headers.
+=for html <p><img src="https://raw.github.com/bestpractical/rt-extension-localdateheader/master/doc/images/extension.png" alt="History Preview in Search Results" /></p>
+
=head1 VERSION
Compatible with RT 4.0 and 4.2. Versions earlier than 4.0.8 will need to
commit d376fe030b9b87dc803ce0e11087fc4a7721f7fa
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Mar 13 12:24:34 2014 -0400
Update MIRTx
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index ac04c79..469eb42 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
use Module::Install::Base;
use base 'Module::Install::Base';
-our $VERSION = '0.32';
+our $VERSION = '0.32_02';
use FindBin;
use File::Glob ();
@@ -136,7 +136,9 @@ install ::
$has_etc{acl}++;
}
if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
- if ( -d 'etc/upgrade/' ) { $has_etc{upgrade}++; }
+ if ( grep { /\d+\.\d+\.\d+.*$/ } glob('etc/upgrade/*.*.*') ) {
+ $has_etc{upgrade}++;
+ }
$self->postamble("$postamble\n");
unless ( $subdirs{'lib'} ) {
@@ -174,46 +176,50 @@ install ::
}
}
-# stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
-{ my %word = (
- a => -4,
- alpha => -4,
- b => -3,
- beta => -3,
- pre => -2,
- rc => -1,
- head => 9999,
-);
-sub cmp_version($$) {
- my ($a, $b) = (@_);
- my @a = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
- split /([^0-9]+)/, $a;
- my @b = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
- split /([^0-9]+)/, $b;
- @a > @b
- ? push @b, (0) x (@a- at b)
- : push @a, (0) x (@b- at a);
- for ( my $i = 0; $i < @a; $i++ ) {
- return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i];
- }
- return 0;
-}}
sub requires_rt {
my ($self,$version) = @_;
# if we're exactly the same version as what we want, silently return
return if ($version eq $RT::VERSION);
- my @sorted = sort cmp_version $version,$RT::VERSION;
+ _load_rt_handle();
+ my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
if ($sorted[-1] eq $version) {
# should we die?
- warn "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+ die "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+ }
+}
+
+sub rt_too_new {
+ my ($self,$version,$msg) = @_;
+ $msg ||= "Your version %s is too new, this extension requires a release of RT older than %s\n";
+
+ _load_rt_handle();
+ my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
+
+ if ($sorted[0] eq $version) {
+ die sprintf($msg,$RT::VERSION,$version);
+ }
+}
+
+# RT::Handle runs FinalizeDatabaseType which calls RT->Config->Get
+# On 3.8, this dies. On 4.0/4.2 ->Config transparently runs LoadConfig.
+# LoadConfig requires being able to read RT_SiteConfig.pm (root) so we'd
+# like to avoid pushing that on users.
+# Fake up just enough Config to let FinalizeDatabaseType finish, and
+# anyone later calling LoadConfig will overwrite our shenanigans.
+sub _load_rt_handle {
+ unless ($RT::Config) {
+ require RT::Config;
+ $RT::Config = RT::Config->new;
+ RT->Config->Set('DatabaseType','mysql');
}
+ require RT::Handle;
}
1;
__END__
-#line 336
+#line 362
commit a1bfca7b9473b84ca0d4cd6a39787cfca33c495c
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Mar 13 12:25:21 2014 -0400
Bump version to 0.03
diff --git a/Changes b/Changes
index 9dad9ce..1ea2e29 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
Revision history for RT-Extension-LocalDateHeader
+0.03 2014-03-13
+ - Documentation updates
+
0.02 2014-01-06
- Compatibility with 4.2
diff --git a/META.yml b/META.yml
index 8ea611e..52b9574 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.02
+version: 0.03
diff --git a/lib/RT/Extension/LocalDateHeader.pm b/lib/RT/Extension/LocalDateHeader.pm
index acd6812..1d19a69 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.02';
+our $VERSION = '0.03';
=head1 NAME
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list